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.SpecialFunctions.Integrals.Basic |
| 2 | |
| 3 | /-! |
| 4 | # Logarithmic scalar-age extraction from nonnegative action |
| 5 | |
| 6 | Integrating c/v on one fixed positive-age interval contradicts the |
| 7 | Chapter 7 low-action bound. This is the elementary joint-point argument |
| 8 | using Definition 6.2, p. 106, and Theorem 7.10, p. 154. |
| 9 | See `proof-work/tasks/M47/derivations/joint-seed.md`, Stage B. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set MeasureTheory |
| 15 | open scoped intervalIntegral |
| 16 | |
| 17 | namespace PoincareMT.M47 |
| 18 | |
| 19 | /-- The logarithmic age window is strictly positive and below its chosen |
| 20 | upper age, before the flow is specified; joint-point estimate, p. 154. -/ |
| 21 | theorem jointSeed_age_window {c sigma : ℝ} (hc : 0 < c) (hsigma : 0 < sigma) : |
| 22 | 0 < sigma * Real.exp (-5 / c) ∧ sigma * Real.exp (-5 / c) < sigma := by |
| 23 | refine ⟨mul_pos hsigma (Real.exp_pos _), ?_⟩ |
| 24 | apply mul_lt_of_lt_one_right hsigma |
| 25 | apply Real.exp_lt_one_iff.mpr |
| 26 | exact div_neg_of_neg_of_pos (by norm_num) hc |
| 27 | |
| 28 | /-- Actual nonnegative action and its scalar contribution force one |
| 29 | point of bounded scalar times age. Integrability remains explicit in |
| 30 | this internal comparison; Definition 6.2 and Theorem 7.10. -/ |
| 31 | theorem jointSeed_scalar_age_of_action |
| 32 | {d c sigma a eta : ℝ} (hc : 0 < c) (hsigma : 0 < sigma) |
| 33 | (hsigmaAge : sigma ≤ d / 2) (ha : a = sigma * Real.exp (-5 / c)) |
| 34 | (heta : eta < a) (f r : ℝ → ℝ) |
| 35 | (hfi : IntervalIntegrable f volume eta d) |
| 36 | (hf : ∀ v ∈ Icc eta d, 0 ≤ f v) |
| 37 | (hscalar : ∀ v ∈ Icc a sigma, Real.sqrt (d / 2) * r v ≤ f v) |
| 38 | (hupper : (∫ v in eta..d, f v) ≤ 3 * Real.sqrt d) : |
| 39 | ∃ v ∈ Icc a sigma, v * r v ≤ c := by |
| 40 | have haWindow := jointSeed_age_window hc hsigma |
| 41 | rw [← ha] at haWindow |
| 42 | have haPos : 0 < a := haWindow.1 |
| 43 | have haSigma : a ≤ sigma := haWindow.2.le |
| 44 | have hd : 0 < d := by linarith |
| 45 | have hsigmaD : sigma ≤ d := by linarith |
| 46 | have hsmall : Icc a sigma ⊆ Icc eta d := Icc_subset_Icc heta.le hsigmaD |
| 47 | have hfiSmall : IntervalIntegrable f volume a sigma := hfi.mono_set (by |
| 48 | rw [uIcc_of_le haSigma, uIcc_of_le (heta.le.trans (haSigma.trans hsigmaD))] |
| 49 | exact hsmall) |
| 50 | have hInv : IntervalIntegrable (fun v : ℝ => v⁻¹) volume a sigma := |
| 51 | (continuousOn_id.inv₀ (fun v hv => (haPos.trans_le hv.1).ne')).intervalIntegrable_of_Icc |
| 52 | haSigma |
| 53 | by_contra hnone |
| 54 | push Not at hnone |
| 55 | have hcompare := intervalIntegral.integral_mono_on haSigma |
| 56 | (hInv.const_mul (Real.sqrt (d / 2) * c)) hfiSmall (fun v hv => by |
| 57 | have hvPos : 0 < v := haPos.trans_le hv.1 |
| 58 | have hcv : c * v⁻¹ ≤ r v := by |
| 59 | rw [← div_eq_mul_inv] |
| 60 | apply (div_le_iff₀ hvPos).2 |
| 61 | nlinarith [hnone v hv] |
| 62 | exact (show Real.sqrt (d / 2) * c * v⁻¹ ≤ Real.sqrt (d / 2) * r v by |
| 63 | nlinarith [mul_le_mul_of_nonneg_left hcv (Real.sqrt_nonneg (d / 2))]).trans |
| 64 | (hscalar v hv)) |
| 65 | have hlog : Real.log (sigma / a) = 5 / c := by |
| 66 | rw [Real.log_div hsigma.ne' haPos.ne', ha, |
| 67 | Real.log_mul hsigma.ne' (Real.exp_ne_zero _), Real.log_exp] |
| 68 | ring |
| 69 | rw [intervalIntegral.integral_const_mul, integral_inv_of_pos haPos hsigma, hlog] at hcompare |
| 70 | have hcancel : Real.sqrt (d / 2) * c * (5 / c) = 5 * Real.sqrt (d / 2) := by |
| 71 | field_simp |
| 72 | rw [hcancel] at hcompare |
| 73 | have hmono := intervalIntegral.integral_mono_interval heta.le haSigma hsigmaD |
| 74 | ((ae_restrict_mem measurableSet_Ioc).mono (fun v hv => hf v ⟨hv.1.le, hv.2⟩)) hfi |
| 75 | have hlarge : 3 * Real.sqrt d < 5 * Real.sqrt (d / 2) := by |
| 76 | by_contra h |
| 77 | have hsq := (sq_le_sq₀ (by positivity : 0 ≤ 5 * Real.sqrt (d / 2)) |
| 78 | (by positivity : 0 ≤ 3 * Real.sqrt d)).2 (le_of_not_gt h) |
| 79 | nlinarith [Real.sq_sqrt hd.le, Real.sq_sqrt (half_pos hd).le] |
| 80 | exact (not_lt_of_ge (hcompare.trans (hmono.trans hupper))) hlarge |
| 81 | |
| 82 | end PoincareMT.M47 |