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 | |
| 3 | /-! |
| 4 | # Distance slabs with explicit scale bounds |
| 5 | |
| 6 | A fixed fraction of the radial scale suffices for the smoothing length. |
| 7 | The resulting Hessian bound is at most five divided by that scale. |
| 8 | Reference: Petrunin (2009), Section 4.5, author manuscript p. 9. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | open scoped Manifold ContDiff Bundle |
| 16 | |
| 17 | namespace PoincareMT.RiemannianMetric |
| 18 | |
| 19 | private theorem slab_hessian_mul_radius_le {r : ℝ} (hr : 0 < r) (hr1 : r ≤ 1) : |
| 20 | (4 / (3 * (r / 2 - r / 64)) + (3 * r + r / 64) / 4 + 1) * r ≤ 5 := by |
| 21 | have hsq : r ^ 2 ≤ 1 := by nlinarith |
| 22 | have heq : (4 / (3 * (r / 2 - r / 64)) + (3 * r + r / 64) / 4 + 1) * r = |
| 23 | 256 / 93 + (193 : ℝ) / 256 * r ^ 2 + r := by |
| 24 | field_simp |
| 25 | ring |
| 26 | rw [heq] |
| 27 | nlinarith |
| 28 | |
| 29 | /-- Local ascent on a buffered annulus constructs a wide smooth slab with |
| 30 | approximation error `r/65536`, gradient in `[1/4,2]`, and Hessian at most `5/r`. -/ |
| 31 | theorem exists_proper_regular_slab_with_scale_bounds |
| 32 | {n : ℕ} {M : Type*} [TopologicalSpace M] [T3Space M] [PreconnectedSpace M] |
| 33 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 34 | (g : RiemannianMetric n M) (D : LeviCivitaData g) (hc : MetricComplete g) |
| 35 | (hsec : ∀ x : M, ∀ v w : TangentSpace (𝓡 n) x, -1 ≤ D.sectionalCurvature x v w) |
| 36 | (p : M) {r : ℝ} (hr : 0 < r) (hr1 : r ≤ 1) |
| 37 | (hascent : ∀ y : M, r / 2 < (g.edist p y).toReal → |
| 38 | (g.edist p y).toReal < 3 * r → ∀ s : ℝ, 0 < s → |
| 39 | ∃ z : M, (g.edist y z).toReal < s ∧ |
| 40 | (1 : ℝ) / 2 * (g.edist y z).toReal < |
| 41 | (g.edist p z).toReal - (g.edist p y).toReal) : |
| 42 | ∃ f : M → ℝ, ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ f ∧ |
| 43 | IsProperMap ((Ioo (9 * r / 8) (15 * r / 8)).restrictPreimage f) ∧ |
| 44 | (∀ x : M, f x ∈ Ioo (9 * r / 8) (15 * r / 8) → |
| 45 | mfderiv (𝓡 n) 𝓘(ℝ, ℝ) f x ≠ 0) ∧ |
| 46 | (∀ x : M, f x ∈ Ioo (9 * r / 8) (15 * r / 8) → |
| 47 | r < (g.edist p x).toReal ∧ (g.edist p x).toReal < 2 * r) ∧ |
| 48 | ∀ x : M, r < (g.edist p x).toReal → (g.edist p x).toReal < 2 * r → |
| 49 | |f x - (g.edist p x).toReal| ≤ r / 65536 ∧ |
| 50 | (1 : ℝ) / 4 ≤ g.tangentNorm x (D.gradient f x) ∧ |
| 51 | g.tangentNorm x (D.gradient f x) ≤ 2 ∧ |
| 52 | ∀ v : TangentSpace (𝓡 n) x, D.hessian f x v v ≤ (5 / r) * g.inner x v v := by |
| 53 | let : ConnectedSpace M := { toNonempty := ⟨p⟩ } |
| 54 | let H := 4 / (3 * (r / 2 - r / 64)) + (3 * r + r / 64) / 4 + 1 |
| 55 | have hHr : H * r ≤ 5 := slab_hessian_mul_radius_le hr hr1 |
| 56 | have herror : 2 * (r / 65536) / (r / 64) + H * (r / 64) / 2 < 1 / 4 := by |
| 57 | have he : 2 * (r / 65536) / (r / 64) = (1 : ℝ) / 512 := by |
| 58 | field_simp |
| 59 | norm_num |
| 60 | rw [he] |
| 61 | nlinarith only [hHr] |
| 62 | obtain ⟨f, hf, hproper, hreg, hband, hbound⟩ := |
| 63 | g.exists_proper_regular_slab_of_local_distance_ascent D hc (K := 1) zero_le_one hsec p |
| 64 | (r₀ := r / 2) (r₁ := r) (R₀ := 2 * r) (R₁ := 3 * r) |
| 65 | (T := r / 64) (ε := r / 65536) (η := 1) (c := (1 : ℝ) / 2) |
| 66 | (a := 9 * r / 8) (b := 15 * r / 8) |
| 67 | (by positivity) (by linarith) (by linarith) (by linarith) (by linarith) |
| 68 | (by positivity) zero_lt_one (by norm_num) (by positivity) (by linarith) |
| 69 | (by linarith) (by linarith) |
| 70 | (by simpa only [one_mul] using herror.trans (by norm_num : (1 : ℝ) / 4 < 1 / 2)) |
| 71 | (fun y hy hy' => hascent y (by linarith) (by linarith)) |
| 72 | refine ⟨f, hf, hproper, hreg, hband, ?_⟩ |
| 73 | intro x hx hx' |
| 74 | obtain ⟨hvalue, hlower, hupper, hhess⟩ := hbound x hx hx' |
| 75 | simp only [one_mul] at hlower hhess |
| 76 | refine ⟨hvalue, ?_, by simpa only [one_add_one_eq_two] using hupper, ?_⟩ |
| 77 | · apply le_trans _ hlower |
| 78 | change (1 : ℝ) / 4 ≤ 1 / 2 - 2 * (r / 65536) / (r / 64) - H * (r / 64) / 2 |
| 79 | linarith only [herror] |
| 80 | · intro v |
| 81 | apply (hhess v).trans |
| 82 | apply mul_le_mul_of_nonneg_right _ (by |
| 83 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 84 | ⟨g.toRiemannianMetric⟩ |
| 85 | change 0 ≤ inner ℝ v v |
| 86 | exact real_inner_self_nonneg) |
| 87 | change H ≤ 5 / r |
| 88 | exact (le_div_iff₀ hr).mpr hHr |
| 89 | |
| 90 | end PoincareMT.RiemannianMetric |