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.Ramp.LocalFlow.C2.Locality |
| 2 | import Mathlib.Topology.Order.IntermediateValue |
| 3 | |
| 4 | /-! |
| 5 | # Forward extension of fixed-label uniqueness |
| 6 | |
| 7 | One-sided continuous induction extends short-time equality through a |
| 8 | closed interval. Closed uniqueness then gives the exact half-open field |
| 9 | by restriction. MT2007 Claim 19.1, p. 437; |
| 10 | `2026-09-21-uniqueness-graph-comparison-components.md`, sections 3-4. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | namespace PoincareMT.M63 |
| 19 | |
| 20 | /-- Forward agreement and closed continuity imply equality through the |
| 21 | final included time. No backward uniqueness or ordinary openness of the |
| 22 | equalizer is assumed. MT2007 Claim 19.1, p. 437; graph comparison |
| 23 | components, section 3. Empty label types are allowed. -/ |
| 24 | theorem eqOn_Icc_of_forward_agreement |
| 25 | {X Y : Type*} [TopologicalSpace Y] [T2Space Y] |
| 26 | {c d : X → ℝ → Y} {a b : ℝ} |
| 27 | (hc : ∀ x, ContinuousOn (c x) (Icc a b)) |
| 28 | (hd : ∀ x, ContinuousOn (d x) (Icc a b)) |
| 29 | (hinit : ∀ x, c x a = d x a) |
| 30 | (hforward : ∀ s ∈ Ico a b, (∀ x, c x s = d x s) → |
| 31 | ∃ r, s < r ∧ ∀ t ∈ Icc s r, t ≤ b → ∀ x, c x t = d x t) : |
| 32 | ∀ t ∈ Icc a b, ∀ x, c x t = d x t := by |
| 33 | let E : Set ℝ := {t | ∀ x, c x t = d x t} |
| 34 | have hclosed : IsClosed (E ∩ Icc a b) := by |
| 35 | have hc' : ContinuousOn (fun t x => c x t) (Icc a b) := continuousOn_pi.mpr hc |
| 36 | have hd' : ContinuousOn (fun t x => d x t) (Icc a b) := continuousOn_pi.mpr hd |
| 37 | convert isClosed_Icc.isClosed_eq hc' hd' using 1 |
| 38 | ext t |
| 39 | simp only [E, mem_inter_iff, mem_ofPred_eq, funext_iff] |
| 40 | exact and_comm |
| 41 | apply hclosed.Icc_subset_of_forall_mem_nhdsWithin hinit |
| 42 | intro s hs |
| 43 | obtain ⟨r, hsr, hagree⟩ := hforward s hs.2 hs.1 |
| 44 | filter_upwards [Ioo_mem_nhdsGT hsr, Ioo_mem_nhdsGT hs.2.2] with t htr htb |
| 45 | exact hagree t ⟨htr.1.le, htr.2.le⟩ htb.2.le |
| 46 | |
| 47 | universe u |
| 48 | |
| 49 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 50 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 51 | {a b : ℝ} {F : RicciFlow n M (Icc a b)} |
| 52 | |
| 53 | /-- The exact closed uniqueness field supplies the frozen half-open |
| 54 | uniqueness field by restriction to strictly shorter closed intervals. |
| 55 | MT2007 Claim 19.1, p. 437; graph comparison components, section 4. |
| 56 | There is no equation or trace assertion at the omitted final endpoint. -/ |
| 57 | theorem unique_half_open_of_unique_closed |
| 58 | (hclosed : ∀ T : ℝ, a < T → T ≤ b → ∀ c d : ℝ → ℝ → M, |
| 59 | M63C2ShrinkingCurveOn F c (Icc a T) → |
| 60 | M63C2ShrinkingCurveOn F d (Icc a T) → |
| 61 | (∀ x, c x a = d x a) → ∀ t ∈ Icc a T, ∀ x, c x t = d x t) |
| 62 | {T : ℝ} (_haT : a < T) (hTb : T ≤ b) |
| 63 | {c d : ℝ → ℝ → M} |
| 64 | (hc : M63C2ShrinkingCurveOn F c (Ico a T)) |
| 65 | (hd : M63C2ShrinkingCurveOn F d (Ico a T)) |
| 66 | (hinit : ∀ x, c x a = d x a) : |
| 67 | ∀ t ∈ Ico a T, ∀ x, c x t = d x t := by |
| 68 | intro t ht |
| 69 | obtain ⟨s, hts, hsT⟩ := exists_between ht.2 |
| 70 | have hsub : Icc a s ⊆ Ico a T := fun _ hy => ⟨hy.1, hy.2.trans_lt hsT⟩ |
| 71 | exact hclosed s (ht.1.trans_lt hts) (hsT.le.trans hTb) c d |
| 72 | (c2_restrict hc hsub) (c2_restrict hd hsub) hinit t ⟨ht.1, hts.le⟩ |
| 73 | |
| 74 | end PoincareMT.M63 |