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.CurveShortening.Ramp.LocalFlow.Initial.SpectralTrace |
| 2 | |
| 3 | /-! |
| 4 | # Differentiation of the actual initial heat contribution |
| 5 | |
| 6 | The proved Bochner primitive identity and Mathlib's a.e. fundamental |
| 7 | theorem give the actual homogeneous derivative at positive times. |
| 8 | MT2007 Claim 19.1, p. 437; contract review block 8 and the supporting |
| 9 | derivation `2026-09-21-affine-spectral-residual.md`. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter MeasureTheory |
| 15 | open scoped Topology ENNReal |
| 16 | |
| 17 | namespace PoincareMT.M63 |
| 18 | |
| 19 | open SpectralHeatNative |
| 20 | |
| 21 | /-- The actual initial heat path has negative generator derivative a.e. |
| 22 | No derivative at the initial time is asserted. MT2007 Claim 19.1, p. 437; |
| 23 | contract block 8 and the affine spectral-residual derivation. -/ |
| 24 | theorem ae_hasDerivAt_initialHeat {iota : Type*} [Countable iota] |
| 25 | (lambda : iota → NNReal) (w : State iota) {T : ℝ} (hT : 0 ≤ T) : |
| 26 | ∀ᵐ t ∂timeMeasure T, |
| 27 | HasDerivAt (fun s => heat lambda s.toNNReal (shiftedBaseMultiplier lambda w)) |
| 28 | (-initialHeatGenerator lambda w t) t := by |
| 29 | have hGmem := (initialHeatGenerator_memLp_energy lambda w hT).1 |
| 30 | have hGint : IntervalIntegrable (initialHeatGenerator lambda w) volume 0 T := |
| 31 | (intervalIntegrable_iff_integrableOn_Ioc_of_le hT).mpr |
| 32 | (hGmem.integrable (by norm_num : (1 : ENNReal) ≤ 2)) |
| 33 | rw [ae_restrict_iff' measurableSet_Ioc] |
| 34 | filter_upwards [hGint.ae_hasDerivAt_integral] with t ht hmem |
| 35 | have hd := (hasDerivAt_const t (shiftedBaseMultiplier lambda w)).sub |
| 36 | (ht (by simpa only [uIcc_of_le hT] using Ioc_subset_Icc_self hmem) 0 left_mem_uIcc) |
| 37 | have heq : (fun s => heat lambda s.toNNReal (shiftedBaseMultiplier lambda w)) =ᶠ[𝓝 t] |
| 38 | (fun s => shiftedBaseMultiplier lambda w - |
| 39 | ∫ v in (0 : ℝ)..s, initialHeatGenerator lambda w v) := by |
| 40 | filter_upwards [Ioi_mem_nhds hmem.1] with s hs |
| 41 | exact initialHeat_eq_sub_integral lambda w hs.le |
| 42 | simpa only [zero_sub] using hd.congr_of_eventuallyEq heq |
| 43 | |
| 44 | end PoincareMT.M63 |