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.ReducedGeometry.ReducedVolume.Regularity.AlmostEverywhere.RegularGerms |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Basic |
| 3 | import Mathlib.Analysis.SpecialFunctions.Pow.Deriv |
| 4 | |
| 5 | /-! |
| 6 | # Scalar calculus for the unnormalized reduced-volume density |
| 7 | |
| 8 | These formulas concern the actual density in Morgan-Tian Definition 6.70. |
| 9 | They retain a genuine time derivative witness before differentiating at a |
| 10 | fixed spatial point. Integrability and the varying volume measure are |
| 11 | separate geometric obligations. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.ReducedVolume |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p q : M} {τ : ℝ} |
| 25 | |
| 26 | /-- The book's density is strictly positive at every positive backward time. -/ |
| 27 | theorem reducedVolumeDensity_pos (hτ : 0 < τ) : |
| 28 | 0 < reducedVolumeDensity F T p τ q := by |
| 29 | delta reducedVolumeDensity |
| 30 | rw [if_pos hτ] |
| 31 | exact mul_pos (Real.rpow_pos_of_pos hτ _) (Real.exp_pos _) |
| 32 | |
| 33 | /-- The nonpositive-time convention preserves nonnegativity. -/ |
| 34 | theorem reducedVolumeDensity_nonneg : 0 ≤ reducedVolumeDensity F T p τ q := by |
| 35 | by_cases hτ : 0 < τ |
| 36 | · exact (reducedVolumeDensity_pos hτ).le |
| 37 | · delta reducedVolumeDensity |
| 38 | simp only [if_neg hτ, le_refl] |
| 39 | |
| 40 | /-- The Euclidean reduced volume is positive, including in dimension zero. -/ |
| 41 | theorem euclideanReducedVolume_pos (n : ℕ) : 0 < euclideanReducedVolume n := |
| 42 | Real.rpow_pos_of_pos (mul_pos (by norm_num) Real.pi_pos) _ |
| 43 | |
| 44 | /-- Scalar product and chain rules for the fixed-spatial-point density. -/ |
| 45 | theorem reducedVolumeDensity_hasDerivAt {d : ℝ} (hτ : 0 < τ) |
| 46 | (hl : HasDerivAt (fun s ↦ reducedLength F T p q s) d τ) : |
| 47 | HasDerivAt (fun s ↦ reducedVolumeDensity F T p s q) |
| 48 | (reducedVolumeDensity F T p τ q * (-(n : ℝ) / (2 * τ) - d)) τ := by |
| 49 | have hp := Real.hasDerivAt_rpow_const (p := -(n : ℝ) / 2) (Or.inl hτ.ne') |
| 50 | have h := hp.mul hl.neg.exp |
| 51 | have heq : (fun s ↦ reducedVolumeDensity F T p s q) =ᶠ[𝓝 τ] |
| 52 | (fun s ↦ Real.rpow s (-(n : ℝ) / 2) * Real.exp (-reducedLength F T p q s)) := by |
| 53 | filter_upwards [eventually_gt_nhds hτ] with s hs |
| 54 | exact if_pos hs |
| 55 | apply (h.congr_of_eventuallyEq heq).congr_deriv |
| 56 | delta reducedVolumeDensity |
| 57 | rw [if_pos hτ, Real.rpow_sub_one hτ.ne'] |
| 58 | simp only [Pi.neg_apply, Real.rpow_eq_pow] |
| 59 | ring |
| 60 | |
| 61 | /-- The actual density has the stated derivative at a witnessed regular point. -/ |
| 62 | theorem reducedVolumeDensity_regular_hasDerivAt |
| 63 | (r : ReducedLengthRegularPoint F T τmax p q τ) : |
| 64 | HasDerivAt (fun s ↦ reducedVolumeDensity F T p s q) |
| 65 | (reducedVolumeDensity F T p τ q * |
| 66 | (-(n : ℝ) / (2 * τ) - deriv (fun s ↦ reducedLength F T p q s) τ)) τ := |
| 67 | reducedVolumeDensity_hasDerivAt r.tau_pos (reducedLength_hasDerivAt r) |
| 68 | |
| 69 | end PoincareMT.ReducedVolume |