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.AncientKappa.Compactness.Coordinates.EmbeddingConvergence |
| 2 | |
| 3 | /-! |
| 4 | # Terminal jet convergence to the actual retained flow |
| 5 | |
| 6 | Closed coefficient limits agree with any actual terminal extension of the |
| 7 | retained negative-time metric. Local closed-ball jets then give convergence |
| 8 | of the canonical past-halfspace jets on every compact coordinate set. |
| 9 | Compactness supplies a common threshold, preserving the original maps and |
| 10 | subsequence throughout. |
| 11 | |
| 12 | Reference: Morgan--Tian, Theorem 9.64, pp. 225-229. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | set_option maxSynthPendingDepth 12 |
| 18 | set_option synthInstance.maxHeartbeats 100000 |
| 19 | set_option maxHeartbeats 1000000 |
| 20 | |
| 21 | open Set Filter Metric |
| 22 | open scoped Manifold ContDiff Bundle Topology |
| 23 | |
| 24 | namespace PoincareMT.NormalizedKappaSolutionSequence |
| 25 | |
| 26 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.chartedSpace |
| 27 | FlowCarrier.isManifold FlowCarrier.measurableSpace FlowCarrier.borelSpace |
| 28 | FlowCarrier.t2Space FlowCarrier.t3Space FlowCarrier.secondCountable |
| 29 | |
| 30 | local instance terminalConvergenceCarrierConnected (C : FlowCarrier.{0} 3) : |
| 31 | ConnectedSpace C.carrier := connectedSpace_iff_univ.mpr C.connected |
| 32 | |
| 33 | variable {κ : ℝ} (S : NormalizedKappaSolutionSequence κ) |
| 34 | (G : AncientPointedGeometricConvergence (fun k => (S.term k).carrier) |
| 35 | (fun k t => (S.term k).flow.flow.metric (t - 1)) (fun k => (S.term k).base) 1) |
| 36 | (F : RicciFlow 3 G.limitCarrier.carrier (Iic 0)) |
| 37 | (hF : ∀ t : ℝ, t < 0 → F.metric t = G.limitFlow.metric (t + 1)) |
| 38 | |
| 39 | include hF |
| 40 | |
| 41 | /-- The closed coefficient limit of the retained maps equals the actual |
| 42 | terminal flow, including at zero. -/ |
| 43 | theorem terminal_embedding_coefficients_eqOn_actualFlow |
| 44 | (q : G.limitCarrier.carrier) {x₀ : EuclideanSpace ℝ (Fin 3)} {ρ : ℝ} |
| 45 | (hchart : closedBall x₀ ρ ⊆ (extChartAt (𝓡 3) q).target) |
| 46 | (B : ℝ × EuclideanSpace ℝ (Fin 3) → SpacetimeBounds.MetricCoefficient 3) |
| 47 | (hB : ContDiffOn ℝ ∞ B (Iic 0 ×ˢ closedBall x₀ ρ)) |
| 48 | (hzero : ∀ K, IsCompact K → K ⊆ Iic 0 ×ˢ closedBall x₀ ρ → |
| 49 | TendstoUniformlyOn |
| 50 | (fun k => iteratedFDerivWithin ℝ 0 |
| 51 | (fun z : ℝ × EuclideanSpace ℝ (Fin 3) => |
| 52 | ((S.term (G.subsequence k)).flow.flow.metric z.1).pullbackCoefficients |
| 53 | (G.embedding k ∘ (extChartAt (𝓡 3) q).symm) z.2) |
| 54 | (Iic 0 ×ˢ closedBall x₀ ρ)) |
| 55 | (iteratedFDerivWithin ℝ 0 B (Iic 0 ×ˢ closedBall x₀ ρ)) atTop K) : |
| 56 | EqOn B (fun z : ℝ × EuclideanSpace ℝ (Fin 3) => |
| 57 | (F.metric z.1).pullbackCoefficients (extChartAt (𝓡 3) q).symm z.2) |
| 58 | (Iic 0 ×ˢ closedBall x₀ ρ) := by |
| 59 | let A := fun z : ℝ × EuclideanSpace ℝ (Fin 3) => |
| 60 | (F.metric z.1).pullbackCoefficients (extChartAt (𝓡 3) q).symm z.2 |
| 61 | have hA : ContDiffOn ℝ ∞ A (Iic 0 ×ˢ closedBall x₀ ρ) := |
| 62 | (F.contDiffOn_pullbackCoefficients_within (isOpen_extChartAt_target q) |
| 63 | (contMDiffOn_extChartAt_symm (n := ∞) q)).mono (prod_mono subset_rfl hchart) |
| 64 | have hpast : EqOn B A (Iio 0 ×ˢ closedBall x₀ ρ) := by |
| 65 | intro z hz |
| 66 | have hzclosed : z ∈ Iic 0 ×ˢ closedBall x₀ ρ := |
| 67 | ⟨le_of_lt (show z.1 < 0 from hz.1), hz.2⟩ |
| 68 | have hclosed := (ContinuousMultilinearMap.uniformContinuous_eval_const |
| 69 | (0 : Fin 0 → ℝ × EuclideanSpace ℝ (Fin 3))).comp_tendstoUniformlyOn |
| 70 | (hzero {z} isCompact_singleton (singleton_subset_iff.mpr hzclosed)) |
| 71 | have hclosedpoint := hclosed.tendsto_at (mem_singleton z) |
| 72 | simp only [Function.comp_def, iteratedFDerivWithin_zero_apply] at hclosedpoint |
| 73 | have hnegative := (S.tendstoUniformlyOn_embedding_bilinear_metricJet_unshifted G q 0 |
| 74 | (K := {z}) isCompact_singleton |
| 75 | (fun w hw => by rcases mem_singleton_iff.mp hw with rfl; exact hz.1) |
| 76 | (fun w hw => by rcases mem_singleton_iff.mp hw with rfl; exact hchart hz.2)).tendsto_at |
| 77 | (mem_singleton z) |
| 78 | have hvalue := (continuous_eval_const |
| 79 | (0 : Fin 0 → ℝ × EuclideanSpace ℝ (Fin 3))).continuousAt.tendsto.comp hnegative |
| 80 | simp only [iteratedFDeriv_zero_apply] at hvalue |
| 81 | dsimp only [A] |
| 82 | rw [hF z.1 hz.1] |
| 83 | exact tendsto_nhds_unique hclosedpoint hvalue |
| 84 | apply hpast.of_subset_closure hB.continuousOn hA.continuousOn |
| 85 | (prod_mono (show Iio (0 : ℝ) ⊆ Iic 0 from |
| 86 | fun t ht => show t ≤ 0 from le_of_lt ht) subset_rfl) |
| 87 | rw [closure_prod_eq, closure_Iio, isClosed_closedBall.closure_eq] |
| 88 | |
| 89 | /-- Closed bilinear coefficient jets converge to the actual terminal flow |
| 90 | on every compact subset of a retained coordinate ball. -/ |
| 91 | theorem tendstoUniformlyOn_terminal_bilinearJet_on_closedBall |
| 92 | (P : M23NormalizedKappaCompactnessPredecessors) |
| 93 | (hcontrol : M23AllTimeCurvatureControl S) |
| 94 | (hcomplete : G.limitCarrier.metricComplete (G.limitFlow.metric 0)) |
| 95 | (q : G.limitCarrier.carrier) {x₀ : EuclideanSpace ℝ (Fin 3)} {ρ : ℝ} (hρ : 0 < ρ) |
| 96 | (hchart : closedBall x₀ ρ ⊆ (extChartAt (𝓡 3) q).target) (m : ℕ) |
| 97 | {K : Set (ℝ × EuclideanSpace ℝ (Fin 3))} (hK : IsCompact K) |
| 98 | (hKU : K ⊆ Iic 0 ×ˢ closedBall x₀ ρ) : |
| 99 | TendstoUniformlyOn |
| 100 | (fun k => iteratedFDerivWithin ℝ m |
| 101 | (fun z : ℝ × EuclideanSpace ℝ (Fin 3) => |
| 102 | ((S.term (G.subsequence k)).flow.flow.metric z.1).pullbackCoefficients |
| 103 | (G.embedding k ∘ (extChartAt (𝓡 3) q).symm) z.2) |
| 104 | (Iic 0 ×ˢ closedBall x₀ ρ)) |
| 105 | (iteratedFDerivWithin ℝ m |
| 106 | (fun z : ℝ × EuclideanSpace ℝ (Fin 3) => |
| 107 | (F.metric z.1).pullbackCoefficients (extChartAt (𝓡 3) q).symm z.2) |
| 108 | (Iic 0 ×ˢ closedBall x₀ ρ)) atTop K := by |
| 109 | obtain ⟨B, hB, hjets⟩ := S.exists_smooth_terminal_embedding_coefficients |
| 110 | G P hcontrol hcomplete q hρ hchart |
| 111 | have hBA := S.terminal_embedding_coefficients_eqOn_actualFlow G F hF q hchart B hB (hjets 0) |
| 112 | exact (hjets m K hK hKU).congr_right fun z hz => |
| 113 | iteratedFDerivWithin_congr hBA (hKU hz) m |
| 114 | |
| 115 | omit hF in |
| 116 | private theorem halfspace_eq_closedBall_germ |
| 117 | {x₀ : EuclideanSpace ℝ (Fin 3)} {ρ : ℝ} |
| 118 | {z : ℝ × EuclideanSpace ℝ (Fin 3)} (hz : z.2 ∈ ball x₀ ρ) : |
| 119 | Iic (0 : ℝ) ×ˢ closedBall x₀ ρ =ᶠ[𝓝 z] |
| 120 | Iic 0 ×ˢ (univ : Set (EuclideanSpace ℝ (Fin 3))) := by |
| 121 | filter_upwards [continuousAt_snd.preimage_mem_nhds (isOpen_ball.mem_nhds hz)] with w hw |
| 122 | apply propext |
| 123 | change (w.1 ≤ 0 ∧ w.2 ∈ closedBall x₀ ρ) ↔ (w.1 ≤ 0 ∧ True) |
| 124 | simp only [ball_subset_closedBall hw, and_true] |
| 125 | |
| 126 | /-- On a compact subset of one coordinate ball, the actual flow is the |
| 127 | limit of the canonical scalar halfspace jets of the same source maps. -/ |
| 128 | theorem tendstoUniformlyOn_terminal_metricJet_on_ball |
| 129 | (P : M23NormalizedKappaCompactnessPredecessors) |
| 130 | (hcontrol : M23AllTimeCurvatureControl S) |
| 131 | (hcomplete : G.limitCarrier.metricComplete (G.limitFlow.metric 0)) |
| 132 | (q : G.limitCarrier.carrier) {x₀ : EuclideanSpace ℝ (Fin 3)} {ρ : ℝ} (hρ : 0 < ρ) |
| 133 | (hchart : closedBall x₀ ρ ⊆ (extChartAt (𝓡 3) q).target) |
| 134 | (m : ℕ) (a b : Fin 3) |
| 135 | {K : Set (ℝ × EuclideanSpace ℝ (Fin 3))} (hK : IsCompact K) |
| 136 | (hKU : K ⊆ Iic 0 ×ˢ ball x₀ ρ) : |
| 137 | TendstoUniformlyOn |
| 138 | (fun k => M23TerminalMetricJet m (G.limitCarrier.coordinateCoefficient q |
| 139 | (fun t x v w => spatialPullbackInner G.limitCarrier |
| 140 | (S.term (G.subsequence k)).carrier ((S.term (G.subsequence k)).flow.flow.metric t) |
| 141 | (G.embedding k) x v w) a b)) |
| 142 | (M23TerminalMetricJet m (G.limitCarrier.coordinateCoefficient q |
| 143 | (fun t x v w => (F.metric t).inner x v w) a b)) atTop K := by |
| 144 | let c := extChartAt (𝓡 3) q |
| 145 | let Ω : Set (ℝ × EuclideanSpace ℝ (Fin 3)) := Iic 0 ×ˢ closedBall x₀ ρ |
| 146 | let Γ : Set (ℝ × EuclideanSpace ℝ (Fin 3)) := Iic 0 ×ˢ univ |
| 147 | let f := fun k (z : ℝ × EuclideanSpace ℝ (Fin 3)) => |
| 148 | ((S.term (G.subsequence k)).flow.flow.metric z.1).pullbackCoefficients |
| 149 | (G.embedding k ∘ c.symm) z.2 |
| 150 | let A := fun z : ℝ × EuclideanSpace ℝ (Fin 3) => |
| 151 | (F.metric z.1).pullbackCoefficients c.symm z.2 |
| 152 | let fs := fun k => G.limitCarrier.coordinateCoefficient q |
| 153 | (fun t x v w => spatialPullbackInner G.limitCarrier |
| 154 | (S.term (G.subsequence k)).carrier ((S.term (G.subsequence k)).flow.flow.metric t) |
| 155 | (G.embedding k) x v w) a b |
| 156 | let As := G.limitCarrier.coordinateCoefficient q |
| 157 | (fun t x v w => (F.metric t).inner x v w) a b |
| 158 | have hKΩ : K ⊆ Ω := hKU.trans (prod_mono subset_rfl ball_subset_closedBall) |
| 159 | have hconvex : Convex ℝ Ω := (convex_Iic 0).prod (convex_closedBall x₀ ρ) |
| 160 | have hne : (interior Ω).Nonempty := by |
| 161 | rw [show Ω = Iic 0 ×ˢ closedBall x₀ ρ from rfl, |
| 162 | interior_prod_eq, interior_Iic, interior_closedBall x₀ hρ.ne'] |
| 163 | exact ⟨(-1, x₀), by simp [hρ]⟩ |
| 164 | have hunique := uniqueDiffOn_convex hconvex hne |
| 165 | have hm : (m : ℕ∞ω) ≤ ∞ := WithTop.coe_le_coe.mpr (le_top : (m : ℕ∞) ≤ ⊤) |
| 166 | have hA : ContDiffOn ℝ ∞ A Ω := |
| 167 | (F.contDiffOn_pullbackCoefficients_within (isOpen_extChartAt_target q) |
| 168 | (contMDiffOn_extChartAt_symm (n := ∞) q)).mono (prod_mono subset_rfl hchart) |
| 169 | have hlimit : TendstoUniformlyOn (fun k => iteratedFDerivWithin ℝ m (f k) Ω) |
| 170 | (iteratedFDerivWithin ℝ m A Ω) atTop K := |
| 171 | S.tendstoUniformlyOn_terminal_bilinearJet_on_closedBall G F hF |
| 172 | P hcontrol hcomplete q hρ hchart m hK hKΩ |
| 173 | let L := ContinuousLinearMap.compContinuousMultilinearMapL ℝ |
| 174 | (fun _ : Fin m => ℝ × EuclideanSpace ℝ (Fin 3)) |
| 175 | (SpacetimeBounds.MetricCoefficient 3) ℝ (coefficientEval a b) |
| 176 | have hscalar := L.uniformContinuous.comp_tendstoUniformlyOn hlimit |
| 177 | have hAs : As = coefficientEval a b ∘ A := rfl |
| 178 | have hc : ContinuousOn c.symm (closedBall x₀ ρ) := |
| 179 | (contMDiffOn_extChartAt_symm (n := ∞) q).continuousOn.mono hchart |
| 180 | obtain ⟨j, hj⟩ := G.exists_exhaustion_superset |
| 181 | ((isCompact_closedBall x₀ ρ).image_of_continuousOn hc) |
| 182 | have hmono : Monotone G.exhaustion := monotone_nat_of_le_succ G.exhaustion_increasing |
| 183 | have hsource : ∀ᶠ k : ℕ in atTop, EqOn (fs k) (coefficientEval a b ∘ f k) Ω := by |
| 184 | filter_upwards [eventually_ge_atTop j] with k hk z hz |
| 185 | convert! S.embedding_coordinateCoefficient_eq_pullbackCoefficients_unshifted |
| 186 | G q k z.1 z.2 (hchart hz.2) (hmono hk (hj (mem_image_of_mem _ hz.2))) a b using 1 |
| 187 | have hscalarΩ : TendstoUniformlyOn |
| 188 | (fun k => iteratedFDerivWithin ℝ m (fs k) Ω) |
| 189 | (iteratedFDerivWithin ℝ m As Ω) atTop K := by |
| 190 | have htarget : TendstoUniformlyOn |
| 191 | (fun k => L ∘ iteratedFDerivWithin ℝ m (f k) Ω) |
| 192 | (iteratedFDerivWithin ℝ m As Ω) atTop K := |
| 193 | hscalar.congr_right fun z hz => by |
| 194 | rw [hAs, (coefficientEval a b).iteratedFDerivWithin_comp_left |
| 195 | (hA z (hKΩ hz)) hunique (hKΩ hz) hm] |
| 196 | rfl |
| 197 | apply htarget.congr |
| 198 | filter_upwards [hsource, S.eventually_embedding_contDiffOn_terminal G q hchart] |
| 199 | with k hk hfk z hz |
| 200 | rw [iteratedFDerivWithin_congr hk (hKΩ hz) m, |
| 201 | (coefficientEval a b).iteratedFDerivWithin_comp_left (hfk z (hKΩ hz)) |
| 202 | hunique (hKΩ hz) hm] |
| 203 | rfl |
| 204 | have htarget := hscalarΩ.congr_right fun z hz => |
| 205 | iteratedFDerivWithin_congr_set (halfspace_eq_closedBall_germ (hKU hz).2) m |
| 206 | apply htarget.congr |
| 207 | exact Eventually.of_forall fun k z hz => |
| 208 | iteratedFDerivWithin_congr_set (halfspace_eq_closedBall_germ (hKU hz).2) m |
| 209 | |
| 210 | /-- Compact testing sets in an arbitrary original limit chart have uniform |
| 211 | terminal convergence. Local chart balls supply the finite-cover argument. -/ |
| 212 | theorem tendstoUniformlyOn_terminal_metricJet |
| 213 | (P : M23NormalizedKappaCompactnessPredecessors) |
| 214 | (hcontrol : M23AllTimeCurvatureControl S) |
| 215 | (hcomplete : G.limitCarrier.metricComplete (G.limitFlow.metric 0)) |
| 216 | (q : G.limitCarrier.carrier) (m : ℕ) (a b : Fin 3) |
| 217 | {K : Set (ℝ × EuclideanSpace ℝ (Fin 3))} (hK : IsCompact K) |
| 218 | (hKU : K ⊆ Iic 0 ×ˢ (extChartAt (𝓡 3) q).target) : |
| 219 | TendstoUniformlyOn |
| 220 | (fun k => M23TerminalMetricJet m (G.limitCarrier.coordinateCoefficient q |
| 221 | (fun t x v w => spatialPullbackInner G.limitCarrier |
| 222 | (S.term (G.subsequence k)).carrier ((S.term (G.subsequence k)).flow.flow.metric t) |
| 223 | (G.embedding k) x v w) a b)) |
| 224 | (M23TerminalMetricJet m (G.limitCarrier.coordinateCoefficient q |
| 225 | (fun t x v w => (F.metric t).inner x v w) a b)) atTop K := by |
| 226 | let U : Set (ℝ × EuclideanSpace ℝ (Fin 3)) := |
| 227 | Iic 0 ×ˢ (extChartAt (𝓡 3) q).target |
| 228 | apply (tendstoLocallyUniformlyOn_iff_tendstoUniformlyOn_of_compact hK).mp |
| 229 | apply TendstoLocallyUniformlyOn.mono (s := U) _ hKU |
| 230 | apply tendstoLocallyUniformlyOn_of_forall_exists_nhds |
| 231 | intro z hz |
| 232 | obtain ⟨R, hR, hRsub⟩ := Metric.mem_nhds_iff.mp |
| 233 | ((isOpen_extChartAt_target (I := 𝓡 3) q).mem_nhds hz.2) |
| 234 | let ρ := R / 2 |
| 235 | have hρ : 0 < ρ := by dsimp [ρ]; positivity |
| 236 | have hchart : closedBall z.2 ρ ⊆ (extChartAt (𝓡 3) q).target := |
| 237 | (closedBall_subset_ball (by dsimp [ρ]; linarith)).trans hRsub |
| 238 | let C : Set (ℝ × EuclideanSpace ℝ (Fin 3)) := Icc (z.1 - 1) 0 ×ˢ closedBall z.2 (ρ / 2) |
| 239 | have hC : IsCompact C := isCompact_Icc.prod (isCompact_closedBall _ _) |
| 240 | have hCsmall : C ⊆ Iic 0 ×ˢ ball z.2 ρ := |
| 241 | prod_mono (fun _ ht => ht.2) (closedBall_subset_ball (by linarith)) |
| 242 | have hCnhds : C ∈ 𝓝[U] z := by |
| 243 | have hnear : Ioi (z.1 - 1) ×ˢ ball z.2 (ρ / 2) ∈ 𝓝 z := |
| 244 | (isOpen_Ioi.prod isOpen_ball).mem_nhds ⟨by simp, mem_ball_self (by positivity)⟩ |
| 245 | apply mem_of_superset (inter_mem (mem_nhdsWithin_of_mem_nhds hnear) self_mem_nhdsWithin) |
| 246 | intro w hw |
| 247 | exact ⟨⟨hw.1.1.le, hw.2.1⟩, ball_subset_closedBall hw.1.2⟩ |
| 248 | exact ⟨C, hCnhds, S.tendstoUniformlyOn_terminal_metricJet_on_ball G F hF |
| 249 | P hcontrol hcomplete q hρ hchart m a b hC hCsmall⟩ |
| 250 | |
| 251 | /-- The exact common-threshold form needed by the frozen M23 terminal |
| 252 | metric-convergence clause, on the same maps and subsequence. -/ |
| 253 | theorem terminal_pullback_metric_CInfinity |
| 254 | (P : M23NormalizedKappaCompactnessPredecessors) |
| 255 | (hcontrol : M23AllTimeCurvatureControl S) |
| 256 | (hcomplete : G.limitCarrier.metricComplete (G.limitFlow.metric 0)) |
| 257 | (q : G.limitCarrier.carrier) (j m : ℕ) |
| 258 | (K : Set (ℝ × EuclideanSpace ℝ (Fin 3))) (hK : IsCompact K) |
| 259 | (hKU : K ⊆ {z | z.1 ≤ 0 ∧ z.2 ∈ (extChartAt (𝓡 3) q).target ∧ |
| 260 | (extChartAt (𝓡 3) q).symm z.2 ∈ G.exhaustion j}) |
| 261 | (ε : ℝ) (hε : 0 < ε) : |
| 262 | ∃ N : ℕ, j ≤ N ∧ ∀ k ≥ N, ∀ a b : Fin 3, ∀ z ∈ K, |
| 263 | ‖M23TerminalMetricJet m (G.limitCarrier.coordinateCoefficient q |
| 264 | (fun t x v w => spatialPullbackInner G.limitCarrier |
| 265 | (S.term (G.subsequence k)).carrier ((S.term (G.subsequence k)).flow.flow.metric t) |
| 266 | (G.embedding k) x v w) a b) z - |
| 267 | M23TerminalMetricJet m (G.limitCarrier.coordinateCoefficient q |
| 268 | (fun t x v w => (F.metric t).inner x v w) a b) z‖ < ε := by |
| 269 | have hc (a b : Fin 3) := Metric.tendstoUniformlyOn_iff.mp |
| 270 | (S.tendstoUniformlyOn_terminal_metricJet G F hF P hcontrol hcomplete q m a b hK |
| 271 | (fun z hz => ⟨(hKU hz).1, (hKU hz).2.1⟩)) ε hε |
| 272 | have hall := Filter.eventually_all.mpr (fun a => Filter.eventually_all.mpr (hc a)) |
| 273 | obtain ⟨N, hN⟩ := eventually_atTop.mp hall |
| 274 | refine ⟨max j N, le_max_left _ _, fun k hk a b z hz => ?_⟩ |
| 275 | have h := hN k ((le_max_right j N).trans hk) a b z hz |
| 276 | rwa [dist_eq_norm, norm_sub_rev] at h |
| 277 | |
| 278 | end PoincareMT.NormalizedKappaSolutionSequence |