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.Basic |
| 2 | import PoincareLib.Geometry.RicciFlow.Curvature.Estimates.QuadraticRicci |
| 3 | import Mathlib.Analysis.Calculus.Deriv.MeanValue |
| 4 | import Mathlib.Analysis.SpecialFunctions.ExpDeriv |
| 5 | |
| 6 | /-! Adapted from Mapher06/Poincare-MorganTian, `PoincareMT/Proofs/M04/MetricComparison.lean`, |
| 7 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. See the curvature import record under |
| 8 | `references/ricci-flow/mapher/curvature/`. -/ |
| 9 | |
| 10 | /-! |
| 11 | # Metric comparison under a uniform curvature bound |
| 12 | |
| 13 | Morgan-Tian Lemma 3.15, printed p. 42, with explicit exponential constants |
| 14 | for the full four-covariant curvature norm. No completeness is needed. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open scoped Manifold ContDiff Bundle |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.RicciFlow |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | |
| 28 | /-- A spacetime curvature bound compares the metric quadratic forms exponentially. -/ |
| 29 | theorem metric_comparison_of_curvature_bound {J : Set ℝ} |
| 30 | (F : RicciFlow n M J) {s t K : ℝ} (hs : s ∈ J) (ht : t ∈ J) |
| 31 | (hst : s ≤ t) (hK : 0 ≤ K) |
| 32 | (hRm : ∀ τ ∈ Set.Icc s t, ∀ x : M, (F.connection τ).curvatureTensorNorm x ≤ K) |
| 33 | (x : M) (v : TangentSpace (𝓡 n) x) : |
| 34 | Real.exp (-2 * (n : ℝ) * K * (t - s)) * (F.metric s).inner x v v ≤ |
| 35 | (F.metric t).inner x v v ∧ |
| 36 | (F.metric t).inner x v v ≤ |
| 37 | Real.exp (2 * (n : ℝ) * K * (t - s)) * (F.metric s).inner x v v := by |
| 38 | let q := fun τ ↦ (F.metric τ).inner x v v |
| 39 | let c := 2 * (n : ℝ) * K |
| 40 | have hJI : Set.Icc s t ⊆ J := F.interval.out hs ht |
| 41 | have hq0 (τ : ℝ) : 0 ≤ q τ := by |
| 42 | by_cases hv : v = 0 |
| 43 | · simp [q, hv] |
| 44 | · exact (F.metric τ).pos x v hv |>.le |
| 45 | have hqD (τ : ℝ) (hτ : τ ∈ Set.Icc s t) : |
| 46 | HasDerivWithinAt q (-2 * (F.connection τ).ricci x v v) (Set.Icc s t) τ := |
| 47 | (F.equation τ (hJI hτ) x v v).mono hJI |
| 48 | have hBound (τ : ℝ) (hτ : τ ∈ Set.Icc s t) : |
| 49 | -c * q τ ≤ -2 * (F.connection τ).ricci x v v ∧ |
| 50 | -2 * (F.connection τ).ricci x v v ≤ c * q τ := by |
| 51 | have h := (RicciFlowAnalysis.abs_ricci_le_curvatureTensorNorm (F.connection τ) x v).trans |
| 52 | (mul_le_mul_of_nonneg_right |
| 53 | (mul_le_mul_of_nonneg_left (hRm τ hτ x) (Nat.cast_nonneg n)) (hq0 τ)) |
| 54 | have hnK : 0 ≤ (n : ℝ) * K := mul_nonneg (Nat.cast_nonneg n) hK |
| 55 | have h0 := mul_nonneg hnK (hq0 τ) |
| 56 | obtain ⟨hl, hu⟩ := abs_le.mp h |
| 57 | dsimp only [c, q] at * |
| 58 | constructor <;> nlinarith |
| 59 | let p := fun τ ↦ Real.exp (c * (τ - s)) * q τ |
| 60 | let m := fun τ ↦ Real.exp (-(c * (τ - s))) * q τ |
| 61 | have hpD (τ : ℝ) (hτ : τ ∈ Set.Icc s t) : |
| 62 | HasDerivWithinAt p |
| 63 | (Real.exp (c * (τ - s)) * (c * q τ - 2 * (F.connection τ).ricci x v v)) |
| 64 | (Set.Icc s t) τ := by |
| 65 | convert! ((((hasDerivAt_id τ).sub_const s).const_mul c).exp.hasDerivWithinAt.mul |
| 66 | (hqD τ hτ)) using 1 |
| 67 | dsimp only [id, Pi.neg_apply] |
| 68 | ring |
| 69 | have hmD (τ : ℝ) (hτ : τ ∈ Set.Icc s t) : |
| 70 | HasDerivWithinAt m |
| 71 | (Real.exp (-(c * (τ - s))) * (-2 * (F.connection τ).ricci x v v - c * q τ)) |
| 72 | (Set.Icc s t) τ := by |
| 73 | convert! (((((hasDerivAt_id τ).sub_const s).const_mul c).neg.exp.hasDerivWithinAt).mul |
| 74 | (hqD τ hτ)) using 1 |
| 75 | dsimp only [id, Pi.neg_apply] |
| 76 | ring |
| 77 | have hp : MonotoneOn p (Set.Icc s t) := by |
| 78 | apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc s t) |
| 79 | (fun τ hτ ↦ (hpD τ hτ).continuousWithinAt) |
| 80 | (fun τ hτ ↦ (hpD τ (interior_subset hτ)).mono interior_subset) |
| 81 | intro τ hτ |
| 82 | apply mul_nonneg (Real.exp_pos _).le |
| 83 | have h := (hBound τ (interior_subset hτ)).1 |
| 84 | linarith |
| 85 | have hm : AntitoneOn m (Set.Icc s t) := by |
| 86 | apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc s t) |
| 87 | (fun τ hτ ↦ (hmD τ hτ).continuousWithinAt) |
| 88 | (fun τ hτ ↦ (hmD τ (interior_subset hτ)).mono interior_subset) |
| 89 | intro τ hτ |
| 90 | apply mul_nonpos_of_nonneg_of_nonpos (Real.exp_pos _).le |
| 91 | have h := (hBound τ (interior_subset hτ)).2 |
| 92 | linarith |
| 93 | have hp' : q s ≤ Real.exp (c * (t - s)) * q t := by |
| 94 | simpa only [p, sub_self, mul_zero, Real.exp_zero, one_mul] using |
| 95 | hp ⟨le_rfl, hst⟩ ⟨hst, le_rfl⟩ hst |
| 96 | have hm' : Real.exp (-(c * (t - s))) * q t ≤ q s := by |
| 97 | simpa only [m, sub_self, mul_zero, neg_zero, Real.exp_zero, one_mul] using |
| 98 | hm ⟨le_rfl, hst⟩ ⟨hst, le_rfl⟩ hst |
| 99 | constructor |
| 100 | · have h := mul_le_mul_of_nonneg_left hp' (Real.exp_pos (-(c * (t - s)))).le |
| 101 | have he : Real.exp (-(c * (t - s))) * Real.exp (c * (t - s)) = 1 := by |
| 102 | rw [← Real.exp_add, neg_add_cancel, Real.exp_zero] |
| 103 | rw [← mul_assoc, he, one_mul] at h |
| 104 | simpa only [c, q, neg_mul] using h |
| 105 | · have h := mul_le_mul_of_nonneg_left hm' (Real.exp_pos (c * (t - s))).le |
| 106 | have he : Real.exp (c * (t - s)) * Real.exp (-(c * (t - s))) = 1 := by |
| 107 | rw [← Real.exp_add, add_neg_cancel, Real.exp_zero] |
| 108 | rw [← mul_assoc, he, one_mul] at h |
| 109 | exact h |
| 110 | |
| 111 | end PoincareMT.RicciFlow |