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.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Fields.VariationPaths |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Action.VariationAction |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Action.FirstVariation |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.IndexForm.FixedEndpointBoundary |
| 6 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.Index.IndexPositivity |
| 7 | |
| 8 | /-! |
| 9 | # Positivity consequences for actual fixed-endpoint variations |
| 10 | |
| 11 | Morgan-Tian Lemma 6.4 and Proposition 6.33, pp. 107-108, 121-122. |
| 12 | Admissible variation slices give an actual local action minimum. M08's |
| 13 | generic scalar second-derivative theorem gives nonnegativity. The index |
| 14 | form consequence explicitly takes the geometric variation identity as |
| 15 | input; this module does not assume that identity through a new definition. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | open scoped Manifold ContDiff Bundle |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M14 |
| 25 | |
| 26 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 27 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 28 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 29 | {R : M14SquareRootPath G p} |
| 30 | |
| 31 | /-- The actual second derivative of a fixed-endpoint variation at a |
| 32 | minimizing path is nonnegative, Proposition 6.33, pp. 121-122. -/ |
| 33 | theorem secondDerivative_variationAction_nonneg (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 34 | (V : M14LVariationData G p R) (hmin : M14IsMinimizing p) |
| 35 | (hfix : M14BothEndpointsFixed V) {d : ℝ} |
| 36 | (hd : HasDerivAt (fun u => deriv (M14VariationAction V) u) d 0) : 0 ≤ d := by |
| 37 | have hz : (0 : ℝ) ∈ V.parameterDomain := by |
| 38 | rw [V.parameterDomain_eq] |
| 39 | exact ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩ |
| 40 | exact M08.secondDerivative_nonneg_of_localMin (isLocalMin_variationAction V hmin hfix) |
| 41 | (hasDerivAt_variationAction_integral hM12 V hz).continuousAt hd |
| 42 | |
| 43 | /-- At a minimizing fixed-endpoint variation, a proved first-variation |
| 44 | identity forces its actual residual integral to vanish, Lemma 6.4, |
| 45 | pp. 107-108. -/ |
| 46 | theorem firstVariationResidualIntegral_eq_zero_of_identity (V : M14LVariationData G p R) |
| 47 | (D : M14VariationDerivativeData V) (hmin : M14IsMinimizing p) |
| 48 | (hfix : M14BothEndpointsFixed V) (hid : M14FirstVariationIdentity V D) : |
| 49 | M14FirstVariationResidualIntegral V D = 0 := by |
| 50 | have h := hasDerivAt_variationAction_eq_zero V hmin hfix hid |
| 51 | simpa only [firstVariationBoundaryTerm_eq_zero V hfix, zero_add] using h |
| 52 | |
| 53 | /-- The actual paired residual integral vanishes for every fixed-endpoint |
| 54 | variation of a minimizing path, Lemma 6.4, pp. 107-108. -/ |
| 55 | theorem firstVariationResidualIntegral_eq_zero |
| 56 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 57 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 58 | (V : M14LVariationData G p R) (D : M14VariationDerivativeData V) |
| 59 | (hmin : M14IsMinimizing p) (hfix : M14BothEndpointsFixed V) : |
| 60 | M14FirstVariationResidualIntegral V D = 0 := |
| 61 | firstVariationResidualIntegral_eq_zero_of_identity V D hmin hfix |
| 62 | (firstVariationIdentity hCoordinates hM12 V D) |
| 63 | |
| 64 | /-- A proved second-variation identity identifies the nonnegative second |
| 65 | derivative with the actual fixed-endpoint index form, Proposition 6.33, |
| 66 | pp. 121-122. -/ |
| 67 | theorem secondVariationIndexForm_nonneg_of_identity (V : M14LVariationData G p R) |
| 68 | (D : M14VariationDerivativeData V) (hmin : M14IsMinimizing p) |
| 69 | (hfix : M14BothEndpointsFixed V) (hid : M14SecondVariationIdentity V D) : |
| 70 | 0 ≤ M14SecondVariationIndexForm V D := by |
| 71 | obtain ⟨⟨d₁, hd₁, _⟩, ⟨d₂, hd₂, heq⟩⟩ := hid |
| 72 | have h := M08.secondDerivative_nonneg_of_localMin |
| 73 | (isLocalMin_variationAction V hmin hfix) hd₁.continuousAt hd₂ |
| 74 | rwa [heq, secondVariationBoundaryTerm_eq_zero V D hfix, zero_add] at h |
| 75 | |
| 76 | end PoincareMT.M14 |