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: drop unused zero lemmas after linear_combination in Surfaces/Cuts
Browse filesChecks
build Program · lake build and axioms
Details
challenge Program · challenge files and build config
Details
ci/docs
Details
+1 −1 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OrientedDiskBoundary.lean View file
| @@ -209,7 +209,7 @@ theorem coherent_triangle_signs_global_difference | ||
| 209 | 209 | have hs := hsigma t u hne s hst hsu |
| 210 | 210 | have ht := htau t u hne s hst hsu |
| 211 | 211 | linear_combination (norm := ring_nf) hs + ht |
| 212 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, sub_zero] | |
| 212 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 213 | 213 | have hwalk {t u} (w : (triangleGraph A).Walk t u) : |
| 214 | 214 | sigma t + tau t = sigma u + tau u := by |
| 215 | 215 | induction w with |
+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, neg_zero] | |
| 261 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_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, neg_zero] | |
| 269 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_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, neg_zero] | |
| 517 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_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, add_zero, sub_zero] | |
| 78 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 79 | 79 | |
| 80 | 80 | end PoincareMT.M76.OriginalTriangleCopies |
| 81 | 81 | |
+2 −2 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, sub_zero] | |
| 168 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_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. -/ |
| @@ -303,7 +303,7 @@ theorem refined_original_cofaces_cancel [DecidableEq E] | ||
| 303 | 303 | (mul_ne_zero_iff.mp hnS).1 (mul_ne_zero_iff.mp hnS).2, hR, hS] |
| 304 | 304 | have hc := Dehn.orderedCofaceParity_cancellation number T U a b st su hcancel |
| 305 | 305 | linear_combination (norm := ring_nf) hc |
| 306 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, sub_zero] | |
| 306 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 307 | 307 | |
| 308 | 308 | /-- In one original owner chart, injectivity of the complete pair of |
| 309 | 309 | refined cofaces forces their actual edge/apex determinants to be opposite. -/ |
+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, neg_zero] | |
| 106 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_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. -/ |
+1 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalRefinementOrientation.lean View file
| @@ -47,6 +47,7 @@ private theorem parity_sum_of_negative_product (x y : ℝ) (h : x * y < 0) : | ||
| 47 | 47 | · rw [sign_neg h.1, sign_pos h.2] |
| 48 | 48 | norm_num [orientationSignParity] |
| 49 | 49 | |
| 50 | +omit [FiniteDimensional ℝ E] [DecidableEq E] in | |
| 50 | 51 | theorem charted_refined_cross_ne_zero |
| 51 | 52 | (L : SimplicialComplex ℝ (ℝ × ℝ)) (F : (ℝ × ℝ) → E) |
| 52 | 53 | (hF : L.AffineOnFaces F) (a b x : ℝ × ℝ) |
+2 −2 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/PlanarBoundaryOrientation.lean View file
| @@ -457,7 +457,7 @@ theorem planar_numbered_boundary_cross_parity_reverse | ||
| 457 | 457 | hord.ne |
| 458 | 458 | rw [hcross, hneg, hbase] |
| 459 | 459 | linear_combination (norm := ring_nf) hrev |
| 460 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, sub_zero] | |
| 460 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 461 | 461 | |
| 462 | 462 | /-- The comparison with the numbered orientation applies to either ordering |
| 463 | 463 | of any actual edge and its remaining triangle vertex. -/ |
| @@ -582,7 +582,7 @@ theorem planar_sorted_cross_cancellation | ||
| 582 | 582 | rw [hpa, hqa, hpt, hqu] at hsign |
| 583 | 583 | unfold Dehn.orderedCofaceParity at hsign |
| 584 | 584 | linear_combination (norm := ring_nf) hsign |
| 585 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, neg_zero] | |
| 585 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 586 | 586 | |
| 587 | 587 | /-- Construct the sorted planar determinant signs for all actual triangles, |
| 588 | 588 | retaining their formula and proving all-edge coherence. -/ |
+6 −0 routes/p1-surfaces-cuts/README.md View file
| @@ -35,6 +35,12 @@ Job 845 (fourth head) showed `or_assoc` unused at `OriginalOwnerIntersection.lea | ||
| 35 | 35 | `[FiniteDimensional ℝ E] [DecidableEq E]` unused in `charted_refined_triangle_independent` |
| 36 | 36 | (`OriginalRefinementOrientation.lean:14`), omitted. |
| 37 | 37 | |
| 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; `build` judges it. | |
| 43 | + | |
| 38 | 44 | Only binder names, one tactic keyword, `omit` lines and unused simp arguments change; no statement changes. `python3 checks/challenge.py .` says ok. |
| 39 | 45 | |
| 40 | 46 | ## Next |