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.Local.Theory |
| 2 | import PoincareLib.Geometry.RicciFlow.Curvature.Energy.Regularity |
| 3 | import Mathlib.Topology.Instances.ENNReal.Lemmas |
| 4 | |
| 5 | /-! |
| 6 | # The union of ordinary restart intervals |
| 7 | |
| 8 | Uniqueness identifies every compact-time solution with the same initial metric |
| 9 | on overlaps. Choosing those solutions pointwise therefore gives one smooth |
| 10 | Ricci flow up to the supremum of their existence times. This is the ordinary |
| 11 | restart construction used in Morgan--Tian, Definition 15.8, pp. 361-362, |
| 12 | from Theorem 3.11, p. 39, and Proposition 4.12, p. 68. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.Surgery.OrdinaryRestart |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | |
| 27 | /-- A positive finite ordinary interval starting at the specified metric. -/ |
| 28 | structure Solution (g₀ : RiemannianMetric n M) where |
| 29 | time : ℝ |
| 30 | time_pos : 0 < time |
| 31 | flow : RicciFlow n M (Ico 0 time) |
| 32 | initial : flow.metric 0 = g₀ |
| 33 | |
| 34 | variable {g₀ : RiemannianMetric n M} |
| 35 | |
| 36 | /-- Uniqueness makes the finite restart intervals compatible. -/ |
| 37 | theorem Solution.metric_eq (hunique : RicciFlowUniqueness n M) |
| 38 | (A B : Solution g₀) {t : ℝ} (htA : t ∈ Ico 0 A.time) |
| 39 | (htB : t ∈ Ico 0 B.time) : A.flow.metric t = B.flow.metric t := by |
| 40 | exact hunique _ _ A.flow B.flow ⟨⟨le_rfl, A.time_pos⟩, fun _ h => h.1⟩ |
| 41 | ⟨⟨le_rfl, B.time_pos⟩, fun _ h => h.1⟩ (A.initial.trans B.initial.symm) |
| 42 | ⟨htA, htB⟩ |
| 43 | |
| 44 | /-- The maximal ordinary lifetime, allowing an immortal restart. -/ |
| 45 | noncomputable def lifetime (g₀ : RiemannianMetric n M) : ℝ≥0∞ := |
| 46 | ⨆ A : Solution g₀, ENNReal.ofReal A.time |
| 47 | |
| 48 | /-- Times strictly below the supremum belong to a finite restart interval. -/ |
| 49 | theorem exists_solution_at {t : ℝ} (ht : 0 ≤ t) |
| 50 | (h : ENNReal.ofReal t < lifetime g₀) : |
| 51 | ∃ A : Solution g₀, t < A.time := by |
| 52 | obtain ⟨A, hA⟩ := (lt_iSup_iff).mp h |
| 53 | exact ⟨A, (ENNReal.ofReal_lt_ofReal_iff_of_nonneg ht).mp hA⟩ |
| 54 | |
| 55 | /-- Every finite restart interval lies in the maximal interval. -/ |
| 56 | theorem solution_time_lt (A : Solution g₀) {t : ℝ} (ht : t < A.time) : |
| 57 | ENNReal.ofReal t < lifetime g₀ := by |
| 58 | exact ((ENNReal.ofReal_lt_ofReal_iff A.time_pos).mpr ht).trans_le |
| 59 | (le_iSup (fun B : Solution g₀ => ENNReal.ofReal B.time) A) |
| 60 | |
| 61 | /-- A local restart guarantees a positive maximal lifetime. -/ |
| 62 | theorem lifetime_pos (A : Solution g₀) : 0 < lifetime g₀ := by |
| 63 | simpa only [ENNReal.ofReal_zero] using solution_time_lt A A.time_pos |
| 64 | |
| 65 | /-- Choose a finite solution at each time; outside the maximal interval use the seed. -/ |
| 66 | noncomputable def solutionAt (A : Solution g₀) (t : ℝ) : Solution g₀ := |
| 67 | if h : 0 ≤ t ∧ ENNReal.ofReal t < lifetime g₀ then |
| 68 | (exists_solution_at h.1 h.2).choose else A |
| 69 | |
| 70 | /-- The selected solution exists beyond the selected time. -/ |
| 71 | theorem solutionAt_time (A : Solution g₀) {t : ℝ} |
| 72 | (ht : 0 ≤ t ∧ ENNReal.ofReal t < lifetime g₀) : |
| 73 | t < (solutionAt A t).time := by |
| 74 | simp only [solutionAt, dif_pos ht] |
| 75 | exact (exists_solution_at ht.1 ht.2).choose_spec |
| 76 | |
| 77 | /-- The selected metric agrees with each solution throughout its interval. -/ |
| 78 | theorem selected_metric_eq (hunique : RicciFlowUniqueness n M) |
| 79 | (A B : Solution g₀) {t : ℝ} (ht : t ∈ Ico 0 B.time) : |
| 80 | (solutionAt A t).flow.metric t = B.flow.metric t := by |
| 81 | exact (solutionAt A t).metric_eq hunique B |
| 82 | ⟨ht.1, solutionAt_time A ⟨ht.1, solution_time_lt B ht.2⟩⟩ ht |
| 83 | |
| 84 | /-- A finite solution interval is a relative neighborhood at each of its times. -/ |
| 85 | theorem solution_interval_mem (B : Solution g₀) {t : ℝ} (ht : t ∈ Ico 0 B.time) : |
| 86 | Ico 0 B.time ∈ 𝓝[{s : ℝ | 0 ≤ s ∧ ENNReal.ofReal s < lifetime g₀}] t := by |
| 87 | filter_upwards [self_mem_nhdsWithin, |
| 88 | mem_nhdsWithin_of_mem_nhds (isOpen_Iio.mem_nhds ht.2)] with s hs hst |
| 89 | exact ⟨hs.1, hst⟩ |
| 90 | |
| 91 | /-- Gluing by uniqueness constructs the ordinary flow on the entire maximal interval. -/ |
| 92 | noncomputable def maximalFlow (hunique : RicciFlowUniqueness n M) |
| 93 | (A : Solution g₀) : |
| 94 | RicciFlow n M {t : ℝ | 0 ≤ t ∧ ENNReal.ofReal t < lifetime g₀} where |
| 95 | metric t := (solutionAt A t).flow.metric t |
| 96 | connection t := (solutionAt A t).flow.connection t |
| 97 | interval := ⟨by |
| 98 | intro a ha b hb t ht |
| 99 | exact ⟨ha.1.trans ht.1, (ENNReal.ofReal_le_ofReal ht.2).trans_lt hb.2⟩⟩ |
| 100 | nontrivial := by |
| 101 | refine ⟨0, ⟨le_rfl, ?_⟩, A.time / 2, ⟨by linarith [A.time_pos], ?_⟩, ?_⟩ |
| 102 | · simpa only [ENNReal.ofReal_zero] using lifetime_pos A |
| 103 | · exact solution_time_lt A (by linarith [A.time_pos]) |
| 104 | · linarith [A.time_pos] |
| 105 | smooth := by |
| 106 | intro p hp |
| 107 | let B := solutionAt A p.1 |
| 108 | have ht : p.1 ∈ Ico 0 B.time := ⟨hp.1.1, solutionAt_time A hp.1⟩ |
| 109 | have hneigh : Ico 0 B.time ×ˢ (univ : Set M) ∈ |
| 110 | 𝓝[({t : ℝ | 0 ≤ t ∧ ENNReal.ofReal t < lifetime g₀} ×ˢ univ)] p := by |
| 111 | filter_upwards [self_mem_nhdsWithin, |
| 112 | mem_nhdsWithin_of_mem_nhds |
| 113 | ((isOpen_Iio.preimage continuous_fst).mem_nhds ht.2)] with q hq hqt |
| 114 | exact ⟨⟨hq.1.1, hqt⟩, mem_univ _⟩ |
| 115 | apply ContMDiffWithinAt.congr_of_eventuallyEq_of_mem |
| 116 | ((B.flow.smooth p ⟨ht, mem_univ _⟩).mono_of_mem_nhdsWithin hneigh) _ hp |
| 117 | filter_upwards [hneigh] with q hq |
| 118 | rw [selected_metric_eq hunique A B hq.1] |
| 119 | equation := by |
| 120 | intro t ht x v w |
| 121 | let B := solutionAt A t |
| 122 | have htB : t ∈ Ico 0 B.time := ⟨ht.1, solutionAt_time A ht⟩ |
| 123 | apply ((B.flow.equation t htB x v w).mono_of_mem_nhdsWithin |
| 124 | (solution_interval_mem B htB)).congr_of_eventuallyEq_of_mem _ ht |
| 125 | filter_upwards [solution_interval_mem B htB] with s hs |
| 126 | rw [selected_metric_eq hunique A B hs] |
| 127 | |
| 128 | /-- The union solution starts at exactly the prescribed metric. -/ |
| 129 | theorem maximalFlow_initial (hunique : RicciFlowUniqueness n M) (A : Solution g₀) : |
| 130 | (maximalFlow hunique A).metric 0 = g₀ := |
| 131 | (solutionAt A 0).initial |
| 132 | |
| 133 | /-- Each finite solution contributes its full lifetime to the union. -/ |
| 134 | theorem time_le_lifetime (A : Solution g₀) : ENNReal.ofReal A.time ≤ lifetime g₀ := |
| 135 | le_iSup (fun B : Solution g₀ => ENNReal.ofReal B.time) A |
| 136 | |
| 137 | /-- At a finite lifetime, the maximal domain has its usual half-open form. -/ |
| 138 | theorem finite_domain (hfinite : lifetime g₀ ≠ ⊤) : |
| 139 | {t : ℝ | 0 ≤ t ∧ ENNReal.ofReal t < lifetime g₀} = |
| 140 | Ico 0 (lifetime g₀).toReal := by |
| 141 | ext t |
| 142 | constructor |
| 143 | · rintro ⟨ht, he⟩ |
| 144 | exact ⟨ht, (ENNReal.ofReal_lt_iff_lt_toReal ht hfinite).mp he⟩ |
| 145 | · rintro ⟨ht, he⟩ |
| 146 | exact ⟨ht, (ENNReal.ofReal_lt_iff_lt_toReal ht hfinite).mpr he⟩ |
| 147 | |
| 148 | /-- The finite maximal solution retains the chosen metric and connection families. -/ |
| 149 | noncomputable def finiteFlow (hunique : RicciFlowUniqueness n M) |
| 150 | (A : Solution g₀) (hfinite : lifetime g₀ ≠ ⊤) : |
| 151 | RicciFlow n M (Ico 0 (lifetime g₀).toReal) where |
| 152 | metric := (maximalFlow hunique A).metric |
| 153 | connection := (maximalFlow hunique A).connection |
| 154 | interval := ordConnected_Ico |
| 155 | nontrivial := by |
| 156 | rw [← finite_domain hfinite] |
| 157 | exact (maximalFlow hunique A).nontrivial |
| 158 | smooth := by |
| 159 | rw [← finite_domain hfinite] |
| 160 | exact (maximalFlow hunique A).smooth |
| 161 | equation := by |
| 162 | rw [← finite_domain hfinite] |
| 163 | exact (maximalFlow hunique A).equation |
| 164 | |
| 165 | /-- A finite maximal endpoint cannot have a uniform full-curvature bound. -/ |
| 166 | theorem finite_curvature_unbounded (hlocal : RicciFlowLocalTheory n M) |
| 167 | (A : Solution g₀) (hfinite : lifetime g₀ ≠ ⊤) (C : ℝ) : |
| 168 | ∃ t ∈ Ico 0 (lifetime g₀).toReal, ∃ x : M, |
| 169 | C < ((finiteFlow hlocal.2.1 A hfinite).connection t).curvatureTensorNorm x := by |
| 170 | by_contra h |
| 171 | push Not at h |
| 172 | have hpos : 0 < (lifetime g₀).toReal := |
| 173 | ENNReal.toReal_pos (ne_of_gt (lifetime_pos A)) hfinite |
| 174 | obtain ⟨b, hb, F, hF⟩ := |
| 175 | hlocal.2.2 _ hpos (finiteFlow hlocal.2.1 A hfinite) ⟨C, h⟩ |
| 176 | let B : Solution g₀ := ⟨b, hpos.trans hb, F, |
| 177 | (hF ⟨le_rfl, hpos⟩).symm.trans (maximalFlow_initial hlocal.2.1 A)⟩ |
| 178 | have hle := time_le_lifetime B |
| 179 | have hlt : lifetime g₀ < ENNReal.ofReal b := by |
| 180 | rw [← ENNReal.ofReal_toReal hfinite] |
| 181 | exact (ENNReal.ofReal_lt_ofReal_iff (hpos.trans hb)).mpr hb |
| 182 | exact (not_lt_of_ge hle) hlt |
| 183 | |
| 184 | /-- An empty ordinary carrier has infinite lifetime. -/ |
| 185 | theorem lifetime_eq_top_of_isEmpty [IsEmpty M] |
| 186 | (hlocal : RicciFlowLocalTheory n M) (A : Solution g₀) : lifetime g₀ = ⊤ := by |
| 187 | by_contra hfinite |
| 188 | obtain ⟨_, _, x, _⟩ := finite_curvature_unbounded hlocal A hfinite 0 |
| 189 | exact isEmptyElim x |
| 190 | |
| 191 | /-- The local existence service supplies a seed for the maximal union. -/ |
| 192 | theorem nonempty_solution (hlocal : RicciFlowLocalTheory n M) |
| 193 | (g₀ : RiemannianMetric n M) : Nonempty (Solution g₀) := by |
| 194 | obtain ⟨b, hb, F, hF⟩ := hlocal.1 g₀ |
| 195 | exact ⟨⟨b, hb, F, hF⟩⟩ |
| 196 | |
| 197 | /-- Compact earlier strips have a uniform full-curvature bound. -/ |
| 198 | theorem curvature_bound_on_compact [CompactSpace M] {J K : Set ℝ} |
| 199 | (F : RicciFlow n M J) (hK : IsCompact K) (hKJ : K ⊆ J) : |
| 200 | ∃ C : ℝ, ∀ t ∈ K, ∀ x : M, (F.connection t).curvatureTensorNorm x ≤ C := by |
| 201 | have hE : ContinuousOn |
| 202 | (fun p : ℝ × M => ((F.connection p.1).curvatureTensorNorm p.2) ^ 2) |
| 203 | (J ×ˢ univ) := by |
| 204 | simpa only [LeviCivitaData.curvatureDerivativeNorm_zero] using |
| 205 | (RicciFlowAnalysis.contMDiffOn_flow_curvatureDerivativeEnergy F 0).continuousOn |
| 206 | have hN : ContinuousOn |
| 207 | (fun p : ℝ × M => (F.connection p.1).curvatureTensorNorm p.2) |
| 208 | (K ×ˢ univ) := by |
| 209 | apply (hE.mono (prod_mono hKJ (subset_refl _))).sqrt.congr |
| 210 | intro p _ |
| 211 | exact (Real.sqrt_sq (show 0 ≤ (F.connection p.1).curvatureTensorNorm p.2 from |
| 212 | Real.sqrt_nonneg _)).symm |
| 213 | obtain ⟨C, hC⟩ := |
| 214 | (hK.prod (isCompact_univ : IsCompact (univ : Set M))).bddAbove_image hN |
| 215 | exact ⟨C, fun t ht x => hC ⟨(t, x), ⟨ht, mem_univ _⟩, rfl⟩⟩ |
| 216 | |
| 217 | /-- Full curvature is unbounded in every tail of a finite maximal restart. -/ |
| 218 | theorem finite_curvature_unbounded_tail [CompactSpace M] |
| 219 | (hlocal : RicciFlowLocalTheory n M) (A : Solution g₀) |
| 220 | (hfinite : lifetime g₀ ≠ ⊤) (C s : ℝ) (hs : s < (lifetime g₀).toReal) : |
| 221 | ∃ t ∈ Ioo (max 0 s) (lifetime g₀).toReal, ∃ x : M, |
| 222 | C < ((maximalFlow hlocal.2.1 A).connection t).curvatureTensorNorm x := by |
| 223 | have hpos : 0 < (lifetime g₀).toReal := |
| 224 | ENNReal.toReal_pos (ne_of_gt (lifetime_pos A)) hfinite |
| 225 | have hmax : max 0 s < (lifetime g₀).toReal := max_lt hpos hs |
| 226 | obtain ⟨K, hK⟩ := curvature_bound_on_compact (finiteFlow hlocal.2.1 A hfinite) |
| 227 | (K := Icc 0 (max 0 s)) isCompact_Icc |
| 228 | (fun _ ht => ⟨ht.1, ht.2.trans_lt hmax⟩) |
| 229 | obtain ⟨t, ht, x, hx⟩ := finite_curvature_unbounded hlocal A hfinite (max C K) |
| 230 | refine ⟨t, ⟨?_, ht.2⟩, x, (le_max_left C K).trans_lt hx⟩ |
| 231 | by_contra h |
| 232 | exact (not_lt_of_ge (hK t ⟨ht.1, le_of_not_gt h⟩ x)) ((le_max_right C K).trans_lt hx) |
| 233 | |
| 234 | /-- Construct a maximal ordinary restart from the local-flow service. -/ |
| 235 | theorem exists_maximal_flow [CompactSpace M] (P : RicciFlowLocalTheory n M) |
| 236 | (g₀ : RiemannianMetric n M) : |
| 237 | ∃ b : ℝ≥0∞, 0 < b ∧ |
| 238 | ∃ F : RicciFlow n M {t : ℝ | 0 ≤ t ∧ ENNReal.ofReal t < b}, |
| 239 | F.metric 0 = g₀ ∧ |
| 240 | (∀ c : ℝ, 0 < c → ∀ G : RicciFlow n M (Ico 0 c), |
| 241 | G.metric 0 = g₀ → ENNReal.ofReal c ≤ b) ∧ |
| 242 | (b ≠ ⊤ → ∀ C s : ℝ, s < b.toReal → |
| 243 | ∃ t ∈ Ioo (max 0 s) b.toReal, ∃ x : M, |
| 244 | C < (F.connection t).curvatureTensorNorm x) := by |
| 245 | obtain ⟨A⟩ := nonempty_solution P g₀ |
| 246 | refine ⟨lifetime g₀, lifetime_pos A, maximalFlow P.2.1 A, |
| 247 | maximalFlow_initial P.2.1 A, ?_, finite_curvature_unbounded_tail P A⟩ |
| 248 | intro c hc G hG |
| 249 | exact time_le_lifetime ⟨c, hc, G, hG⟩ |
| 250 | |
| 251 | end PoincareMT.Surgery.OrdinaryRestart |