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.PhaseField |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Exponential.Dynamics.MixedAction |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Exponential.Coordinates.ProductDerivatives |
| 4 | |
| 5 | /-! |
| 6 | # The phase equation of a smooth action branch |
| 7 | |
| 8 | The actual endpoint velocity defines its covector momentum. The two action |
| 9 | identities imply its momentum equation by symmetry of second derivatives. |
| 10 | All three components therefore solve the same autonomous phase equation. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Filter |
| 16 | open scoped ContDiff Topology |
| 17 | |
| 18 | namespace PoincareMT.ReducedVolume |
| 19 | |
| 20 | variable {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 21 | [NormedAddCommGroup Y] [InnerProductSpace ℝ Y] |
| 22 | |
| 23 | /-- Covector momentum of the actual endpoint-time branch. -/ |
| 24 | noncomputable def actionBranchMomentum (E : X × ℝ → Y) |
| 25 | (B : Y × ℝ → Y →L[ℝ] Y →L[ℝ] ℝ) (z : X × ℝ) : Y →L[ℝ] ℝ := |
| 26 | (2 * Real.sqrt z.2) • B (E z, z.2) (fderiv ℝ E z (0, 1)) |
| 27 | |
| 28 | /-- The time, endpoint, and momentum of one fixed initial vector. -/ |
| 29 | noncomputable def actionBranchPhase (E : X × ℝ → Y) |
| 30 | (B : Y × ℝ → Y →L[ℝ] Y →L[ℝ] ℝ) (Z : X) (t : ℝ) : |
| 31 | ℝ × Y × (Y →L[ℝ] ℝ) := |
| 32 | (t, E (Z, t), actionBranchMomentum E B (Z, t)) |
| 33 | |
| 34 | /-- Smooth endpoint and metric germs give a smooth actual momentum at positive time. -/ |
| 35 | theorem actionBranchMomentum_contDiffAt {E : X × ℝ → Y} |
| 36 | {B : Y × ℝ → Y →L[ℝ] Y →L[ℝ] ℝ} {z : X × ℝ} |
| 37 | (hE : ContDiffAt ℝ ∞ E z) (hB : ContDiffAt ℝ ∞ B (E z, z.2)) |
| 38 | (ht : 0 < z.2) : ContDiffAt ℝ ∞ (actionBranchMomentum E B) z := by |
| 39 | exact (contDiffAt_const.mul (contDiffAt_snd.sqrt ht.ne')).smul |
| 40 | ((hB.comp z (hE.prodMk contDiffAt_snd)).clm_apply |
| 41 | ((hE.fderiv_right (by simp)).clm_apply contDiffAt_const)) |
| 42 | |
| 43 | /-- The two actual action germs yield the full phase equation at a noncritical point. -/ |
| 44 | theorem hasDerivAt_actionBranchPhase |
| 45 | {E : X × ℝ → Y} {A : X × ℝ → ℝ} |
| 46 | {B : Y × ℝ → Y →L[ℝ] Y →L[ℝ] ℝ} {R : Y × ℝ → ℝ} {z : X × ℝ} |
| 47 | (hE : ContDiffAt ℝ 2 E z) (hA : ContDiffAt ℝ 2 A z) |
| 48 | (hP : DifferentiableAt ℝ (actionBranchMomentum E B) z) |
| 49 | (hL : DifferentiableAt ℝ (kineticLagrangian B R) |
| 50 | (z.2, E z, fderiv ℝ E z (0, 1))) |
| 51 | (ht : 0 < z.2) (hi : (B (E z, z.2)).IsInvertible) |
| 52 | (hsym : ∀ u v : Y, B (E z, z.2) u v = B (E z, z.2) v u) |
| 53 | (hspace : ∀ᶠ w in 𝓝 z, ∀ h : X, |
| 54 | fderiv ℝ A w (h, 0) = actionBranchMomentum E B w (fderiv ℝ E w (h, 0))) |
| 55 | (htime : ∀ᶠ w in 𝓝 z, |
| 56 | fderiv ℝ A w (0, 1) = kineticLagrangian B R |
| 57 | (w.2, E w, fderiv ℝ E w (0, 1))) |
| 58 | (hsurj : Function.Surjective (fun h : X ↦ fderiv ℝ E z (h, 0))) : |
| 59 | HasDerivAt (actionBranchPhase E B z.1) |
| 60 | (phaseField B R (actionBranchPhase E B z.1 z.2)) z.2 := by |
| 61 | have hvelocity (v : Y) : |
| 62 | fderiv ℝ (kineticLagrangian B R) (z.2, E z, fderiv ℝ E z (0, 1)) |
| 63 | (0, 0, v) = actionBranchMomentum E B z v := by |
| 64 | exact kineticLagrangian_velocity_derivative hL hsym v |
| 65 | have hmoment : fderiv ℝ (actionBranchMomentum E B) z (0, 1) = |
| 66 | (fderiv ℝ (kineticLagrangian B R) (z.2, E z, fderiv ℝ E z (0, 1))).comp |
| 67 | ((0 : Y →L[ℝ] ℝ).prod |
| 68 | ((ContinuousLinearMap.id ℝ Y).prod (0 : Y →L[ℝ] Y))) := by |
| 69 | ext v |
| 70 | exact momentum_time_derivative_of_action hE hA hP hL |
| 71 | hspace htime hvelocity hsurj v |
| 72 | have hd : HasDerivAt (actionBranchPhase E B z.1) |
| 73 | (1, fderiv ℝ E z (0, 1), fderiv ℝ (actionBranchMomentum E B) z (0, 1)) z.2 := |
| 74 | (hasDerivAt_id z.2).prodMk |
| 75 | ((hasDerivAt_time_slice (hE.differentiableAt two_ne_zero)).prodMk |
| 76 | (hasDerivAt_time_slice hP)) |
| 77 | have heq : phaseField B R (actionBranchPhase E B z.1 z.2) = |
| 78 | (1, fderiv ℝ E z (0, 1), fderiv ℝ (actionBranchMomentum E B) z (0, 1)) := by |
| 79 | dsimp only [phaseField, actionBranchPhase, actionBranchMomentum] |
| 80 | rw [phaseVelocity_of_momentum B (E z) ht hi, hmoment] |
| 81 | rwa [← heq] at hd |
| 82 | |
| 83 | end PoincareMT.ReducedVolume |