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.Riemannian.Distance.Smoothing.Directional.Ascent |
| 2 | import PoincareLib.Geometry.Curvature.Integral.Induction.SlabNormalization |
| 3 | |
| 4 | /-! |
| 5 | # Regular distance slabs with nearly unit gradient |
| 6 | |
| 7 | High local distance ascent and smoothing at a delta-dependent scale produce |
| 8 | a proper regular slab whose gradient norm is between `1 - delta` and one. |
| 9 | The Hessian bound remains five divided by the radial scale. |
| 10 | |
| 11 | Reference: Petrunin (2009), Definition 3.1, p. 5, and Section 4.5, p. 9. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.RiemannianMetric |
| 23 | |
| 24 | private theorem tight_scale_hessian_mul_radius_le {r δ : ℝ} |
| 25 | (hr : 0 < r) (hr1 : r ≤ 1) (hδ : 0 < δ) (hδquarter : δ ≤ 1 / 4) : |
| 26 | (4 / (3 * (r / 2 - δ * r / 1024)) + |
| 27 | (3 * r + δ * r / 1024) / 4 + δ / 8) * r ≤ 5 := by |
| 28 | have hT : δ * r / 1024 ≤ r / 64 := by |
| 29 | nlinarith [mul_le_mul_of_nonneg_right hδquarter hr.le] |
| 30 | have hden : 0 < 3 * (r / 2 - δ * r / 1024) := by linarith |
| 31 | have hfirst : 4 / (3 * (r / 2 - δ * r / 1024)) * r ≤ 3 := by |
| 32 | rw [div_mul_eq_mul_div] |
| 33 | apply (div_le_iff₀ hden).mpr |
| 34 | linarith |
| 35 | have hsq : r ^ 2 ≤ 1 := by nlinarith |
| 36 | have hsecond : (3 * r + δ * r / 1024) / 4 * r ≤ 1 := by |
| 37 | nlinarith [mul_le_mul_of_nonneg_right hT hr.le] |
| 38 | have hη : δ / 8 * r ≤ 1 := by |
| 39 | nlinarith [mul_le_mul_of_nonneg_right hδquarter hr.le] |
| 40 | nlinarith only [hfirst, hsecond, hη] |
| 41 | |
| 42 | private theorem tight_scale_losses {r δ : ℝ} |
| 43 | (hr : 0 < r) (hr1 : r ≤ 1) (hδ : 0 < δ) (hδquarter : δ ≤ 1 / 4) : |
| 44 | let T := δ * r / 1024 |
| 45 | let ε := δ ^ 2 * r / 1048576 |
| 46 | let H := 4 / (3 * (r / 2 - T)) + (3 * r + T) / 4 + δ / 8 |
| 47 | ε < r / 8 ∧ 2 * ε / T + H * T / 2 < 1 - δ / 8 ∧ |
| 48 | (1 - δ) * (1 + δ / 8) ≤ 1 - δ / 8 - 2 * ε / T - H * T / 2 := by |
| 49 | let T := δ * r / 1024 |
| 50 | let ε := δ ^ 2 * r / 1048576 |
| 51 | let H := 4 / (3 * (r / 2 - T)) + (3 * r + T) / 4 + δ / 8 |
| 52 | have hH : H * r ≤ 5 := tight_scale_hessian_mul_radius_le hr hr1 hδ hδquarter |
| 53 | have herror : 2 * ε / T = δ / 512 := by |
| 54 | dsimp only [ε, T] |
| 55 | field_simp |
| 56 | ring |
| 57 | have hHT : H * T / 2 ≤ 5 * δ / 2048 := by |
| 58 | have h := mul_le_mul_of_nonneg_right hH hδ.le |
| 59 | dsimp only [T] |
| 60 | nlinarith only [h] |
| 61 | have hloss : 2 * ε / T + H * T / 2 ≤ 9 * δ / 2048 := by |
| 62 | rw [herror] |
| 63 | linarith |
| 64 | have hε : ε < r / 8 := by |
| 65 | have hsq : δ ^ 2 ≤ 1 / 16 := by nlinarith |
| 66 | have h := mul_le_mul_of_nonneg_right hsq hr.le |
| 67 | dsimp only [ε] |
| 68 | nlinarith only [h, hr] |
| 69 | exact ⟨hε, by change 2 * ε / T + H * T / 2 < _; linarith, |
| 70 | by change (1 - δ) * (1 + δ / 8) ≤ 1 - δ / 8 - 2 * ε / T - H * T / 2 |
| 71 | nlinarith [sq_nonneg δ]⟩ |
| 72 | |
| 73 | /-- High local ascent constructs a proper regular slab whose actual gradient |
| 74 | norm is nearly one throughout the full radial core. -/ |
| 75 | theorem exists_proper_regular_slab_with_near_unit_gradient |
| 76 | {n : ℕ} {M : Type u} [TopologicalSpace M] [T3Space M] [PreconnectedSpace M] |
| 77 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 78 | (g : RiemannianMetric n M) (D : LeviCivitaData g) (hc : MetricComplete g) |
| 79 | (hsec : ∀ x : M, ∀ v w : TangentSpace (𝓡 n) x, |
| 80 | -1 ≤ D.sectionalCurvature x v w) |
| 81 | (p : M) {r δ : ℝ} (hr : 0 < r) (hr1 : r ≤ 1) |
| 82 | (hδ : 0 < δ) (hδquarter : δ ≤ 1 / 4) |
| 83 | (hascent : ∀ y : M, r / 2 < (g.edist p y).toReal → |
| 84 | (g.edist p y).toReal < 3 * r → ∀ s : ℝ, 0 < s → |
| 85 | ∃ z : M, (g.edist y z).toReal < s ∧ |
| 86 | (1 - δ / 8) * (g.edist y z).toReal < |
| 87 | (g.edist p z).toReal - (g.edist p y).toReal) : |
| 88 | let τ := 1 / (1 + δ / 8) |
| 89 | let ε := δ ^ 2 * r / 1048576 |
| 90 | let I := Ioo (τ * (9 * r / 8)) (τ * (15 * r / 8)) |
| 91 | ∃ f : M → ℝ, ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ f ∧ |
| 92 | IsProperMap (I.restrictPreimage f) ∧ |
| 93 | (∀ x : M, f x ∈ I → mfderiv (𝓡 n) 𝓘(ℝ, ℝ) f x ≠ 0) ∧ |
| 94 | (∀ x : M, f x ∈ I → |
| 95 | r < (g.edist p x).toReal ∧ (g.edist p x).toReal < 2 * r) ∧ |
| 96 | ∀ x : M, r < (g.edist p x).toReal → (g.edist p x).toReal < 2 * r → |
| 97 | |f x - τ * (g.edist p x).toReal| ≤ τ * ε ∧ |
| 98 | 1 - δ ≤ g.tangentNorm x (D.gradient f x) ∧ |
| 99 | g.tangentNorm x (D.gradient f x) ≤ 1 ∧ |
| 100 | ∀ v : TangentSpace (𝓡 n) x, |
| 101 | D.hessian f x v v ≤ (5 / r) * g.inner x v v := by |
| 102 | let : ConnectedSpace M := { toNonempty := ⟨p⟩ } |
| 103 | let T := δ * r / 1024 |
| 104 | let ε := δ ^ 2 * r / 1048576 |
| 105 | let η := δ / 8 |
| 106 | let H := 4 / (3 * (r / 2 - T)) + (3 * r + T) / 4 + η |
| 107 | let L := 1 - δ / 8 - 2 * ε / T - H * T / 2 |
| 108 | let τ := 1 / (1 + δ / 8) |
| 109 | have hT : 0 < T := by dsimp only [T]; positivity |
| 110 | have hTsmall : T ≤ r / 64 := by |
| 111 | dsimp only [T] |
| 112 | nlinarith [mul_le_mul_of_nonneg_right hδquarter hr.le] |
| 113 | have hTr : T < r / 2 := by linarith |
| 114 | have hε : 0 < ε := by dsimp only [ε]; positivity |
| 115 | have hη : 0 < η := by dsimp only [η]; positivity |
| 116 | have hH : H * r ≤ 5 := tight_scale_hessian_mul_radius_le hr hr1 hδ hδquarter |
| 117 | have hHpos : 0 < H := by dsimp only [H]; positivity |
| 118 | have hHle : H ≤ 5 / r := (le_div_iff₀ hr).mpr hH |
| 119 | have hden : 0 < 1 + δ / 8 := by positivity |
| 120 | have hτ : 0 < τ := by dsimp only [τ]; positivity |
| 121 | have hτle : τ ≤ 1 := by |
| 122 | dsimp only [τ] |
| 123 | exact (div_le_one hden).mpr (by linarith) |
| 124 | have hloss := tight_scale_losses hr hr1 hδ hδquarter |
| 125 | change ε < r / 8 ∧ 2 * ε / T + H * T / 2 < 1 - δ / 8 ∧ |
| 126 | (1 - δ) * (1 + δ / 8) ≤ L at hloss |
| 127 | have hlower : 1 - δ ≤ τ * L := by |
| 128 | dsimp only [τ] |
| 129 | rw [one_div_mul_eq_div] |
| 130 | exact (le_div_iff₀ hden).mpr hloss.2.2 |
| 131 | obtain ⟨f, hf, hproper, _, hband, hbounds⟩ := |
| 132 | g.exists_proper_regular_slab_of_local_distance_ascent D hc (K := 1) |
| 133 | zero_le_one hsec p (r₀ := r / 2) (r₁ := r) (R₀ := 2 * r) (R₁ := 3 * r) |
| 134 | (T := T) (ε := ε) (η := η) (c := 1 - δ / 8) |
| 135 | (a := 9 * r / 8) (b := 15 * r / 8) |
| 136 | hT hTr (by linarith) (by linarith) (by linarith) hε hη |
| 137 | (by linarith) (by positivity) (by linarith) (by linarith [hloss.1]) |
| 138 | (by linarith [hloss.1]) (by simpa only [one_mul] using hloss.2.1) |
| 139 | (fun y hy hy' => hascent y (by linarith) (by linarith)) |
| 140 | let F := fun x => τ * f x |
| 141 | have hF : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ F := contMDiff_const.mul hf |
| 142 | have hgrad (x : M) : D.gradient F x = τ • D.gradient f x := by |
| 143 | apply (g.inner_isInvertible x).injective |
| 144 | ext v |
| 145 | rw [D.inner_gradient, mvfderiv_const_mul] |
| 146 | simp only [map_smul, smul_apply, smul_eq_mul, D.inner_gradient] |
| 147 | have hnorm (x : M) : |
| 148 | g.tangentNorm x (D.gradient F x) = τ * g.tangentNorm x (D.gradient f x) := by |
| 149 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 150 | ⟨g.toRiemannianMetric⟩ |
| 151 | rw [hgrad] |
| 152 | change ‖τ • D.gradient f x‖ = τ * ‖D.gradient f x‖ |
| 153 | rw [norm_smul, Real.norm_eq_abs, abs_of_pos hτ] |
| 154 | let I := Ioo (τ * (9 * r / 8)) (τ * (15 * r / 8)) |
| 155 | have hbandF (x : M) (hx : F x ∈ I) : |
| 156 | r < (g.edist p x).toReal ∧ (g.edist p x).toReal < 2 * r := by |
| 157 | apply hband x |
| 158 | simpa only [F, I, mem_Ioo, mul_lt_mul_iff_right₀ hτ] using hx |
| 159 | have hboundsF (x : M) (hx : r < (g.edist p x).toReal) |
| 160 | (hx' : (g.edist p x).toReal < 2 * r) : |
| 161 | |F x - τ * (g.edist p x).toReal| ≤ τ * ε ∧ |
| 162 | 1 - δ ≤ g.tangentNorm x (D.gradient F x) ∧ |
| 163 | g.tangentNorm x (D.gradient F x) ≤ 1 ∧ |
| 164 | ∀ v : TangentSpace (𝓡 n) x, |
| 165 | D.hessian F x v v ≤ (5 / r) * g.inner x v v := by |
| 166 | obtain ⟨hvalue, hlow, hupp, hhess⟩ := hbounds x hx hx' |
| 167 | simp only [one_mul] at hlow hhess |
| 168 | change L ≤ g.tangentNorm x (D.gradient f x) at hlow |
| 169 | refine ⟨?_, ?_, ?_, ?_⟩ |
| 170 | · change |τ * f x - τ * (g.edist p x).toReal| ≤ τ * ε |
| 171 | rw [← mul_sub, abs_mul, abs_of_pos hτ] |
| 172 | exact mul_le_mul_of_nonneg_left hvalue hτ.le |
| 173 | · rw [hnorm] |
| 174 | exact hlower.trans (mul_le_mul_of_nonneg_left hlow hτ.le) |
| 175 | · rw [hnorm] |
| 176 | calc |
| 177 | _ ≤ τ * (1 + η) := mul_le_mul_of_nonneg_left hupp hτ.le |
| 178 | _ = 1 := by dsimp only [τ, η]; field_simp |
| 179 | · intro v |
| 180 | change D.hessian (fun y => τ * f y) x v v ≤ _ |
| 181 | rw [D.hessian_const_mul] |
| 182 | have hv : 0 ≤ g.inner x v v := by |
| 183 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 184 | ⟨g.toRiemannianMetric⟩ |
| 185 | change 0 ≤ inner ℝ v v |
| 186 | exact real_inner_self_nonneg |
| 187 | calc |
| 188 | _ ≤ τ * (H * g.inner x v v) := mul_le_mul_of_nonneg_left (hhess v) hτ.le |
| 189 | _ = (τ * H) * g.inner x v v := by ring |
| 190 | _ ≤ (5 / r) * g.inner x v v := mul_le_mul_of_nonneg_right |
| 191 | ((mul_le_mul_of_nonneg_right hτle hHpos.le).trans (by simpa using hHle)) hv |
| 192 | have hproperF : IsProperMap (I.restrictPreimage F) := by |
| 193 | let target : Ioo (9 * r / 8) (15 * r / 8) ≃ₜ I := |
| 194 | (Homeomorph.mulLeft₀ τ hτ.ne').subtype (fun x => by |
| 195 | change x ∈ Ioo (9 * r / 8) (15 * r / 8) ↔ |
| 196 | τ * x ∈ Ioo (τ * (9 * r / 8)) (τ * (15 * r / 8)) |
| 197 | simp only [mem_Ioo, mul_lt_mul_iff_right₀ hτ]) |
| 198 | let source : (F ⁻¹' I) ≃ₜ (f ⁻¹' Ioo (9 * r / 8) (15 * r / 8)) := |
| 199 | (Homeomorph.refl M).subtype (fun x => by |
| 200 | change τ * f x ∈ Ioo (τ * (9 * r / 8)) (τ * (15 * r / 8)) ↔ |
| 201 | f x ∈ Ioo (9 * r / 8) (15 * r / 8) |
| 202 | simp only [mem_Ioo, mul_lt_mul_iff_right₀ hτ]) |
| 203 | exact (target.isProperMap.comp hproper).comp source.isProperMap |
| 204 | refine ⟨F, hF, hproperF, ?_, hbandF, hboundsF⟩ |
| 205 | intro x hx |
| 206 | apply (g.tangentNorm_gradient_pos_iff F x).mp |
| 207 | exact (by linarith : 0 < 1 - δ).trans_le |
| 208 | (hboundsF x (hbandF x hx).1 (hbandF x hx).2).2.1 |
| 209 | |
| 210 | end PoincareMT.RiemannianMetric |