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.Analysis.Parabolic.Maximum.Compact |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Imports.Analysis.Parabolic.Maximum.Compact |
| 3 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 4 | |
| 5 | /-! |
| 6 | # A quadratic growth barrier for a compact family of nonnegative norms |
| 7 | |
| 8 | Compare a continuous norm through its differentiable square, using the |
| 9 | compact minimum principle. This is the full-curvature version of the |
| 10 | uniform-time comparison in Morgan-Tian Theorem 12.5, p. 297; see the |
| 11 | source-reviewed common-compact-lifetime derivation in the task records. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | |
| 18 | namespace Real |
| 19 | |
| 20 | /-- The explicit positive-denominator quadratic growth barrier |
| 21 | (Theorem 12.5, p. 297, common-compact-lifetime derivation). -/ |
| 22 | noncomputable def quadraticGrowthBarrier (c B t : ℝ) : ℝ := B / (1 - c * B * t) |
| 23 | |
| 24 | /-- The barrier starts at the prescribed bound |
| 25 | (Theorem 12.5, p. 297, common-compact-lifetime derivation). -/ |
| 26 | theorem quadraticGrowthBarrier_zero (c B : ℝ) : quadraticGrowthBarrier c B 0 = B := by |
| 27 | simp [quadraticGrowthBarrier] |
| 28 | |
| 29 | /-- The actual barrier derivative satisfies its quadratic ODE away from its pole |
| 30 | (Theorem 12.5, p. 297, common-compact-lifetime derivation). -/ |
| 31 | theorem hasDerivAt_quadraticGrowthBarrier (c B t : ℝ) (ht : 1 - c * B * t ≠ 0) : |
| 32 | HasDerivAt (quadraticGrowthBarrier c B) |
| 33 | (c * quadraticGrowthBarrier c B t ^ 2) t := by |
| 34 | have hd := (hasDerivAt_const t (1 : ℝ)).sub ((hasDerivAt_id t).const_mul (c * B)) |
| 35 | have h := (hasDerivAt_const t B).div hd ht |
| 36 | convert! h using 1 |
| 37 | dsimp [quadraticGrowthBarrier] |
| 38 | field_simp |
| 39 | ring |
| 40 | |
| 41 | /-- Before the half-pole threshold the barrier is at most twice its |
| 42 | nonnegative initial bound (Theorem 12.5, p. 297). -/ |
| 43 | theorem quadraticGrowthBarrier_le_twice {c B t : ℝ} (hB : 0 ≤ B) |
| 44 | (ht : c * B * t ≤ 1 / 2) : quadraticGrowthBarrier c B t ≤ 2 * B := by |
| 45 | have hden : 0 < 1 - c * B * t := by linarith |
| 46 | apply (div_le_iff₀ hden).mpr |
| 47 | nlinarith [mul_le_mul_of_nonneg_left ht hB] |
| 48 | |
| 49 | end Real |
| 50 | |
| 51 | /-- A compact family with cubically controlled squared-norm velocity at |
| 52 | spatial maxima obeys the explicit quadratic growth bound. Only the square |
| 53 | needs a time derivative (Theorem 12.5, p. 297, common-lifetime derivation). -/ |
| 54 | theorem compact_nonnegative_norm_le_quadraticGrowthBarrier |
| 55 | {X : Type*} [TopologicalSpace X] [CompactSpace X] {T B c : ℝ} |
| 56 | (hT : 0 < T) (hB : 0 < B) (hc : 0 ≤ c) (hden : c * B * T < 1) |
| 57 | (N V : ℝ → X → ℝ) |
| 58 | (hcont : ContinuousOn (Function.uncurry N) (Icc 0 T ×ˢ (univ : Set X))) |
| 59 | (hN : ∀ t ∈ Icc 0 T, ∀ x : X, 0 ≤ N t x) |
| 60 | (hderiv : ∀ t ∈ Icc 0 T, ∀ x : X, |
| 61 | HasDerivWithinAt (fun s => N s x ^ 2) (V t x) (Icc 0 T) t) |
| 62 | (hmax : ∀ t ∈ Ioc 0 T, ∀ x : X, |
| 63 | (∀ z : X, N t z ^ 2 ≤ N t x ^ 2) → V t x ≤ c * N t x ^ 3) |
| 64 | (hinit : ∀ x : X, N 0 x ≤ B) : |
| 65 | ∀ t ∈ Icc 0 T, ∀ x : X, N t x ≤ Real.quadraticGrowthBarrier c B t := by |
| 66 | let y := Real.quadraticGrowthBarrier c B |
| 67 | have hdpos (t : ℝ) (ht : t ∈ Icc 0 T) : 0 < 1 - c * B * t := by |
| 68 | have hb := mul_le_mul_of_nonneg_left ht.2 (mul_nonneg hc hB.le) |
| 69 | linarith |
| 70 | have hypos (t : ℝ) (ht : t ∈ Icc 0 T) : 0 < y t := |
| 71 | div_pos hB (hdpos t ht) |
| 72 | have hyd (t : ℝ) (ht : t ∈ Icc 0 T) : HasDerivAt y (c * y t ^ 2) t := |
| 73 | Real.hasDerivAt_quadraticGrowthBarrier c B t (ne_of_gt (hdpos t ht)) |
| 74 | have hycont : ContinuousOn y (Icc 0 T) := |
| 75 | fun t ht => (hyd t ht).continuousAt.continuousWithinAt |
| 76 | have hyp : ContinuousOn (fun p : ℝ × X => y p.1) (Icc 0 T ×ˢ univ) := |
| 77 | hycont.comp continuous_fst.continuousOn (fun _ hp => hp.1) |
| 78 | let f : ℝ → X → ℝ := fun t x => y t ^ 2 - N t x ^ 2 |
| 79 | let v : ℝ → X → ℝ := fun t x => 2 * c * y t ^ 3 - V t x |
| 80 | have hf : ContinuousOn (Function.uncurry f) (Icc 0 T ×ˢ (univ : Set X)) := |
| 81 | (hyp.pow 2).sub (hcont.pow 2) |
| 82 | have hv : ∀ t ∈ Icc 0 T, ∀ x : X, |
| 83 | HasDerivWithinAt (fun s => f s x) (v t x) (Icc 0 T) t := by |
| 84 | intro t ht x |
| 85 | have hy2 : HasDerivAt (fun s => y s ^ 2) (2 * c * y t ^ 3) t := by |
| 86 | convert! (hyd t ht).pow 2 using 1 |
| 87 | ring |
| 88 | exact hy2.hasDerivWithinAt.sub (hderiv t ht x) |
| 89 | have hcoef : ContinuousOn (fun p : ℝ × X => c * (y p.1 + N p.1 p.2)) |
| 90 | (Icc 0 T ×ˢ univ) := continuousOn_const.mul (hyp.add hcont) |
| 91 | obtain ⟨A, hA⟩ := ((isCompact_Icc.prod isCompact_univ).image_of_continuousOn hcoef).bddAbove |
| 92 | have hminimum : ∀ t ∈ Ioc 0 T, ∀ x : X, |
| 93 | (∀ z : X, f t x ≤ f t z) → f t x ≤ 0 → -(-A) * f t x ≤ v t x := by |
| 94 | intro t ht x hmin hfneg |
| 95 | have ht' : t ∈ Icc 0 T := ⟨ht.1.le, ht.2⟩ |
| 96 | have hmaxN : ∀ z : X, N t z ^ 2 ≤ N t x ^ 2 := by |
| 97 | intro z |
| 98 | have hm := hmin z |
| 99 | dsimp [f] at hm |
| 100 | linarith |
| 101 | have hvel := hmax t ht x hmaxN |
| 102 | have hy := (hypos t ht').le |
| 103 | have hn := hN t ht' x |
| 104 | have hyN : y t ≤ N t x := by |
| 105 | dsimp [f] at hfneg |
| 106 | nlinarith |
| 107 | have hpoly : (y t + N t x) * (y t ^ 2 - N t x ^ 2) ≤ |
| 108 | y t ^ 3 - N t x ^ 3 := by |
| 109 | nlinarith only [mul_nonneg (mul_nonneg hy hn) (sub_nonneg.mpr hyN)] |
| 110 | have hax : c * (y t + N t x) ≤ A := |
| 111 | hA (mem_image_of_mem _ (show (t, x) ∈ Icc 0 T ×ˢ univ from ⟨ht', mem_univ x⟩)) |
| 112 | have hmul := mul_le_mul_of_nonpos_right hax hfneg |
| 113 | have hpoly' := mul_le_mul_of_nonneg_left hpoly hc |
| 114 | have hycube := mul_nonneg hc (pow_nonneg hy 3) |
| 115 | dsimp [f, v] at hmul ⊢ |
| 116 | nlinarith |
| 117 | have hinitial : ∀ x : X, 0 ≤ f 0 x := by |
| 118 | intro x |
| 119 | have hn := hN 0 ⟨le_rfl, hT.le⟩ x |
| 120 | have hb := hinit x |
| 121 | dsimp [f, y] |
| 122 | rw [Real.quadraticGrowthBarrier_zero] |
| 123 | nlinarith |
| 124 | have hbound := PoincareMT.M04.compact_min_velocity_nonnegative |
| 125 | (K := -A) hT f v hf hv hminimum hinitial |
| 126 | intro t ht x |
| 127 | have hb := hbound t ht x |
| 128 | have hn := hN t ht x |
| 129 | have hy := (hypos t ht).le |
| 130 | dsimp [f] at hb |
| 131 | change N t x ≤ y t |
| 132 | nlinarith |