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.Harnack.Matrix.Bounds |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.TwoForm |
| 3 | |
| 4 | /-! |
| 5 | # Bounds for Hamilton's prescribed first jets |
| 6 | |
| 7 | The spatial two-form jet in Chow et al., Part II, Theorem 15.16, |
| 8 | equation (15.58), has a quadratic bound in the vector variable. This controls |
| 9 | the negative gradient-square term in the perturbed evolution inequality, |
| 10 | Lemma 15.24, Section 15.4.5. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open scoped BigOperators Manifold ContDiff Bundle |
| 17 | |
| 18 | namespace Poincare.RicciFlow.Harnack |
| 19 | |
| 20 | variable {I : Type*} [Fintype I] |
| 21 | |
| 22 | /-- The squared coefficient norm of a half-wedge is at most the product of |
| 23 | the two squared vector norms. -/ |
| 24 | lemma sum_sq_half_wedge_le (A W : I → ℝ) : |
| 25 | (∑ a, ∑ b, ((A a * W b - W a * A b) / 2) ^ 2) ≤ |
| 26 | (∑ a, (A a) ^ 2) * ∑ b, (W b) ^ 2 := by |
| 27 | calc |
| 28 | _ ≤ ∑ a : I, ∑ b : I, ((A a) ^ 2 * (W b) ^ 2 + (W a) ^ 2 * (A b) ^ 2) / 2 := by |
| 29 | apply Finset.sum_le_sum |
| 30 | intro a _ |
| 31 | apply Finset.sum_le_sum |
| 32 | intro b _ |
| 33 | nlinarith only [sq_nonneg (A a * W b + W a * A b)] |
| 34 | _ = _ := by |
| 35 | simp only [← Finset.sum_div, Finset.sum_add_distrib, |
| 36 | ← Finset.mul_sum, ← Finset.sum_mul] |
| 37 | ring |
| 38 | |
| 39 | variable [DecidableEq I] |
| 40 | |
| 41 | /-- A bound on the entries of the Ricci array controls the full squared norm |
| 42 | of Hamilton's prescribed first jet, including its reciprocal-time term. -/ |
| 43 | lemma sum_sq_prescribed_jet_le |
| 44 | (Ric : I → I → ℝ) (W : I → ℝ) (C k : ℝ) |
| 45 | (hC : 0 ≤ C) (hRic : ∀ e a, |Ric e a| ≤ C) : |
| 46 | (∑ e, ∑ a, ∑ b, |
| 47 | (((Ric e a + k * (if e = a then 1 else 0)) * W b - |
| 48 | W a * (Ric e b + k * (if e = b then 1 else 0))) / 2) ^ 2) ≤ |
| 49 | (2 * (Fintype.card I : ℝ) ^ 2 * C ^ 2 + |
| 50 | 2 * Fintype.card I * k ^ 2) * ∑ a, (W a) ^ 2 := by |
| 51 | have hW : 0 ≤ ∑ a, (W a) ^ 2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) |
| 52 | have hentry (e a : I) : |
| 53 | (Ric e a + k * (if e = a then 1 else 0)) ^ 2 ≤ |
| 54 | 2 * C ^ 2 + 2 * k ^ 2 * (if e = a then 1 else 0) := by |
| 55 | have hsq : (Ric e a) ^ 2 ≤ C ^ 2 := by |
| 56 | simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) hC).2 (hRic e a) |
| 57 | by_cases h : e = a |
| 58 | · subst a |
| 59 | simp only [if_true, mul_one] |
| 60 | nlinarith only [hsq, sq_nonneg (Ric e e - k)] |
| 61 | · simp only [h, if_false, mul_zero, add_zero] |
| 62 | nlinarith only [hsq, sq_nonneg C] |
| 63 | calc |
| 64 | _ ≤ ∑ e, (∑ a, (Ric e a + k * (if e = a then 1 else 0)) ^ 2) * |
| 65 | ∑ a, (W a) ^ 2 := by |
| 66 | exact Finset.sum_le_sum (fun e _ => |
| 67 | sum_sq_half_wedge_le (fun a => Ric e a + k * (if e = a then 1 else 0)) W) |
| 68 | _ = (∑ e, ∑ a, (Ric e a + k * (if e = a then 1 else 0)) ^ 2) * |
| 69 | ∑ a, (W a) ^ 2 := (Finset.sum_mul _ _ _).symm |
| 70 | _ ≤ (∑ e : I, ∑ a : I, (2 * C ^ 2 + 2 * k ^ 2 * (if e = a then 1 else 0))) * |
| 71 | ∑ a, (W a) ^ 2 := by |
| 72 | apply mul_le_mul_of_nonneg_right _ hW |
| 73 | exact Finset.sum_le_sum (fun e _ => Finset.sum_le_sum (fun a _ => hentry e a)) |
| 74 | _ = _ := by |
| 75 | simp only [Finset.sum_add_distrib, mul_ite, mul_one, mul_zero, |
| 76 | Finset.sum_ite_eq, Finset.mem_univ, if_true, Finset.sum_const, |
| 77 | Finset.card_univ, nsmul_eq_mul] |
| 78 | ring |
| 79 | |
| 80 | universe u |
| 81 | |
| 82 | open PoincareMT |
| 83 | |
| 84 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 85 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 86 | {g : RiemannianMetric n M} |
| 87 | |
| 88 | /-- The geometric prescribed jet is bounded using only the undifferentiated |
| 89 | curvature norm. The time coefficient is left explicit. -/ |
| 90 | lemma sum_sq_geometric_prescribed_jet_le |
| 91 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) |
| 92 | (x : M) (K k : ℝ) (hK : 0 ≤ K) (hcurv : D.curvatureDerivativeNorm 0 x ≤ K) |
| 93 | (W : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x)) → ℝ) : |
| 94 | let b := g.orthonormalBasis x |
| 95 | let Ric := fun e a => D.ricci x (b e) (b a) |
| 96 | (∑ e, ∑ a, ∑ b, |
| 97 | (((Ric e a + k * (if e = a then 1 else 0)) * W b - |
| 98 | W a * (Ric e b + k * (if e = b then 1 else 0))) / 2) ^ 2) ≤ |
| 99 | (2 * (n : ℝ) ^ 4 * K ^ 2 + 2 * n * k ^ 2) * ∑ a, (W a) ^ 2 := by |
| 100 | classical |
| 101 | let b := g.orthonormalBasis x |
| 102 | have hdim : Module.finrank ℝ (TangentSpace (𝓡 n) x) = n := by |
| 103 | unfold TangentSpace |
| 104 | simp |
| 105 | have hb (i : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x))) : |
| 106 | g.tangentNorm x (b i) = 1 := by |
| 107 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 108 | ⟨g.toRiemannianMetric⟩ |
| 109 | change Real.sqrt (inner ℝ (b i) (b i)) = 1 |
| 110 | rw [real_inner_self_eq_norm_sq, b.norm_eq_one] |
| 111 | norm_num |
| 112 | have hRic (e a : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x))) : |
| 113 | |D.ricci x (b e) (b a)| ≤ (n : ℝ) * K := by |
| 114 | have h := D.abs_ricci_le_curvatureDerivativeNorm_zero hD x (b e) (b a) |
| 115 | simp only [hb, mul_one] at h |
| 116 | exact h.trans (mul_le_mul_of_nonneg_left hcurv (Nat.cast_nonneg n)) |
| 117 | have h := sum_sq_prescribed_jet_le (fun e a => D.ricci x (b e) (b a)) |
| 118 | W ((n : ℝ) * K) k (mul_nonneg (Nat.cast_nonneg n) hK) hRic |
| 119 | simp only [Fintype.card_fin, hdim] at h |
| 120 | convert h using 1 |
| 121 | ring |
| 122 | |
| 123 | /-- The negative gradient-square error caused by a nonnegative curvature |
| 124 | perturbation has an explicit lower bound in the vector coefficient norm. -/ |
| 125 | lemma neg_mul_sum_sq_geometric_prescribed_jet_ge |
| 126 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) |
| 127 | (x : M) (K k ψ : ℝ) (hK : 0 ≤ K) (hcurv : D.curvatureDerivativeNorm 0 x ≤ K) |
| 128 | (hψ : 0 ≤ ψ) |
| 129 | (W : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x)) → ℝ) : |
| 130 | let b := g.orthonormalBasis x |
| 131 | let Ric := fun e a => D.ricci x (b e) (b a); |
| 132 | -(4 * (n : ℝ) ^ 4 * K ^ 2 + 4 * n * k ^ 2) * ψ * (∑ a, (W a) ^ 2) ≤ |
| 133 | -2 * ψ * (∑ e, ∑ a, ∑ b, |
| 134 | (((Ric e a + k * (if e = a then 1 else 0)) * W b - |
| 135 | W a * (Ric e b + k * (if e = b then 1 else 0))) / 2) ^ 2) := by |
| 136 | dsimp only |
| 137 | have h := mul_le_mul_of_nonpos_left |
| 138 | (sum_sq_geometric_prescribed_jet_le D hD x K k hK hcurv W) |
| 139 | (show -2 * ψ ≤ 0 by linarith) |
| 140 | convert h using 1 |
| 141 | · rfl |
| 142 | · ring |
| 143 | |
| 144 | /-- On a time slab of length at most `T`, the actual reciprocal-time |
| 145 | Hamilton jet satisfies the `C / τ^2` estimate used in Lemma 15.24. -/ |
| 146 | lemma sum_sq_geometric_prescribed_jet_le_time_bound |
| 147 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) |
| 148 | (x : M) (K τ T : ℝ) (hK : 0 ≤ K) (hcurv : D.curvatureDerivativeNorm 0 x ≤ K) |
| 149 | (hτ : 0 < τ) (hT : τ ≤ T) |
| 150 | (W : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x)) → ℝ) : |
| 151 | let b := g.orthonormalBasis x |
| 152 | let Ric := fun e a => D.ricci x (b e) (b a) |
| 153 | (∑ e, ∑ a, ∑ b, |
| 154 | (((Ric e a + (1 / (2 * τ)) * (if e = a then 1 else 0)) * W b - |
| 155 | W a * (Ric e b + (1 / (2 * τ)) * (if e = b then 1 else 0))) / 2) ^ 2) ≤ |
| 156 | (2 * (n : ℝ) ^ 4 * K ^ 2 * T ^ 2 + n / 2) / τ ^ 2 * ∑ a, (W a) ^ 2 := by |
| 157 | have hτsq : τ ^ 2 ≤ T ^ 2 := (sq_le_sq₀ hτ.le (hτ.le.trans hT)).2 hT |
| 158 | have hcoeff : 2 * (n : ℝ) ^ 4 * K ^ 2 + 2 * n * (1 / (2 * τ)) ^ 2 ≤ |
| 159 | (2 * (n : ℝ) ^ 4 * K ^ 2 * T ^ 2 + n / 2) / τ ^ 2 := by |
| 160 | apply (le_div_iff₀ (sq_pos_of_pos hτ)).2 |
| 161 | calc |
| 162 | _ = 2 * (n : ℝ) ^ 4 * K ^ 2 * τ ^ 2 + n / 2 := by |
| 163 | field_simp |
| 164 | _ ≤ _ := by |
| 165 | have h := mul_le_mul_of_nonneg_left hτsq |
| 166 | (show 0 ≤ 2 * (n : ℝ) ^ 4 * K ^ 2 by positivity) |
| 167 | linarith only [h] |
| 168 | exact (sum_sq_geometric_prescribed_jet_le D hD x K (1 / (2 * τ)) hK hcurv W).trans |
| 169 | (mul_le_mul_of_nonneg_right hcoeff (Finset.sum_nonneg (fun _ _ => sq_nonneg _))) |
| 170 | |
| 171 | end Poincare.RicciFlow.Harnack |