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.ReducedLength.Minimum.Variation.Second.Minimizer |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variation.Construction.CompactField |
| 3 | |
| 4 | /-! |
| 5 | # Index inequality for smooth fields along minimizing paths |
| 6 | |
| 7 | The intrinsic five-term density is the expanded index density of |
| 8 | Morgan--Tian, Proposition 6.33, pp. 120-121. Smooth fields vanishing initially |
| 9 | are realized by actual initial-fixed variations, so their index inequality |
| 10 | follows from the checked second variation formula and path minimality. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | open Set Filter Topology MeasureTheory |
| 19 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 20 | |
| 21 | namespace PoincareMT.ReducedLengthMinimum.Variation.Geometry |
| 22 | |
| 23 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | |
| 26 | /-- The expanded intrinsic index density of a field along a square-time curve. -/ |
| 27 | def fieldIndexDensity {J : Set ℝ} (F : RicciFlow n M J) (T : ℝ) (α : ℝ → M) |
| 28 | (C : Set ℝ) (Y : ∀ s, TangentSpace (𝓡 n) (α s)) |
| 29 | (H : ParametricAlongCurveExtensionOn C α Y) (s : ℝ) : ℝ := |
| 30 | let A := curveVelocityWithin (n := n) α C s |
| 31 | let DY := pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) α Y C H s |
| 32 | let connection := F.connection (T - s ^ 2) |
| 33 | (F.metric (T - s ^ 2)).inner (α s) DY DY + |
| 34 | connection.curvatureTensor (α s) (Y s) A A (Y s) + |
| 35 | 2 * s ^ 2 * connection.hessian connection.scalarCurvature (α s) (Y s) (Y s) - |
| 36 | 4 * s * ricciDerivativePairing connection (α s) (Y s) A (Y s) + |
| 37 | 2 * s * ricciDerivativePairing connection (α s) A (Y s) (Y s) |
| 38 | |
| 39 | /-- Index density depends on the actual curve and field, not the selected smooth extensions. -/ |
| 40 | theorem secondVariationIndexDensity_eq_fieldIndexDensity |
| 41 | {J : Set ℝ} {F : RicciFlow n M J} {T a b : ℝ} {p : BackwardTimePath F T a b} |
| 42 | (V : LVariation F T a b p) (D : LVariationDerivativeData V) |
| 43 | (α : ℝ → M) (Y : ∀ s, TangentSpace (𝓡 n) (α s)) |
| 44 | (H : ParametricAlongCurveExtensionOn (sqrtParameterInterval a b) α Y) |
| 45 | (hcurve : EqOn V.baseSquareCurve α (sqrtParameterInterval a b)) |
| 46 | (hfield : ∀ s ∈ sqrtParameterInterval a b, squareVariationField V s = Y s) |
| 47 | {s : ℝ} (hs : s ∈ sqrtParameterInterval a b) |
| 48 | (hα : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α s) : |
| 49 | secondVariationIndexDensity V D s = fieldIndexDensity F T α (sqrtParameterInterval a b) Y H s := by |
| 50 | have hC := uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.nonnegative p.ordered) s hs |
| 51 | have hderivative := pullbackCovariantDerivative_congr F (fun r ↦ T - r ^ 2) |
| 52 | hcurve hfield D.variation_extension H hs hC hα |
| 53 | unfold secondVariationIndexDensity fieldIndexDensity |
| 54 | dsimp only |
| 55 | rw [hderivative, curveVelocityWithin_congr hcurve hs, hfield s hs, hcurve hs] |
| 56 | |
| 57 | end PoincareMT.ReducedLengthMinimum.Variation.Geometry |
| 58 | |
| 59 | namespace PoincareMT.AncientKappaSolution |
| 60 | |
| 61 | open ReducedLengthMinimum.Variation ReducedLengthMinimum.Variation.Geometry |
| 62 | |
| 63 | variable {M : Type*} [TopologicalSpace M] |
| 64 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 65 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 66 | [SecondCountableTopology M] [ConnectedSpace M] |
| 67 | |
| 68 | /-- Smooth initial-zero fields along the actual minimizing Euler path have integrable, |
| 69 | nonnegative index form. The realizing variation and its derivative data are produced. -/ |
| 70 | theorem fieldIndexDensity_integrable_and_integral_nonneg (K : AncientKappaSolution 2 M) |
| 71 | {τ : ℝ} {p : BackwardTimePath K.flow 0 0 τ} (S : SqrtRegularPath p) |
| 72 | (E : ParametricAlongCurveExtensionOn (Icc 0 (Real.sqrt τ)) S.curve |
| 73 | (curveVelocityWithin (n := 2) S.curve (Icc 0 (Real.sqrt τ)))) |
| 74 | (hmin : ∀ q : BackwardTimePath K.flow 0 0 τ, q.curve 0 = p.curve 0 → |
| 75 | backwardLLength K.flow 0 0 τ p.curve ≤ backwardLLength K.flow 0 0 τ q.curve) |
| 76 | (heuler : ∀ s ∈ Ioo 0 (Real.sqrt τ), |
| 77 | regularizedLGeodesicEquation K.flow 0 S.curve (Icc 0 (Real.sqrt τ)) E s) |
| 78 | (hterminal : curveVelocityWithin (n := 2) S.curve (Icc 0 (Real.sqrt τ)) (Real.sqrt τ) = 0) |
| 79 | (Y : ∀ s, TangentSpace (𝓡 2) (S.curve s)) (U : Set ℝ) |
| 80 | (hU : IsOpen U) (hCU : Icc 0 (Real.sqrt τ) ⊆ U) |
| 81 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 2).prod (𝓡 2)) ∞ |
| 82 | (fun s ↦ (⟨S.curve s, Y s⟩ : TangentBundle (𝓡 2) M)) U) |
| 83 | (hY0 : Y 0 = 0) |
| 84 | (H : ParametricAlongCurveExtensionOn (Icc 0 (Real.sqrt τ)) S.curve Y) : |
| 85 | IntervalIntegrable (fieldIndexDensity K.flow 0 S.curve (Icc 0 (Real.sqrt τ)) Y H) |
| 86 | volume 0 (Real.sqrt τ) ∧ |
| 87 | 0 ≤ ∫ s in (0 : ℝ)..Real.sqrt τ, |
| 88 | fieldIndexDensity K.flow 0 S.curve (Icc 0 (Real.sqrt τ)) Y H s := by |
| 89 | let C := sqrtParameterInterval 0 τ |
| 90 | let O := U ∩ S.domain |
| 91 | have hO : IsOpen O := hU.inter S.open_domain |
| 92 | have hCO : Icc 0 (Real.sqrt τ) ⊆ O := by |
| 93 | intro s hs |
| 94 | exact ⟨hCU hs, S.interval_subset (by simpa only [sqrtParameterInterval, Real.sqrt_zero] using hs)⟩ |
| 95 | have hagrees (s : ℝ) (hs : s ∈ Icc 0 (Real.sqrt τ)) : S.curve s = p.curve (s ^ 2) := |
| 96 | S.agrees s (by simpa only [sqrtParameterInterval, Real.sqrt_zero] using hs) |
| 97 | obtain ⟨V, hbase, hfield⟩ := K.exists_initialFixedLVariation_of_smooth_field |
| 98 | p S.curve Y O hO hCO (S.smooth.mono inter_subset_right) |
| 99 | (hY.mono inter_subset_left) hagrees hY0 |
| 100 | obtain ⟨D, hindex, hint⟩ := K.exists_nonneg_secondVariationIndexForm |
| 101 | S E hmin heuler hterminal V |
| 102 | let HC : ParametricAlongCurveExtensionOn C S.curve Y := { |
| 103 | extension := H.extension |
| 104 | domain := H.domain |
| 105 | open_domain := H.open_domain |
| 106 | graph_mem := fun s hs ↦ H.graph_mem s (by |
| 107 | simpa only [C, sqrtParameterInterval, Real.sqrt_zero] using hs) |
| 108 | smooth := H.smooth |
| 109 | agrees := fun s hs ↦ H.agrees s (by |
| 110 | simpa only [C, sqrtParameterInterval, Real.sqrt_zero] using hs) } |
| 111 | have hcurve : EqOn V.toLVariation.baseSquareCurve S.curve C := |
| 112 | fun s _ ↦ congrFun hbase s |
| 113 | have hfieldC (s : ℝ) (hs : s ∈ C) : squareVariationField V.toLVariation s = Y s := |
| 114 | hfield s (by simpa only [C, sqrtParameterInterval, Real.sqrt_zero] using hs) |
| 115 | have hdensity (s : ℝ) (hs : s ∈ Icc 0 (Real.sqrt τ)) : |
| 116 | secondVariationIndexDensity V.toLVariation D s = |
| 117 | fieldIndexDensity K.flow 0 S.curve (Icc 0 (Real.sqrt τ)) Y H s := by |
| 118 | have hsC : s ∈ C := by simpa only [C, sqrtParameterInterval, Real.sqrt_zero] using hs |
| 119 | have hSs := ((S.smooth s (S.interval_subset hsC)).contMDiffAt |
| 120 | (S.open_domain.mem_nhds (S.interval_subset hsC))).mdifferentiableAt (by simp) |
| 121 | have h := secondVariationIndexDensity_eq_fieldIndexDensity V.toLVariation D |
| 122 | S.curve Y HC hcurve hfieldC hsC hSs |
| 123 | simpa only [fieldIndexDensity, pullbackCovariantDerivative, HC, C, |
| 124 | sqrtParameterInterval, Real.sqrt_zero] using h |
| 125 | have hcongr : EqOn (secondVariationIndexDensity V.toLVariation D) |
| 126 | (fieldIndexDensity K.flow 0 S.curve (Icc 0 (Real.sqrt τ)) Y H) |
| 127 | (uIoo 0 (Real.sqrt τ)) := by |
| 128 | rw [uIoo_of_le (Real.sqrt_nonneg τ)] |
| 129 | exact fun s hs ↦ hdensity s (Ioo_subset_Icc_self hs) |
| 130 | refine ⟨hint.congr_uIoo hcongr, ?_⟩ |
| 131 | have hindex' : 0 ≤ ∫ s in (0 : ℝ)..Real.sqrt τ, secondVariationIndexDensity V.toLVariation D s := by |
| 132 | simpa only [secondVariationIndexForm, Real.sqrt_zero] using hindex |
| 133 | rwa [intervalIntegral.integral_congr_uIoo hcongr] at hindex' |
| 134 | |
| 135 | end PoincareMT.AncientKappaSolution |