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.JetSlices |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Noncompact.AncientVolume.ScalarRatio.Annular.ChartFlow |
| 3 | import PoincareLib.Geometry.RicciFlow.Compactness.Pointed |
| 4 | import PoincareLib.Geometry.RicciFlow.Harnack.Noncompact.AncientVolume.ScalarRatio.Annular.FlowEquation |
| 5 | import PoincareLib.Geometry.RicciFlow.MetricFamily.Coordinates |
| 6 | import PoincareLib.Geometry.Riemannian.Connection.OpenDomain |
| 7 | import PoincareLib.Geometry.Riemannian.Coordinates.CanonicalDomain |
| 8 | |
| 9 | /-! |
| 10 | # Local ancient flows on arbitrary coordinate balls |
| 11 | |
| 12 | Positive smooth bilinear limits construct actual metric families on an open |
| 13 | spatial domain. Closed-domain jet slicing and the within-time equation |
| 14 | passage retain the Ricci-flow equation at the terminal time. |
| 15 | |
| 16 | This is the local realization step in Kleiner--Lott (corrected 2013), |
| 17 | Theorem 41.2, Case 1, pp. 2674--2675. The smooth coefficient limit and its |
| 18 | positivity are constructed separately by the annular compactness producers. |
| 19 | -/ |
| 20 | |
| 21 | noncomputable section |
| 22 | set_option autoImplicit false |
| 23 | set_option backward.isDefEq.respectTransparency false |
| 24 | set_option maxSynthPendingDepth 8 |
| 25 | set_option synthInstance.maxHeartbeats 100000 |
| 26 | |
| 27 | open Set Filter Metric TopologicalSpace |
| 28 | open scoped Manifold ContDiff Bundle Topology |
| 29 | |
| 30 | universe u |
| 31 | |
| 32 | namespace PoincareMT.RiemannianMetric |
| 33 | |
| 34 | private theorem pullbackCoefficients_openChart |
| 35 | {n : ℕ} (U : Opens (EuclideanSpace ℝ (Fin n))) |
| 36 | (g : RiemannianMetric n U) (p x : U) : |
| 37 | g.pullbackCoefficients (extChartAt (𝓡 n) p).symm (x : EuclideanSpace ℝ (Fin n)) = |
| 38 | g.inner x := by |
| 39 | have hd := mfderivWithin_range_extChartAt_symm (I := 𝓡 n) (x := x) |
| 40 | rw [ModelWithCorners.range_eq_univ, mfderivWithin_univ] at hd |
| 41 | have hc : extChartAt (𝓡 n) p = extChartAt (𝓡 n) x := by |
| 42 | simp [extChartAt, Opens.chartAt_eq] |
| 43 | rw [hc] |
| 44 | ext v w |
| 45 | change g.inner ((extChartAt (𝓡 n) x).symm x) |
| 46 | (mfderiv (𝓡 n) (𝓡 n) (extChartAt (𝓡 n) x).symm x v) |
| 47 | (mfderiv (𝓡 n) (𝓡 n) (extChartAt (𝓡 n) x).symm x w) = g.inner x v w |
| 48 | have hx : (extChartAt (𝓡 n) x).symm (x : EuclideanSpace ℝ (Fin n)) = x := |
| 49 | (extChartAt (𝓡 n) x).left_inv (mem_extChartAt_source x) |
| 50 | change mfderiv (𝓡 n) (𝓡 n) (extChartAt (𝓡 n) x).symm |
| 51 | (x : EuclideanSpace ℝ (Fin n)) = ContinuousLinearMap.id ℝ _ at hd |
| 52 | rw [hd, hx] |
| 53 | rfl |
| 54 | |
| 55 | private theorem iteratedFDeriv_openChart_eq |
| 56 | {n : ℕ} (U : Opens (EuclideanSpace ℝ (Fin n))) |
| 57 | (g : RiemannianMetric n U) |
| 58 | (B : EuclideanSpace ℝ (Fin n) → |
| 59 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 60 | (hcoeff : ∀ (x : U) v w, g.inner x v w = B x v w) |
| 61 | (x : U) (v w : EuclideanSpace ℝ (Fin n)) (r : ℕ) : |
| 62 | iteratedFDeriv ℝ r |
| 63 | (fun y => g.pullbackCoefficients (extChartAt (𝓡 n) x).symm y v w) |
| 64 | (extChartAt (𝓡 n) x x) = iteratedFDeriv ℝ r (fun y => B y v w) x := by |
| 65 | have heq : (fun y => g.pullbackCoefficients (extChartAt (𝓡 n) x).symm y v w) |
| 66 | =ᶠ[𝓝 (x : EuclideanSpace ℝ (Fin n))] (fun y => B y v w) := by |
| 67 | filter_upwards [U.isOpen.mem_nhds x.property] with y hy |
| 68 | rw [pullbackCoefficients_openChart U g x ⟨y, hy⟩] |
| 69 | exact hcoeff ⟨y, hy⟩ v w |
| 70 | exact (heq.iteratedFDeriv ℝ r).eq_of_nhds |
| 71 | |
| 72 | end PoincareMT.RiemannianMetric |
| 73 | |
| 74 | namespace PoincareMT.RicciFlow |
| 75 | |
| 76 | private theorem scalar_slices_of_bilinear_jets |
| 77 | {n : ℕ} {x₀ : EuclideanSpace ℝ (Fin n)} {ρ : ℝ} (hρ : 0 < ρ) |
| 78 | (Bseq : ℕ → ℝ × EuclideanSpace ℝ (Fin n) → |
| 79 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 80 | (B : ℝ × EuclideanSpace ℝ (Fin n) → |
| 81 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 82 | (hseq : ∀ k, ContDiffOn ℝ ∞ (Bseq k) (Iic 0 ×ˢ closedBall x₀ ρ)) |
| 83 | (hB : ContDiffOn ℝ ∞ B (Iic 0 ×ˢ closedBall x₀ ρ)) |
| 84 | {t : ℝ} (ht : t ≤ 0) {x : EuclideanSpace ℝ (Fin n)} (hx : x ∈ ball x₀ ρ) |
| 85 | (hjet : ∀ r, Tendsto (fun k => iteratedFDerivWithin ℝ r (Bseq k) |
| 86 | (Iic 0 ×ˢ closedBall x₀ ρ) (t, x)) atTop |
| 87 | (𝓝 (iteratedFDerivWithin ℝ r B (Iic 0 ×ˢ closedBall x₀ ρ) (t, x)))) |
| 88 | (v w : EuclideanSpace ℝ (Fin n)) : |
| 89 | (∀ r, Tendsto (fun k => iteratedFDeriv ℝ r (fun y => Bseq k (t, y) v w) x) atTop |
| 90 | (𝓝 (iteratedFDeriv ℝ r (fun y => B (t, y) v w) x))) ∧ |
| 91 | Tendsto (fun k => derivWithin (fun s => Bseq k (s, x) v w) (Iic 0) t) atTop |
| 92 | (𝓝 (derivWithin (fun s => B (s, x) v w) (Iic 0) t)) := by |
| 93 | let E := EuclideanSpace ℝ (Fin n) |
| 94 | let L : (E →L[ℝ] E →L[ℝ] ℝ) →L[ℝ] ℝ := |
| 95 | (ContinuousLinearMap.apply ℝ ℝ w).comp |
| 96 | (ContinuousLinearMap.apply ℝ (E →L[ℝ] ℝ) v) |
| 97 | have huBall : UniqueDiffOn ℝ (closedBall x₀ ρ) := by |
| 98 | apply uniqueDiffOn_convex (convex_closedBall x₀ ρ) |
| 99 | rw [interior_closedBall x₀ hρ.ne'] |
| 100 | exact ⟨x₀, by simpa using hρ⟩ |
| 101 | have hu := (uniqueDiffOn_Iic 0).prod huBall |
| 102 | have hp : (t, x) ∈ Iic 0 ×ˢ closedBall x₀ ρ := ⟨ht, ball_subset_closedBall hx⟩ |
| 103 | have hs (C : ℝ × E → E →L[ℝ] E →L[ℝ] ℝ) |
| 104 | (hC : ContDiffOn ℝ ∞ C (Iic 0 ×ˢ closedBall x₀ ρ)) : |
| 105 | ContDiffOn ℝ ∞ (fun z => C z v w) (Iic 0 ×ˢ closedBall x₀ ρ) := |
| 106 | (hC.clm_apply contDiffOn_const).clm_apply contDiffOn_const |
| 107 | have heq (C : ℝ × E → E →L[ℝ] E →L[ℝ] ℝ) |
| 108 | (hC : ContDiffOn ℝ ∞ C (Iic 0 ×ˢ closedBall x₀ ρ)) (r : ℕ) : |
| 109 | iteratedFDerivWithin ℝ r (fun z => C z v w) (Iic 0 ×ˢ closedBall x₀ ρ) (t, x) = |
| 110 | L.compContinuousMultilinearMap |
| 111 | (iteratedFDerivWithin ℝ r C (Iic 0 ×ˢ closedBall x₀ ρ) (t, x)) := by |
| 112 | exact L.iteratedFDerivWithin_comp_left (hC (t, x) hp) hu hp |
| 113 | (WithTop.coe_le_coe.mpr (le_top : (r : ℕ∞) ≤ ⊤)) |
| 114 | have hj (r : ℕ) : Tendsto (fun k => iteratedFDerivWithin ℝ r |
| 115 | (fun z => Bseq k z v w) (Iic 0 ×ˢ closedBall x₀ ρ) (t, x)) atTop |
| 116 | (𝓝 (iteratedFDerivWithin ℝ r (fun z => B z v w) |
| 117 | (Iic 0 ×ˢ closedBall x₀ ρ) (t, x))) := by |
| 118 | rw [heq B hB r] |
| 119 | have hpost := ((ContinuousLinearMap.compContinuousMultilinearMapL ℝ |
| 120 | (fun _ : Fin r => ℝ × E) (E →L[ℝ] E →L[ℝ] ℝ) ℝ L).continuous.tendsto _).comp |
| 121 | (hjet r) |
| 122 | exact hpost.congr (fun k => (heq (Bseq k) (hseq k) r).symm) |
| 123 | exact ⟨fun r => PoincareMT.AncientCompactness.tendsto_spatial_slice_jet_of_centered_halfCylinder |
| 124 | hρ _ _ (fun k => hs _ (hseq k)) (hs _ hB) ht hx r (hj r), |
| 125 | PoincareMT.AncientCompactness.tendsto_derivWithin_time_slice_of_centered_halfCylinder hρ _ _ |
| 126 | (fun k => hs _ (hseq k)) (hs _ hB) ht (ball_subset_closedBall hx) (hj 1)⟩ |
| 127 | |
| 128 | /-- Actual ancient source flows and their closed spacetime coefficient jets |
| 129 | construct an actual local limit flow, retaining time zero. Positivity is |
| 130 | needed only on the chosen open spatial subdomain. -/ |
| 131 | theorem exists_of_ancient_centered_halfCylinder_coefficients |
| 132 | {n : ℕ} {x₀ : EuclideanSpace ℝ (Fin n)} {ρ : ℝ} (hρ : 0 < ρ) |
| 133 | (U : Opens (EuclideanSpace ℝ (Fin n))) |
| 134 | (hU : (U : Set (EuclideanSpace ℝ (Fin n))) ⊆ ball x₀ ρ) |
| 135 | (Fseq : ℕ → RicciFlow n U (Iic 0)) |
| 136 | (Bseq : ℕ → ℝ × EuclideanSpace ℝ (Fin n) → |
| 137 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 138 | (B : ℝ × EuclideanSpace ℝ (Fin n) → |
| 139 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 140 | (hseq : ∀ k, ContDiffOn ℝ ∞ (Bseq k) (Iic 0 ×ˢ closedBall x₀ ρ)) |
| 141 | (hB : ContDiffOn ℝ ∞ B (Iic 0 ×ˢ closedBall x₀ ρ)) |
| 142 | (hcoeff : ∀ k t, t ≤ 0 → ∀ (x : U) (v w : TangentSpace (𝓡 n) x), |
| 143 | ((Fseq k).metric t).inner x v w = Bseq k (t, x) v w) |
| 144 | (hsymm : ∀ t ≤ 0, ∀ x ∈ U, ∀ v w, B (t, x) v w = B (t, x) w v) |
| 145 | (hlower : ∀ t ≤ 0, ∀ x ∈ U, ∃ c : ℝ, 0 < c ∧ |
| 146 | ∀ v, c * ‖v‖ ^ 2 ≤ B (t, x) v v) |
| 147 | (hjet : ∀ r K, IsCompact K → K ⊆ Iic 0 ×ˢ closedBall x₀ ρ → |
| 148 | TendstoUniformlyOn |
| 149 | (fun k => iteratedFDerivWithin ℝ r (Bseq k) (Iic 0 ×ˢ closedBall x₀ ρ)) |
| 150 | (iteratedFDerivWithin ℝ r B (Iic 0 ×ˢ closedBall x₀ ρ)) atTop K) : |
| 151 | ∃ F : RicciFlow n U (Iic 0), ∀ t ≤ 0, ∀ (x : U) (v w : TangentSpace (𝓡 n) x), |
| 152 | (F.metric t).inner x v w = B (t, x) v w := by |
| 153 | obtain ⟨g, hg, hgcoeff⟩ := RiemannianMetric.exists_smoothFamily_of_ancient_coefficients |
| 154 | U B (hB.mono (prod_mono subset_rfl (hU.trans ball_subset_closedBall))) hsymm hlower |
| 155 | let D : ∀ t, LeviCivitaData (g t) := fun t => (g t).openEuclideanLeviCivitaData U |
| 156 | have hj (t : ℝ) (ht : t ≤ 0) (x : U) (v w : EuclideanSpace ℝ (Fin n)) := by |
| 157 | apply scalar_slices_of_bilinear_jets hρ Bseq B hseq hB ht (hU x.property) ?_ v w |
| 158 | intro r |
| 159 | exact (hjet r {(t, (x : EuclideanSpace ℝ (Fin n)))} isCompact_singleton |
| 160 | (singleton_subset_iff.mpr ⟨ht, ball_subset_closedBall (hU x.property)⟩)).tendsto_at |
| 161 | (mem_singleton _) |
| 162 | have heq := equation_of_coordinate_jets_within Fseq g D (uniqueDiffOn_Iic 0) hg |
| 163 | have hequation : ∀ t ∈ Iic (0 : ℝ), ∀ (x : U) (v w : TangentSpace (𝓡 n) x), |
| 164 | HasDerivWithinAt (fun s => (g s).inner x v w) (-2 * (D t).ricci x v w) (Iic 0) t := by |
| 165 | apply heq |
| 166 | · intro t ht x r _ a c |
| 167 | simpa only [RiemannianMetric.iteratedFDeriv_openChart_eq U (g t) |
| 168 | (fun y => B (t, y)) (hgcoeff t ht), |
| 169 | RiemannianMetric.iteratedFDeriv_openChart_eq U ((Fseq _).metric t) |
| 170 | (fun y => Bseq _ (t, y)) (hcoeff _ t ht)] using |
| 171 | (hj t ht x (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 172 | (EuclideanSpace.basisFun (Fin n) ℝ c)).1 r |
| 173 | · intro t ht x v w |
| 174 | have hlim : derivWithin (fun s => (g s).inner x v w) (Iic 0) t = |
| 175 | derivWithin (fun s => B (s, x) v w) (Iic 0) t := |
| 176 | derivWithin_congr (fun s hs => hgcoeff s hs x v w) (hgcoeff t ht x v w) |
| 177 | have hsrc (k : ℕ) : derivWithin (fun s => ((Fseq k).metric s).inner x v w) (Iic 0) t = |
| 178 | derivWithin (fun s => Bseq k (s, x) v w) (Iic 0) t := |
| 179 | derivWithin_congr (fun s hs => hcoeff k s hs x v w) (hcoeff k t ht x v w) |
| 180 | simpa only [hlim, hsrc] using (hj t ht x v w).2 |
| 181 | exact ⟨{ |
| 182 | metric := g |
| 183 | connection := D |
| 184 | interval := (Fseq 0).interval |
| 185 | nontrivial := (Fseq 0).nontrivial |
| 186 | smooth := hg |
| 187 | equation := hequation }, hgcoeff⟩ |
| 188 | |
| 189 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.chartedSpace |
| 190 | FlowCarrier.isManifold |
| 191 | |
| 192 | /-- Eventual partial-chart domains and closed jets of varying source flows |
| 193 | realize a terminal chart flow on any centered coordinate ball. The limiting |
| 194 | coefficients are those of the original sequence. -/ |
| 195 | theorem exists_ancient_limit_of_eventual_partial_chart_coefficients |
| 196 | {n : ℕ} (C : ℕ → FlowCarrier.{u} n) |
| 197 | {x₀ : EuclideanSpace ℝ (Fin n)} {ρ : ℝ} (hρ : 0 < ρ) |
| 198 | (Fseq : ∀ k, RicciFlow n (C k).carrier (Iic 0)) |
| 199 | (Φ : ∀ k, PartialDiffeomorph (𝓡 n) (𝓡 n) |
| 200 | (EuclideanSpace ℝ (Fin n)) (C k).carrier ∞) |
| 201 | (hsource : ∀ᶠ k : ℕ in atTop, closedBall x₀ ρ ⊆ (Φ k).source) |
| 202 | (U : Opens (EuclideanSpace ℝ (Fin n))) |
| 203 | (hU : (U : Set (EuclideanSpace ℝ (Fin n))) ⊆ ball x₀ ρ) |
| 204 | (B : ℝ × EuclideanSpace ℝ (Fin n) → |
| 205 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 206 | (hB : ContDiffOn ℝ ∞ B (Iic 0 ×ˢ closedBall x₀ ρ)) |
| 207 | (hsymm : ∀ t ≤ 0, ∀ x ∈ U, ∀ v w, B (t, x) v w = B (t, x) w v) |
| 208 | (hlower : ∀ t ≤ 0, ∀ x ∈ U, ∃ c : ℝ, 0 < c ∧ |
| 209 | ∀ v, c * ‖v‖ ^ 2 ≤ B (t, x) v v) |
| 210 | (hjet : ∀ r K, IsCompact K → K ⊆ Iic 0 ×ˢ closedBall x₀ ρ → |
| 211 | TendstoUniformlyOn |
| 212 | (fun k => iteratedFDerivWithin ℝ r |
| 213 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 214 | ((Fseq k).metric z.1).pullbackCoefficients (Φ k) z.2) |
| 215 | (Iic 0 ×ˢ closedBall x₀ ρ)) |
| 216 | (iteratedFDerivWithin ℝ r B (Iic 0 ×ˢ closedBall x₀ ρ)) atTop K) : |
| 217 | ∃ F : RicciFlow n U (Iic 0), ∀ t ≤ 0, ∀ (x : U) (v w : TangentSpace (𝓡 n) x), |
| 218 | (F.metric t).inner x v w = B (t, x) v w := by |
| 219 | obtain ⟨N, hN⟩ := eventually_atTop.mp hsource |
| 220 | have hUΦ (k : ℕ) : (U : Set (EuclideanSpace ℝ (Fin n))) ⊆ |
| 221 | (Φ (max k N)).source := |
| 222 | (hU.trans ball_subset_closedBall).trans (hN _ (le_max_right k N)) |
| 223 | let Fchart (k : ℕ) := |
| 224 | (Fseq (max k N)).pullbackToPartialChart (Φ (max k N)) U (hUΦ k) |
| 225 | apply exists_of_ancient_centered_halfCylinder_coefficients hρ U hU Fchart |
| 226 | (fun k z => ((Fseq (max k N)).metric z.1).pullbackCoefficients |
| 227 | (Φ (max k N)) z.2) B ?_ hB ?_ hsymm hlower ?_ |
| 228 | · intro k |
| 229 | exact ((Fseq (max k N)).contDiffOn_pullbackCoefficients_within |
| 230 | (Φ (max k N)).open_source (Φ (max k N)).contMDiffOn_toFun).mono |
| 231 | (prod_mono subset_rfl (hN _ (le_max_right k N))) |
| 232 | · intro k t _ x v w |
| 233 | exact pullbackToPartialChart_inner (Fseq (max k N)) (Φ (max k N)) U (hUΦ k) t x v w |
| 234 | · intro r K hK hKΩ |
| 235 | apply (hjet r K hK hKΩ).congr |
| 236 | filter_upwards [eventually_ge_atTop N] with k hk z _ |
| 237 | rw [max_eq_left hk] |
| 238 | |
| 239 | end PoincareMT.RicciFlow |