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.Collar.Bounds.CovariantComponentBounds |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Scalar.Calculus.UniformCoordinateJets |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Collar.Coordinates.ClosedTimeJets |
| 5 | import PoincareLib.Geometry.Riemannian.Coordinates.CompactFamily |
| 6 | |
| 7 | /-! |
| 8 | # Uniform covariant comparison on a compact model family |
| 9 | |
| 10 | The constants converting coordinate jets into the frozen metric error |
| 11 | are uniform in model time. Morgan--Tian, Corollary 16.9, p. 373; |
| 12 | M44 derivation 81. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Topology BigOperators |
| 20 | |
| 21 | namespace PoincareMT.M44 |
| 22 | |
| 23 | open M36 |
| 24 | |
| 25 | local notation "E" => StandardCapSpace |
| 26 | local notation "V" => E →L[ℝ] E →L[ℝ] ℝ |
| 27 | local notation "e" => EuclideanSpace.basisFun (Fin 3) ℝ |
| 28 | |
| 29 | noncomputable local instance familyJetsCoefficientNorm : NormedAddCommGroup V := |
| 30 | ContinuousLinearMap.toNormedAddCommGroup |
| 31 | |
| 32 | noncomputable local instance familyJetsCoefficientSpace : NormedSpace ℝ V := |
| 33 | ContinuousLinearMap.toNormedSpace |
| 34 | |
| 35 | set_option maxHeartbeats 800000 in |
| 36 | -- Expanding the finitely many covariant derivatives needs a larger elaboration budget. |
| 37 | /-- Ellipticity and finite background metric jets give one conversion |
| 38 | constant before the background metric, connection, and local comparison |
| 39 | field. Source: Corollary 16.9, p. 373; derivation 81. The finite |
| 40 | covariant expansion uses a larger local elaboration budget. -/ |
| 41 | theorem exists_uniform_singularMetricJetErrorSquared_bound |
| 42 | (m : ℕ) {a : ℝ} (ha : 0 < a) (B0 : ℝ) : |
| 43 | ∃ C : ℝ, 0 < C ∧ ∀ (g : RiemannianMetric 3 E) (D : LeviCivitaData g) |
| 44 | (U : Set E), IsOpen U → ∀ (B : E → V), ContDiffOn ℝ ∞ B U → |
| 45 | ∀ (x : E), x ∈ U → ∀ rho : ℝ, 0 ≤ rho → |
| 46 | (∀ v : E, a * ‖v‖ ^ 2 ≤ g.inner x v v) → |
| 47 | (∀ j ≤ m + 1, ‖iteratedFDeriv ℝ j g.euclideanCoefficients x‖ ≤ B0) → |
| 48 | (∀ j ≤ m, ‖iteratedFDeriv ℝ j (B - g.euclideanCoefficients) x‖ ≤ rho) → |
| 49 | singularMetricJetErrorSquared g D (fun y v => B y (v 0) (v 1)) m x ≤ |
| 50 | C * rho ^ 2 := by |
| 51 | classical |
| 52 | obtain ⟨G, hG, hchrist⟩ := exists_uniform_comparisonChristoffel_bound m ha B0 |
| 53 | choose A hA hAbound using fun j : Fin (m + 1) => |
| 54 | exists_uniform_covariant_norm_bound 2 j ha hG |
| 55 | let C := 1 + ∑ j : Fin (m + 1), (A j) ^ 2 |
| 56 | have hC : 0 < C := by dsimp [C]; positivity |
| 57 | refine ⟨C, hC, ?_⟩ |
| 58 | intro g D U hU B hB x hx rho hrho hell hjets hbase |
| 59 | have hg : ContDiff ℝ ∞ g.euclideanCoefficients := |
| 60 | contDiff_iff_contDiffAt.mpr g.contDiffAt_euclideanCoefficients |
| 61 | obtain ⟨F, hF, heq⟩ := exists_comparison_smooth_germ hU (hB.sub hg.contDiffOn) hx |
| 62 | let T : CovariantTensorEvaluation 3 E 2 := fun y v => F y (v 0) (v 1) |
| 63 | have hT : IsSmoothCovariantTensor T := comparison_bilinear_isSmooth hF |
| 64 | have hcoeff (j : ℕ) (hj : j ≤ m) (b : Fin 2 → Fin 3) : |
| 65 | ‖iteratedFDeriv ℝ j (comparisonTensorComponent T b) x‖ ≤ rho := by |
| 66 | have h1 := norm_iteratedFDeriv_clm_apply_const (hF.contDiffAt (x := x)) |
| 67 | (show (j : ℕ∞ω) ≤ ∞ by exact_mod_cast le_top) (c := e (b 0)) |
| 68 | have h2 := norm_iteratedFDeriv_clm_apply_const |
| 69 | (((hF.contDiffAt (x := x)).clm_apply (contDiffAt_const (c := e (b 0))))) |
| 70 | (show (j : ℕ∞ω) ≤ ∞ by exact_mod_cast le_top) (c := e (b 1)) |
| 71 | simp only [(e).norm_eq_one, one_mul] at h1 h2 |
| 72 | apply (h2.trans h1).trans |
| 73 | rw [(heq.iteratedFDeriv ℝ j).self_of_nhds] |
| 74 | exact hbase j hj |
| 75 | have hTeq : ∀ᶠ y in nhds x, |
| 76 | T y = (fun v => B y (v 0) (v 1) - g.inner y (v 0) (v 1)) := by |
| 77 | filter_upwards [heq] with y hy |
| 78 | funext v |
| 79 | change F y (v 0) (v 1) = _ |
| 80 | rw [hy] |
| 81 | rfl |
| 82 | have hbound (j : Fin (m + 1)) : |
| 83 | g.tensorNorm (D.iteratedCovariantTensorDerivative (k := 2) |
| 84 | (fun y v => B y (v 0) (v 1) - g.inner y (v 0) (v 1)) j) x ≤ A j * rho := by |
| 85 | have hn : g.tensorNorm (D.iteratedCovariantTensorDerivative T j) x = |
| 86 | g.tensorNorm (D.iteratedCovariantTensorDerivative (k := 2) |
| 87 | (fun y v => B y (v 0) (v 1) - g.inner y (v 0) (v 1)) j) x := by |
| 88 | unfold RiemannianMetric.tensorNorm |
| 89 | rw [(comparison_iteratedCovariantTensorDerivative_eventuallyEq D hTeq j).self_of_nhds] |
| 90 | rw [← hn] |
| 91 | exact hAbound j g D T hT x rho hrho hell |
| 92 | (fun l hl => hchrist g x hell hjets l (by omega)) |
| 93 | (fun l hl b => hcoeff l (by omega) b) |
| 94 | unfold singularMetricJetErrorSquared |
| 95 | rw [← Fin.sum_univ_eq_sum_range] |
| 96 | calc |
| 97 | _ ≤ ∑ j : Fin (m + 1), (A j * rho) ^ 2 := by |
| 98 | apply Finset.sum_le_sum |
| 99 | intro j _ |
| 100 | apply (sq_le_sq₀ (by unfold RiemannianMetric.tensorNorm; positivity) |
| 101 | (mul_nonneg (hA j).le hrho)).mpr |
| 102 | exact hbound j |
| 103 | _ = (∑ j : Fin (m + 1), (A j) ^ 2) * rho ^ 2 := by |
| 104 | simp only [mul_pow, Finset.sum_mul] |
| 105 | _ ≤ C * rho ^ 2 := by |
| 106 | apply mul_le_mul_of_nonneg_right _ (sq_nonneg rho) |
| 107 | dsimp [C] |
| 108 | linarith |
| 109 | |
| 110 | /-- Standard-coordinate metric coefficients are jointly smooth within |
| 111 | the full actual flow time set. Source: Corollary 16.9; derivation 81. -/ |
| 112 | theorem contDiffOn_euclideanCoefficients_within {J : Set ℝ} |
| 113 | (F : RicciFlow 3 E J) : |
| 114 | ContDiffOn ℝ ∞ (fun p : ℝ × E => (F.metric p.1).euclideanCoefficients p.2) |
| 115 | (J ×ˢ univ) := by |
| 116 | have h := contDiffOn_pullbackCoefficients_within F isOpen_univ |
| 117 | (contMDiff_id.contMDiffOn : ContMDiffOn (𝓡 3) (𝓡 3) ∞ id univ) |
| 118 | apply h.congr |
| 119 | intro p _ |
| 120 | apply ContinuousLinearMap.ext |
| 121 | intro v |
| 122 | apply ContinuousLinearMap.ext |
| 123 | intro w |
| 124 | change (F.metric p.1).inner p.2 v w = |
| 125 | (F.metric p.1).inner p.2 (mfderiv (𝓡 3) (𝓡 3) id p.2 v) |
| 126 | (mfderiv (𝓡 3) (𝓡 3) id p.2 w) |
| 127 | rw [mfderiv_id] |
| 128 | rfl |
| 129 | |
| 130 | /-- The actual spatial metric jets are continuous jointly in space |
| 131 | and time, including birth. Source: Corollary 16.9; derivation 81. -/ |
| 132 | theorem continuousOn_standard_spatialJet {g0 : StandardInitialMetric} |
| 133 | (S : PartialStandardCapFlow g0) (m : ℕ) : |
| 134 | ContinuousOn (fun p : ℝ × E => |
| 135 | iteratedFDeriv ℝ m (S.flow.metric p.1).euclideanCoefficients p.2) |
| 136 | (Ico 0 S.lifetime ×ˢ univ) := |
| 137 | (contDiffOn_spatialJet_within (contDiffOn_euclideanCoefficients_within S.flow) |
| 138 | (uniqueDiffOn_Ico _ _) isOpen_univ m).continuousOn |
| 139 | |
| 140 | /-- A compact standard time slab and compact spatial set have one |
| 141 | ellipticity constant and one bound for every requested finite metric |
| 142 | jet. Source: Corollary 16.9, p. 373; derivation 81. -/ |
| 143 | theorem exists_standard_family_ellipticity_jet_bound {g0 : StandardInitialMetric} |
| 144 | (S : PartialStandardCapFlow g0) {H : ℝ} (hH : H < S.lifetime) |
| 145 | {K : Set E} (hK : IsCompact K) (m : ℕ) : |
| 146 | ∃ a : ℝ, 0 < a ∧ ∃ B : ℝ, ∀ t ∈ Icc 0 H, ∀ x ∈ K, |
| 147 | (∀ v : E, a * ‖v‖ ^ 2 ≤ (S.flow.metric t).inner x v v) ∧ |
| 148 | (∀ j ≤ m, ‖iteratedFDeriv ℝ j (S.flow.metric t).euclideanCoefficients x‖ ≤ B) := by |
| 149 | classical |
| 150 | have hsub : Icc (0 : ℝ) H ×ˢ K ⊆ Ico 0 S.lifetime ×ˢ (univ : Set E) := |
| 151 | fun _ hp => ⟨⟨hp.1.1, hp.1.2.trans_lt hH⟩, mem_univ _⟩ |
| 152 | have hcompact : IsCompact (Icc (0 : ℝ) H ×ˢ K) := isCompact_Icc.prod hK |
| 153 | have hc := (contDiffOn_euclideanCoefficients_within S.flow).continuousOn.mono hsub |
| 154 | obtain ⟨a, ha, hell⟩ := exists_uniform_bilinear_family_lower_bound hcompact hc |
| 155 | (fun p _ v hv => (S.flow.metric p.1).pos p.2 v hv) |
| 156 | choose B hB using fun j : Fin (m + 1) => hcompact.exists_bound_of_continuousOn |
| 157 | ((continuousOn_standard_spatialJet S j).mono hsub) |
| 158 | let B0 := ∑ j : Fin (m + 1), |B j| |
| 159 | refine ⟨a, ha, B0, ?_⟩ |
| 160 | intro t ht x hx |
| 161 | refine ⟨hell (t, x) ⟨ht, hx⟩, ?_⟩ |
| 162 | intro j hj |
| 163 | have hbound := hB ⟨j, by omega⟩ (t, x) ⟨ht, hx⟩ |
| 164 | apply hbound.trans |
| 165 | apply (le_abs_self _).trans |
| 166 | dsimp only [B0] |
| 167 | exact Finset.single_le_sum (fun q _ => abs_nonneg (B q)) |
| 168 | (Finset.mem_univ (⟨j, by omega⟩ : Fin (m + 1))) |
| 169 | |
| 170 | /-- The frozen squared covariant metric error has one uniform |
| 171 | coordinate conversion constant over the entire compact model slab. |
| 172 | Source: Corollary 16.9, p. 373; derivation 81. -/ |
| 173 | theorem exists_standard_family_metricJetError_bound {g0 : StandardInitialMetric} |
| 174 | (S : MaximalStandardCapFlow g0) {H : ℝ} (hH : H < S.base.lifetime) |
| 175 | {K : Set E} (hK : IsCompact K) (m : ℕ) : |
| 176 | ∃ C : ℝ, 0 < C ∧ ∀ t ∈ Icc 0 H, |
| 177 | ∀ (g : RiemannianMetric 3 E), g = S.metric t → ∀ (D : LeviCivitaData g), |
| 178 | ∀ (U : Set E), IsOpen U → |
| 179 | ∀ (B : E → V), ContDiffOn ℝ ∞ B U → ∀ x ∈ K, x ∈ U → |
| 180 | ∀ rho : ℝ, 0 ≤ rho → |
| 181 | (∀ j ≤ m, ‖iteratedFDeriv ℝ j (B - g.euclideanCoefficients) x‖ ≤ rho) → |
| 182 | singularMetricJetErrorSquared g D |
| 183 | (fun y v => B y (v 0) (v 1)) m x ≤ C * rho ^ 2 := by |
| 184 | obtain ⟨a, ha, B0, hbackground⟩ := |
| 185 | exists_standard_family_ellipticity_jet_bound S.base hH hK (m + 1) |
| 186 | obtain ⟨C, hC, hbound⟩ := exists_uniform_singularMetricJetErrorSquared_bound m ha B0 |
| 187 | refine ⟨C, hC, ?_⟩ |
| 188 | intro t ht g hmetric D U hU B hB x hx hxU rho hrho hdiff |
| 189 | subst g |
| 190 | obtain ⟨hell, hjets⟩ := hbackground t ht x hx |
| 191 | exact hbound (S.metric t) D U hU B hB x hxU rho hrho hell hjets hdiff |
| 192 | |
| 193 | end PoincareMT.M44 |