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.ReducedLength.Calculus.SmoothPartials |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.ODE.LinearizedODE |
| 3 | |
| 4 | /-! |
| 5 | # Linearization of an actual second-order coordinate equation |
| 6 | |
| 7 | The phase variation is identified with the variation and its ordinary |
| 8 | time derivative on a neighborhood before transferring its derivative. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped ContDiff Topology |
| 14 | open Filter |
| 15 | |
| 16 | namespace PoincareMT.ReducedLength |
| 17 | |
| 18 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 19 | |
| 20 | theorem hasDerivAt_variation_phase_of_ode (f : ℝ × ℝ → E) (B : ℝ × (E × E) → E × E) |
| 21 | (U : Set (ℝ × ℝ)) (hU : IsOpen U) (hf : ContDiffOn ℝ ∞ f U) |
| 22 | (s : ℝ) (hs : (s, 0) ∈ U) |
| 23 | (hB : DifferentiableAt ℝ B (s, timeDerivativePhase f (s, 0))) |
| 24 | (hode : ∀ᶠ u in 𝓝 (0 : ℝ), HasDerivAt (fun r ↦ timeDerivativePhase f (r, u)) |
| 25 | (B (s, timeDerivativePhase f (s, u))) s) : |
| 26 | let Y : ℝ → E := fun r ↦ deriv (fun u ↦ f (r, u)) 0 |
| 27 | HasDerivAt (fun r ↦ (Y r, deriv Y r)) |
| 28 | (fderiv ℝ B (s, timeDerivativePhase f (s, 0)) (0, (Y s, deriv Y s))) s := by |
| 29 | let Y : ℝ → E := fun r ↦ deriv (fun u ↦ f (r, u)) 0 |
| 30 | have hlin := hasDerivAt_variation_of_ode (timeDerivativePhase f) B s |
| 31 | ((timeDerivativePhase_contDiffOn f U hU hf).contDiffAt (hU.mem_nhds hs)) hB hode |
| 32 | have heq : (fun r ↦ deriv (fun u ↦ timeDerivativePhase f (r, u)) 0) =ᶠ[𝓝 s] |
| 33 | (fun r ↦ (Y r, deriv Y r)) := by |
| 34 | filter_upwards [(continuous_id.prodMk continuous_const).continuousAt.preimage_mem_nhds |
| 35 | (hU.mem_nhds hs)] with r hr |
| 36 | exact deriv_timeDerivativePhase_variation f U hU hf r hr |
| 37 | rw [heq.eq_of_nhds] at hlin |
| 38 | exact hlin.congr_of_eventuallyEq heq.symm |
| 39 | |
| 40 | end PoincareMT.ReducedLength |