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

| 1 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Nested.GraphBands |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Band.CutContacts |
| 3 | |
| 4 | /-! Nesting with unchanged coordinates preserves exact endpoint contacts. |
| 5 | Source: MT Claim 19.40; joined-orientation derivation, Section 6. -/ |
| 6 | |
| 7 | noncomputable section |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open Set |
| 12 | open scoped Topology ContDiff Manifold |
| 13 | open Poincare.Topology.Plane.Curves PoincareMT.Topology.Surface |
| 14 | |
| 15 | namespace PoincareMT |
| 16 | |
| 17 | private theorem endpoint_height_image |
| 18 | {F : OpenPartialHomeomorph AnnulusCoordinates AnnulusCoordinates} |
| 19 | {f : ℝ → ℝ} {a b ua wa ub wb ra rb : ℝ} |
| 20 | (B : ObliqueBandFaces F f a b ua wa ub wb ra rb) (right : Bool) : |
| 21 | (fun z => B.coordinates (collarParameterEquiv.symm (if right then 1 else 0, z))) '' |
| 22 | Icc (0 : ℝ) (B.height (if right then 1 else 0)) = |
| 23 | if right then B.rightCut else B.leftCut := by |
| 24 | cases right |
| 25 | · exact B.left_height_image |
| 26 | · exact B.right_height_image |
| 27 | |
| 28 | /-- A band nested in the original coordinate subgraph meets an original endpoint cut in |
| 29 | exactly its own shorter endpoint cut. Source: |
| 30 | `proof-work/tasks/M64/derivations/2026-09-27-joined-orientation-and-attachments.md`, Section |
| 31 | 6. -/ |
| 32 | theorem m64Intrinsic_nested_band_cut_contact |
| 33 | {F : OpenPartialHomeomorph AnnulusCoordinates AnnulusCoordinates} |
| 34 | {f : ℝ → ℝ} {a b ua wa ub wb ra rb sa sb : ℝ} |
| 35 | (B : ObliqueBandFaces F f a b ua wa ub wb ra rb) |
| 36 | (C : ObliqueBandFaces F f a b ua wa ub wb sa sb) |
| 37 | (hcoordinates : ∀ q, C.coordinates q = B.coordinates q) (hband : C.band ⊆ B.band) |
| 38 | (right : Bool) : |
| 39 | C.carrier ∩ (if right then B.rightCut else B.leftCut) = |
| 40 | if right then C.rightCut else C.leftCut := by |
| 41 | let e : ℝ := if right then 1 else 0 |
| 42 | have he : e ∈ Icc (0 : ℝ) 1 := by cases right <;> simp [e] |
| 43 | rw [← endpoint_height_image B right, ← endpoint_height_image C right] |
| 44 | ext p |
| 45 | constructor |
| 46 | · rintro ⟨hpC, z, hz, hzp⟩ |
| 47 | obtain ⟨q, hq, hqp⟩ := C.carrier_eq_image ▸ hpC |
| 48 | have heq : B.coordinates (collarParameterEquiv.symm (e, z)) = B.coordinates q := |
| 49 | hzp.trans (hqp.symm.trans (hcoordinates q)) |
| 50 | have hqeq := B.coordinates.injOn (m64Intrinsic_band_height_mem_source B he hz) |
| 51 | (B.band_subset_source (hband hq)) heq |
| 52 | have hqe : (collarParameterEquiv q).1 = e := by |
| 53 | simpa only [collarParameterEquiv.apply_symm_apply] using |
| 54 | (congrArg (fun x => (collarParameterEquiv x).1) hqeq).symm |
| 55 | have hq' := C.band_eq_subgraph ▸ hq |
| 56 | refine ⟨(collarParameterEquiv q).2, ⟨hq'.2.1, ?_⟩, ?_⟩ |
| 57 | · simpa only [hqe] using hq'.2.2 |
| 58 | · change C.coordinates (collarParameterEquiv.symm (e, (collarParameterEquiv q).2)) = p |
| 59 | rw [← hqe, Prod.eta, collarParameterEquiv.symm_apply_apply] |
| 60 | exact hqp |
| 61 | · rintro ⟨z, hz, rfl⟩ |
| 62 | have hq : collarParameterEquiv.symm (e, z) ∈ C.band := by |
| 63 | rw [C.band_eq_subgraph] |
| 64 | simpa only [mem_ofPred_eq, collarParameterEquiv.apply_symm_apply, mem_Icc, e] |
| 65 | using And.intro he hz |
| 66 | have hqB := B.band_eq_subgraph ▸ hband hq |
| 67 | have hzB : z ∈ Icc (0 : ℝ) (B.height e) := by |
| 68 | simpa only [collarParameterEquiv.apply_symm_apply, mem_Icc] using hqB.2 |
| 69 | refine ⟨?_, z, hzB, (hcoordinates _).symm⟩ |
| 70 | rw [C.carrier_eq_image] |
| 71 | exact ⟨collarParameterEquiv.symm (e, z), hq, rfl⟩ |
| 72 | |
| 73 | end PoincareMT |