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.LGeometry.Variation.SupportedChartField |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Coordinates.PullbackLinearity |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.Index.IndexGreen |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Second.SecondVariation |
| 5 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.Index.IndexPositivity |
| 6 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.Index.JacobiTestFields |
| 7 | |
| 8 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/SupportedIndexVariation.lean` at |
| 9 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 10 | |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | open Set Filter Topology MeasureTheory |
| 18 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.LGeometry |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ τ₂ : ℝ} |
| 27 | {p : BackwardTimePath F T τ₁ τ₂} |
| 28 | |
| 29 | theorem exists_supportedChartFieldExtension (hM04 : RicciFlowCurvatureTheory.{u}) |
| 30 | (V : FixedEndpointLVariation F T τ₁ τ₂ p) (D : LVariationDerivativeData V.toLVariation) |
| 31 | (x : M) (η : ℝ → EuclideanSpace ℝ (Fin n)) (hη : ContDiff ℝ ∞ η) |
| 32 | (hsrc : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, s ∈ tsupport η → |
| 33 | V.toLVariation.baseSquareCurve s ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 34 | (hleft : η (Real.sqrt τ₁) = 0) (hright : η (Real.sqrt τ₂) = 0) : |
| 35 | Nonempty (ParametricAlongCurveExtensionOn (sqrtParameterInterval τ₁ τ₂) |
| 36 | V.toLVariation.baseSquareCurve |
| 37 | (fun s ↦ chartFrame x (η s) (V.toLVariation.baseSquareCurve s))) := by |
| 38 | let A := variationSqrtRegularPath V.toLVariation |
| 39 | exact exists_closedSectionExtension (Real.sqrt_lt_sqrt p.nonnegative p.ordered) |
| 40 | A.open_domain A.interval_subset A.curve A.smooth _ |
| 41 | (supportedChartField_contMDiffOn A.open_domain A.interval_subset A.curve A.smooth x η hη hsrc) |
| 42 | |
| 43 | set_option maxHeartbeats 1200000 in |
| 44 | theorem variation_index_density_affine (hM04 : RicciFlowCurvatureTheory.{u}) |
| 45 | (V W : LVariation F T τ₁ τ₂ p) |
| 46 | (DV : LVariationDerivativeData V) (DW : LVariationDerivativeData W) |
| 47 | (Z : ∀ s, TangentSpace (𝓡 n) (V.baseSquareCurve s)) |
| 48 | (EZ : ParametricAlongCurveExtensionOn (sqrtParameterInterval τ₁ τ₂) V.baseSquareCurve Z) |
| 49 | (c : ℝ) |
| 50 | (hfield : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, |
| 51 | squareVariationField W s = squareVariationField V s + c • Z s) |
| 52 | {s : ℝ} (hs : s ∈ sqrtParameterInterval τ₁ τ₂) : |
| 53 | secondVariationIndexDensity W DW s = secondVariationIndexDensity V DV s + |
| 54 | 2 * c * pullbackIndexPairDensity F T DV.variation_extension EZ s + |
| 55 | c ^ 2 * pullbackIndexPairDensity F T EZ EZ s := by |
| 56 | let C := sqrtParameterInterval τ₁ τ₂ |
| 57 | have hcurve : EqOn W.baseSquareCurve V.baseSquareCurve C := |
| 58 | sqrtRegularPath_eqOn (variationSqrtRegularPath W) (variationSqrtRegularPath V) |
| 59 | have hab : Real.sqrt τ₁ < Real.sqrt τ₂ := Real.sqrt_lt_sqrt p.nonnegative p.ordered |
| 60 | have hderiv : pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) W.baseSquareCurve |
| 61 | (squareVariationField W) C DW.variation_extension s = |
| 62 | pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) V.baseSquareCurve |
| 63 | (squareVariationField V) C DV.variation_extension s + |
| 64 | c • pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) V.baseSquareCurve Z C EZ s := by |
| 65 | rw [pullbackCovariantDerivative_congr F (fun r ↦ T - r ^ 2) hcurve hfield |
| 66 | DW.variation_extension (affineParametricExtension DV.variation_extension EZ c) hs |
| 67 | (uniqueDiffOn_Icc hab s hs) (variationBaseSquare_mdifferentiableAt V hs)] |
| 68 | exact pullbackCovariantDerivative_affine F _ DV.variation_extension EZ c hs |
| 69 | have hvelocity := curveVelocityWithin_congr (n := n) hcurve hs |
| 70 | have hpair : regularizedIndexPairDensity F T W.baseSquareCurve C s |
| 71 | (squareVariationField W s) (squareVariationField W s) |
| 72 | (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) W.baseSquareCurve |
| 73 | (squareVariationField W) C DW.variation_extension s) |
| 74 | (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) W.baseSquareCurve |
| 75 | (squareVariationField W) C DW.variation_extension s) = |
| 76 | regularizedIndexPairDensity F T V.baseSquareCurve C s |
| 77 | (squareVariationField V s + c • Z s) (squareVariationField V s + c • Z s) |
| 78 | (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) V.baseSquareCurve |
| 79 | (squareVariationField V) C DV.variation_extension s + |
| 80 | c • pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) V.baseSquareCurve Z C EZ s) |
| 81 | (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) V.baseSquareCurve |
| 82 | (squareVariationField V) C DV.variation_extension s + |
| 83 | c • pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) V.baseSquareCurve Z C EZ s) := by |
| 84 | unfold regularizedIndexPairDensity jacobiPairResidual |
| 85 | rw [hderiv, hfield s hs, hvelocity, hcurve hs] |
| 86 | rw [secondVariationIndexDensity_eq_pair hM04 W DW hs, hpair, |
| 87 | secondVariationIndexDensity_eq_pair hM04 V DV hs] |
| 88 | exact regularizedIndexPairDensity_quadratic F hM04 T hab |
| 89 | (fun r hr ↦ p.time_mem _ (square_mem_backward_interval p hr)) V.baseSquareCurve hs |
| 90 | (variationBaseSquare_mdifferentiableAt V hs) (squareVariationField V s) (Z s) |
| 91 | (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) V.baseSquareCurve |
| 92 | (squareVariationField V) C DV.variation_extension s) |
| 93 | (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) V.baseSquareCurve Z C EZ s) c |
| 94 | |
| 95 | theorem variation_index_form_affine (hM04 : RicciFlowCurvatureTheory.{u}) |
| 96 | (V W : LVariation F T τ₁ τ₂ p) |
| 97 | (DV : LVariationDerivativeData V) (DW : LVariationDerivativeData W) |
| 98 | (Z : ∀ s, TangentSpace (𝓡 n) (V.baseSquareCurve s)) |
| 99 | (EZ : ParametricAlongCurveExtensionOn (sqrtParameterInterval τ₁ τ₂) V.baseSquareCurve Z) |
| 100 | (c : ℝ) |
| 101 | (hfield : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, |
| 102 | squareVariationField W s = squareVariationField V s + c • Z s) : |
| 103 | secondVariationIndexForm W DW = secondVariationIndexForm V DV + |
| 104 | 2 * c * (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, |
| 105 | pullbackIndexPairDensity F T DV.variation_extension EZ s) + |
| 106 | c ^ 2 * (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, pullbackIndexPairDensity F T EZ EZ s) := by |
| 107 | let R := variationSqrtRegularPath V |
| 108 | have hab : Real.sqrt τ₁ < Real.sqrt τ₂ := Real.sqrt_lt_sqrt p.nonnegative p.ordered |
| 109 | have htime (r : ℝ) (hr : r ∈ sqrtParameterInterval τ₁ τ₂) : T - r ^ 2 ∈ J := |
| 110 | p.time_mem _ (square_mem_backward_interval p hr) |
| 111 | have hI (A B : ∀ s, TangentSpace (𝓡 n) (V.baseSquareCurve s)) |
| 112 | (EA : ParametricAlongCurveExtensionOn (sqrtParameterInterval τ₁ τ₂) V.baseSquareCurve A) |
| 113 | (EB : ParametricAlongCurveExtensionOn (sqrtParameterInterval τ₁ τ₂) V.baseSquareCurve B) : |
| 114 | IntervalIntegrable (pullbackIndexPairDensity F T EA EB) volume |
| 115 | (Real.sqrt τ₁) (Real.sqrt τ₂) := |
| 116 | (pullbackIndexPairDensity_contDiffOn F hM04 T hab htime R.open_domain R.interval_subset |
| 117 | R.curve R.smooth A B EA EB).continuousOn.intervalIntegrable_of_Icc hab.le |
| 118 | have hVV := hI _ _ DV.variation_extension DV.variation_extension |
| 119 | have hVZ := hI _ _ DV.variation_extension EZ |
| 120 | have hZZ := hI _ _ EZ EZ |
| 121 | have hidx : IntervalIntegrable (secondVariationIndexDensity V DV) volume |
| 122 | (Real.sqrt τ₁) (Real.sqrt τ₂) := by |
| 123 | apply hVV.congr_uIoo |
| 124 | intro s hs |
| 125 | rw [uIoo_of_le hab.le] at hs |
| 126 | exact (secondVariationIndexDensity_eq_pair hM04 V DV (Ioo_subset_Icc_self hs)).symm |
| 127 | unfold secondVariationIndexForm |
| 128 | calc |
| 129 | (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, secondVariationIndexDensity W DW s) = |
| 130 | ∫ s in Real.sqrt τ₁..Real.sqrt τ₂, |
| 131 | secondVariationIndexDensity V DV s + |
| 132 | 2 * c * pullbackIndexPairDensity F T DV.variation_extension EZ s + |
| 133 | c ^ 2 * pullbackIndexPairDensity F T EZ EZ s := |
| 134 | intervalIntegral.integral_congr_Ioo_of_le hab.le (fun s hs ↦ |
| 135 | variation_index_density_affine hM04 V W DV DW Z EZ c hfield (Ioo_subset_Icc_self hs)) |
| 136 | _ = _ := by |
| 137 | rw [intervalIntegral.integral_add (hidx.add (hVZ.const_mul _)) (hZZ.const_mul _), |
| 138 | intervalIntegral.integral_add hidx (hVZ.const_mul _), |
| 139 | intervalIntegral.integral_const_mul, intervalIntegral.integral_const_mul] |
| 140 | |
| 141 | theorem index_pair_zero_of_index_zero (hM04 : RicciFlowCurvatureTheory.{u}) |
| 142 | (hmin : IsMinimizingBackwardLPath F T τ₁ τ₂ p) |
| 143 | (R : RegularizedLGeodesicData p) |
| 144 | (V : FixedEndpointLVariation F T τ₁ τ₂ p) (D : LVariationDerivativeData V.toLVariation) |
| 145 | (hzero : secondVariationIndexForm V.toLVariation D = 0) |
| 146 | (x : M) (η : ℝ → EuclideanSpace ℝ (Fin n)) (hη : ContDiff ℝ ∞ η) |
| 147 | (hsrc : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, s ∈ tsupport η → |
| 148 | V.toLVariation.baseSquareCurve s ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 149 | (hleft : η (Real.sqrt τ₁) = 0) (hright : η (Real.sqrt τ₂) = 0) |
| 150 | (Eη : ParametricAlongCurveExtensionOn (sqrtParameterInterval τ₁ τ₂) |
| 151 | V.toLVariation.baseSquareCurve |
| 152 | (fun s ↦ chartFrame x (η s) (V.toLVariation.baseSquareCurve s))) : |
| 153 | (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, |
| 154 | pullbackIndexPairDensity F T D.variation_extension Eη s) = 0 := by |
| 155 | apply mixedTerm_eq_zero_of_quadratic_nonneg |
| 156 | (C := ∫ s in Real.sqrt τ₁..Real.sqrt τ₂, pullbackIndexPairDensity F T Eη Eη s) |
| 157 | intro c |
| 158 | obtain ⟨W, _, hfamily, _⟩ := exists_supportedChartVariation hM04 V x η hη c hsrc hleft hright |
| 159 | obtain ⟨DW⟩ := exists_variationDerivativeData W.toLVariation |
| 160 | have hnonneg := secondVariation_nonneg hM04 hmin W |
| 161 | (hasDerivAt_secondVariation hM04 W.toLVariation DW R) |
| 162 | rw [secondVariationBoundaryTerm_eq_zero W DW, zero_add] at hnonneg |
| 163 | rw [variation_index_form_affine hM04 V.toLVariation W.toLVariation D DW _ Eη c |
| 164 | (fun s hs ↦ supportedChartVariation_squareField V.toLVariation W.toLVariation x η hη c |
| 165 | hfamily hsrc hs), hzero, zero_add] at hnonneg |
| 166 | exact hnonneg |
| 167 | |
| 168 | end PoincareMT.LGeometry |
| 169 | |
| 170 |