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.IndexForm.PullbackLinearity |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.IndexForm.IndexAlgebra |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.IndexForm.IndexJacobi |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Action.SecondVariation |
| 6 | |
| 7 | /-! |
| 8 | # Actual affine variation and the index polynomial |
| 9 | |
| 10 | Morgan-Tian Proposition 6.13 and Corollary 6.16, pp. 110-112. |
| 11 | Actual affine variation fields have the exact quadratic index form. |
| 12 | Minimality and direct M08 scalar polarization force its mixed term |
| 13 | to vanish when the original index is zero, provided every affine |
| 14 | field is realized by an actual fixed-endpoint variation. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set MeasureTheory |
| 20 | open scoped Manifold ContDiff intervalIntegral |
| 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 | /-- Actual affine variation fields give the pointwise quadratic |
| 32 | identity for their frozen index densities, Proposition 6.13 and |
| 33 | Corollary 6.16, pp. 110-112. -/ |
| 34 | theorem variation_index_density_affine |
| 35 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 36 | (V W : M14LVariationData G p R) |
| 37 | (DV : M14VariationDerivativeData V) (DW : M14VariationDerivativeData W) |
| 38 | (Z : ∀ s, G.Horizontal (R.curve s)) |
| 39 | (EZ : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) Z) (c : ℝ) |
| 40 | (hfield : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, |
| 41 | M14VariationField W s = M14VariationField V s + c • Z s) |
| 42 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) : |
| 43 | M14SecondVariationIndexDensity W DW s = M14SecondVariationIndexDensity V DV s + |
| 44 | 2 * c * pullbackIndexPairDensity R DV.variation_extension EZ s + |
| 45 | c ^ 2 * pullbackIndexPairDensity R EZ EZ s := by |
| 46 | have hderiv := horizontalCovariantDerivative_affine_congr DV.variation_extension EZ |
| 47 | DW.variation_extension c hfield hs |
| 48 | (uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt) s hs) |
| 49 | ((R.smooth.mono R.interval_subset s hs).mdifferentiableWithinAt (by simp)) |
| 50 | rw [secondVariationIndexDensity_eq_pair R W DW s, secondVariationIndexDensity_eq_pair R V DV s] |
| 51 | simp only [pullbackIndexPairDensity] |
| 52 | rw [hfield s hs, hderiv] |
| 53 | exact horizontalIndexPairDensity_quadratic R hM04 hM12 hs (M14VariationField V s) (Z s) _ _ c |
| 54 | |
| 55 | /-- The frozen index form of an actual affine variation is the |
| 56 | integral quadratic polynomial, with every density integrable, |
| 57 | Proposition 6.13 and Corollary 6.16, pp. 110-112. -/ |
| 58 | theorem variation_index_form_affine |
| 59 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 60 | (V W : M14LVariationData G p R) |
| 61 | (DV : M14VariationDerivativeData V) (DW : M14VariationDerivativeData W) |
| 62 | (Z : ∀ s, G.Horizontal (R.curve s)) |
| 63 | (EZ : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) Z) (c : ℝ) |
| 64 | (hfield : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, |
| 65 | M14VariationField W s = M14VariationField V s + c • Z s) : |
| 66 | M14SecondVariationIndexForm W DW = M14SecondVariationIndexForm V DV + |
| 67 | 2 * c * (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, |
| 68 | pullbackIndexPairDensity R DV.variation_extension EZ s) + |
| 69 | c ^ 2 * (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, pullbackIndexPairDensity R EZ EZ s) := by |
| 70 | have hab := Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt |
| 71 | have hCoordinates := hM12.coordinate_gauges X time I G.spacetime G.slices |
| 72 | G.timeIntervals G.gaugeCover G.leafwise |
| 73 | have hI {A B : ∀ s, G.Horizontal (R.curve s)} |
| 74 | (EA : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) A) |
| 75 | (EB : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) B) : |
| 76 | IntervalIntegrable (pullbackIndexPairDensity R EA EB) volume |
| 77 | (Real.sqrt τ₁) (Real.sqrt τ₂) := |
| 78 | (pullbackIndexPairDensity_contDiffOn R (jacobiFieldDataOfExtension hCoordinates EA) |
| 79 | EB hM04 hM12).continuousOn.intervalIntegrable_of_Icc hab.le |
| 80 | have hVV := hI DV.variation_extension DV.variation_extension |
| 81 | have hVZ := hI DV.variation_extension EZ |
| 82 | have hZZ := hI EZ EZ |
| 83 | have hidx : IntervalIntegrable (M14SecondVariationIndexDensity V DV) volume |
| 84 | (Real.sqrt τ₁) (Real.sqrt τ₂) := by |
| 85 | apply hVV.congr_uIoo |
| 86 | intro s hs |
| 87 | exact (secondVariationIndexDensity_eq_pair R V DV s).symm |
| 88 | unfold M14SecondVariationIndexForm |
| 89 | calc |
| 90 | (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, M14SecondVariationIndexDensity W DW s) = |
| 91 | ∫ s in Real.sqrt τ₁..Real.sqrt τ₂, |
| 92 | M14SecondVariationIndexDensity V DV s + |
| 93 | 2 * c * pullbackIndexPairDensity R DV.variation_extension EZ s + |
| 94 | c ^ 2 * pullbackIndexPairDensity R EZ EZ s := |
| 95 | intervalIntegral.integral_congr_Ioo_of_le hab.le (fun s hs => |
| 96 | variation_index_density_affine hM04 hM12 V W DV DW Z EZ c hfield (Ioo_subset_Icc_self hs)) |
| 97 | _ = _ := by |
| 98 | rw [intervalIntegral.integral_add (hidx.add (hVZ.const_mul _)) (hZZ.const_mul _), |
| 99 | intervalIntegral.integral_add hidx (hVZ.const_mul _), |
| 100 | intervalIntegral.integral_const_mul, intervalIntegral.integral_const_mul] |
| 101 | |
| 102 | /-- If every affine test field is realized by an actual fixed-endpoint |
| 103 | variation, minimality and zero original index force the mixed index |
| 104 | pair to vanish, Proposition 6.13, pp. 110-112. -/ |
| 105 | theorem index_pair_zero_of_affine_variations |
| 106 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 107 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 108 | (V : M14LVariationData G p R) (D : M14VariationDerivativeData V) |
| 109 | (hmin : M14IsMinimizing p) (hzero : M14SecondVariationIndexForm V D = 0) |
| 110 | (Z : ∀ s, G.Horizontal (R.curve s)) |
| 111 | (EZ : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) Z) |
| 112 | (hrealize : ∀ c : ℝ, ∃ W : M14LVariationData G p R, M14BothEndpointsFixed W ∧ |
| 113 | ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, |
| 114 | M14VariationField W s = M14VariationField V s + c • Z s) : |
| 115 | (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, |
| 116 | pullbackIndexPairDensity R D.variation_extension EZ s) = 0 := by |
| 117 | apply M08.mixedTerm_eq_zero_of_quadratic_nonneg |
| 118 | (C := ∫ s in Real.sqrt τ₁..Real.sqrt τ₂, pullbackIndexPairDensity R EZ EZ s) |
| 119 | intro c |
| 120 | obtain ⟨W, hfix, hfield⟩ := hrealize c |
| 121 | obtain ⟨DW⟩ := exists_variationDerivativeData W |
| 122 | have hnonneg := secondVariationIndexForm_nonneg hCoordinates hM04 hM12 W DW hmin hfix |
| 123 | rw [variation_index_form_affine hM04 hM12 V W D DW Z EZ c hfield, hzero, zero_add] at hnonneg |
| 124 | exact hnonneg |
| 125 | |
| 126 | end PoincareMT.M14 |