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.ODE.ScalarComparison |
| 2 | |
| 3 | /-! |
| 4 | # Differential Harnack path estimates |
| 5 | |
| 6 | This module is the real-analysis interface used by the geometric differential |
| 7 | Harnack argument. The geometric work supplies the scalar curvature along a |
| 8 | path, its time derivative, and the squared path speed. The two structures |
| 9 | below retain those hypotheses explicitly and expose the finite-start and |
| 10 | ancient endpoint comparisons with the factors appearing in the M06 contract. |
| 11 | |
| 12 | The finite estimate is the integrating-factor form of Morgan--Tian, |
| 13 | Theorem 4.37 and Corollary 4.39, p. 81. The ancient estimate is the |
| 14 | time-origin-free form used in Theorem 4.40, p. 82. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set MeasureTheory |
| 20 | open scoped intervalIntegral |
| 21 | |
| 22 | namespace Poincare.Geometry.RicciFlow.Harnack |
| 23 | |
| 24 | /-- Data along a finite time interval satisfying the scalar differential |
| 25 | Harnack inequality. `f` is scalar curvature and `speedSq` is the squared |
| 26 | spacetime speed of the chosen path. -/ |
| 27 | structure FiniteHarnackPath (T a b : ℝ) where |
| 28 | hTa : T < a |
| 29 | hab : a ≤ b |
| 30 | f : ℝ → ℝ |
| 31 | f' : ℝ → ℝ |
| 32 | speedSq : ℝ → ℝ |
| 33 | f_continuous : ContinuousOn f (Icc a b) |
| 34 | speed_continuous : ContinuousOn speedSq (Ioo a b) |
| 35 | speed_integrable : IntervalIntegrable speedSq volume a b |
| 36 | derivative : ∀ t ∈ Ioo a b, HasDerivAt f (f' t) t |
| 37 | differential : ∀ t ∈ Ioo a b, |
| 38 | 0 ≤ f' t + f t / (t - T) + speedSq t / 2 * f t |
| 39 | |
| 40 | /-- The integrated finite differential Harnack estimate, including both |
| 41 | elapsed-time factors and allowing `f` to vanish or change sign. -/ |
| 42 | theorem FiniteHarnackPath.integrated {T a b : ℝ} |
| 43 | (H : FiniteHarnackPath T a b) : |
| 44 | H.f a * (a - T) * |
| 45 | Real.exp (-(∫ t in a..b, H.speedSq t) / 2) ≤ |
| 46 | H.f b * (b - T) := by |
| 47 | exact Poincare.ODE.finite_harnack_of_energy_inequality H.hTa H.hab |
| 48 | H.f_continuous H.speed_continuous H.speed_integrable H.derivative |
| 49 | H.differential |
| 50 | |
| 51 | /-- Data along an ancient time interval satisfying the time-origin-free scalar |
| 52 | differential Harnack inequality. -/ |
| 53 | structure AncientHarnackPath (a b : ℝ) where |
| 54 | hab : a ≤ b |
| 55 | f : ℝ → ℝ |
| 56 | f' : ℝ → ℝ |
| 57 | speedSq : ℝ → ℝ |
| 58 | f_continuous : ContinuousOn f (Icc a b) |
| 59 | speed_continuous : ContinuousOn speedSq (Ioo a b) |
| 60 | speed_integrable : IntervalIntegrable speedSq volume a b |
| 61 | derivative : ∀ t ∈ Ioo a b, HasDerivAt f (f' t) t |
| 62 | differential : ∀ t ∈ Ioo a b, 0 ≤ f' t + speedSq t / 2 * f t |
| 63 | |
| 64 | /-- The integrated ancient differential Harnack estimate. -/ |
| 65 | theorem AncientHarnackPath.integrated {a b : ℝ} |
| 66 | (H : AncientHarnackPath a b) : |
| 67 | H.f a * Real.exp (-(∫ t in a..b, H.speedSq t) / 2) ≤ H.f b := by |
| 68 | exact Poincare.ODE.harnack_of_energy_inequality H.hab H.f_continuous |
| 69 | H.speed_continuous H.speed_integrable H.derivative H.differential |
| 70 | |
| 71 | end Poincare.Geometry.RicciFlow.Harnack |