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.Topology.Manifold.Poincare.Final.Compatibility.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Component.ComponentEstimateGeometry |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Metric.Distance.MetricComparison |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Limit.Coordinates.NormalizedCoefficients |
| 5 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Scalar.Bounds.LocalScalarTransport |
| 6 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Lifetime.Curvature.CapPersistenceScalarContinuity |
| 7 | import Mathlib.Analysis.Calculus.ContDiff.Bounds |
| 8 | |
| 9 | /-! |
| 10 | # Scalar normalization at the actual surgery tip |
| 11 | |
| 12 | A model-dependent two-jet tolerance gives the uniform scalar lower bound |
| 13 | three quarters in the actual surgery-scale units. The normalized coefficients |
| 14 | are the literal pullback through the supplied comparison map. Source: |
| 15 | Definition 12.1, p. 293, Theorem 13.2, pp. 332-333, and pp. 402-405. |
| 16 | See `proof-work/tasks/M47/derivations/component-estimate.md`, Stage C2. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set Filter |
| 23 | open scoped Manifold ContDiff Bundle Topology |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.M47 |
| 28 | |
| 29 | local notation "E" => StandardCapSpace |
| 30 | |
| 31 | noncomputable local instance : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := |
| 32 | ContinuousLinearMap.toNormedAddCommGroup |
| 33 | |
| 34 | noncomputable local instance : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := |
| 35 | ContinuousLinearMap.toNormedSpace |
| 36 | |
| 37 | /-- The fixed round-tip normalization leaves a strict scalar margin above |
| 38 | three quarters; Morgan--Tian Definition 12.1, p. 293. -/ |
| 39 | theorem standard_tip_scalar_gt_three_quarters (g₀ : StandardInitialMetric) : |
| 40 | (3 / 4 : ℝ) < g₀.connection.scalarCurvature 0 := by |
| 41 | obtain ⟨r, hr, htip⟩ := g₀.tip_sectional_curvature |
| 42 | have hzero : (0 : E) ∈ g₀.metric.ball 0 r := by |
| 43 | change g₀.metric.edist 0 0 < ENNReal.ofReal r |
| 44 | rw [M36.metric_edist_self] |
| 45 | exact ENNReal.ofReal_pos.mpr hr |
| 46 | have h := six_mul_lt_scalar_of_sectional_lower g₀.connection 0 (1 / 8) |
| 47 | (fun v w hvw => by rw [htip 0 hzero v w hvw]; norm_num) |
| 48 | norm_num at h |
| 49 | exact h |
| 50 | |
| 51 | private theorem coefficient_jet_norm_le_bilinear |
| 52 | {B : E → E →L[ℝ] E →L[ℝ] ℝ} (hB : ContDiffAt ℝ ∞ B 0) |
| 53 | (j : ℕ) (a b : Fin 3) : |
| 54 | ‖iteratedFDeriv ℝ j (fun y => B y (EuclideanSpace.basisFun (Fin 3) ℝ a) |
| 55 | (EuclideanSpace.basisFun (Fin 3) ℝ b)) 0‖ ≤ ‖iteratedFDeriv ℝ j B 0‖ := by |
| 56 | have hj : (j : ℕ∞ω) ≤ ∞ := by exact_mod_cast le_top |
| 57 | have h1 := norm_iteratedFDeriv_clm_apply_const hB hj |
| 58 | (c := EuclideanSpace.basisFun (Fin 3) ℝ a) |
| 59 | have h2 := norm_iteratedFDeriv_clm_apply_const |
| 60 | (hB.clm_apply (contDiffAt_const (c := EuclideanSpace.basisFun (Fin 3) ℝ a))) hj |
| 61 | (c := EuclideanSpace.basisFun (Fin 3) ℝ b) |
| 62 | simp only [OrthonormalBasis.norm_eq_one, one_mul] at h1 h2 |
| 63 | exact h2.trans h1 |
| 64 | |
| 65 | /-- One accuracy is chosen before every actual output manifold, surgery |
| 66 | scale and comparison map; in that scale the tip scalar exceeds three quarters. |
| 67 | Theorem 13.2, pp. 332-333, used in the cap-encounter exclusion, pp. 402-405. -/ |
| 68 | theorem exists_tip_scalar_accuracy (g₀ : StandardInitialMetric) : |
| 69 | ∃ eta₀ : ℝ, 0 < eta₀ ∧ eta₀ ≤ 1 / 4 ∧ |
| 70 | ∀ (S : GeneralizedSliceCarrier.{u}) (g : RiemannianMetric 3 S.carrier) |
| 71 | (D : LeviCivitaData g) (tip : S.carrier) (scale eta : ℝ) |
| 72 | (_Q : SurgeryCapClose g₀ S g tip scale eta), |
| 73 | eta ≤ eta₀ → (3 / 4 : ℝ) < scale ^ 2 * D.scalarCurvature tip := by |
| 74 | have hbase := standard_tip_scalar_gt_three_quarters g₀ |
| 75 | obtain ⟨zeta, hzeta, hscalar⟩ := M34.capPersistence_exists_scalar_tolerance |
| 76 | g₀.connection (0 : E) (sub_pos.mpr hbase) |
| 77 | choose B hB hbound using fun j : Fin 3 => |
| 78 | SurgeryCapClose.exists_normalized_coefficient_jet_bound.{u} |
| 79 | g₀ (K := ({0} : Set E)) isCompact_singleton j.1 |
| 80 | let Bmax := max (B 0) (max (B 1) (B 2)) |
| 81 | have hBmax : 0 < Bmax := (hB 0).trans_le (le_max_left _ _) |
| 82 | have hBj (j : Fin 3) : B j ≤ Bmax := by |
| 83 | fin_cases j |
| 84 | · exact le_max_left _ _ |
| 85 | · exact (le_max_left _ _).trans (le_max_right _ _) |
| 86 | · exact (le_max_right _ _).trans (le_max_right _ _) |
| 87 | let eta₀ := min (1 / 4 : ℝ) (zeta / (Bmax + 1)) |
| 88 | have heta₀ : 0 < eta₀ := lt_min (by norm_num) (div_pos hzeta (by positivity)) |
| 89 | refine ⟨eta₀, heta₀, min_le_left _ _, ?_⟩ |
| 90 | intro S g D tip scale eta Q heta |
| 91 | have hsmall : eta ≤ 1 / 4 := heta.trans (min_le_left _ _) |
| 92 | have horder : 2 ≤ ⌊eta⁻¹⌋₊ := by |
| 93 | apply Nat.le_floor |
| 94 | rw [Nat.cast_ofNat, inv_eq_one_div, le_div_iff₀ Q.eta_pos] |
| 95 | linarith |
| 96 | have hzero : (0 : E) ∈ g₀.metric.ball 0 eta⁻¹ := by |
| 97 | change g₀.metric.edist 0 0 < ENNReal.ofReal eta⁻¹ |
| 98 | rw [M36.metric_edist_self] |
| 99 | exact ENNReal.ofReal_pos.mpr (inv_pos.mpr Q.eta_pos) |
| 100 | have hsingleton : ({0} : Set E) ⊆ g₀.metric.ball 0 eta⁻¹ := by |
| 101 | simpa only [singleton_subset_iff] using hzero |
| 102 | have herrorSize : Bmax * eta ≤ zeta := by |
| 103 | have hb := (le_div_iff₀ (show 0 < Bmax + 1 by positivity)).1 |
| 104 | (heta.trans (min_le_right _ _)) |
| 105 | nlinarith [Q.eta_pos] |
| 106 | have hinv (y : E) (hy : y ∈ g₀.metric.ball 0 eta⁻¹) : |
| 107 | (mfderiv (𝓡 3) (𝓡 3) Q.map y).IsInvertible := |
| 108 | ⟨(Q.toPartialDiffeomorph.isLocalDiffeomorphAt (𝓡 3) (𝓡 3) ∞ hy).mfderivToContinuousLinearEquiv |
| 109 | (by simp), rfl⟩ |
| 110 | obtain ⟨gE, DE, V, hV, hzeroV, hVsub, hmetric⟩ := |
| 111 | RiemannianMetric.exists_local_realization Q.toPartialDiffeomorph.open_source hzero |
| 112 | Q.normalizedCoefficients Q.contDiffOn_normalizedCoefficients |
| 113 | (fun y _ v w => by |
| 114 | simp only [SurgeryCapClose.normalizedCoefficients_apply, g.symm]) |
| 115 | (fun y hy v hv => by |
| 116 | change 0 < scale⁻¹ ^ 2 * g.inner (Q.map y) |
| 117 | (mfderiv (𝓡 3) (𝓡 3) Q.map y v) (mfderiv (𝓡 3) (𝓡 3) Q.map y v) |
| 118 | apply mul_pos (sq_pos_of_pos (inv_pos.mpr Q.scale_pos)) |
| 119 | apply g.pos |
| 120 | intro hz |
| 121 | apply hv |
| 122 | exact (hinv y hy).injective (by simpa only [map_zero] using hz)) |
| 123 | have hcoeff : gE.euclideanCoefficients =ᶠ[𝓝 (0 : E)] Q.normalizedCoefficients := |
| 124 | eventually_of_mem (hV.mem_nhds hzeroV) hmetric |
| 125 | have hdiff : (gE.euclideanCoefficients - g₀.metric.euclideanCoefficients) =ᶠ[𝓝 (0 : E)] |
| 126 | (Q.normalizedCoefficients - g₀.metric.euclideanCoefficients) := |
| 127 | hcoeff.sub Filter.EventuallyEq.rfl |
| 128 | have hjet (j : ℕ) (hj : j ≤ 2) : |
| 129 | ‖iteratedFDeriv ℝ j (gE.euclideanCoefficients - g₀.metric.euclideanCoefficients) 0‖ ≤ |
| 130 | zeta := by |
| 131 | rw [(hdiff.iteratedFDeriv (𝕜 := ℝ) (n := j)).self_of_nhds] |
| 132 | have h := hbound ⟨j, by omega⟩ S g tip scale eta Q (hj.trans horder) |
| 133 | hsingleton 0 (mem_singleton 0) |
| 134 | exact h.trans ((mul_le_mul_of_nonneg_right (hBj ⟨j, by omega⟩) Q.eta_pos.le).trans |
| 135 | herrorSize) |
| 136 | have hclose := hscalar gE DE (fun j hj a b => |
| 137 | (coefficient_jet_norm_le_bilinear |
| 138 | ((gE.contDiffAt_euclideanCoefficients 0).sub |
| 139 | (g₀.metric.contDiffAt_euclideanCoefficients 0)) j a b).trans (hjet j hj)) |
| 140 | have hpositive : (3 / 4 : ℝ) < DE.scalarCurvature 0 := by |
| 141 | have h := (abs_lt.1 hclose).1 |
| 142 | linarith |
| 143 | have hpullback (y : E) (hy : y ∈ V) (v w : E) : |
| 144 | g.inner (Q.map y) (mfderiv (𝓡 3) (𝓡 3) Q.map y v) |
| 145 | (mfderiv (𝓡 3) (𝓡 3) Q.map y w) = scale ^ 2 * gE.inner y v w := by |
| 146 | have hm := congrArg (fun A => A v w) (hmetric y hy) |
| 147 | change gE.inner y v w = scale⁻¹ ^ 2 * g.inner (Q.map y) |
| 148 | (mfderiv (𝓡 3) (𝓡 3) Q.map y v) (mfderiv (𝓡 3) (𝓡 3) Q.map y w) at hm |
| 149 | rw [hm] |
| 150 | field_simp [Q.scale_pos.ne'] |
| 151 | have hscaled := M44.scalar_eq_of_local_homothety DE D hV |
| 152 | (Q.map_smooth.mono hVsub) (fun y hy => hinv y (hVsub hy)) |
| 153 | (sq_pos_of_pos Q.scale_pos) hpullback hzeroV |
| 154 | rw [Q.map_tip] at hscaled |
| 155 | have heq : scale ^ 2 * D.scalarCurvature tip = DE.scalarCurvature 0 := by |
| 156 | rw [hscaled] |
| 157 | field_simp [Q.scale_pos.ne'] |
| 158 | rwa [heq] |
| 159 | |
| 160 | end PoincareMT.M47 |