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.Curvature.Integral.Concentration.WeightedFiberBalls |
| 2 | import PoincareLib.Geometry.Curvature.Integral.Induction.Corners.Scaling |
| 3 | import PoincareLib.Geometry.Riemannian.Curvature.Similarity |
| 4 | /-! |
| 5 | # Weighted corner geometry under actual fiber scaling |
| 6 | |
| 7 | The defining equations and partners scale with the square root of the ambient |
| 8 | metric factor. One actual fiber equivalence transports the variable sectional |
| 9 | error, ambient buffers and weighted scalar ratios. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | open Set Function TopologicalSpace MeasureTheory |
| 16 | open Poincare.Geometry.Manifold.RegularFiber |
| 17 | open scoped Manifold ContDiff Topology Bundle |
| 18 | namespace PoincareMT.RiemannianMetric |
| 19 | private theorem scaled_closedBall_iff |
| 20 | {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | (g : RiemannianMetric n M) {a : ℝ} (ha : 0 < a) (p x : M) (r : ℝ) : |
| 23 | (PoincareMT.rescaledMetric g a ha).edist p x ≤ ENNReal.ofReal (Real.sqrt a*r) ↔ |
| 24 | g.edist p x ≤ ENNReal.ofReal r := by |
| 25 | rw [PoincareMT.rescaledMetric_edist, ENNReal.ofReal_mul (Real.sqrt_nonneg a)] |
| 26 | rw [mul_comm (ENNReal.ofReal (Real.sqrt a)) (g.edist p x), |
| 27 | mul_comm (ENNReal.ofReal (Real.sqrt a)) (ENNReal.ofReal r)] |
| 28 | exact ENNReal.mul_le_mul_iff_left (by positivity) ENNReal.ofReal_ne_top |
| 29 | |
| 30 | /-- Simultaneous actual metric and equation scaling retains corner geometry |
| 31 | and weighted ambient-ball concentration through the same fiber equivalence. -/ |
| 32 | theorem exists_scaled_openFiber_weighted_corner_geometry |
| 33 | {m k : ℕ} {M : Type*} [TopologicalSpace M] [T3Space M] |
| 34 | [MeasurableSpace M] [BorelSpace M] |
| 35 | [ChartedSpace (EuclideanSpace ℝ (Fin (m+k))) M] |
| 36 | [IsManifold (𝓡 (m+k)) ∞ M] |
| 37 | (g : RiemannianMetric (m+k) M) (D : LeviCivitaData g) |
| 38 | (hc : MetricComplete g) |
| 39 | (hsec : ∀ x (v w : TangentSpace (𝓡 (m+k)) x), -1 ≤ D.sectionalCurvature x v w) |
| 40 | (f h : Fin k → M → ℝ) |
| 41 | (hf : ∀ i, ContMDiff (𝓡 (m+k)) 𝓘(ℝ, ℝ) ∞ (f i)) |
| 42 | (hh : ∀ i, ContMDiff (𝓡 (m+k)) 𝓘(ℝ, ℝ) ∞ (h i)) |
| 43 | (U : Opens M) {δ H : ℝ} |
| 44 | (hunit : ∀ x ∈ U, ∀ i, |
| 45 | g.tangentNorm x (D.gradient (f i) x) ≤ 1 ∧ |
| 46 | g.tangentNorm x (D.gradient (h i) x) ≤ 1) |
| 47 | (hpair : ∀ x ∈ U, ∀ i, |
| 48 | g.inner x (D.gradient (f i) x) (D.gradient (h i) x) ≤ -1+2*δ) |
| 49 | (hcross : ∀ x ∈ U, ∀ i j, i ≠ j → |
| 50 | |g.inner x (D.gradient (f i) x) (D.gradient (f j) x)| ≤ δ ∧ |
| 51 | |g.inner x (D.gradient (f i) x) (D.gradient (h j) x)| ≤ δ ∧ |
| 52 | |g.inner x (D.gradient (h i) x) (D.gradient (f j) x)| ≤ δ ∧ |
| 53 | |g.inner x (D.gradient (h i) x) (D.gradient (h j) x)| ≤ δ) |
| 54 | (htight : ∀ x ∈ U, ∀ i j, i ≠ j → |
| 55 | g.inner x (D.gradient (f i) x) (D.gradient (f j) x) ≤ 0) |
| 56 | (hhess : ∀ x ∈ U, ∀ i z, |
| 57 | D.hessian (f i) x z z ≤ H*g.inner x z z ∧ |
| 58 | D.hessian (h i) x z z ≤ H*g.inner x z z) |
| 59 | (v : Fin k → ℝ) (hm : 2 ≤ m) {a : ℝ} (ha : 1 ≤ a) : |
| 60 | let P := fun x i => f i x |
| 61 | let hP : ContMDiff (𝓡 (m+k)) 𝓘(ℝ, Fin k → ℝ) ∞ P := contMDiff_pi_space.mpr hf |
| 62 | ∀ hreg : ∀ x ∈ U, Surjective |
| 63 | (mfderiv (𝓡 (m+k)) 𝓘(ℝ, Fin k → ℝ) P x), |
| 64 | let G := PoincareMT.rescaledMetric g a (zero_lt_one.trans_le ha) |
| 65 | let DG := PoincareMT.rescaledMetric_connection g D a (zero_lt_one.trans_le ha) |
| 66 | let fs := fun i x => Real.sqrt a * f i x |
| 67 | let hs := fun i x => Real.sqrt a * h i x |
| 68 | let Ps := fun x => Real.sqrt a • P x |
| 69 | let vs := Real.sqrt a • v |
| 70 | MetricComplete G ∧ |
| 71 | (∀ x (z w : TangentSpace (𝓡 (m+k)) x), -1 ≤ DG.sectionalCurvature x z w) ∧ |
| 72 | (∀ i, ContMDiff (𝓡 (m+k)) 𝓘(ℝ, ℝ) ∞ (fs i)) ∧ |
| 73 | (∀ i, ContMDiff (𝓡 (m+k)) 𝓘(ℝ, ℝ) ∞ (hs i)) ∧ |
| 74 | (∀ x ∈ U, ∀ i, |
| 75 | G.tangentNorm x (DG.gradient (fs i) x) ≤ 1 ∧ |
| 76 | G.tangentNorm x (DG.gradient (hs i) x) ≤ 1) ∧ |
| 77 | (∀ x ∈ U, ∀ i, |
| 78 | G.inner x (DG.gradient (fs i) x) (DG.gradient (hs i) x) ≤ -1+2*δ) ∧ |
| 79 | (∀ x ∈ U, ∀ i j, i ≠ j → |
| 80 | |G.inner x (DG.gradient (fs i) x) (DG.gradient (fs j) x)| ≤ δ ∧ |
| 81 | |G.inner x (DG.gradient (fs i) x) (DG.gradient (hs j) x)| ≤ δ ∧ |
| 82 | |G.inner x (DG.gradient (hs i) x) (DG.gradient (fs j) x)| ≤ δ ∧ |
| 83 | |G.inner x (DG.gradient (hs i) x) (DG.gradient (hs j) x)| ≤ δ) ∧ |
| 84 | (∀ x ∈ U, ∀ i j, i ≠ j → |
| 85 | G.inner x (DG.gradient (fs i) x) (DG.gradient (fs j) x) ≤ 0) ∧ |
| 86 | (∀ x ∈ U, ∀ i z, |
| 87 | DG.hessian (fs i) x z z ≤ (H/Real.sqrt a)*G.inner x z z ∧ |
| 88 | DG.hessian (hs i) x z z ≤ (H/Real.sqrt a)*G.inner x z z) ∧ |
| 89 | ∃ hPs : ContMDiff (𝓡 (m+k)) 𝓘(ℝ, Fin k → ℝ) ∞ Ps, |
| 90 | ∃ hregS : ∀ x ∈ U, Surjective |
| 91 | (mfderiv (𝓡 (m+k)) 𝓘(ℝ, Fin k → ℝ) Ps x), |
| 92 | letI : Fact (Module.finrank ℝ (EuclideanSpace ℝ (Fin (m+k))) = m+k) := |
| 93 | ⟨finrank_euclideanSpace_fin⟩ |
| 94 | letI := openFiberChartedSpace (m := m) hP U hreg v |
| 95 | letI := isManifold_openFiber (m := m) hP U hreg v |
| 96 | letI := openFiberChartedSpace (m := m) hPs U hregS vs |
| 97 | letI := isManifold_openFiber (m := m) hPs U hregS vs |
| 98 | let gOld := g.openRegularFiberMetric hP U hreg v |
| 99 | let gNew := G.openRegularFiberMetric hPs U hregS vs |
| 100 | ∃ e : openFiber P U v ≃ₘ⟮𝓡 m, 𝓡 m⟯ openFiber Ps U vs, |
| 101 | (∀ x, openFiberIncl Ps U vs (e x) = openFiberIncl P U v x) ∧ |
| 102 | (∀ (x : openFiber P U v) (z w : TangentSpace (𝓡 m) x), |
| 103 | gNew.inner (e x) (mfderiv (𝓡 m) (𝓡 m) e x z) |
| 104 | (mfderiv (𝓡 m) (𝓡 m) e x w) = a*gOld.inner x z w) ∧ |
| 105 | (∀ x y, gNew.edist (e x) (e y) = |
| 106 | ENNReal.ofReal (Real.sqrt a)*gOld.edist x y) ∧ |
| 107 | (∀ (p : M) (r : ℝ), |
| 108 | e '' {x | openFiberIncl P U v x ∈ g.ball p r} = |
| 109 | {y | openFiberIncl Ps U vs y ∈ G.ball p (Real.sqrt a*r)}) ∧ |
| 110 | (∀ η : ℝ, |
| 111 | (∀ x : openFiber P U v, ∀ y : M, |
| 112 | g.edist (openFiberIncl P U v x) y ≤ ENNReal.ofReal η → y ∈ U) → |
| 113 | ∀ x : openFiber Ps U vs, ∀ y : M, |
| 114 | G.edist (openFiberIncl Ps U vs x) y ≤ ENNReal.ofReal (Real.sqrt a*η) → |
| 115 | y ∈ U) ∧ |
| 116 | ∀ K : openFiber P U v → ℝ, Continuous K → (∀ x, 0 ≤ K x) → |
| 117 | (∀ x (z w : TangentSpace (𝓡 m) x), |
| 118 | -K x ≤ gOld.leviCivitaData.sectionalCurvature x z w) → |
| 119 | let Knew := fun y => a⁻¹*K (e.symm y) |
| 120 | Continuous Knew ∧ (∀ y, 0 ≤ Knew y) ∧ |
| 121 | (∀ y (z w : TangentSpace (𝓡 m) y), |
| 122 | -Knew y ≤ gNew.leviCivitaData.sectionalCurvature y z w) ∧ |
| 123 | ∀ (p : M) (r R : ℝ), |
| 124 | g.openFiberWeightedAmbientBallRatio hP U hreg v K p r R ≤ |
| 125 | G.openFiberWeightedAmbientBallRatio hPs U hregS vs Knew p |
| 126 | (Real.sqrt a*r) (Real.sqrt a*R) := by |
| 127 | dsimp only |
| 128 | intro hreg |
| 129 | let P := fun x i => f i x |
| 130 | let hP : ContMDiff (𝓡 (m+k)) 𝓘(ℝ, Fin k → ℝ) ∞ P := |
| 131 | contMDiff_pi_space.mpr hf |
| 132 | have hap : 0 < a := zero_lt_one.trans_le ha |
| 133 | let G := PoincareMT.rescaledMetric g a hap |
| 134 | let DG := PoincareMT.rescaledMetric_connection g D a hap |
| 135 | let Ps := fun x => Real.sqrt a • P x |
| 136 | let vs := Real.sqrt a • v |
| 137 | have hcG : MetricComplete G := PoincareMT.metricComplete_rescaledMetric g a hap hc |
| 138 | have hsecG : ∀ x (z w : TangentSpace (𝓡 (m+k)) x), |
| 139 | -1 ≤ DG.sectionalCurvature x z w := by |
| 140 | intro x z w |
| 141 | change -1 ≤ (PoincareMT.rescaledMetric_connection g D a hap).sectionalCurvature x z w |
| 142 | rw [PoincareMT.rescaledMetric_sectionalCurvature] |
| 143 | have hl := mul_le_mul_of_nonneg_left (hsec x z w) (inv_nonneg.mpr hap.le) |
| 144 | have hi : a⁻¹ ≤ 1 := (inv_le_one₀ hap).mpr ha |
| 145 | nlinarith |
| 146 | obtain ⟨hfs, hhs, hunitS, hpairS, hcrossS, htightS, hhessS⟩ := |
| 147 | D.rescaled_smooth_strainer_pair_bounds f h hf hh hunit hpair hcross htight hhess hap |
| 148 | refine ⟨hcG, hsecG, hfs, hhs, hunitS, hpairS, hcrossS, htightS, hhessS, ?_⟩ |
| 149 | obtain ⟨hPs, hregS, hdata⟩ := |
| 150 | g.exists_scaled_openFiber_weighted_ambientBall_equivalence hP U hreg v hm ha |
| 151 | refine ⟨hPs, hregS, ?_⟩ |
| 152 | let : Fact (Module.finrank ℝ (EuclideanSpace ℝ (Fin (m+k))) = m+k) := |
| 153 | ⟨finrank_euclideanSpace_fin⟩ |
| 154 | let := openFiberChartedSpace (m := m) hP U hreg v |
| 155 | let := isManifold_openFiber (m := m) hP U hreg v |
| 156 | let := openFiberChartedSpace (m := m) hPs U hregS vs |
| 157 | let := isManifold_openFiber (m := m) hPs U hregS vs |
| 158 | let gOld := g.openRegularFiberMetric hP U hreg v |
| 159 | let gNew := G.openRegularFiberMetric hPs U hregS vs |
| 160 | obtain ⟨e, hinc, hmetric, hdist, _, himage, hratio⟩ := hdata |
| 161 | refine ⟨e, hinc, hmetric, hdist, himage, ?_, ?_⟩ |
| 162 | · intro η hbuffer x y hxy |
| 163 | obtain ⟨x, rfl⟩ := e.surjective x |
| 164 | change G.edist (openFiberIncl Ps U vs (e x)) y ≤ ENNReal.ofReal (Real.sqrt a*η) at hxy |
| 165 | rw [hinc] at hxy |
| 166 | exact hbuffer x y ((scaled_closedBall_iff g hap (openFiberIncl P U v x) y η).mp hxy) |
| 167 | · intro K hK hK0 hKsec |
| 168 | refine ⟨continuous_const.mul (hK.comp e.symm.continuous), |
| 169 | (fun y => mul_nonneg (inv_nonneg.mpr hap.le) (hK0 (e.symm y))), |
| 170 | ?_, ?_⟩ |
| 171 | · exact gOld.leviCivitaData.sectionalCurvature_lower_bound_of_metric_similarity |
| 172 | gNew.leviCivitaData e hap hmetric hKsec |
| 173 | · intro p r R |
| 174 | exact hratio K hK0 p r R |
| 175 | |
| 176 | |
| 177 | end PoincareMT.RiemannianMetric |
| 178 |