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.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.GaugeLift |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Basic |
| 3 | import Mathlib.Topology.Compactness.Compact |
| 4 | |
| 5 | /-! |
| 6 | # Finite gauge data for realizing a field |
| 7 | |
| 8 | Compatible cylinder inverses cover the actual closed square-time curve. |
| 9 | Compactness gives finitely many relative time neighborhoods. No lift or |
| 10 | curve extension outside the physical interval is asserted. Morgan-Tian |
| 11 | Proposition 6.37 and Lemma 6.40, pp. 123-127. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 26 | |
| 27 | /-- An actual cylinder inverse near part of a square-time curve, |
| 28 | with a real open neighborhood used only relative to its closed time |
| 29 | interval. Proposition 6.37 and Lemma 6.40, pp. 123-127. -/ |
| 30 | structure SquareFieldGaugePatch (R : M14SquareRootPath G p) where |
| 31 | gauge : G.gaugeCover.index |
| 32 | domain : Set G.Point |
| 33 | lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval gauge)).Point × |
| 34 | G.gaugeCover.spatial gauge |
| 35 | domain_open : IsOpen domain |
| 36 | lift_smooth : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift domain |
| 37 | right_inverse : ∀ q ∈ domain, (G.gaugeCover.cylinder gauge).toSpacetime (lift q) = q |
| 38 | parameterSet : Set ℝ |
| 39 | parameter_open : IsOpen parameterSet |
| 40 | curve_mem : ∀ s ∈ M14SqrtParameterInterval a b ∩ parameterSet, R.curve s ∈ domain |
| 41 | |
| 42 | /-- A field-realization gauge patch exists near each closed time |
| 43 | point, Proposition 6.37, pp. 123-127. -/ |
| 44 | theorem exists_squareFieldGaugePatch (R : M14SquareRootPath G p) {s : ℝ} |
| 45 | (hs : s ∈ M14SqrtParameterInterval a b) : |
| 46 | ∃ D : SquareFieldGaugePatch R, s ∈ D.parameterSet := by |
| 47 | obtain ⟨j, U, lift, hU, hsU, hlift, hright, _⟩ := exists_smooth_gauge_lift G (R.curve s) |
| 48 | have hpre : R.curve ⁻¹' U ∈ 𝓝[M14SqrtParameterInterval a b] s := |
| 49 | (R.smooth.continuousOn.mono R.interval_subset s hs).preimage_mem_nhdsWithin |
| 50 | (hU.mem_nhds hsU) |
| 51 | obtain ⟨N, hN, hsN, hsub⟩ := mem_nhdsWithin.mp hpre |
| 52 | exact ⟨⟨j, U, lift, hU, hlift, hright, N, hN, fun _ hr => hsub ⟨hr.2, hr.1⟩⟩, hsN⟩ |
| 53 | |
| 54 | /-- Finitely many actual gauge patches cover the whole closed |
| 55 | square interval, Proposition 6.37 and Lemma 6.40, pp. 123-127. -/ |
| 56 | theorem exists_finite_squareFieldGaugeCover (R : M14SquareRootPath G p) : |
| 57 | ∃ (m : ℕ) (D : Fin m → SquareFieldGaugePatch R), |
| 58 | M14SqrtParameterInterval a b ⊆ ⋃ i, (D i).parameterSet := by |
| 59 | classical |
| 60 | let C := M14SqrtParameterInterval a b |
| 61 | choose D hD using fun s : C => exists_squareFieldGaugePatch R s.property |
| 62 | have hcover : C ⊆ ⋃ s : C, (D s).parameterSet := fun s hs => |
| 63 | mem_iUnion.mpr ⟨⟨s, hs⟩, hD ⟨s, hs⟩⟩ |
| 64 | obtain ⟨S, hS⟩ := (show IsCompact C from isCompact_Icc).elim_finite_subcover |
| 65 | (fun s : C => (D s).parameterSet) (fun s => (D s).parameter_open) hcover |
| 66 | let e := (Fintype.equivFin S).symm |
| 67 | refine ⟨Fintype.card S, fun i => D (e i).val, ?_⟩ |
| 68 | intro s hs |
| 69 | obtain ⟨t, htS, hst⟩ := mem_iUnion₂.mp (hS hs) |
| 70 | obtain ⟨i, hi⟩ := e.surjective ⟨t, htS⟩ |
| 71 | exact mem_iUnion.mpr ⟨i, by simpa only [hi] using hst⟩ |
| 72 | |
| 73 | end PoincareMT.M14 |