---
title: "A Kernel-Verified Lean 4 Reduction and Balanced 3-Color Cut Framework for Erdős Problem #23"
url: https://certxiv.org/abs/certxiv:2612.00021
id: "certxiv:2612.00021"
authors: ["Adrian Sorbalo"]
published: 2026-12-04
version: 1
journal: "certXiv: Journal of Certified and Reproducible Science"
verification_tier: TCB-2
declared_tier: TCB-0
license: "CC BY 4.0"
---

# A Kernel-Verified Lean 4 Reduction and Balanced 3-Color Cut Framework for Erdős Problem #23

**Authors:** Adrian Sorbalo

**Identifier:** `certxiv:2612.00021` · **Published:** 2026-12-04 · **Version:** v1 · **Category:** math.CO · **Licence:** CC BY 4.0

## Abstract

We present a Lean 4 formalization of reductions for Erdős Problem #23, which asks whether every triangle-free graph on 5n vertices can be made bipartite by deleting at most n^2 edges. The formalization reduces the problem to four cases. For graphs in the third case (Leaf 3) admitting a proper coloring with three equal-sized color classes, we prove that any counterexample must satisfy 13 explicit residual conditions. All eight Lean modules compile under lake build –wfail with zero sorrys, zero warnings, and only standard Lean axioms (propext, Classical.choice, Quot.sound), providing reusable cut constructions, double-counting identities, and template exclusions. Companion Python and C tools support computational experiments. Whether such a balanced three-color counterexample exists remains open.

## Plain-language summary

Editorial summary. The paper uses Lean to reduce Erdős Problem 23 to four cases. For one of those cases, it proves thirteen conditions that any counterexample with three equally sized color classes would have to satisfy. Whether such a counterexample exists remains open.

## Verification

**Tier:** TCB-2 (Reproducible Compute); declared TCB-0 by its authors, which no passed replay supports

Backed by executable verification code, simulation scripts, or hybrid formal+tested artifacts with SHA-256 integrity hash.

What a machine checked:

- The linked repository was replayed in certXiv's sandbox, with no network access, on 2026-12-04 at commit 434625ef59, and met the requirements for TCB-2 (Lean 4 (v4.33.1)).
- 15 formal claims are recorded for this article and listed below.

What was not checked:

- No machine-readable reference list was supplied with this article, so its references were not checked.
- Its authors declared TCB-0. The best replay that passed supports TCB-2, so that is the tier shown.
- That the code implements the method the article describes, or that the method is right. A replay shows that the code reproduces its own reported output.
- Novelty and importance. No human expert reviewed this article; the AI review is a language model's assessment and can be wrong.

**Repository:** https://github.com/adsor27/erdos23-lean4-reduction · **Proof system:** Lean 4 (v4.33.1) · **Artifact digest:** `8ac33388b13186bd9b6de5245a8716afc38ecee66e41817472ca1ad7ca99e267`

### Sandbox replays

| Finished | Status | Target tier | Earned tier | Commit |
| --- | --- | --- | --- | --- |
| 2026-12-04 | verified | TCB-0 | TCB-2 | 434625ef598d |

## Claims

1. Verified Lean declaration `fin3_distinct` in commit 434625ef59 (verifier: lean4-ast; declaration: `fin3_distinct`)
2. Verified Lean declaration `fin3_exhaust` in commit 434625ef59 (verifier: lean4-ast; declaration: `fin3_exhaust`)
3. Verified Lean declaration `fin3_step` in commit 434625ef59 (verifier: lean4-ast; declaration: `fin3_step`)
4. Verified Lean declaration `univ_fin3` in commit 434625ef59 (verifier: lean4-ast; declaration: `univ_fin3`)
5. Verified Lean declaration `sum_fin3` in commit 434625ef59 (verifier: lean4-ast; declaration: `sum_fin3`)
6. Verified Lean declaration `same_mk` in commit 434625ef59 (verifier: lean4-ast; declaration: `same_mk`)
7. Verified Lean declaration `cut_graph` in commit 434625ef59 (verifier: lean4-ast; declaration: `cut_graph`)
8. Verified Lean declaration `tri` in commit 434625ef59 (verifier: lean4-ast; declaration: `tri`)
9. Verified Lean declaration `card_filter_edges_eq_eAB` in commit 434625ef59 (verifier: lean4-ast; declaration: `card_filter_edges_eq_eAB`)
10. Verified Lean declaration `edgeFinset_card_three_part` in commit 434625ef59 (verifier: lean4-ast; declaration: `edgeFinset_card_three_part`)
11. Verified Lean declaration `cut_two_part_eq_eAB` in commit 434625ef59 (verifier: lean4-ast; declaration: `cut_two_part_eq_eAB`)
12. Verified Lean declaration `three_choice_bipartite_le` in commit 434625ef59 (verifier: lean4-ast; declaration: `three_choice_bipartite_le`)
13. Verified Lean declaration `cCodeg_le_dAB` in commit 434625ef59 (verifier: lean4-ast; declaration: `cCodeg_le_dAB`)
14. Verified Lean declaration `card_Rset_filter_adj` in commit 434625ef59 (verifier: lean4-ast; declaration: `card_Rset_filter_adj`)
15. Verified Lean declaration `ns_bipartite_le` in commit 434625ef59 (verifier: lean4-ast; declaration: `ns_bipartite_le`)

## AI review

This review was written by a language model against the public rubric at https://certxiv.org/rubric. It is an opinion, not a guarantee.

**Score:** 37/100 · **Verdict:** Unsubstantiated — Fundamental Rework (<50) · **Reviewer:** gpt-6.2-astra (codex-cli, repository read at commit 434625ef598d) · **Date:** 2026-12-04 · **Reviewed version:** v1

Major revision. The artifact for certxiv:2612.00021 v1 supports meaningful partial reductions and several explicit cut theorems. The main publication issue is the scope of “kernel-verified.” The export contains the common reduction steps and the lower-density branch, while the README places the full composition upstream. The supplied balanced-module excerpt ends before the headline theorem, and the structured claims do not identify it. I assessed the supplied sources and recorded outputs without executing Lean, Python, or C. The weighted rubric score is 1.85/5.

| Dimension | Weight | Score | Reviewer's reason |
| --- | --- | --- | --- |
| Problem Formulation, Hypotheses & Definitions | 20% | 2/5 | `Erdos23/Statements.lean` precisely defines the finite graph, triangle-free hypothesis, bipartite subgraph, and deletion budget. The manuscript leaves its own principal objects, especially Leaf 3 and the residual predicate for a chosen coloring, undefined. |
| Methodological, Logical & Mathematical Soundness | 25% | 2/5 | The visible proofs construct cuts and count their deleted edges under precise hypotheses. Two substantial steps remain unaudited at the claimed scope: composing both density branches into the advertised four-leaf theorem and deriving the full residual conjunction under the exact Leaf 3 hypotheses. |
| Empirical, Computational & Specification Fidelity | 20% | 2/5 | The toolchain, dependency revisions, build targets, proof sources, and benchmark inputs provide substantial evidence for individual components. The 15 structured records cover helper declarations. The evidence supplied for review does not connect the two headline claims to their exact theorem types, composition, and axiom reports. |
| Literature Grounding & Prior-Art Attribution | 15% | 1/5 | A source comment credits the classical neighborhood-cut argument, and the repository credits upstream formalization work. The manuscript has no bibliography and omits the published density bounds that explain its own subcase interval. |
| Originality & Scientific Contribution | 10% | 3/5 | The formal cut constructions, independent-set bound, and conditional block-cover exclusion make a useful nontrivial formalization. The submission leaves the mathematical advance over existing bounds and the division of work with the upstream project unclear. |
| Expository Clarity, Claim Calibration & Limitations | 10% | 1/5 | The abstract correctly leaves the balanced case open. The complete body repeats the abstract, so readers never see the four cases, the 13 conditions, or the restriction on the exported reduction that the README acknowledges. |

Strengths:

- `Erdos23/Statements.lean` faithfully encodes the problem on 5n vertices. In `OMAReductions/R_Erdos23_erdos_23_R2.lean`, `cut_graph` identifies the deleted edges with the same-side edges of a partition, and `dense` handles e ≥ 5n², including n=0. The maximal-extension argument explicitly transfers the cut bound back to the original graph.
- The visible portion of `Erdos23/erdos23-3col-balanced-master.lean` contains substantive mathematics. `three_choice_bipartite_le` gives a deletion cost at most ⌊e/3⌋ for any proper three-partition. `ns_bipartite_le` constructs a neighborhood cut and assigns vertices of the remaining independent class to their cheaper side. The codegree bounds show how triangle-freeness enters the subsequent counting argument.
- `Erdos23/erdos23-leaf3-subcase.lean` contains a result worth stating separately. `indep_cut_295` proves the target when 20|I| ≥ 59n for an independent set I, without a density hypothesis. The same file gives explicit five-cut certificates for the Clebsch and Wagner templates and explicit maps for Petersen and Grötzsch. In `Erdos23/erdos23-edge-block-cover.lean`, `density_of_r4_template` forces e ≥ 4n²+4 under the disjoint-block hypothesis, which excludes that template in the stated Leaf 3 range.
- `lean-toolchain`, `lake-manifest.json`, and `lakefile.toml` identify Lean 4.33.1, pin Mathlib and its dependencies, and target both source trees. The abstract accurately presents the central balanced claim as a necessary condition for a hypothetical counterexample.

Weaknesses:

- The four-leaf claim needs an end-to-end theorem. `R_Erdos23_erdos_23_R2.main` takes a middle-density proposition and a half-cut proposition as premises. Later `OMAReductions` modules split at e=3n²+2. The last exported `main` refines only the lower branch, with a further split at 2e=5n² and lower threshold 200e>443n². The higher branch still appears as a single obligation in the visible chain. `README.md` locates the combined proof in `scratch/erdos23-full-composed.lean`, outside the 22-file export. The issue is coverage of the reduction, not the fact that a reduction has open leaves.
- The balanced theorem cannot be matched field by field to the abstract. Only 60,000 of 350,631 bytes of `erdos23-3col-balanced-master.lean` are shown. Its header names `BalancedLeaf3OpenResidual` and locates exact Leaf 3 signature compatibility in a separate, unlisted `scratch/erdos23-3col-h1-compat.lean`. `tools/leaf3_alternating_stress_results.json` lists 13 filter names, but names alone leave their formulas, quantifiers, and correspondence to the Lean conjunction undetermined.
- The 15 `lean4-ast` records run from `fin3_distinct` through `ns_bipartite_le`. Several names, including `cut_graph` and `tri`, occur in multiple namespaces. The records share an artifact digest and give bare declaration names. None identifies the composed reduction or the theorem forcing the residual predicate. The README reports eight clean builds and three standard axioms. The visible `#print axioms` commands document intended checks, but the supplied material contains no corresponding headline-theorem transcript. A conditional theorem can use only standard axioms while still requiring substantial mathematical premises.
- Prior art materially affects the interpretation of the constants. The classical neighborhood estimate and induced-bipartite extension principle appear in Erdős–Faudree–Pach–Spencer. Balogh–Clemen–Lidický’s Theorem 2 gives the sharp deletion target in the density tails at 0.2486 and 0.3197 for sufficiently large order, using e/binom(N,2). Under 2e/N² with N=5n, those constants correspond to 3.1075n² and 3.99625n². A finite-order comparison needs the density convention and blow-up transfer. Ferudun’s 2026 preprint also reports the target for 1≤n≤40. The paper should identify which results are new finite graph bounds and which contribute formal proofs of known arguments. [Erdős et al.](https://www.renyi.hu/~p_erdos/1988-12.pdf) · [Balogh et al., Theorem 2](https://arxiv.org/pdf/2103.14179) · [Ferudun, Theorem 1.1](https://arxiv.org/abs/2606.28041)
- The companion tools support exploration with distinct evidentiary limits. `tools/leaf3_cs_benchmarks.py` uses exact fractions for selected examples and floating point for its 7,013-record scan. `tools/leaf3_cs_sdp_solver.py` checks numerical tolerances, and the rational coefficients in `tools/leaf3_cs_sos_lib.py` still require a dual certificate to establish an SDP bound. The README places the exact certification driver outside the export. `tools/leaf3_disjoint_exact.c` searches labelings of one supplied weighted template with fixed-width integer arithmetic. The separate shared-neighbor JSON reports 70 checked cases, zero passing the disjoint-block condition, and zero full survivors. Those counts do not test the residual implication on a graph satisfying all its hypotheses.

## Links

- Article page: https://certxiv.org/abs/certxiv:2612.00021
- PDF: https://certxiv.org/pdf/certxiv:2612.00021
- Cite: [BibTeX](https://certxiv.org/cite/certxiv:2612.00021.bib) · [RIS](https://certxiv.org/cite/certxiv:2612.00021.ris) · [EndNote](https://certxiv.org/cite/certxiv:2612.00021.enw)
- Full record as JSON: https://certxiv.org/api/v1/papers/certxiv:2612.00021

