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.Noncollapse.Confinement.Coordinates.SpatialLift |
| 2 | import Mathlib.Topology.Order.IntermediateValue |
| 3 | |
| 4 | /-! Adapted from Mapher `PoincareMT/Proofs/M15/Lemma8_7_CompactContinuation.lean` at |
| 5 | `0c5d5c4e1ecbc12703b1994e226df1b15d2e8d39`. See the source mapping in |
| 6 | `references/ricci-flow/mapher/noncollapse/import.json`. -/ |
| 7 | |
| 8 | /-! |
| 9 | # Continuing an actual cylinder lift through a compact region |
| 10 | |
| 11 | Morgan-Tian Claims 8.6-8.7, pp. 173-174, and Definition 3.38, p. 61. |
| 12 | Relative image neighborhoods and continuous induction extend a lift when |
| 13 | each available open-region prefix has its endpoint in a compact subset. |
| 14 | See `references/ricci-flow/mapher/noncollapse/derivations/2026-09-21-compact-continuation.md`. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Manifold ContDiff Topology |
| 21 | |
| 22 | universe u v |
| 23 | |
| 24 | namespace PoincareMT.Generalized.Noncollapse |
| 25 | |
| 26 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] |
| 27 | {time : X → ℝ} {I K : SpacetimeInterval} |
| 28 | (G : GeneralizedLGeometryTransport n X time I) |
| 29 | (D : SmoothSpacetimeInterval K) |
| 30 | {C : Type v} [TopologicalSpace C] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] |
| 32 | [IsManifold (𝓡 n) ∞ C] |
| 33 | (e : CompatibleSpacetimeCylinder G.spacetime D C) |
| 34 | (g : SpacetimeCylinderMetric e) |
| 35 | |
| 36 | include g |
| 37 | |
| 38 | /-- An open spatial restriction of a compatible cylinder still contains |
| 39 | a relative spacetime neighborhood. This is the local continuation input |
| 40 | for Claims 8.6-8.7, pp. 173-174. -/ |
| 41 | theorem compatibleCylinder_spatialOpen_image_mem_nhdsWithin_timeDomain |
| 42 | (q : D.Point × C) {U : Set C} (hU : IsOpen U) (hq : q.2 ∈ U) : |
| 43 | e.toSpacetime '' (Set.univ ×ˢ U) ∈ |
| 44 | nhdsWithin (e.toSpacetime q) |
| 45 | {p : G.Point | G.spacetime.timeFunction p ∈ K.domain} := by |
| 46 | obtain ⟨O, hO, hOU⟩ := e.embedding.isInducing.isOpen_iff.mp (isOpen_univ.prod hU) |
| 47 | have hqO : e.toSpacetime q ∈ O := by |
| 48 | change q ∈ e.toSpacetime ⁻¹' O |
| 49 | rw [hOU] |
| 50 | exact ⟨mem_univ _, hq⟩ |
| 51 | have hn := compatibleCylinder_range_mem_nhdsWithin_timeDomain G D e g q |
| 52 | have ho : O ∈ 𝓝[{p : G.Point | G.spacetime.timeFunction p ∈ K.domain}] |
| 53 | (e.toSpacetime q) := mem_nhdsWithin_of_mem_nhds (hO.mem_nhds hqO) |
| 54 | filter_upwards [hn, ho] with p hp hpO |
| 55 | obtain ⟨z, rfl⟩ := hp |
| 56 | refine ⟨z, ?_, rfl⟩ |
| 57 | rw [← hOU] |
| 58 | exact hpO |
| 59 | |
| 60 | /-- A compact interior endpoint trap continues an actual lift on the |
| 61 | whole closed parameter interval. This is the topological continuation |
| 62 | step of Claims 8.6-8.7, pp. 173-174; the trap is proved separately. -/ |
| 63 | theorem compatibleCylinder_lift_of_compact_prefix_trap |
| 64 | (hK : IsCompact K.domain) |
| 65 | {U A : Set C} (hU : IsOpen U) (hA : IsCompact A) (hAU : A ⊆ U) |
| 66 | (q : D.Point × C) (hq : q.2 ∈ A) |
| 67 | {S : ℝ} (hS : 0 ≤ S) (gamma : ℝ → G.Point) |
| 68 | (hgamma : ContMDiffOn 𝓘(ℝ) (spacetimeModel n) ∞ gamma (Set.Icc 0 S)) |
| 69 | (hzero : gamma 0 = e.toSpacetime q) |
| 70 | (htime : ∀ s ∈ Set.Icc 0 S, |
| 71 | G.spacetime.timeFunction (gamma s) ∈ K.domain) |
| 72 | (htrap : ∀ b ∈ Set.Ioc 0 S, |
| 73 | (∀ s ∈ Set.Icc 0 b, gamma s ∈ e.toSpacetime '' (Set.univ ×ˢ U)) → |
| 74 | gamma b ∈ e.toSpacetime '' (Set.univ ×ˢ A)) : |
| 75 | ∃ L : ℝ → D.Point × C, |
| 76 | L 0 = q ∧ |
| 77 | ContMDiffOn 𝓘(ℝ) (spacetimeModel n) ∞ L (Set.Icc 0 S) ∧ |
| 78 | ∀ s ∈ Set.Icc 0 S, |
| 79 | e.toSpacetime (L s) = gamma s ∧ (L s).2 ∈ A := by |
| 80 | let : CompactSpace D.Point := isCompact_iff_compactSpace.mp hK |
| 81 | have hQ : IsCompact (e.toSpacetime '' (univ ×ˢ A)) := |
| 82 | (isCompact_univ.prod hA).image e.embedding.continuous |
| 83 | let H := gamma ⁻¹' (e.toSpacetime '' (univ ×ˢ A)) |
| 84 | have hH : IsClosed (H ∩ Icc 0 S) := by |
| 85 | simpa only [H, inter_comm] using |
| 86 | hgamma.continuousOn.preimage_isClosed_of_isClosed isClosed_Icc hQ.isClosed |
| 87 | have h0 : (0 : ℝ) ∈ H := ⟨q, ⟨mem_univ _, hq⟩, hzero.symm⟩ |
| 88 | have hAll : Icc 0 S ⊆ H := by |
| 89 | apply hH.Icc_subset_of_forall_mem_nhdsGT_of_Icc_subset h0 |
| 90 | intro t ht hprefix |
| 91 | obtain ⟨qt, hqt, heqt⟩ := hprefix ⟨ht.1, le_rfl⟩ |
| 92 | have hn := compatibleCylinder_spatialOpen_image_mem_nhdsWithin_timeDomain |
| 93 | G D e g qt hU (hAU hqt.2) |
| 94 | rw [heqt] at hn |
| 95 | have hpre : gamma ⁻¹' (e.toSpacetime '' (univ ×ˢ U)) ∈ 𝓝[Icc 0 S] t := |
| 96 | ((hgamma t ⟨ht.1, ht.2.le⟩).continuousWithinAt.tendsto_nhdsWithin |
| 97 | (t := {p : G.Point | G.spacetime.timeFunction p ∈ K.domain}) |
| 98 | (fun s hs => htime s hs)) hn |
| 99 | obtain ⟨O, hO, hOI⟩ := mem_nhdsWithin_iff_exists_mem_nhds_inter.mp hpre |
| 100 | obtain ⟨delta, hdelta, hdeltaO⟩ := Metric.mem_nhds_iff.mp hO |
| 101 | let m := min S (t + delta / 2) |
| 102 | have htm : t < m := lt_min ht.2 (by linarith) |
| 103 | apply (mem_nhdsGT_iff_exists_Ioo_subset' ht.2).mpr |
| 104 | refine ⟨m, htm, ?_⟩ |
| 105 | intro b hb |
| 106 | have hbS : b ≤ S := hb.2.le.trans (min_le_left _ _) |
| 107 | apply htrap b ⟨lt_of_le_of_lt ht.1 hb.1, hbS⟩ |
| 108 | intro s hs |
| 109 | by_cases hst : s ≤ t |
| 110 | · obtain ⟨qs, hqs, heqs⟩ := hprefix ⟨hs.1, hst⟩ |
| 111 | exact ⟨qs, ⟨mem_univ _, hAU hqs.2⟩, heqs⟩ |
| 112 | · have hts : t < s := lt_of_not_ge hst |
| 113 | apply hOI |
| 114 | refine ⟨hdeltaO ?_, ⟨hs.1, hs.2.trans hbS⟩⟩ |
| 115 | rw [Metric.mem_ball, Real.dist_eq, abs_of_pos (sub_pos.mpr hts)] |
| 116 | have hbm : b < t + delta / 2 := hb.2.trans_le (min_le_right _ _) |
| 117 | linarith [hs.2] |
| 118 | let : Nonempty (D.Point × C) := ⟨q⟩ |
| 119 | let L := fun s => Function.invFun e.toSpacetime (gamma s) |
| 120 | have hL (s : ℝ) (hs : s ∈ Icc 0 S) : e.toSpacetime (L s) = gamma s := by |
| 121 | apply Function.invFun_eq |
| 122 | obtain ⟨z, _, hz⟩ := hAll hs |
| 123 | exact ⟨z, hz⟩ |
| 124 | refine ⟨L, ?_, compatibleCylinder_lift_contMDiffOn G D e g hgamma L hL, ?_⟩ |
| 125 | · apply e.embedding.injective |
| 126 | exact (hL 0 ⟨le_rfl, hS⟩).trans hzero |
| 127 | · intro s hs |
| 128 | refine ⟨hL s hs, ?_⟩ |
| 129 | obtain ⟨z, hz, hez⟩ := hAll hs |
| 130 | have hLz : L s = z := e.embedding.injective ((hL s hs).trans hez.symm) |
| 131 | rw [hLz] |
| 132 | exact hz.2 |
| 133 | |
| 134 | end PoincareMT.Generalized.Noncollapse |