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.Surgery.StandardCap.Persistence.SourceNames.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Comparison.Evolution.FamilyJetsBounds |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.PersistenceGeometry |
| 4 | |
| 5 | /-! |
| 6 | # From uniform spatial jets to the frozen family comparison |
| 7 | |
| 8 | Uniform finite coordinate jets on possibly varying time domains give one |
| 9 | strict squared covariant error bound. A local tensor identity then reads |
| 10 | that bound in the actual cylinder pullback. Morgan--Tian, Corollary 16.9, |
| 11 | p. 373; M44 derivation 81. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M44 |
| 23 | |
| 24 | open M36 |
| 25 | |
| 26 | local notation "E" => StandardCapSpace |
| 27 | local notation "V" => E →L[ℝ] E →L[ℝ] ℝ |
| 28 | |
| 29 | noncomputable local instance familyComparisonCoefficientNorm : NormedAddCommGroup V := |
| 30 | ContinuousLinearMap.toNormedAddCommGroup |
| 31 | |
| 32 | noncomputable local instance familyComparisonCoefficientSpace : NormedSpace ℝ V := |
| 33 | ContinuousLinearMap.toNormedSpace |
| 34 | |
| 35 | /-- Uniform convergence of finitely many ordinary spatial jets gives |
| 36 | one strict frozen covariant error bound on the complete moving time |
| 37 | domain. Source: Corollary 16.9, p. 373; derivation 81. -/ |
| 38 | theorem eventually_standard_family_metricJetError_le_of_metric_eq |
| 39 | {g0 : StandardInitialMetric} (S : MaximalStandardCapFlow g0) |
| 40 | {H : ℝ} (hH : H < S.base.lifetime) {K : Set E} (hK : IsCompact K) |
| 41 | {f : ℕ → ℝ × E → V} {J : ℕ → Set ℝ} {U : ℕ → Set E} |
| 42 | (G : ℕ → ℝ → RiemannianMetric 3 E) (D : ∀ k t, LeviCivitaData (G k t)) |
| 43 | (hmodel : ∀ᶠ k in atTop, ∀ t ∈ J k, G k t = S.metric t) |
| 44 | (m : ℕ) (hU : ∀ k, IsOpen (U k)) |
| 45 | (hKU : ∀ᶠ k in atTop, K ⊆ U k) |
| 46 | (hJ : ∀ᶠ k in atTop, J k ⊆ Icc 0 H) |
| 47 | (hsmooth : ∀ᶠ k in atTop, ∀ t ∈ J k, |
| 48 | ContDiffOn ℝ ∞ (fun y => f k (t, y)) (U k)) |
| 49 | (hjets : ∀ j ≤ m, ∀ rho : ℝ, 0 < rho → ∀ᶠ k in atTop, |
| 50 | ∀ t ∈ J k, ∀ x ∈ K, |
| 51 | ‖iteratedFDeriv ℝ j (fun y => f k (t, y)) x - |
| 52 | iteratedFDeriv ℝ j (S.metric t).euclideanCoefficients x‖ < rho) |
| 53 | {epsilon : ℝ} (hepsilon : 0 < epsilon) : |
| 54 | ∀ᶠ k in atTop, ∀ t ∈ J k, ∀ x ∈ K, |
| 55 | singularMetricJetErrorSquared (G k t) (D k t) |
| 56 | (fun y v => f k (t, y) (v 0) (v 1)) m x ≤ epsilon / 2 := by |
| 57 | obtain ⟨C, hC, hbound⟩ := exists_standard_family_metricJetError_bound S hH hK m |
| 58 | let rho := Real.sqrt (epsilon / (2 * C)) |
| 59 | have hrho : 0 < rho := Real.sqrt_pos.2 (div_pos hepsilon (by positivity)) |
| 60 | have hrho_sq : C * rho ^ 2 = epsilon / 2 := by |
| 61 | change C * (Real.sqrt (epsilon / (2 * C))) ^ 2 = epsilon / 2 |
| 62 | rw [Real.sq_sqrt (div_nonneg hepsilon.le (by positivity))] |
| 63 | field_simp [hC.ne'] |
| 64 | have hfinite : ∀ᶠ k in atTop, ∀ j : Fin (m + 1), |
| 65 | ∀ t ∈ J k, ∀ x ∈ K, |
| 66 | ‖iteratedFDeriv ℝ (j : ℕ) (fun y => f k (t, y)) x - |
| 67 | iteratedFDeriv ℝ (j : ℕ) (S.metric t).euclideanCoefficients x‖ < rho := |
| 68 | Filter.eventually_all.mpr (fun j => hjets j (by omega) rho hrho) |
| 69 | filter_upwards [hKU, hJ, hsmooth, hfinite, hmodel] with k hkU hkJ hkS hk hkmodel |
| 70 | intro t ht x hx |
| 71 | have hdiff (j : ℕ) (hj : j ≤ m) : |
| 72 | ‖iteratedFDeriv ℝ j |
| 73 | ((fun y => f k (t, y)) - (S.metric t).euclideanCoefficients) x‖ ≤ rho := by |
| 74 | change ‖iteratedFDeriv ℝ j |
| 75 | (fun y => f k (t, y) - (S.metric t).euclideanCoefficients y) x‖ ≤ rho |
| 76 | rw [fun_iteratedFDeriv_sub_apply |
| 77 | (((hkS t ht).contDiffAt ((hU k).mem_nhds (hkU hx))).of_le |
| 78 | (show (j : ℕ∞ω) ≤ ∞ by exact_mod_cast le_top)) |
| 79 | (((S.metric t).contDiffAt_euclideanCoefficients x).of_le |
| 80 | (show (j : ℕ∞ω) ≤ ∞ by exact_mod_cast le_top))] |
| 81 | exact (hk ⟨j, by omega⟩ t ht x hx).le |
| 82 | have hdiff' (j : ℕ) (hj : j ≤ m) : |
| 83 | ‖iteratedFDeriv ℝ j |
| 84 | ((fun y => f k (t, y)) - (G k t).euclideanCoefficients) x‖ ≤ rho := by |
| 85 | rw [hkmodel t ht] |
| 86 | exact hdiff j hj |
| 87 | exact (hbound t (hkJ ht) (G k t) (hkmodel t ht) (D k t) (U k) (hU k) |
| 88 | (fun y => f k (t, y)) (hkS t ht) x hx (hkU hx) rho hrho.le hdiff').trans_eq hrho_sq |
| 89 | |
| 90 | /-- A fixed maximal model is the special case of the varying-model |
| 91 | comparison with its actual connection. Source: Corollary 16.9; |
| 92 | derivation 81. -/ |
| 93 | theorem eventually_standard_family_metricJetError_le |
| 94 | {g0 : StandardInitialMetric} (S : MaximalStandardCapFlow g0) |
| 95 | {H : ℝ} (hH : H < S.base.lifetime) {K : Set E} (hK : IsCompact K) |
| 96 | {f : ℕ → ℝ × E → V} {J : ℕ → Set ℝ} {U : ℕ → Set E} |
| 97 | (m : ℕ) (hU : ∀ k, IsOpen (U k)) |
| 98 | (hKU : ∀ᶠ k in atTop, K ⊆ U k) |
| 99 | (hJ : ∀ᶠ k in atTop, J k ⊆ Icc 0 H) |
| 100 | (hsmooth : ∀ᶠ k in atTop, ∀ t ∈ J k, |
| 101 | ContDiffOn ℝ ∞ (fun y => f k (t, y)) (U k)) |
| 102 | (hjets : ∀ j ≤ m, ∀ rho : ℝ, 0 < rho → ∀ᶠ k in atTop, |
| 103 | ∀ t ∈ J k, ∀ x ∈ K, |
| 104 | ‖iteratedFDeriv ℝ j (fun y => f k (t, y)) x - |
| 105 | iteratedFDeriv ℝ j (S.metric t).euclideanCoefficients x‖ < rho) |
| 106 | {epsilon : ℝ} (hepsilon : 0 < epsilon) : |
| 107 | ∀ᶠ k in atTop, ∀ t ∈ J k, ∀ x ∈ K, |
| 108 | singularMetricJetErrorSquared (S.metric t) (S.connection t) |
| 109 | (fun y v => f k (t, y) (v 0) (v 1)) m x ≤ epsilon / 2 := |
| 110 | eventually_standard_family_metricJetError_le_of_metric_eq S hH hK |
| 111 | (fun _ => S.metric) (fun _ => S.connection) (Eventually.of_forall (fun _ _ _ => rfl)) |
| 112 | m hU hKU hJ hsmooth hjets hepsilon |
| 113 | |
| 114 | /-- The frozen error depends only on the germ of the compared tensor, |
| 115 | including every covariant derivative slot. Source: Corollary 16.9; |
| 116 | derivation 81. -/ |
| 117 | theorem singularMetricJetErrorSquared_congr_germ |
| 118 | (g : RiemannianMetric 3 E) (D : LeviCivitaData g) |
| 119 | {B C : CovariantTensorEvaluation 3 E 2} {x : E} |
| 120 | (h : ∀ᶠ y in nhds x, B y = C y) (m : ℕ) : |
| 121 | singularMetricJetErrorSquared g D B m x = |
| 122 | singularMetricJetErrorSquared g D C m x := by |
| 123 | have hdiff : ∀ᶠ y in nhds x, |
| 124 | (fun v => B y v - g.inner y (v 0) (v 1)) = |
| 125 | (fun v => C y v - g.inner y (v 0) (v 1)) := by |
| 126 | filter_upwards [h] with y hy |
| 127 | rw [hy] |
| 128 | unfold singularMetricJetErrorSquared |
| 129 | apply Finset.sum_congr rfl |
| 130 | intro j _ |
| 131 | have hderiv := |
| 132 | (comparison_iteratedCovariantTensorDerivative_eventuallyEq D hdiff j).self_of_nhds |
| 133 | unfold RiemannianMetric.tensorNorm |
| 134 | rw [hderiv] |
| 135 | |
| 136 | /-- Actual coefficient comparison on an open chart gives the literal |
| 137 | frozen surgery-cap family comparison, with a single bound before time |
| 138 | and point. Source: Corollary 16.9 and Proposition 16.5; derivation 81. -/ |
| 139 | theorem surgeryCapFamilyComparison_of_coefficient_error |
| 140 | {F : SurgeryFlowData.{u}} (S : MaximalStandardCapFlow F.standard_initial) |
| 141 | {t A eta : ℝ} {I : Set ℝ} {U : Set (F.slice t).carrier} |
| 142 | (e : SurgeryFlowCylinder F (F.slice t) t ((F.parameters.h t)⁻¹ ^ 2) I U) |
| 143 | (chart : E → (F.slice t).carrier) {W : Set E} (hW : IsOpen W) |
| 144 | (hAW : F.standard_initial.metric.ball 0 A ⊆ W) |
| 145 | (B : ℝ × E → V) (bound : ℝ) (hbound : bound < eta ^ 2) |
| 146 | (hlifetime : S.base.lifetime = 1) |
| 147 | (htime : ∀ s ∈ I, s ∈ Ico 0 S.base.lifetime) |
| 148 | (himage : chart '' F.standard_initial.metric.ball 0 A = U) |
| 149 | (hread : ∀ s (hs : s ∈ I), ∀ y ∈ W, ∀ v w : E, |
| 150 | B (s, y) v w = e.pullbackInner s hs (chart y) |
| 151 | (mfderiv (𝓡 3) (𝓡 3) chart y v) (mfderiv (𝓡 3) (𝓡 3) chart y w)) |
| 152 | (herror : ∀ s ∈ I, ∀ x ∈ F.standard_initial.metric.ball 0 A, |
| 153 | singularMetricJetErrorSquared (S.metric s) (S.connection s) |
| 154 | (fun y v => B (s, y) (v 0) (v 1)) ⌊eta⁻¹⌋₊ x ≤ bound) : |
| 155 | SurgeryCapFamilyComparison F S A eta e chart := by |
| 156 | refine ⟨bound, hbound, hlifetime, htime, himage, ?_⟩ |
| 157 | intro s hs x hx |
| 158 | have heq : (fun y (v : Fin 2 → E) => B (s, y) (v 0) (v 1)) =ᶠ[nhds x] |
| 159 | (fun y v => e.pullbackInner s hs (chart y) |
| 160 | (mfderiv (𝓡 3) (𝓡 3) chart y (v 0)) |
| 161 | (mfderiv (𝓡 3) (𝓡 3) chart y (v 1))) := by |
| 162 | filter_upwards [hW.mem_nhds (hAW hx)] with y hy |
| 163 | funext v |
| 164 | exact hread s hs y hy (v 0) (v 1) |
| 165 | exact (singularMetricJetErrorSquared_congr_germ (S.metric s) (S.connection s) |
| 166 | (x := x) heq ⌊eta⁻¹⌋₊).symm.trans_le (herror s hs x hx) |
| 167 | |
| 168 | end PoincareMT.M44 |