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.Comparison.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.C2.TraceNormalization |
| 3 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalEstimates.Curvature.VectorEvolution |
| 4 | |
| 5 | /-! |
| 6 | # The actual curvature-vector diffusion error |
| 7 | |
| 8 | Testing the literal paired evolution against its error vector bounds the |
| 9 | full vector, retaining the first intrinsic curvature jet. MT2007 Claim |
| 10 | 19.1, p. 437; MT2015Correction Lemmas 0.1--0.2, pp. 3--6. See |
| 11 | `2026-09-22-c2-embedded-product-rules.md`, statement 1. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Bundle Manifold |
| 17 | open scoped Manifold ContDiff Bundle BigOperators |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M63 |
| 22 | |
| 23 | open M62 |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | {a b : ℝ} |
| 28 | |
| 29 | /-- The actual covariant time derivative minus intrinsic diffusion has |
| 30 | the displayed metric norm bound. No residual or evolution premise is |
| 31 | introduced. MT2007 Claim 19.1, p. 437; correction pp. 3--6; |
| 32 | embedded-product derivation, statement 1. -/ |
| 33 | theorem curvatureVector_diffusionError_norm_le [T2Space M] |
| 34 | (F : RicciFlow n M (Icc a b)) (c : ℝ → ℝ → M) |
| 35 | (hc : M62ShrinkingCurve F c) {K0 K1 K2 : ℝ} |
| 36 | (h0 : 0 ≤ K0) (h1 : 0 ≤ K1) (h2 : 0 ≤ K2) |
| 37 | (hBounds : CurveEvolutionAmbientBounds F K0 K1 K2) |
| 38 | {t : ℝ} (ht : t ∈ Ioo a b) (x : ℝ) : |
| 39 | (F.metric t).tangentNorm (c x t) |
| 40 | (rampHorizontalCovariantDerivative (F.connection t) (fun r => c x r) |
| 41 | (fun r => m62CurvatureVector F c r x) t - m63CurvatureJet F c 2 t x) ≤ |
| 42 | 2 * m62Curvature F c t x ^ 3 + (K0 + 4 * K2) * m62Curvature F c t x + |
| 43 | 4 * K1 + 2 * m62Curvature F c t x * |
| 44 | (F.metric t).tangentNorm (c x t) (m63CurvatureJet F c 1 t x) := by |
| 45 | let p := c x t |
| 46 | let g := F.metric t |
| 47 | let D := F.connection t |
| 48 | let S := spatialUnitTangent F c t x |
| 49 | let H := m62CurvatureVector F c t x |
| 50 | let B := m63CurvatureJet F c 1 t x |
| 51 | let Q := rampHorizontalCovariantDerivative D (fun r => c x r) |
| 52 | (fun r => m62CurvatureVector F c r x) t - m63CurvatureJet F c 2 t x |
| 53 | let A : ℝ → ℝ := fun y => m62TangentRicci F c t y + m62CurvatureSquared F c t y |
| 54 | let k := m62Curvature F c t x |
| 55 | let u := g.tangentNorm p B |
| 56 | let N := g.tangentNorm p Q |
| 57 | let C := 2 * k ^ 3 + (K0 + 4 * K2) * k + 4 * K1 + 2 * k * u |
| 58 | have ht' := Ioo_subset_Icc_self ht |
| 59 | have hv := speed_pos F c hc ht' x |
| 60 | have hS : g.tangentNorm p S = 1 := unitTangent_norm F c hc ht' x |
| 61 | have hH : g.tangentNorm p H = k := rfl |
| 62 | have hB : g.tangentNorm p B = u := rfl |
| 63 | have hN : g.tangentNorm p Q = N := rfl |
| 64 | have hk : 0 ≤ k := curvature_nonneg F c t x |
| 65 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 66 | ⟨g.toRiemannianMetric⟩ |
| 67 | have hn (Z : TangentSpace (𝓡 n) p) : ‖Z‖ = g.tangentNorm p Z := by |
| 68 | rw [norm_eq_sqrt_real_inner] |
| 69 | rfl |
| 70 | have hu : 0 ≤ u := by simpa only [hn, hB] using norm_nonneg B |
| 71 | have hN0 : 0 ≤ N := by simpa only [hn, hN] using norm_nonneg Q |
| 72 | have hC : 0 ≤ C := by dsimp only [C]; positivity |
| 73 | have hRic : |D.ricci p S S| ≤ K2 := hBounds.ricci t ht' p S S hS.le hS.le |
| 74 | have hA : |A x| ≤ K2 + k ^ 2 := by |
| 75 | have hq := curvatureSquared_nonneg F c t x |
| 76 | have hkq : k ^ 2 = m62CurvatureSquared F c t x := curvature_sq F c t x |
| 77 | change |D.ricci p S S + m62CurvatureSquared F c t x| ≤ _ |
| 78 | rw [hkq] |
| 79 | apply abs_le.mpr |
| 80 | constructor |
| 81 | · linarith only [(abs_le.mp hRic).1, hq] |
| 82 | · linarith only [(abs_le.mp hRic).2] |
| 83 | have hDA : |m62ArcDerivative F c t A x| ≤ K1 + 2 * K2 * k + 2 * k * u := by |
| 84 | have hd := normalizationCoefficient_spatial_abs_bound F c hc hBounds ht x |
| 85 | change |deriv A x| ≤ curveSpeed F c t x * (K1 + 2 * K2 * k + 2 * k * u) at hd |
| 86 | have heq : curveSpeed F c t x * m62ArcDerivative F c t A x = deriv A x := by |
| 87 | dsimp only [m62ArcDerivative] |
| 88 | rw [← mul_assoc, mul_inv_cancel₀ hv.ne', one_mul] |
| 89 | rw [← heq, abs_mul, abs_of_pos hv] at hd |
| 90 | exact (mul_le_mul_iff_right₀ hv).mp hd |
| 91 | have hHZ : |g.inner p H Q| ≤ k * N := by |
| 92 | change |inner ℝ H Q| ≤ k * N |
| 93 | simpa only [hn, hH, hN] using abs_real_inner_le_norm H Q |
| 94 | have hSZ : |g.inner p S Q| ≤ N := by |
| 95 | change |inner ℝ S Q| ≤ N |
| 96 | simpa only [hn, hS, hN, one_mul] using abs_real_inner_le_norm S Q |
| 97 | have hRm : |D.curvatureTensor p H S Q S| ≤ K0 * k * N := by |
| 98 | have h := tensor_abs_le_of_unit_bound g D.riemannEvaluation |
| 99 | (M04.isSmoothCovariantTensor_riemannEvaluation D) p |
| 100 | (hBounds.riemann t ht' p) ![H, S, Q, S] |
| 101 | simpa [LeviCivitaData.riemannEvaluation, Fin.prod_univ_succ, |
| 102 | hH, hS, hN, mul_assoc] using h |
| 103 | have hDer (w : Fin 3 → TangentSpace (𝓡 n) p) : |
| 104 | |D.covariantTensorDerivative D.ricciEvaluation p w| ≤ |
| 105 | K1 * ∏ i, g.tangentNorm p (w i) := |
| 106 | tensor_abs_le_of_unit_bound g (D.covariantTensorDerivative D.ricciEvaluation) |
| 107 | (M04.isSmoothCovariantTensor_covariantTensorDerivative D |
| 108 | (M04.isSmoothCovariantTensor_ricciEvaluation D)) p |
| 109 | (hBounds.ricci_derivative t ht' p) w |
| 110 | have hSSQ : |D.covariantTensorDerivative D.ricciEvaluation p ![S, S, Q]| ≤ K1 * N := by |
| 111 | simpa [Fin.prod_univ_succ, hS, hN] using hDer ![S, S, Q] |
| 112 | have hQSS : |D.covariantTensorDerivative D.ricciEvaluation p ![Q, S, S]| ≤ K1 * N := by |
| 113 | simpa [Fin.prod_univ_succ, hS, hN] using hDer ![Q, S, S] |
| 114 | have hlead : |2 * A x * g.inner p H Q| ≤ 2 * (K2 + k ^ 2) * (k * N) := by |
| 115 | rw [abs_mul, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] |
| 116 | exact mul_le_mul (mul_le_mul_of_nonneg_left hA (by norm_num)) hHZ |
| 117 | (abs_nonneg _) (by positivity) |
| 118 | have hnorm : |m62ArcDerivative F c t A x * g.inner p S Q| ≤ |
| 119 | (K1 + 2 * K2 * k + 2 * k * u) * N := by |
| 120 | rw [abs_mul] |
| 121 | exact mul_le_mul hDA hSZ (abs_nonneg _) (by positivity) |
| 122 | have hevol := m63CurvatureVector_time_pair F c hc ht x Q |
| 123 | have hpair : g.inner p Q Q = 2 * A x * g.inner p H Q + |
| 124 | m62ArcDerivative F c t A x * g.inner p S Q + D.curvatureTensor p H S Q S - |
| 125 | 2 * D.covariantTensorDerivative D.ricciEvaluation p ![S, S, Q] + |
| 126 | D.covariantTensorDerivative D.ricciEvaluation p ![Q, S, S] := by |
| 127 | dsimp only at hevol |
| 128 | change g.inner p |
| 129 | (rampHorizontalCovariantDerivative D (fun r => c x r) |
| 130 | (fun r => m62CurvatureVector F c r x) t) Q = _ at hevol |
| 131 | calc |
| 132 | g.inner p Q Q = g.inner p |
| 133 | (rampHorizontalCovariantDerivative D (fun r => c x r) |
| 134 | (fun r => m62CurvatureVector F c r x) t) Q - |
| 135 | g.inner p (m63CurvatureJet F c 2 t x) Q := by |
| 136 | change inner ℝ |
| 137 | (rampHorizontalCovariantDerivative D (fun r => c x r) |
| 138 | (fun r => m62CurvatureVector F c r x) t - m63CurvatureJet F c 2 t x) Q = |
| 139 | inner ℝ _ Q - inner ℝ _ Q |
| 140 | exact inner_sub_left _ _ _ |
| 141 | _ = _ := by linarith only [hevol] |
| 142 | have habs : |g.inner p Q Q| ≤ C * N := by |
| 143 | rw [hpair] |
| 144 | apply abs_le.mpr |
| 145 | dsimp only [C] |
| 146 | constructor |
| 147 | · nlinarith only [(abs_le.mp hlead).1, (abs_le.mp hnorm).1, |
| 148 | (abs_le.mp hRm).1, (abs_le.mp hSSQ).2, (abs_le.mp hQSS).1] |
| 149 | · nlinarith only [(abs_le.mp hlead).2, (abs_le.mp hnorm).2, |
| 150 | (abs_le.mp hRm).2, (abs_le.mp hSSQ).1, (abs_le.mp hQSS).2] |
| 151 | have hself : g.inner p Q Q = N ^ 2 := by |
| 152 | change inner ℝ Q Q = N ^ 2 |
| 153 | simpa only [hn, hN] using real_inner_self_eq_norm_sq Q |
| 154 | have hsquare : N ^ 2 ≤ C * N := by |
| 155 | simpa only [hself, abs_of_nonneg (sq_nonneg N)] using habs |
| 156 | change N ≤ C |
| 157 | by_cases hz : N = 0 |
| 158 | · simpa only [hz] using hC |
| 159 | · have hpos : 0 < N := lt_of_le_of_ne hN0 (Ne.symm hz) |
| 160 | nlinarith only [hsquare, hpos] |
| 161 | |
| 162 | end PoincareMT.M63 |