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.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.ChartPullbackExtension |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.ClosedExtensionGluing |
| 4 | import Mathlib.Tactic.Linarith |
| 5 | |
| 6 | /-! |
| 7 | # Extending horizontal fields from a closed interval |
| 8 | |
| 9 | Morgan-Tian Lemmas 6.4 and 6.8, pp. 107-109. Buffered closed parameter |
| 10 | intervals give single-chart extensions, including at both endpoints. |
| 11 | Gluing on the closed parameterized graph yields the full horizontal |
| 12 | extension record without extending the spacetime curve. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle 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 | {γ : ℝ → G.Point} {Y : ∀ s, G.Horizontal (γ s)} |
| 26 | |
| 27 | /-- A smooth horizontal field on a closed interval has local chart |
| 28 | extensions at its endpoints as well as its interior, Lemma 6.8, pp. 108-109. -/ |
| 29 | theorem exists_local_pullbackExtension_Icc {a b : ℝ} (hab : a < b) |
| 30 | (hγ : ContinuousOn γ (Set.Icc a b)) |
| 31 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) |
| 32 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 33 | (fun s => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 34 | (E := G.spacetime.Horizontal) (γ s) (Y s)) (Set.Icc a b)) |
| 35 | {s : ℝ} (hs : s ∈ Set.Icc a b) : |
| 36 | ∃ U : Set ℝ, IsOpen U ∧ s ∈ U ∧ |
| 37 | Nonempty (M14PullbackExtension G γ (Set.Icc a b ∩ U) Y) := by |
| 38 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) G.Horizontal (γ s) |
| 39 | have hnear : γ ⁻¹' e.baseSet ∈ 𝓝[Set.Icc a b] s := |
| 40 | (hγ s hs).preimage_mem_nhdsWithin (e.open_baseSet.mem_nhds |
| 41 | (mem_baseSet_trivializationAt (EuclideanSpace ℝ (Fin n)) G.Horizontal (γ s))) |
| 42 | obtain ⟨N, hN, hchart⟩ := mem_nhdsWithin_iff_exists_mem_nhds_inter.mp hnear |
| 43 | obtain ⟨l, r, ⟨hls, hsr⟩, hlr⟩ := mem_nhds_iff_exists_Ioo_subset.mp hN |
| 44 | let l' := (l + s) / 2 |
| 45 | let r' := (s + r) / 2 |
| 46 | let c := max a l' |
| 47 | let d := min b r' |
| 48 | have hll : l < l' := by dsimp only [l']; linarith |
| 49 | have hls' : l' < s := by dsimp only [l']; linarith |
| 50 | have hsr' : s < r' := by dsimp only [r']; linarith |
| 51 | have hrr : r' < r := by dsimp only [r']; linarith |
| 52 | have hcd : c < d := max_lt |
| 53 | (lt_min hab (hs.1.trans_lt hsr')) |
| 54 | (lt_min (hls'.trans_le hs.2) (hls'.trans hsr')) |
| 55 | have hsub : Set.Icc c d ⊆ Set.Icc a b := |
| 56 | Set.Icc_subset_Icc (le_max_left _ _) (min_le_left _ _) |
| 57 | have hsrc : ∀ t ∈ Set.Icc c d, γ t ∈ e.baseSet := by |
| 58 | intro t ht |
| 59 | exact hchart ⟨hlr ⟨hll.trans_le ((le_max_right _ _).trans ht.1), |
| 60 | (ht.2.trans (min_le_right _ _)).trans_lt hrr⟩, hsub ht⟩ |
| 61 | let y := fun t => (e (Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 62 | (E := G.spacetime.Horizontal) (γ t) (Y t))).2 |
| 63 | have hpair := e.contMDiffOn.comp (hY.mono hsub) |
| 64 | (fun t ht => e.mem_source.mpr (hsrc t ht)) |
| 65 | have hy : ContDiffOn ℝ ∞ y (Set.Icc c d) := |
| 66 | ContMDiffOn.contDiffOn (fun t ht => (hpair t ht).snd) |
| 67 | obtain ⟨g, hg, hgy⟩ := M08.exists_smooth_extension_Icc hcd y hy |
| 68 | let U := Set.Ioo l' r' |
| 69 | have hUsub : Set.Icc a b ∩ U ⊆ Set.Icc c d := fun _ ht => |
| 70 | ⟨max_le ht.1.1 ht.2.1.le, le_min ht.1.2 ht.2.2.le⟩ |
| 71 | refine ⟨U, isOpen_Ioo, ⟨hls', hsr'⟩, |
| 72 | ⟨pullbackExtensionInChart e isOpen_univ (Set.subset_univ _) g hg.contDiffOn |
| 73 | (fun t ht => hsrc t (hUsub ht)) ?_⟩⟩ |
| 74 | intro t ht |
| 75 | rw [hgy (hUsub ht)] |
| 76 | exact e.symm_apply_apply_mk (hsrc t (hUsub ht)) (Y t) |
| 77 | |
| 78 | /-- A field smooth within a nondegenerate closed interval admits the full |
| 79 | horizontal pullback extension required in Lemmas 6.4 and 6.8, pp. 107-109. -/ |
| 80 | theorem exists_pullbackExtension_Icc {a b : ℝ} (hab : a < b) |
| 81 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) |
| 82 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 83 | (fun s => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 84 | (E := G.spacetime.Horizontal) (γ s) (Y s)) (Set.Icc a b)) : |
| 85 | Nonempty (M14PullbackExtension G γ (Set.Icc a b) Y) := by |
| 86 | have hγ := (FiberBundle.continuous_proj |
| 87 | (EuclideanSpace ℝ (Fin n)) G.Horizontal).comp_continuousOn hY.continuousOn |
| 88 | exact exists_pullbackExtension_of_closed_local isClosed_Icc hγ |
| 89 | (fun _ hs => exists_local_pullbackExtension_Icc hab hγ hY hs) |
| 90 | |
| 91 | end PoincareMT.M14 |