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.Curvature.Calculus |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Noncompact.AncientVolume.Positivity |
| 3 | import PoincareLib.Geometry.Riemannian.Heat.Kernel.LiYau.Geodesic |
| 4 | |
| 5 | /-! |
| 6 | # Intrinsic-distance Harnack bounds for bounded ancient flows |
| 7 | |
| 8 | A minimizing path for the earlier metric has constant squared speed. |
| 9 | Reparameterizing it over the time interval and using nonnegative Ricci |
| 10 | curvature bounds its evolving energy by squared distance divided by elapsed |
| 11 | time. The bounded exhaustion/block differential Harnack theorem then yields |
| 12 | the intrinsic-distance scalar estimate, including terminal time zero. |
| 13 | |
| 14 | This is the quantitative Harnack input in Kleiner--Lott, Theorem 41.2, |
| 15 | Case 2, pp. 2676--2677 (corrected 2013). The imported heat-path lemma only |
| 16 | constructs a minimizing geodesic and its speed; no heat or per-slice |
| 17 | Ricci-flow Harnack estimate is used. |
| 18 | -/ |
| 19 | |
| 20 | set_option autoImplicit false |
| 21 | set_option backward.isDefEq.respectTransparency false |
| 22 | |
| 23 | open Set Filter MeasureTheory |
| 24 | open scoped Manifold ContDiff Bundle Topology intervalIntegral ENNReal |
| 25 | |
| 26 | universe u |
| 27 | |
| 28 | namespace PoincareMT.RicciFlow |
| 29 | |
| 30 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 32 | |
| 33 | private theorem metric_inner_self_le_of_ancient_ricci_nonneg |
| 34 | (F : RicciFlow n M (Iic 0)) |
| 35 | (hRic : ∀ t ≤ 0, ∀ x : M, ∀ v : TangentSpace (𝓡 n) x, |
| 36 | 0 ≤ (F.connection t).ricci x v v) |
| 37 | {a b : ℝ} (hab : a ≤ b) (hb : b ≤ 0) (x : M) (v : TangentSpace (𝓡 n) x) : |
| 38 | (F.metric b).inner x v v ≤ (F.metric a).inner x v v := by |
| 39 | have hsub : Icc a b ⊆ Iic (0 : ℝ) := fun _ ht => ht.2.trans hb |
| 40 | have hcont : ContinuousOn (fun t => (F.metric t).inner x v v) (Icc a b) := by |
| 41 | intro t ht |
| 42 | exact (F.equation t (hsub ht) x v v).continuousWithinAt.mono hsub |
| 43 | have hderiv (t : ℝ) (ht : t ∈ interior (Icc a b)) : |
| 44 | HasDerivAt (fun s => (F.metric s).inner x v v) |
| 45 | (-2 * (F.connection t).ricci x v v) t := by |
| 46 | have ht' : t ∈ Ioo a b := by simpa only [interior_Icc] using ht |
| 47 | exact (F.equation t (ht'.2.le.trans hb) x v v).hasDerivAt |
| 48 | (Iic_mem_nhds (ht'.2.trans_le hb)) |
| 49 | have hmono : AntitoneOn (fun t => (F.metric t).inner x v v) (Icc a b) := by |
| 50 | apply antitoneOn_of_deriv_nonpos (convex_Icc a b) hcont |
| 51 | (fun t ht => (hderiv t ht).differentiableAt.differentiableWithinAt) |
| 52 | intro t ht |
| 53 | rw [(hderiv t ht).deriv] |
| 54 | exact mul_nonpos_of_nonpos_of_nonneg (by norm_num) |
| 55 | (hRic t (hsub (interior_subset ht)) x v) |
| 56 | exact hmono ⟨le_rfl, hab⟩ ⟨hab, le_rfl⟩ hab |
| 57 | |
| 58 | private theorem exists_path_spacetimeEnergy_le_distance |
| 59 | [T3Space M] [PreconnectedSpace M] |
| 60 | (F : RicciFlow n M (Iic 0)) |
| 61 | (hRic : ∀ t ≤ 0, ∀ x : M, ∀ v : TangentSpace (𝓡 n) x, |
| 62 | 0 ≤ (F.connection t).ricci x v v) |
| 63 | {a b : ℝ} (hab : a < b) (hb : b ≤ 0) |
| 64 | (hcomplete : MetricComplete (F.metric a)) (x y : M) : |
| 65 | ∃ η : ℝ → M, ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 n) 1 η (Icc a b) ∧ |
| 66 | η a = x ∧ η b = y ∧ |
| 67 | spacetimeEnergy F η a b ≤ ((F.metric a).edist x y).toReal ^ 2 / (b - a) := by |
| 68 | let g := F.metric a |
| 69 | let R := (g.edist x x).toReal + (g.edist x y).toReal + 1 |
| 70 | obtain ⟨γ, hγ, hγ0, hγ1, _, hspeed⟩ := |
| 71 | g.exists_heat_harnack_path hcomplete x x y |
| 72 | (show (g.edist x x).toReal ≤ R by |
| 73 | dsimp [R]; linarith [ENNReal.toReal_nonneg (a := g.edist x y)]) |
| 74 | (show (g.edist x y).toReal ≤ R by |
| 75 | dsimp [R]; linarith [ENNReal.toReal_nonneg (a := g.edist x x)]) |
| 76 | let δ := b - a |
| 77 | have hδ : 0 < δ := sub_pos.mpr hab |
| 78 | let z : ℝ → ℝ := fun t => (t - a) / δ |
| 79 | let η : ℝ → M := γ ∘ z |
| 80 | have hz : ContMDiff 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ) 1 z := by |
| 81 | apply contMDiff_iff_contDiff.mpr |
| 82 | dsimp only [z] |
| 83 | fun_prop |
| 84 | have hmap : MapsTo z (Icc a b) (Icc (0 : ℝ) 1) := by |
| 85 | intro t ht |
| 86 | exact ⟨div_nonneg (sub_nonneg.mpr ht.1) hδ.le, |
| 87 | (div_le_one hδ).mpr (sub_le_sub_right ht.2 a)⟩ |
| 88 | have hη : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 n) 1 η (Icc a b) := |
| 89 | hγ.comp hz.contMDiffOn hmap |
| 90 | have hηa : η a = x := by simp only [η, Function.comp_apply, z, sub_self, zero_div, hγ0] |
| 91 | have hηb : η b = y := by |
| 92 | simp only [η, Function.comp_apply, z, ← show δ = b - a from rfl, div_self hδ.ne', hγ1] |
| 93 | refine ⟨η, hη, hηa, hηb, ?_⟩ |
| 94 | have hspeedη (t : ℝ) (ht : t ∈ Ioo a b) : |
| 95 | g.inner (η t) (mfderiv 𝓘(ℝ, ℝ) (𝓡 n) η t 1) |
| 96 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 n) η t 1) = (g.edist x y).toReal ^ 2 / δ ^ 2 := by |
| 97 | have hzt : z t ∈ Ioo (0 : ℝ) 1 := |
| 98 | ⟨div_pos (sub_pos.mpr ht.1) hδ, |
| 99 | (div_lt_one hδ).mpr (sub_lt_sub_right ht.2 a)⟩ |
| 100 | have hγt := (hγ (z t) (Ioo_subset_Icc_self hzt)).contMDiffAt (Icc_mem_nhds hzt.1 hzt.2) |
| 101 | have hzd : HasDerivAt z δ⁻¹ t := by |
| 102 | simpa only [z, id_eq, one_div] using ((hasDerivAt_id t).sub_const a).div_const δ |
| 103 | have hvelocity : mfderiv 𝓘(ℝ, ℝ) (𝓡 n) η t 1 = |
| 104 | δ⁻¹ • mfderiv 𝓘(ℝ, ℝ) (𝓡 n) γ (z t) 1 := by |
| 105 | rw [show η = γ ∘ z from rfl, mfderiv_comp_apply t |
| 106 | (hγt.mdifferentiableAt one_ne_zero) (hz.mdifferentiable one_ne_zero t), |
| 107 | mfderiv_eq_fderiv, hzd.hasFDerivAt.fderiv] |
| 108 | change (mfderiv 𝓘(ℝ, ℝ) (𝓡 n) γ (z t)) ((1 : ℝ) • δ⁻¹) = |
| 109 | δ⁻¹ • (mfderiv 𝓘(ℝ, ℝ) (𝓡 n) γ (z t)) 1 |
| 110 | rw [one_smul, ← map_smul, smul_eq_mul, mul_one] |
| 111 | rw [hvelocity] |
| 112 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 113 | change δ⁻¹ * (δ⁻¹ * g.inner (γ (z t)) |
| 114 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 n) γ (z t) 1) |
| 115 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 n) γ (z t) 1)) = _ |
| 116 | rw [hspeed (z t) (Ioo_subset_Icc_self hzt)] |
| 117 | field_simp |
| 118 | have hint := Poincare.Geometry.RicciFlow.Harnack.intervalIntegrable_spacetimeEnergy_integrand |
| 119 | F hab (fun t ht => ht.2.trans hb) η hη |
| 120 | calc |
| 121 | spacetimeEnergy F η a b ≤ ∫ _t in a..b, (g.edist x y).toReal ^ 2 / δ ^ 2 := by |
| 122 | apply intervalIntegral.integral_mono_on_of_le_Ioo hab.le hint intervalIntegrable_const |
| 123 | intro t ht |
| 124 | exact (F.metric_inner_self_le_of_ancient_ricci_nonneg hRic ht.1.le |
| 125 | (ht.2.le.trans hb) (η t) (mfderiv 𝓘(ℝ, ℝ) (𝓡 n) η t 1)).trans_eq (hspeedη t ht) |
| 126 | _ = ((F.metric a).edist x y).toReal ^ 2 / (b - a) := by |
| 127 | rw [intervalIntegral.integral_const, smul_eq_mul] |
| 128 | change δ * ((g.edist x y).toReal ^ 2 / δ ^ 2) = (g.edist x y).toReal ^ 2 / δ |
| 129 | field_simp |
| 130 | |
| 131 | variable [T3Space M] [SecondCountableTopology M] [ConnectedSpace M] [NoncompactSpace M] |
| 132 | |
| 133 | /-- The bounded ancient differential estimate yields scalar Harnack with |
| 134 | the actual earlier-slice intrinsic distance, including a terminal time of zero. -/ |
| 135 | theorem scalarCurvature_le_exp_distance_of_bounded_ancient |
| 136 | (hC : RicciFlowCurvatureCalculus.{u}) (F : RicciFlow n M (Iic 0)) |
| 137 | (hcomplete : ∀ t ≤ 0, MetricComplete (F.metric t)) |
| 138 | (hoperator : ∀ t ≤ 0, ∀ x, (F.connection t).NonnegativeCurvatureOperator x) |
| 139 | {K : ℝ} (hK : 0 ≤ K) |
| 140 | (hbound : ∀ t ≤ 0, ∀ x, (F.connection t).curvatureTensorNorm x ≤ K) |
| 141 | (hnonflat : ∃ p : M, 0 < (F.connection 0).scalarCurvature p) |
| 142 | {a b : ℝ} (hab : a < b) (hb : b ≤ 0) (x y : M) : |
| 143 | (F.connection a).scalarCurvature x ≤ (F.connection b).scalarCurvature y * |
| 144 | Real.exp (((F.metric a).edist x y).toReal ^ 2 / (2 * (b - a))) := by |
| 145 | have hRic : ∀ t ≤ 0, ∀ z : M, ∀ v : TangentSpace (𝓡 n) z, |
| 146 | 0 ≤ (F.connection t).ricci z v v := by |
| 147 | intro t ht z v |
| 148 | exact ((F.connection t).ricci_bounds_of_nonnegative_curvatureOperator |
| 149 | (hC.tensor_calculus n M (F.metric t) (F.connection t)) z (hoperator t ht z) v).1 |
| 150 | obtain ⟨η, hη, hηa, hηb, henergy⟩ := |
| 151 | F.exists_path_spacetimeEnergy_le_distance hRic hab hb (hcomplete a (hab.le.trans hb)) x y |
| 152 | have hi := Poincare.Geometry.RicciFlow.Harnack.ancient_integrated_of_differential |
| 153 | hC F hoperator (F.ancient_differential_of_bounded_ancient hC hcomplete hoperator hK hbound) |
| 154 | hab hb η hη hηa hηb |
| 155 | have hfirst : (F.connection a).scalarCurvature x ≤ (F.connection b).scalarCurvature y * |
| 156 | Real.exp (spacetimeEnergy F η a b / 2) := by |
| 157 | have hh := mul_le_mul_of_nonneg_right hi (Real.exp_pos (spacetimeEnergy F η a b / 2)).le |
| 158 | have he : Real.exp (-spacetimeEnergy F η a b / 2) * |
| 159 | Real.exp (spacetimeEnergy F η a b / 2) = 1 := by |
| 160 | rw [← Real.exp_add, |
| 161 | show -spacetimeEnergy F η a b / 2 + spacetimeEnergy F η a b / 2 = 0 by ring, |
| 162 | Real.exp_zero] |
| 163 | simpa only [mul_assoc, he, mul_one] using hh |
| 164 | apply hfirst.trans |
| 165 | apply mul_le_mul_of_nonneg_left _ |
| 166 | (F.scalarCurvature_pos_of_bounded_ancient hC hcomplete hoperator hK hbound hnonflat b hb y).le |
| 167 | apply Real.exp_le_exp.mpr |
| 168 | have h := div_le_div_of_nonneg_right henergy (by norm_num : (0 : ℝ) ≤ 2) |
| 169 | simpa only [div_div, mul_comm (b - a) 2] using h |
| 170 | |
| 171 | /-- A prescribed bound on actual earlier-slice distance gives uniform |
| 172 | control by the later scalar value. -/ |
| 173 | theorem scalarCurvature_le_exp_of_bounded_ancient_distance_le |
| 174 | (hC : RicciFlowCurvatureCalculus.{u}) (F : RicciFlow n M (Iic 0)) |
| 175 | (hcomplete : ∀ t ≤ 0, MetricComplete (F.metric t)) |
| 176 | (hoperator : ∀ t ≤ 0, ∀ x, (F.connection t).NonnegativeCurvatureOperator x) |
| 177 | {K : ℝ} (hK : 0 ≤ K) |
| 178 | (hbound : ∀ t ≤ 0, ∀ x, (F.connection t).curvatureTensorNorm x ≤ K) |
| 179 | (hnonflat : ∃ p : M, 0 < (F.connection 0).scalarCurvature p) |
| 180 | {a b D : ℝ} (hab : a < b) (hb : b ≤ 0) (x y : M) |
| 181 | (hD : ((F.metric a).edist x y).toReal ≤ D) : |
| 182 | (F.connection a).scalarCurvature x ≤ (F.connection b).scalarCurvature y * |
| 183 | Real.exp (D ^ 2 / (2 * (b - a))) := by |
| 184 | apply (F.scalarCurvature_le_exp_distance_of_bounded_ancient |
| 185 | hC hcomplete hoperator hK hbound hnonflat hab hb x y).trans |
| 186 | apply mul_le_mul_of_nonneg_left _ |
| 187 | (F.scalarCurvature_pos_of_bounded_ancient hC hcomplete hoperator hK hbound hnonflat b hb y).le |
| 188 | apply Real.exp_le_exp.mpr |
| 189 | exact div_le_div_of_nonneg_right |
| 190 | (pow_le_pow_left₀ ENNReal.toReal_nonneg hD 2) (by positivity) |
| 191 | |
| 192 | /-- The same distance bound controls the full earlier curvature tensor by |
| 193 | the later scalar value through the nonnegative curvature-operator estimate. -/ |
| 194 | theorem curvatureTensorNorm_le_exp_of_bounded_ancient_distance_le |
| 195 | (hC : RicciFlowCurvatureCalculus.{u}) (F : RicciFlow n M (Iic 0)) |
| 196 | (hcomplete : ∀ t ≤ 0, MetricComplete (F.metric t)) |
| 197 | (hoperator : ∀ t ≤ 0, ∀ x, (F.connection t).NonnegativeCurvatureOperator x) |
| 198 | {K : ℝ} (hK : 0 ≤ K) |
| 199 | (hbound : ∀ t ≤ 0, ∀ x, (F.connection t).curvatureTensorNorm x ≤ K) |
| 200 | (hnonflat : ∃ p : M, 0 < (F.connection 0).scalarCurvature p) |
| 201 | {a b D : ℝ} (hab : a < b) (hb : b ≤ 0) (x y : M) |
| 202 | (hD : ((F.metric a).edist x y).toReal ≤ D) : |
| 203 | (F.connection a).curvatureTensorNorm x ≤ (n : ℝ) ^ 2 * |
| 204 | ((F.connection b).scalarCurvature y * Real.exp (D ^ 2 / (2 * (b - a)))) := by |
| 205 | apply ((F.connection a).curvatureTensorNorm_le_scalarCurvature |
| 206 | (hC.tensor_calculus n M (F.metric a) (F.connection a)) x |
| 207 | (hoperator a (hab.le.trans hb) x)).trans |
| 208 | exact mul_le_mul_of_nonneg_left |
| 209 | (F.scalarCurvature_le_exp_of_bounded_ancient_distance_le |
| 210 | hC hcomplete hoperator hK hbound hnonflat hab hb x y hD) (sq_nonneg _) |
| 211 | |
| 212 | end PoincareMT.RicciFlow |