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.Generalized.ReducedGeometry.SourceNames.ReducedLength |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Differential.SecondOrderLinearization |
| 3 | |
| 4 | /-! |
| 5 | # Linearization in an arbitrary parameter direction |
| 6 | |
| 7 | The affine line through an initial parameter reduces its actual differential |
| 8 | to M09's one-real-parameter linearization theorem. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped ContDiff Topology |
| 14 | open Filter |
| 15 | |
| 16 | namespace PoincareMT.M14 |
| 17 | |
| 18 | variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 19 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 20 | |
| 21 | /-- The actual parameter differential of a smooth family of second-order |
| 22 | solutions satisfies the linearized phase equation. This is the directional |
| 23 | form of Morgan--Tian, Lemma 6.19 and Claim 6.20, obtained from M09's real |
| 24 | parameter theorem by restricting to the line through `x` in direction `v`. -/ |
| 25 | theorem parameterDifferential_secondOrderLinearization |
| 26 | {C : Set ℝ} {U : Set E} (hC : IsOpen C) (hU : IsOpen U) |
| 27 | (f : ℝ × E → F) (hf : ContDiffOn ℝ ∞ f (C ×ˢ U)) |
| 28 | (B : ℝ × (F × F) → F × F) {s : ℝ} {x : E} |
| 29 | (hs : s ∈ C) (hx : x ∈ U) (v : E) |
| 30 | (hB : DifferentiableAt ℝ B |
| 31 | (s, (f (s, x), deriv (fun r => f (r, x)) s))) |
| 32 | (hode : ∀ y ∈ U, HasDerivAt |
| 33 | (fun r => (f (r, y), deriv (fun t => f (t, y)) r)) |
| 34 | (B (s, (f (s, y), deriv (fun t => f (t, y)) s))) s) : |
| 35 | let Y : ℝ → F := fun r => fderiv ℝ (fun y => f (r, y)) x v |
| 36 | deriv (deriv Y) s = |
| 37 | (fderiv ℝ B (s, (f (s, x), deriv (fun r => f (r, x)) s)) |
| 38 | (0, (Y s, deriv Y s))).2 := by |
| 39 | let L : ℝ → E := fun u => x + u • v |
| 40 | have hL : ContDiff ℝ ∞ L := contDiff_const.add (contDiff_id.smul contDiff_const) |
| 41 | have hL0 : L 0 = x := by simp [L] |
| 42 | let g : ℝ × ℝ → F := fun z => f (z.1, L z.2) |
| 43 | let V : Set (ℝ × ℝ) := C ×ˢ (L ⁻¹' U) |
| 44 | have hV : IsOpen V := hC.prod (hU.preimage hL.continuous) |
| 45 | have hsg : (s, 0) ∈ V := ⟨hs, by simpa only [Set.mem_preimage, hL0] using hx⟩ |
| 46 | have hg : ContDiffOn ℝ ∞ g V := hf.comp |
| 47 | (contDiff_fst.prodMk (hL.comp contDiff_snd)).contDiffOn |
| 48 | (fun _ hz => hz) |
| 49 | have hBg : DifferentiableAt ℝ B |
| 50 | (s, Proofs.M09.timeDerivativePhase g (s, 0)) := by |
| 51 | simpa only [Proofs.M09.timeDerivativePhase, g, hL0] using hB |
| 52 | have hodeg : ∀ᶠ u in 𝓝 (0 : ℝ), HasDerivAt |
| 53 | (fun r => Proofs.M09.timeDerivativePhase g (r, u)) |
| 54 | (B (s, Proofs.M09.timeDerivativePhase g (s, u))) s := by |
| 55 | filter_upwards [hL.continuous.continuousAt.preimage_mem_nhds |
| 56 | (hU.mem_nhds (by simpa only [hL0] using hx))] with u hu |
| 57 | exact hode (L u) hu |
| 58 | have hvar := Proofs.M09.hasDerivAt_variation_phase_of_ode |
| 59 | g B V hV hg s hsg hBg hodeg |
| 60 | let Y : ℝ → F := fun r => fderiv ℝ (fun y => f (r, y)) x v |
| 61 | let Yg : ℝ → F := fun r => deriv (fun u => g (r, u)) 0 |
| 62 | have heq : Yg =ᶠ[𝓝 s] Y := by |
| 63 | filter_upwards [hC.mem_nhds hs] with r hr |
| 64 | have hfr : ContDiffOn ℝ ∞ (fun y => f (r, y)) U := hf.comp |
| 65 | (contDiff_const.prodMk contDiff_id).contDiffOn (fun _ hy => ⟨hr, hy⟩) |
| 66 | have hdL : HasDerivAt L v 0 := by |
| 67 | simpa only [L, id_eq, one_smul] using |
| 68 | ((hasDerivAt_id (0 : ℝ)).smul_const v).const_add x |
| 69 | have hd := ((hfr.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt |
| 70 | exact (hd.comp_hasDerivAt_of_eq 0 hdL hL0.symm).deriv |
| 71 | have hsecond : deriv (deriv Yg) s = |
| 72 | (fderiv ℝ B (s, Proofs.M09.timeDerivativePhase g (s, 0)) |
| 73 | (0, (Yg s, deriv Yg s))).2 := by |
| 74 | simpa only [ContinuousLinearMap.comp_apply, ContinuousLinearMap.toSpanSingleton_apply, |
| 75 | one_smul, ContinuousLinearMap.coe_snd'] using (hvar.hasFDerivAt.snd).hasDerivAt.deriv |
| 76 | rw [heq.deriv.deriv_eq, heq.deriv_eq, heq.eq_of_nhds] at hsecond |
| 77 | simpa only [Proofs.M09.timeDerivativePhase, g, hL0] using hsecond |
| 78 | |
| 79 | end PoincareMT.M14 |