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.Exponential.Families.FamilyActionComparison |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.Action.ActionFirstVariation |
| 3 | |
| 4 | /-! |
| 5 | # The actual directional differential of a parameterized action |
| 6 | |
| 7 | Morgan-Tian Lemma 6.22, pp. 115-116. Restriction to an affine |
| 8 | parameter line gives a genuine frozen variation. Its action agrees |
| 9 | locally with the actual family integral, so first variation identifies |
| 10 | the Frechet differential with the final square-momentum pairing. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 23 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 24 | {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] |
| 25 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 26 | {R : M14SquareRootPath G p} |
| 27 | |
| 28 | /-- First variation computes the actual Frechet action differential |
| 29 | along a realized parameter direction through an Euler branch with |
| 30 | stationary initial endpoint, Lemma 6.22, pp. 115-116. -/ |
| 31 | theorem fderiv_squareFamilyAction_euler_line |
| 32 | (hCoordinates : M12MetricPredecessors.{0} n) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 33 | (E : M14PullbackExtension G R.curve (M14SqrtParameterInterval a b) R.horizontal_velocity) |
| 34 | (hEuler : ∀ s ∈ M14SqrtParameterInterval a b, ∀ W, |
| 35 | M14SquareRootEulerResidual G R E s W = 0) |
| 36 | (V : M14LVariationData G p R) (γ : ℝ × P → G.Point) {C : Set ℝ} {U : Set P} |
| 37 | (hγ : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, P))) (spacetimeModel n) ∞ γ (C ×ˢ U)) |
| 38 | (hsub : M14SqrtParameterInterval a b ⊆ C) |
| 39 | (hclock : ∀ s ∈ C, ∀ z ∈ U, G.spacetime.timeFunction (γ (s, z)) = T - s ^ 2) |
| 40 | (z d : P) (hparam : ∀ u ∈ V.parameterDomain, z + u • d ∈ U) |
| 41 | (hV : ∀ s ∈ M14SqrtParameterInterval a b, ∀ u, V.squareFamily s u = γ (s, z + u • d)) |
| 42 | (hzero : M14VariationField V (Real.sqrt a) = 0) |
| 43 | (hdiff : DifferentiableAt ℝ (squareFamilyAction G γ C (Real.sqrt a) (Real.sqrt b)) z) : |
| 44 | fderiv ℝ (squareFamilyAction G γ C (Real.sqrt a) (Real.sqrt b)) z d = |
| 45 | G.spacetime.horizontalMetric.inner (R.curve (Real.sqrt b)) |
| 46 | (R.horizontal_velocity (Real.sqrt b)) (M14VariationField V (Real.sqrt b)) := by |
| 47 | have hfirst := firstVariation_euler_fixedInitial hCoordinates hM12 E hEuler V hzero |
| 48 | have h0 : (0 : ℝ) ∈ V.parameterDomain := by |
| 49 | rw [V.parameterDomain_eq] |
| 50 | exact ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 51 | have hP : IsOpen V.parameterDomain := V.parameterDomain_eq ▸ isOpen_Ioo |
| 52 | have heq : (fun u => squareFamilyAction G γ C (Real.sqrt a) (Real.sqrt b) (z + u • d)) =ᶠ[𝓝 0] |
| 53 | M14VariationAction V := by |
| 54 | filter_upwards [hP.mem_nhds h0] with u hu |
| 55 | exact (variationAction_eq_squareFamilyAction hM12 V γ hγ hsub hclock hu |
| 56 | (hparam u hu) (fun s hs => hV s hs u)).symm |
| 57 | have hline : HasDerivAt (fun u : ℝ => z + u • d) d 0 := by |
| 58 | simpa only [id_eq, one_smul] using ((hasDerivAt_id (0 : ℝ)).smul_const d).const_add z |
| 59 | have hactual := hdiff.hasFDerivAt.comp_hasDerivAt_of_eq 0 hline |
| 60 | (by simp only [zero_smul, add_zero]) |
| 61 | exact hactual.unique (hfirst.congr_of_eventuallyEq heq) |
| 62 | |
| 63 | end PoincareMT.M14 |