Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

P-1: undo the guessed simp changes; keep only those build named
Browse filesChecks
build Program · lake build and axioms
Details
challenge Program · challenge files and build config
Details
ci/docs
Details
+3 −3 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalBoundaryOrientationConsumer.lean View file
| @@ -258,7 +258,7 @@ theorem exists_boundary_cycle_for_coherent_signs | ||
| 258 | 258 | rw [sign_pos (hpos i)] at hh |
| 259 | 259 | change tau (t i) + _ = 0 at hh |
| 260 | 260 | linear_combination (norm := ring_nf) hc (t i) + hh |
| 261 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 261 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, neg_zero] | |
| 262 | 262 | · refine ⟨n, P, edge, t, c + 1, hPi, hPb, hcycle, |
| 263 | 263 | fun i ↦ ⟨hedge i, (hcoface i).2.1⟩, ?_⟩ |
| 264 | 264 | intro i |
| @@ -266,7 +266,7 @@ theorem exists_boundary_cycle_for_coherent_signs | ||
| 266 | 266 | rw [sign_neg (hneg i)] at hh |
| 267 | 267 | change tau (t i) + _ = 1 at hh |
| 268 | 268 | linear_combination (norm := ring_nf) hc (t i) + hh |
| 269 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 269 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, neg_zero] | |
| 270 | 270 | |
| 271 | 271 | /-- The four counterclockwise sides in the marked cut's literal square coordinates. -/ |
| 272 | 272 | def unitSquareSide (i : Fin 4) (r : ℝ) : ℝ × ℝ := |
| @@ -514,7 +514,7 @@ theorem OriginalRefinementCoherentSigns.exists_ccw_square_boundary_sign [Decidab | ||
| 514 | 514 | change 0 = _ + _ at hpar |
| 515 | 515 | rw [← htau t] at hpar |
| 516 | 516 | linear_combination (norm := ring_nf) hc t - hpar |
| 517 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 517 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, neg_zero] | |
| 518 | 518 | |
| 519 | 519 | namespace OriginalPrimalCutDiskData |
| 520 | 520 | |
+1 −1 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalCoherentBridgeReversal.lean View file
| @@ -75,7 +75,7 @@ theorem OriginalRefinementCoherentSigns.paired_edge_scalar_product_neg | ||
| 75 | 75 | v w (sourceSign (O.owner t).val) (sourceSign (O.owner u).val) hcancel |
| 76 | 76 | apply scalar_product_neg_of_parity _ _ hrt.1 hsu.1 |
| 77 | 77 | linear_combination (norm := ring_nf) hc + hboundary - hrt.2 - hsu.2 |
| 78 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 78 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, add_zero, sub_zero] | |
| 79 | 79 | |
| 80 | 80 | end PoincareMT.M76.OriginalTriangleCopies |
| 81 | 81 | |
+1 −1 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalCutCoherentSigns.lean View file
| @@ -165,7 +165,7 @@ private theorem mapped_numbered_boundary_cross_parity_reverse [DecidableEq E] | ||
| 165 | 165 | have hrev := Dehn.orderedCofaceParity_reverse_of_label_ne number (Finset.univ.image p) hord.ne |
| 166 | 166 | rw [hcross, hneg, hbase] |
| 167 | 167 | linear_combination (norm := ring_nf) hrev |
| 168 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 168 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, sub_zero] | |
| 169 | 169 | |
| 170 | 170 | /-- The source numbering, rather than any numbering of image vertices, |
| 171 | 171 | controls the boundary contribution of an affine image triangle. -/ |
+1 −1 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalRefinementCoherentSigns.lean View file
| @@ -103,7 +103,7 @@ theorem original_refined_sorted_cross_cancellation | ||
| 103 | 103 | rw [hpa, hqa, hpt, hqu] at hsign |
| 104 | 104 | unfold Dehn.orderedCofaceParity at hsign |
| 105 | 105 | linear_combination (norm := ring_nf) hsign |
| 106 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 106 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, neg_zero] | |
| 107 | 107 | |
| 108 | 108 | /-- Orientation on a planar refinement with the original charts and face |
| 109 | 109 | owners retained. These data are constructed below from actual affine faces. -/ |
+7 −7 routes/p1-surfaces-cuts/README.md View file
| @@ -36,13 +36,13 @@ Job 845 (fourth head) showed `or_assoc` unused at `OriginalOwnerIntersection.lea | ||
| 36 | 36 | (`OriginalRefinementOrientation.lean:14`), omitted. |
| 37 | 37 | |
| 38 | 38 | Job 850 (fifth head) showed the same two section variables unused in `charted_refined_cross_ne_zero` (omitted), and |
| 39 | -`sub_zero` unused in `simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, sub_zero]` at | |
| 40 | -`OriginalCutCoherentSigns.lean:306`, like line 127 before. That `simp only` closes the goal `linear_combination | |
| 41 | -(norm := ring_nf)` leaves in eleven places of the folder, and `ring_nf` leaves no `- 0`, `+ 0` or `-0` behind, so I | |
| 42 | -dropped `sub_zero`, `add_zero` and `neg_zero` from all of them at once. Job 856 failed on that: in | |
| 43 | -`OrientedDiskBoundary.lean:212` the goal left is `0 - 0 - 0 - 0 - 0 = 0` and `sub_zero` is needed, so that line is | |
| 44 | -back as it was. Job 859 then failed in `PlanarBoundaryOrientation.lean` (goal `-0 = 0` left in the proof at line | |
| 45 | -440), so that file is back as it was too. Where a zero lemma is unused there, a later log will say so line by line. | |
| 39 | +`sub_zero` unused at `OriginalCutCoherentSigns.lean:306` (dropped). | |
| 40 | + | |
| 41 | +A failure worth keeping: I first took that `sub_zero` for a pattern (eleven `simp only [show (2 : ZMod 2) = 0 from | |
| 42 | +rfl, mul_zero, …]` lines close what `linear_combination (norm := ring_nf)` leaves) and dropped the zero lemmas from all | |
| 43 | +of them. Jobs 856, 859 and 864 failed: in `OrientedDiskBoundary.lean:212`, `PlanarBoundaryOrientation.lean` and | |
| 44 | +`OriginalCutCoherentSigns.lean:168` the goal left is `0 - 0 … = 0` or `-0 = 0`, so those lemmas are needed there. | |
| 45 | +Every one of those lines is back as it was; only the two the log named (127 and 306) are changed. | |
| 46 | 46 | |
| 47 | 47 | Only binder names, one tactic keyword, `omit` lines and unused simp arguments change; no statement changes. `python3 checks/challenge.py .` says ok. |
| 48 | 48 | |