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 Mathlib.Analysis.Calculus.LocalExtr.Basic |
| 2 | import Mathlib.Analysis.SpecialFunctions.ExpDeriv |
| 3 | import Mathlib.Topology.Order.Compact |
| 4 | import Mathlib.Tactic.Linarith |
| 5 | import Mathlib.Tactic.FunProp |
| 6 | |
| 7 | /-! |
| 8 | # Exponential comparison from local lower time supports |
| 9 | |
| 10 | At a maximum of a compact weighted family, a touching lower time support |
| 11 | inherits a local maximum relative to the past. Its ordinary derivative is |
| 12 | therefore nonnegative, including at the right endpoint of the time interval. |
| 13 | The strict exponential weight contradicts the support's reaction inequality. |
| 14 | |
| 15 | The reviewed statement and proof are recorded in |
| 16 | `notes/parabolic-lower-support-comparison.md`. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open Set Filter |
| 22 | open scoped Topology |
| 23 | |
| 24 | namespace Poincare.Parabolic |
| 25 | |
| 26 | private lemma nonneg_deriv_of_local_max_on_past {f : ℝ → ℝ} {d a t : ℝ} |
| 27 | (hat : a < t) (hmax : IsLocalMaxOn f (Icc a t) t) |
| 28 | (hd : HasDerivAt f d t) : 0 ≤ d := by |
| 29 | have hcone : a - t ∈ posTangentConeAt (Icc a t) t := |
| 30 | sub_mem_posTangentConeAt_of_segment_subset |
| 31 | ((convex_Icc a t).segment_subset ⟨hat.le, le_rfl⟩ ⟨le_rfl, hat.le⟩) |
| 32 | have h := hmax.hasFDerivWithinAt_nonpos hd.hasDerivWithinAt.hasFDerivWithinAt hcone |
| 33 | change (a - t) * d ≤ 0 at h |
| 34 | nlinarith |
| 35 | |
| 36 | /-- A continuous compact family obeys exponential comparison if positive |
| 37 | maxima of each stricter exponential weight admit lower time supports with |
| 38 | the stated affine derivative bound. Only the past neighborhood is used. -/ |
| 39 | theorem le_exp_of_lower_support_deriv_le |
| 40 | {A : Type*} [TopologicalSpace A] [CompactSpace A] |
| 41 | {u : A → ℝ → ℝ} {K B U0 a b : ℝ} |
| 42 | (hK : 0 < K) (hB : 0 ≤ B) (hU0 : 0 ≤ U0) |
| 43 | (hu : ContinuousOn (Function.uncurry u) (univ ×ˢ Icc a b)) |
| 44 | (hinit : ∀ q, u q a ≤ U0) |
| 45 | (hsupport : ∀ (rate : ℝ) (q : A) (t : ℝ), |
| 46 | K < rate → t ∈ Ioc a b → 0 < u q t → |
| 47 | IsMaxOn |
| 48 | (fun p : A × ℝ => Real.exp (-rate * (p.2 - a)) * (u p.1 p.2 + B / K)) |
| 49 | (univ ×ˢ Icc a b) (q, t) → |
| 50 | ∃ (v : ℝ → ℝ) (d : ℝ), |
| 51 | v t = u q t ∧ |
| 52 | (∀ᶠ s in 𝓝[Icc a t] t, v s ≤ u q s) ∧ |
| 53 | HasDerivAt v d t ∧ d ≤ K * u q t + B) : |
| 54 | ∀ q t, t ∈ Icc a b → |
| 55 | u q t ≤ Real.exp (K * (t - a)) * (U0 + B / K) - B / K := by |
| 56 | have hC : 0 ≤ U0 + B / K := add_nonneg hU0 (div_nonneg hB hK.le) |
| 57 | have hweighted (rate : ℝ) (hrate : K < rate) (q : A) (t : ℝ) |
| 58 | (ht : t ∈ Icc a b) : |
| 59 | Real.exp (-rate * (t - a)) * (u q t + B / K) ≤ U0 + B / K := by |
| 60 | by_contra hle |
| 61 | have hlt := lt_of_not_ge hle |
| 62 | let G : A × ℝ → ℝ := fun p => |
| 63 | Real.exp (-rate * (p.2 - a)) * (u p.1 p.2 + B / K) |
| 64 | have hG : ContinuousOn G (univ ×ˢ Icc a b) := |
| 65 | (show Continuous (fun p : A × ℝ => Real.exp (-rate * (p.2 - a))) by |
| 66 | fun_prop).continuousOn.mul (hu.add continuousOn_const) |
| 67 | obtain ⟨⟨p, s⟩, hs, hmax⟩ := |
| 68 | (isCompact_univ.prod isCompact_Icc).exists_isMaxOn ⟨(q, t), trivial, ht⟩ hG |
| 69 | have hGs : U0 + B / K < G (p, s) := |
| 70 | hlt.trans_le (hmax (a := (q, t)) ⟨trivial, ht⟩) |
| 71 | have hshift : 0 < u p s + B / K := |
| 72 | (mul_pos_iff_of_pos_left (Real.exp_pos _)).mp (hC.trans_lt hGs) |
| 73 | have hexple : Real.exp (-rate * (s - a)) ≤ 1 := |
| 74 | Real.exp_le_one_iff.mpr (mul_nonpos_of_nonpos_of_nonneg |
| 75 | (neg_nonpos.mpr (hK.trans hrate).le) (sub_nonneg.mpr hs.2.1)) |
| 76 | have hpos : 0 < u p s := by |
| 77 | have hmul := mul_le_of_le_one_left hshift.le hexple |
| 78 | dsimp only [G] at hGs |
| 79 | linarith |
| 80 | have has : a < s := lt_of_le_of_ne hs.2.1 (by |
| 81 | intro heq |
| 82 | subst s |
| 83 | have hGa : U0 + B / K < u p a + B / K := by simpa [G] using hGs |
| 84 | linarith [hinit p]) |
| 85 | obtain ⟨v, d, htouch, hbelow, hd, hreaction⟩ := |
| 86 | hsupport rate p s hrate ⟨has, hs.2.2⟩ hpos hmax |
| 87 | let w : ℝ → ℝ := fun r => Real.exp (-rate * (r - a)) * (v r + B / K) |
| 88 | have hlocal : IsLocalMaxOn w (Icc a s) s := by |
| 89 | filter_upwards [hbelow, self_mem_nhdsWithin] with r hr hmem |
| 90 | calc |
| 91 | w r ≤ G (p, r) := |
| 92 | mul_le_mul_of_nonneg_left (by linarith : v r + B / K ≤ u p r + B / K) |
| 93 | (Real.exp_pos _).le |
| 94 | _ ≤ G (p, s) := hmax ⟨trivial, hmem.1, hmem.2.trans hs.2.2⟩ |
| 95 | _ = w s := by simp only [G, w, htouch] |
| 96 | have hexp : HasDerivAt (fun r : ℝ => Real.exp (-rate * (r - a))) |
| 97 | (Real.exp (-rate * (s - a)) * (-rate)) s := by |
| 98 | simpa [id_eq] using (((hasDerivAt_id s).sub_const a).const_mul (-rate)).exp |
| 99 | have hnonneg := nonneg_deriv_of_local_max_on_past has hlocal |
| 100 | (hexp.mul (hd.add_const (B / K))) |
| 101 | rw [htouch] at hnonneg |
| 102 | have hBK : K * (B / K) = B := mul_div_cancel₀ B hK.ne' |
| 103 | have hstrict : d - rate * (u p s + B / K) < 0 := by |
| 104 | nlinarith [mul_pos (sub_pos.mpr hrate) hshift] |
| 105 | nlinarith [mul_neg_of_pos_of_neg (Real.exp_pos (-rate * (s - a))) hstrict] |
| 106 | intro q t ht |
| 107 | have hlim : Tendsto |
| 108 | (fun rate : ℝ => Real.exp (-rate * (t - a)) * (u q t + B / K)) |
| 109 | (𝓝[>] K) (𝓝 (Real.exp (-K * (t - a)) * (u q t + B / K))) := |
| 110 | (by fun_prop : Continuous (fun rate : ℝ => |
| 111 | Real.exp (-rate * (t - a)) * (u q t + B / K))).continuousAt.tendsto.mono_left |
| 112 | nhdsWithin_le_nhds |
| 113 | have hbound := le_of_tendsto hlim |
| 114 | ((show ∀ᶠ rate in 𝓝[>] K, K < rate from self_mem_nhdsWithin).mono |
| 115 | fun rate hrate => hweighted rate hrate q t ht) |
| 116 | have hdiv := (le_div_iff₀ (Real.exp_pos (-K * (t - a)))).mpr |
| 117 | (by simpa only [mul_comm] using hbound) |
| 118 | rw [neg_mul, Real.exp_neg, div_inv_eq_mul] at hdiv |
| 119 | nlinarith |
| 120 | |
| 121 | end Poincare.Parabolic |