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.Variation.IndexForm.IndexKernelInterior |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Manifold.SectionThroughVector |
| 3 | |
| 4 | /-! |
| 5 | # The exact fixed-endpoint index kernel |
| 6 | |
| 7 | Morgan-Tian Proposition 6.13, Lemma 6.14 and Corollary 6.16, |
| 8 | pp. 110-112. Continuity carries the interior Jacobi equation to |
| 9 | both closed endpoints. The resulting witness retains the actual |
| 10 | variation field and its supplied first extension exactly, as required |
| 11 | by the frozen generalized path-calculus contract. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 26 | {R : M14SquareRootPath G p} |
| 27 | |
| 28 | /-- The actual Jacobi residual of a zero-index fixed-endpoint |
| 29 | variation vanishes on the entire closed square interval, including |
| 30 | initial time zero, Proposition 6.13 and Lemma 6.14, pp. 110-112. -/ |
| 31 | theorem jacobiResidual_eq_zero_of_index_zero |
| 32 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 33 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 34 | (V : M14LVariationData G p R) (D : M14VariationDerivativeData V) |
| 35 | (hmin : M14IsMinimizing p) (hfix : M14BothEndpointsFixed V) |
| 36 | (hzero : M14SecondVariationIndexForm V D = 0) |
| 37 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) |
| 38 | (W : G.Horizontal (R.curve s)) : |
| 39 | let Q := jacobiFieldDataOfExtension |
| 40 | (hM12.coordinate_gauges X time I G.spacetime G.slices |
| 41 | G.timeIntervals G.gaugeCover G.leafwise) D.variation_extension |
| 42 | M14JacobiResidual G R Q s W = 0 := by |
| 43 | dsimp only |
| 44 | let Q := jacobiFieldDataOfExtension |
| 45 | (hM12.coordinate_gauges X time I G.spacetime G.slices |
| 46 | G.timeIntervals G.gaugeCover G.leafwise) D.variation_extension |
| 47 | have hab := Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt |
| 48 | obtain ⟨Z, hZ, hZs⟩ := FiberBundle.exists_contMDiff_section_through |
| 49 | (I := spacetimeModel n) (F := EuclideanSpace ℝ (Fin n)) W |
| 50 | obtain ⟨EZ⟩ := exists_pullbackExtension_Icc (G := G) (γ := R.curve) |
| 51 | (Y := fun r => Z (R.curve r)) hab |
| 52 | (hZ.comp_contMDiffOn (R.smooth.mono R.interval_subset)) |
| 53 | have hcont := (jacobiResidual_contDiffOn R Q EZ hM04 hM12).continuousOn |
| 54 | have hz : EqOn (fun r => M14JacobiResidual G R Q r (Z (R.curve r))) |
| 55 | (fun _ => 0) (Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) := by |
| 56 | intro r hr |
| 57 | exact jacobiResidual_eq_zero_of_index_zero_interior hCoordinates hM04 hM12 V D |
| 58 | hmin hfix hzero hr _ |
| 59 | have hclosed := hz.of_subset_closure hcont continuousOn_const Ioo_subset_Icc_self |
| 60 | (show M14SqrtParameterInterval τ₁ τ₂ ⊆ closure (Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) by |
| 61 | rw [closure_Ioo hab.ne] |
| 62 | exact Subset.rfl) |
| 63 | simpa only [hZs] using hclosed hs |
| 64 | |
| 65 | /-- Zero index yields the exact frozen Jacobi witness, preserving |
| 66 | the supplied variation extension and both zero endpoint fields, |
| 67 | Proposition 6.13 and Lemma 6.14, pp. 110-112. -/ |
| 68 | theorem variationJacobiCondition_of_index_zero |
| 69 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 70 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 71 | (V : M14LVariationData G p R) (D : M14VariationDerivativeData V) |
| 72 | (hmin : M14IsMinimizing p) (hfix : M14BothEndpointsFixed V) |
| 73 | (hzero : M14SecondVariationIndexForm V D = 0) : M14VariationJacobiCondition V D := by |
| 74 | let Q := jacobiFieldDataOfExtension |
| 75 | (hM12.coordinate_gauges X time I G.spacetime G.slices |
| 76 | G.timeIntervals G.gaugeCover G.leafwise) D.variation_extension |
| 77 | obtain ⟨hleft, hright⟩ := variationField_fixed_endpoints_eq_zero V hfix |
| 78 | exact ⟨Q, rfl, HEq.rfl, hleft, hright, fun _ hs W => |
| 79 | jacobiResidual_eq_zero_of_index_zero hCoordinates hM04 hM12 V D hmin hfix hzero hs W⟩ |
| 80 | |
| 81 | /-- The exact frozen fixed-endpoint index-kernel statement: the |
| 82 | second-variation identity, removed boundary term, Euler equation, |
| 83 | positivity and Jacobi characterization share one actual derivative |
| 84 | record, Proposition 6.13 and Lemma 6.14, pp. 110-112. -/ |
| 85 | theorem fixedEndpointIndexKernelStatement |
| 86 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 87 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) : |
| 88 | M14FixedEndpointIndexKernelStatement G := by |
| 89 | intro T τ₁ τ₂ x y p R V hmin hfix |
| 90 | obtain ⟨D⟩ := exists_variationDerivativeData V |
| 91 | have heuler : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, ∀ W : G.Horizontal (R.curve s), |
| 92 | M14SquareRootEulerResidual G R D.base_extension s W = 0 := |
| 93 | fun _ hs W => squareRootEulerResidual_eq_zero_of_minimizing hCoordinates hM12 hmin |
| 94 | D.base_extension hs W |
| 95 | exact ⟨D, secondVariationIdentity_of_squareEuler hCoordinates hM04 hM12 V D heuler, |
| 96 | secondVariationBoundaryTerm_eq_zero V D hfix, heuler, |
| 97 | secondVariationIndexForm_nonneg hCoordinates hM04 hM12 V D hmin hfix, |
| 98 | variationJacobiCondition_of_index_zero hCoordinates hM04 hM12 V D hmin hfix, |
| 99 | index_zero_of_variationJacobiCondition hM04 hM12 V D⟩ |
| 100 | |
| 101 | end PoincareMT.M14 |