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.Exponential.Dynamics.BranchCalculus |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Regularity.AlmostEverywhere.NoncriticalOpen |
| 3 | |
| 4 | /-! |
| 5 | # A common phase ODE on a neighborhood of a noncritical branch |
| 6 | |
| 7 | Finite-order regularity and invertibility persist on neighborhoods. The |
| 8 | action identities hold as germs at every sufficiently near point, giving |
| 9 | the actual phase equation throughout a time neighborhood of the endpoint. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Filter |
| 15 | open scoped ContDiff Topology |
| 16 | |
| 17 | namespace PoincareMT.ReducedVolume |
| 18 | |
| 19 | variable {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 20 | [FiniteDimensional ℝ X] [NormedAddCommGroup Y] [InnerProductSpace ℝ Y] |
| 21 | [FiniteDimensional ℝ Y] |
| 22 | |
| 23 | /-- A noncritical smooth action branch solves the common phase equation near its terminal time. -/ |
| 24 | theorem eventually_hasDerivAt_actionBranchPhase |
| 25 | {E : X × ℝ → Y} {A : X × ℝ → ℝ} |
| 26 | {B : Y × ℝ → Y →L[ℝ] Y →L[ℝ] ℝ} {R : Y × ℝ → ℝ} {z : X × ℝ} |
| 27 | (hE : ContDiffAt ℝ ∞ E z) (hA : ContDiffAt ℝ ∞ A z) |
| 28 | (hB : ContDiffAt ℝ ∞ B (E z, z.2)) (hR : ContDiffAt ℝ ∞ R (E z, z.2)) |
| 29 | (ht : 0 < z.2) (hi : (B (E z, z.2)).IsInvertible) |
| 30 | (hsym : ∀ᶠ w in 𝓝 (E z, z.2), ∀ u v : Y, B w u v = B w v u) |
| 31 | (hspace : ∀ᶠ w in 𝓝 z, ∀ h : X, |
| 32 | fderiv ℝ A w (h, 0) = actionBranchMomentum E B w (fderiv ℝ E w (h, 0))) |
| 33 | (htime : ∀ᶠ w in 𝓝 z, |
| 34 | fderiv ℝ A w (0, 1) = kineticLagrangian B R |
| 35 | (w.2, E w, fderiv ℝ E w (0, 1))) |
| 36 | (hcrit : Function.Bijective (fun h : X ↦ fderiv ℝ E z (h, 0))) : |
| 37 | ∀ᶠ t in 𝓝 z.2, HasDerivAt (actionBranchPhase E B z.1) |
| 38 | (phaseField B R (actionBranchPhase E B z.1 t)) t := by |
| 39 | have hP := actionBranchMomentum_contDiffAt hE hB ht |
| 40 | have hH : ContinuousAt (fun w : X × ℝ ↦ (E w, w.2)) z := |
| 41 | hE.continuousAt.prodMk continuous_snd.continuousAt |
| 42 | have hV : ContDiffAt ℝ ∞ (fun w : X × ℝ ↦ fderiv ℝ E w (0, 1)) z := |
| 43 | (hE.fderiv_right (by simp)).clm_apply contDiffAt_const |
| 44 | have hC : ContinuousAt |
| 45 | (fun w : X × ℝ ↦ (w.2, E w, fderiv ℝ E w (0, 1))) z := |
| 46 | continuous_snd.continuousAt.prodMk (hE.continuousAt.prodMk hV.continuousAt) |
| 47 | have hL : ContDiffAt ℝ 1 (kineticLagrangian B R) |
| 48 | (z.2, E z, fderiv ℝ E z (0, 1)) := |
| 49 | kineticLagrangian_contDiffAt (hB.of_le (by simp)) (hR.of_le (by simp)) ht |
| 50 | have hbij : ∀ᶠ w in 𝓝 z, |
| 51 | Function.Bijective ((fderiv ℝ E w).comp (ContinuousLinearMap.inl ℝ X ℝ)) := |
| 52 | eventually_bijective_of_continuousAt |
| 53 | (((hE.fderiv_right (m := ∞) (by simp)).clm_comp contDiffAt_const).continuousAt) hcrit |
| 54 | have hinv' : ∀ᶠ w in 𝓝 (E z, z.2), (B w).IsInvertible := |
| 55 | hB.continuousAt (ContinuousLinearEquiv.isOpen.mem_nhds hi) |
| 56 | have hinv : ∀ᶠ w in 𝓝 z, (B (E w, w.2)).IsInvertible := hH hinv' |
| 57 | have hall : ∀ᶠ w in 𝓝 z, HasDerivAt (actionBranchPhase E B w.1) |
| 58 | (phaseField B R (actionBranchPhase E B w.1 w.2)) w.2 := by |
| 59 | filter_upwards [(hE.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)).eventually |
| 60 | (by norm_num), |
| 61 | (hA.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)).eventually (by norm_num), |
| 62 | (hP.of_le (show (1 : ℕ∞ω) ≤ ∞ by simp)).eventually (by simp), |
| 63 | hC (hL.eventually (by simp)), continuous_snd.continuousAt (eventually_gt_nhds ht), |
| 64 | hinv, hH hsym, hspace.eventually_nhds, htime.eventually_nhds, hbij] |
| 65 | with w hwE hwA hwP hwL hwt hwi hwsym hwspace hwtime hwbij |
| 66 | change ContDiffAt ℝ 1 (kineticLagrangian B R) |
| 67 | (w.2, E w, fderiv ℝ E w (0, 1)) at hwL |
| 68 | exact hasDerivAt_actionBranchPhase hwE hwA (hwP.differentiableAt one_ne_zero) |
| 69 | (hwL.differentiableAt one_ne_zero) hwt hwi hwsym hwspace hwtime hwbij.2 |
| 70 | exact (continuousAt_const.prodMk continuousAt_id) hall |
| 71 | |
| 72 | end PoincareMT.ReducedVolume |