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.Blowup.Construction.Generalized.ScalarAlong |
| 2 | import PoincareLib.Geometry.RicciFlow.Blowup.Construction.Analysis.GuardedScalarComparison |
| 3 | import PoincareLib.Geometry.RicciFlow.Blowup.Construction.Generalized.Restriction |
| 4 | import PoincareLib.Geometry.RicciFlow.Blowup.Construction.CurvatureDefect.CurvatureNorm |
| 5 | |
| 6 | /-! |
| 7 | # Finite source continuation from uniform prefix bounds |
| 8 | |
| 9 | Morgan--Tian Claim 11.17, pp. 277--278, extends a scalar bound uniform over |
| 10 | the shorter time prefixes by the guarded differential estimate of Lemma |
| 11 | 11.2, pp. 268--269. The retained finite slab has the original flow, clock, |
| 12 | scale and source ball. Its total extension outside that ball is chosen |
| 13 | along the basepoint trajectory so the final estimates hold for every input. |
| 14 | |
| 15 | The exact statement and total-extension check are in Sections 2--4 of |
| 16 | `proof-work/tasks/M30/derivations/long-slab-continuation.md`. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open Set Filter |
| 22 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.M30 |
| 27 | |
| 28 | /-- A scalar coefficient uniform over the strict prefixes extends across |
| 29 | their limiting time, with lifetime and full-curvature coefficient independent |
| 30 | of the defect tolerance (Morgan--Tian Claim 11.17, pp. 277--278). -/ |
| 31 | theorem eventually_finiteSlab_bounds_of_uniform_prefix_scalar |
| 32 | (hC : RicciFlowCurvatureTheory.{u}) |
| 33 | {S : GeneralizedBlowupSequence.{u}} |
| 34 | {epsilon canonicalConstant kappa r₀ mu : ℝ} |
| 35 | (H : M30CommonBlowupControls S epsilon canonicalConstant kappa r₀ mu) |
| 36 | (A T Tplus D : ℝ) |
| 37 | (hA : 0 < A) (hT : 0 < T) (hTTplus : T < Tplus) (hD : 4 ≤ D) |
| 38 | (hprefix : ∀ t : ℝ, 0 < t → ∀ htT : t < T, |
| 39 | ∀ᶠ k : ℕ in atTop, |
| 40 | ∃ e : M30FiniteHorizonSlab S k A Tplus kappa r₀, |
| 41 | ∀ s (hs : s ∈ Icc (-t) 0) |
| 42 | (x : ((S.flow k).slice (S.base k).1).carrier), |
| 43 | x ∈ S.baseBall k A → |
| 44 | (S.flow k).scalar |
| 45 | ((FiniteHorizonSlab.closedEmbedding e (htT.trans hTTplus)).pointMap |
| 46 | s hs x) ≤ D * S.scale k) : |
| 47 | let delta := min (T / 4) |
| 48 | (min ((Tplus - T) / 4) (1 / (32 * H.analytic_constant * D))) |
| 49 | 0 < delta ∧ ∃ hbuffer : T + delta < Tplus, |
| 50 | ∀ eta : ℝ, 0 < eta → ∀ᶠ k : ℕ in atTop, |
| 51 | ∃ e : M30FiniteHorizonSlab S k A Tplus kappa r₀, |
| 52 | (∀ s (hs : s ∈ Icc (-(T + delta)) 0) |
| 53 | (x : ((S.flow k).slice (S.base k).1).carrier), |
| 54 | |(S.flow k).curvatureNorm |
| 55 | ((FiniteHorizonSlab.closedEmbedding e hbuffer).pointMap s hs x)| ≤ |
| 56 | (26 * D) * S.scale k) ∧ |
| 57 | (∀ s (hs : s ∈ Icc (-(T + delta)) 0) |
| 58 | (x : ((S.flow k).slice (S.base k).1).carrier), |
| 59 | let p := (FiniteHorizonSlab.closedEmbedding e hbuffer).pointMap s hs x |
| 60 | ((S.flow k).connection p.1).negativeCurvaturePart p.2 ≤ |
| 61 | eta * S.scale k) := by |
| 62 | classical |
| 63 | let delta := min (T / 4) |
| 64 | (min ((Tplus - T) / 4) (1 / (32 * H.analytic_constant * D))) |
| 65 | change 0 < delta ∧ ∃ hbuffer : T + delta < Tplus, _ |
| 66 | have hDpos : 0 < D := by linarith |
| 67 | have hden : 0 < 32 * H.analytic_constant * D := by |
| 68 | exact mul_pos (mul_pos (by norm_num) H.analytic_constant_pos) hDpos |
| 69 | have hdelta : 0 < delta := |
| 70 | lt_min (div_pos hT (by norm_num)) |
| 71 | (lt_min (div_pos (sub_pos.mpr hTTplus) (by norm_num)) (one_div_pos.mpr hden)) |
| 72 | have hdeltaT : delta ≤ T / 4 := min_le_left _ _ |
| 73 | have hdeltaGap : delta ≤ (Tplus - T) / 4 := |
| 74 | (min_le_right _ _).trans (min_le_left _ _) |
| 75 | have hdeltaRate : delta ≤ 1 / (32 * H.analytic_constant * D) := |
| 76 | (min_le_right _ _).trans (min_le_right _ _) |
| 77 | have htime : 16 * H.analytic_constant * D * delta ≤ 1 := by |
| 78 | have hle := (le_div_iff₀ hden).mp hdeltaRate |
| 79 | nlinarith |
| 80 | have hbuffer : T + delta < Tplus := by linarith |
| 81 | let tstar := T - delta |
| 82 | have htstar : 0 < tstar := by dsimp [tstar]; linarith |
| 83 | have htstarT : tstar < T := by dsimp [tstar]; linarith |
| 84 | refine ⟨hdelta, hbuffer, ?_⟩ |
| 85 | intro eta heta |
| 86 | filter_upwards [hprefix tstar htstar htstarT, |
| 87 | eventually_curvatureNorm_and_negativeDefect_le hC S H.branch (2 * D) |
| 88 | (by positivity) eta heta] with k hpre hcurv |
| 89 | obtain ⟨e, hpre⟩ := hpre |
| 90 | have hQ : 0 < S.scale k := S.base_scalar_pos k |
| 91 | let I := Icc (-(T + delta)) (-T + delta) |
| 92 | have hI : I ⊆ Ioc (-Tplus) 0 := by |
| 93 | intro s hs |
| 94 | dsimp [I] at hs |
| 95 | exact ⟨by linarith [hs.1], by linarith [hs.2]⟩ |
| 96 | let eI := Cylinder.restrict e.embedding hI Subset.rfl |
| 97 | have hright : -T + delta ∈ I := by |
| 98 | constructor <;> linarith |
| 99 | have hrightPrefix : -T + delta ∈ Icc (-tstar) 0 := by |
| 100 | dsimp [tstar] |
| 101 | constructor <;> linarith |
| 102 | have hscalar : ∀ s (hs : s ∈ Icc (-(T + delta)) 0) |
| 103 | (x : ((S.flow k).slice (S.base k).1).carrier), x ∈ S.baseBall k A → |
| 104 | (S.flow k).scalar |
| 105 | ((FiniteHorizonSlab.closedEmbedding e hbuffer).pointMap s hs x) ≤ |
| 106 | (2 * D) * S.scale k := by |
| 107 | intro s hs x hx |
| 108 | by_cases hleft : s ≤ -T + delta |
| 109 | · let f : ℝ → ℝ := Cylinder.scalarAlong eI x |
| 110 | have hchoice (z : ℝ) : ∃ d : ℝ, z ∈ I → |
| 111 | HasDerivWithinAt f d I z ∧ |
| 112 | (4 * S.scale k ≤ f z → |
| 113 | |d| ≤ H.analytic_constant / S.scale k * f z ^ 2) := by |
| 114 | by_cases hz : z ∈ I |
| 115 | · obtain ⟨d, hd, hrate⟩ := Cylinder.exists_scalarAlong_deriv_bound |
| 116 | hC H eI hz (by dsimp [I] at hz; linarith [hz.2]) x hx |
| 117 | exact ⟨d, fun _ => ⟨hd, hrate⟩⟩ |
| 118 | · exact ⟨0, fun hz' => (hz hz').elim⟩ |
| 119 | choose d hd using hchoice |
| 120 | have hterminal : f (-T + delta) ≤ D * S.scale k := by |
| 121 | rw [show f (-T + delta) = |
| 122 | (S.flow k).scalar (eI.pointMap (-T + delta) hright x) from |
| 123 | Cylinder.scalarAlong_of_mem eI x hright] |
| 124 | exact hpre (-T + delta) hrightPrefix x hx |
| 125 | have htime' : 8 * (H.analytic_constant / S.scale k) * (D * S.scale k) * |
| 126 | ((-T + delta) - -(T + delta)) ≤ 1 := by |
| 127 | calc |
| 128 | _ = 16 * H.analytic_constant * D * delta := by |
| 129 | field_simp [hQ.ne'] |
| 130 | ring |
| 131 | _ ≤ 1 := htime |
| 132 | have hbound := le_two_mul_of_abs_deriv_le_sq_above_backward |
| 133 | (f := f) (f' := d) (div_pos H.analytic_constant_pos hQ) (mul_pos hDpos hQ) |
| 134 | (mul_le_mul_of_nonneg_right hD hQ.le) |
| 135 | (fun z hz => (hd z hz).1) hterminal (fun z hz => (hd z hz).2) htime' |
| 136 | have hsI : s ∈ I := ⟨hs.1, hleft⟩ |
| 137 | have hpoint : eI.pointMap s hsI x = |
| 138 | (FiniteHorizonSlab.closedEmbedding e hbuffer).pointMap s hs x := rfl |
| 139 | simpa only [f, Cylinder.scalarAlong_of_mem eI x hsI, hpoint, mul_assoc] using |
| 140 | hbound s hsI |
| 141 | · have hsPrefix : s ∈ Icc (-tstar) 0 := by |
| 142 | dsimp [tstar] |
| 143 | exact ⟨by linarith, hs.2⟩ |
| 144 | exact (hpre s hsPrefix x hx).trans |
| 145 | (mul_le_mul_of_nonneg_right (by linarith) hQ.le) |
| 146 | let C := (S.flow k).slice (S.base k).1 |
| 147 | let U := S.baseBall k A |
| 148 | have hbase : (S.base k).2 ∈ U := by |
| 149 | let g : RiemannianMetric 3 C.carrier := (S.flow k).metric (S.base k).1 |
| 150 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : C.carrier → Type _) := |
| 151 | ⟨g.toRiemannianMetric⟩ |
| 152 | change g.edist (S.base k).2 (S.base k).2 < |
| 153 | ENNReal.ofReal (A / Real.sqrt (S.scale k)) |
| 154 | have hself : g.edist (S.base k).2 (S.base k).2 = 0 := |
| 155 | Manifold.riemannianEDist_self |
| 156 | rw [hself] |
| 157 | exact ENNReal.ofReal_pos.mpr (div_pos hA (Real.sqrt_pos.mpr hQ)) |
| 158 | let r : C.carrier → C.carrier := fun x => if x ∈ U then x else (S.base k).2 |
| 159 | have hr (x : C.carrier) (hx : x ∈ U) : r x = x := if_pos hx |
| 160 | have hrmem (x : C.carrier) : r x ∈ U := by |
| 161 | by_cases hx : x ∈ U |
| 162 | · simpa only [r, if_pos hx] using hx |
| 163 | · simpa only [r, if_neg hx] using hbase |
| 164 | have himage (s : ℝ) (hs : s ∈ Ioc (-Tplus) 0) : |
| 165 | (fun x => e.embedding.forward s hs (r x)) '' U = |
| 166 | e.embedding.forward s hs '' U := by |
| 167 | apply Set.image_congr |
| 168 | intro x hx |
| 169 | rw [hr x hx] |
| 170 | let eTotal : GeneralizedFlowCylinder (S.flow k) C (S.base k).1 (S.scale k) |
| 171 | (Ioc (-Tplus) 0) U := { |
| 172 | scale_pos := e.embedding.scale_pos |
| 173 | forward := fun s hs x => e.embedding.forward s hs (r x) |
| 174 | inverse := e.embedding.inverse |
| 175 | forward_smooth := by |
| 176 | intro s hs |
| 177 | exact (e.embedding.forward_smooth s hs).congr (fun x hx => by rw [hr x hx]) |
| 178 | inverse_smooth := by |
| 179 | intro s hs |
| 180 | rw [himage s hs] |
| 181 | exact e.embedding.inverse_smooth s hs |
| 182 | left_inverse := by |
| 183 | intro s hs x hx |
| 184 | change e.embedding.inverse s hs (e.embedding.forward s hs (r x)) = x |
| 185 | rw [hr x hx] |
| 186 | exact e.embedding.left_inverse s hs hx |
| 187 | right_inverse := by |
| 188 | intro s hs y hy |
| 189 | rw [himage s hs] at hy |
| 190 | obtain ⟨x, hx, rfl⟩ := hy |
| 191 | change e.embedding.forward s hs |
| 192 | (r (e.embedding.inverse s hs (e.embedding.forward s hs x))) = _ |
| 193 | rw [e.embedding.left_inverse s hs hx, hr x hx] |
| 194 | embedding := by |
| 195 | have hmap : |
| 196 | (fun p : Ioc (-Tplus) 0 × U => |
| 197 | (⟨(S.base k).1 + p.1.1 / S.scale k, |
| 198 | e.embedding.forward p.1.1 p.1.2 (r p.2.1)⟩ : (S.flow k).point)) = |
| 199 | (fun p : Ioc (-Tplus) 0 × U => |
| 200 | (⟨(S.base k).1 + p.1.1 / S.scale k, |
| 201 | e.embedding.forward p.1.1 p.1.2 p.2.1⟩ : (S.flow k).point)) := by |
| 202 | funext p |
| 203 | rw [hr p.2.1 p.2.2] |
| 204 | rw [hmap] |
| 205 | exact e.embedding.embedding |
| 206 | vertical_compatibility := by |
| 207 | intro s hs x hx |
| 208 | simpa only [hr x hx] using e.embedding.vertical_compatibility s hs x hx } |
| 209 | let e' : M30FiniteHorizonSlab S k A Tplus kappa r₀ := { |
| 210 | embedding := eTotal |
| 211 | zero_identity := by |
| 212 | intro hzero x hx |
| 213 | change e.embedding.pointMap 0 hzero (r x) = _ |
| 214 | rw [hr x hx] |
| 215 | exact e.zero_identity hzero x hx |
| 216 | noncollapsed := by |
| 217 | intro s hs x hx |
| 218 | change GeneralizedKappaNoncollapsedAt (S.flow k) |
| 219 | (e.embedding.pointMap s hs (r x)) kappa r₀ |
| 220 | rw [hr x hx] |
| 221 | exact e.noncollapsed s hs x hx } |
| 222 | have hbounds (s : ℝ) (hs : s ∈ Icc (-(T + delta)) 0) (x : C.carrier) : |
| 223 | let p := (FiniteHorizonSlab.closedEmbedding e' hbuffer).pointMap s hs x |
| 224 | |(S.flow k).curvatureNorm p| ≤ (26 * D) * S.scale k ∧ |
| 225 | ((S.flow k).connection p.1).negativeCurvaturePart p.2 ≤ eta * S.scale k := by |
| 226 | let p := (FiniteHorizonSlab.closedEmbedding e' hbuffer).pointMap s hs x |
| 227 | have hp : p.1 ∈ (S.flow k).interval := |
| 228 | ((S.flow k).slice_nonempty_iff p.1).mp ⟨p.2⟩ |
| 229 | have hR : (S.flow k).scalar p ≤ (2 * D) * S.scale k := |
| 230 | hscalar s hs (r x) (hrmem x) |
| 231 | have h := hcurv p.1 hp p.2 hR |
| 232 | have hmax : max (2 * D) 1 = 2 * D := max_eq_left (by linarith) |
| 233 | simpa only [hmax, show 13 * (2 * D) = 26 * D by ring] using h |
| 234 | exact ⟨e', fun s hs x => (hbounds s hs x).1, fun s hs x => (hbounds s hs x).2⟩ |
| 235 | |
| 236 | end PoincareMT.M30 |