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.CurveShortening.Ramp.LocalFlow.C2.TraceCurvatureError |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.C2.TraceEmbeddedCalculus |
| 3 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.C2.TraceEmbeddingBounds |
| 4 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.C2.TracePeriodicCurvature |
| 5 | import Mathlib.Analysis.Calculus.MeanValue |
| 6 | import Mathlib.Topology.Instances.ENNReal.Lemmas |
| 7 | |
| 8 | /-! |
| 9 | # Actual embedded curvature time modulus |
| 10 | |
| 11 | The genuine time derivative and intrinsic second-jet cap give a common |
| 12 | time Lipschitz bound, including the closed slab endpoints. MT2007 Claim |
| 13 | 19.1, p. 437; MT2015Correction Lemmas 0.1--0.2, pp. 3--6; |
| 14 | `2026-09-22-c2-curvature-time-modulus.md`. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set Bundle Manifold |
| 21 | open scoped Manifold ContDiff Bundle Topology |
| 22 | |
| 23 | universe u v |
| 24 | |
| 25 | namespace PoincareMT.M63 |
| 26 | |
| 27 | open M62 |
| 28 | |
| 29 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 31 | [T2Space M] {ι : Type v} [Fintype ι] {a b : ℝ} |
| 32 | |
| 33 | local notation "W" => EuclideanSpace ℝ ι |
| 34 | |
| 35 | /-- The literal pushed curvature has a witnessed time derivative with |
| 36 | the actual intrinsic second-jet bound. MT2007 Claim 19.1, p. 437; |
| 37 | curvature-time-modulus derivation, statement 1. -/ |
| 38 | theorem embeddedCurvature_time_derivative_bound |
| 39 | (F : RicciFlow n M (Icc a b)) (c : ℝ → ℝ → M) |
| 40 | (hc : M62ShrinkingCurve F c) {e : M → W} |
| 41 | (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) |
| 42 | {K0 K1 K2 : ℝ} (h0 : 0 ≤ K0) (h1 : 0 ≤ K1) (h2 : 0 ≤ K2) |
| 43 | (hBounds : CurveEvolutionAmbientBounds F K0 K1 K2) |
| 44 | {t : ℝ} (ht : t ∈ Ioo a b) (x : ℝ) |
| 45 | {E1 E2 : ℝ} (hE1 : 0 ≤ E1) (_hE2 : 0 ≤ E2) |
| 46 | (hde : ∀ V : TangentSpace (𝓡 n) (c x t), |
| 47 | Norm.norm (E := W) (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) V) ≤ |
| 48 | E1 * (F.metric t).tangentNorm (c x t) V) |
| 49 | (hE : ∀ V Y : TangentSpace (𝓡 n) (c x t), |
| 50 | ‖coordinateHessian (F.connection t) e (c x t) V Y‖ ≤ |
| 51 | E2 * (F.metric t).tangentNorm (c x t) V * (F.metric t).tangentNorm (c x t) Y) : |
| 52 | let H := m62CurvatureVector F c t x |
| 53 | let DtH := rampHorizontalCovariantDerivative (F.connection t) (fun r => c x r) |
| 54 | (fun r => m62CurvatureVector F c r x) t |
| 55 | let B : W := HAdd.hAdd (α := W) (β := W) (γ := W) |
| 56 | (coordinateHessian (F.connection t) e (c x t) H H) |
| 57 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) DtH) |
| 58 | HasDerivAt (fun r => (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x r) |
| 59 | (m62CurvatureVector F c r x) : W)) B t ∧ |
| 60 | ‖B‖ ≤ E2 * m62Curvature F c t x ^ 2 + |
| 61 | E1 * ((F.metric t).tangentNorm (c x t) (m63CurvatureJet F c 2 t x) + |
| 62 | 2 * m62Curvature F c t x ^ 3 + (K0 + 4 * K2) * m62Curvature F c t x + |
| 63 | 4 * K1 + 2 * m62Curvature F c t x * |
| 64 | (F.metric t).tangentNorm (c x t) (m63CurvatureJet F c 1 t x)) := by |
| 65 | dsimp only |
| 66 | let p := c x t |
| 67 | let g := F.metric t |
| 68 | let D := F.connection t |
| 69 | let H := m62CurvatureVector F c t x |
| 70 | let H2 := m63CurvatureJet F c 2 t x |
| 71 | let DtH := rampHorizontalCovariantDerivative D (fun r => c x r) |
| 72 | (fun r => m62CurvatureVector F c r x) t |
| 73 | let de : TangentSpace (𝓡 n) p →L[ℝ] W := mfderiv (𝓡 n) 𝓘(ℝ, W) e p |
| 74 | let k := m62Curvature F c t x |
| 75 | let u1 := g.tangentNorm p (m63CurvatureJet F c 1 t x) |
| 76 | let u2 := g.tangentNorm p H2 |
| 77 | let Q := 2 * k ^ 3 + (K0 + 4 * K2) * k + 4 * K1 + 2 * k * u1 |
| 78 | have hopen : IsOpen (univ ×ˢ Ioo a b : Set (ℝ × ℝ)) := isOpen_univ.prod isOpen_Ioo |
| 79 | have hmem : (x, t) ∈ (univ ×ˢ Ioo a b : Set (ℝ × ℝ)) := ⟨mem_univ _, ht⟩ |
| 80 | have htime : ContMDiffAt 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ × ℝ) ∞ (fun r : ℝ => (x, r)) t := |
| 81 | (contDiffAt_const.prodMk contDiffAt_id).contMDiffAt |
| 82 | have hcurve : ContMDiffAt 𝓘(ℝ, ℝ) (𝓡 n) ∞ (fun r => c x r) t := |
| 83 | (hc.joint_smooth.contMDiffAt (hopen.mem_nhds hmem)).comp t htime |
| 84 | have hHtime := (((curvatureJet_joint_contMDiff F c hc 0).contMDiffAt |
| 85 | (hopen.mem_nhds hmem)).comp t htime).mdifferentiableAt (by simp) |
| 86 | have hd := hasDerivAt_embedding_pushforward D he hcurve |
| 87 | (fun r => m62CurvatureVector F c r x) hHtime |
| 88 | rw [hc.equation t ht x] at hd |
| 89 | refine ⟨hd, ?_⟩ |
| 90 | have hQ : g.tangentNorm p (DtH - H2) ≤ Q := |
| 91 | curvatureVector_diffusionError_norm_le F c hc h0 h1 h2 hBounds ht x |
| 92 | have hnorm : g.tangentNorm p DtH ≤ u2 + Q := by |
| 93 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 94 | ⟨g.toRiemannianMetric⟩ |
| 95 | have hn (Z : TangentSpace (𝓡 n) p) : ‖Z‖ = g.tangentNorm p Z := by |
| 96 | rw [norm_eq_sqrt_real_inner] |
| 97 | rfl |
| 98 | have htri := norm_add_le (DtH - H2) H2 |
| 99 | rw [sub_add_cancel, hn, hn, hn] at htri |
| 100 | change g.tangentNorm p DtH ≤ u2 + Q |
| 101 | change g.tangentNorm p (DtH - H2) ≤ Q at hQ |
| 102 | change g.tangentNorm p DtH ≤ g.tangentNorm p (DtH - H2) + u2 at htri |
| 103 | linarith only [htri, hQ] |
| 104 | change ‖coordinateHessian D e p H H + de DtH‖ ≤ |
| 105 | E2 * k ^ 2 + E1 * (u2 + 2 * k ^ 3 + (K0 + 4 * K2) * k + 4 * K1 + 2 * k * u1) |
| 106 | calc |
| 107 | _ ≤ ‖coordinateHessian D e p H H‖ + ‖de DtH‖ := norm_add_le _ _ |
| 108 | _ ≤ E2 * k * k + E1 * (u2 + Q) := |
| 109 | add_le_add (hE H H) ((hde DtH).trans (mul_le_mul_of_nonneg_left hnorm hE1)) |
| 110 | _ = _ := by dsimp only [Q]; ring |
| 111 | |
| 112 | /-- Common intrinsic caps give a time Lipschitz constant selected before |
| 113 | the curve and its subslab, including both time endpoints. MT2007 Claim |
| 114 | 19.1, p. 437; curvature-time-modulus derivation, statement 2. -/ |
| 115 | theorem exists_uniform_embeddedCurvature_time_lipschitz |
| 116 | (F : RicciFlow n M (Icc a b)) (hcompact : IsCompact (univ : Set M)) (hab : a < b) |
| 117 | {e : M → W} (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) |
| 118 | {K0 K1 K2 : ℝ} (h0 : 0 ≤ K0) (h1 : 0 ≤ K1) (h2 : 0 ≤ K2) |
| 119 | (hBounds : CurveEvolutionAmbientBounds F K0 K1 K2) |
| 120 | {kappa J1 J2 : ℝ} (hkappa : 0 ≤ kappa) (hJ1 : 0 ≤ J1) (hJ2 : 0 ≤ J2) : |
| 121 | ∃ C ≥ 0, ∀ (c : ℝ → ℝ → M), M62ShrinkingCurve F c → |
| 122 | ∀ (sigma tau : ℝ), a ≤ sigma → sigma ≤ tau → tau ≤ b → |
| 123 | (∀ r ∈ Ioo sigma tau, ∀ x : ℝ, m62Curvature F c r x ≤ kappa) → |
| 124 | (∀ r ∈ Ioo sigma tau, ∀ x : ℝ, |
| 125 | (F.metric r).tangentNorm (c x r) (m63CurvatureJet F c 1 r x) ≤ J1) → |
| 126 | (∀ r ∈ Ioo sigma tau, ∀ x : ℝ, |
| 127 | (F.metric r).tangentNorm (c x r) (m63CurvatureJet F c 2 r x) ≤ J2) → |
| 128 | ∀ s ∈ Icc sigma tau, ∀ t ∈ Icc sigma tau, ∀ x : ℝ, |
| 129 | ‖HSub.hSub (α := W) (β := W) (γ := W) |
| 130 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x s) (m62CurvatureVector F c s x)) |
| 131 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) (m62CurvatureVector F c t x))‖ ≤ C * |s - t| := by |
| 132 | obtain ⟨E1, E2, _E3, ⟨hE1, hE2, _hE3⟩, hE⟩ := |
| 133 | exists_uniform_embedding_derivative_bounds F hcompact he |
| 134 | let C := E2 * kappa ^ 2 + |
| 135 | E1 * (J2 + 2 * kappa ^ 3 + (K0 + 4 * K2) * kappa + 4 * K1 + 2 * kappa * J1) |
| 136 | have hC : 0 ≤ C := by dsimp only [C]; positivity |
| 137 | refine ⟨C, hC, ?_⟩ |
| 138 | intro c hc sigma tau has hst htb hk hu hw s hs t ht x |
| 139 | let H : ℝ → W := fun r => |
| 140 | mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x r) (m62CurvatureVector F c r x) |
| 141 | by_cases hlt : sigma < tau |
| 142 | · have hder (r : ℝ) (hr : r ∈ Ioo sigma tau) : |
| 143 | DifferentiableAt ℝ H r ∧ ‖deriv H r‖ ≤ C := by |
| 144 | have hr' : r ∈ Ioo a b := ⟨has.trans_lt hr.1, hr.2.trans_le htb⟩ |
| 145 | have hrclosed := Ioo_subset_Icc_self hr' |
| 146 | obtain ⟨hd, hb⟩ := embeddedCurvature_time_derivative_bound F c hc he |
| 147 | h0 h1 h2 hBounds hr' x hE1 hE2 |
| 148 | (fun V => (hE r hrclosed (c x r) V 0 0).1) |
| 149 | (fun V Y => (hE r hrclosed (c x r) V Y 0).2.1) |
| 150 | refine ⟨hd.differentiableAt, ?_⟩ |
| 151 | change ‖deriv (fun z => (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x z) |
| 152 | (m62CurvatureVector F c z x) : W)) r‖ ≤ C |
| 153 | rw [hd.deriv] |
| 154 | apply hb.trans |
| 155 | have hkr := hk r hr x |
| 156 | have hur := hu r hr x |
| 157 | have hwr := hw r hr x |
| 158 | have hk0 := curvature_nonneg F c r x |
| 159 | have hu0 : 0 ≤ (F.metric r).tangentNorm (c x r) (m63CurvatureJet F c 1 r x) := |
| 160 | Real.sqrt_nonneg _ |
| 161 | dsimp only [C] |
| 162 | gcongr |
| 163 | have hclosed : ContinuousOn H (Icc sigma tau) := |
| 164 | ((embeddedCurvature_closed_periodic_data F c hab hc he).2.1).comp |
| 165 | (continuous_const.prodMk continuous_id).continuousOn |
| 166 | (fun r hr => ⟨mem_univ _, ⟨has.trans hr.1, hr.2.trans htb⟩⟩) |
| 167 | have hopen : LipschitzOnWith ⟨C, hC⟩ H (Ioo sigma tau) := |
| 168 | (convex_Ioo sigma tau).lipschitzOnWith_of_nnnorm_deriv_le |
| 169 | (fun r hr => (hder r hr).1) (fun r hr => (hder r hr).2) |
| 170 | have hclosure : LipschitzOnWith ⟨C, hC⟩ H (Icc sigma tau) := by |
| 171 | have hcont : ContinuousOn H (closure (Ioo sigma tau)) := by |
| 172 | simpa only [closure_Ioo hlt.ne] using hclosed |
| 173 | simpa only [closure_Ioo hlt.ne] using LipschitzOnWith.closure hcont hopen |
| 174 | simpa only [dist_eq_norm, Real.norm_eq_abs] using! hclosure.dist_le_mul s hs t ht |
| 175 | · have heq : sigma = tau := le_antisymm hst (le_of_not_gt hlt) |
| 176 | have hsame : s = t := by |
| 177 | rw [heq] at hs ht |
| 178 | exact (le_antisymm hs.2 hs.1).trans (le_antisymm ht.2 ht.1).symm |
| 179 | subst t |
| 180 | simp |
| 181 | |
| 182 | end PoincareMT.M63 |