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.Frame.Scaled |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variation.Second.Field |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variation.Geometry.TraceIntegral |
| 4 | |
| 5 | /-! |
| 6 | # The index trace at a free-endpoint surface minimum |
| 7 | |
| 8 | Actual smooth adapted fields are scaled, realized as variations, and traced. |
| 9 | The resulting nonnegative integral gives the curvature-plus-minimum estimate. |
| 10 | Morgan--Tian, Claim 6.44, pp. 128-129, and Claim 7.11, pp. 155-156. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | noncomputable section |
| 17 | open Set Filter Topology MeasureTheory |
| 18 | open scoped Manifold ContDiff Bundle intervalIntegral BigOperators |
| 19 | |
| 20 | namespace PoincareMT.AncientKappaSolution |
| 21 | |
| 22 | open ReducedLengthMinimum.Variation ReducedLengthMinimum.Variation.Geometry |
| 23 | open ReducedLengthMinimum.Variation.Frame |
| 24 | |
| 25 | variable {M : Type*} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 27 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 28 | [SecondCountableTopology M] [ConnectedSpace M] |
| 29 | |
| 30 | theorem curvature_add_minimum_le_two_of_adapted_frame (K : AncientKappaSolution 2 M) |
| 31 | {τ m : ℝ} (hτ : 0 < τ) (q : BackwardTimePath K.flow 0 0 τ) |
| 32 | (S : SqrtRegularPath q) |
| 33 | (E : ParametricAlongCurveExtensionOn (Icc 0 (Real.sqrt τ)) S.curve |
| 34 | (curveVelocityWithin (n := 2) S.curve (Icc 0 (Real.sqrt τ)))) |
| 35 | (hmin : ∀ r : BackwardTimePath K.flow 0 0 τ, r.curve 0 = q.curve 0 → |
| 36 | backwardLLength K.flow 0 0 τ q.curve ≤ backwardLLength K.flow 0 0 τ r.curve) |
| 37 | (heuler : ∀ s ∈ Ioo 0 (Real.sqrt τ), |
| 38 | regularizedLGeodesicEquation K.flow 0 S.curve (Icc 0 (Real.sqrt τ)) E s) |
| 39 | (hterminal : curveVelocityWithin (n := 2) S.curve (Icc 0 (Real.sqrt τ)) (Real.sqrt τ) = 0) |
| 40 | (haction : backwardLLength K.flow 0 0 τ q.curve = 2 * Real.sqrt τ * m) |
| 41 | (U : Set ℝ) (hU : IsOpen U) (hCU : Icc 0 (Real.sqrt τ) ⊆ U) |
| 42 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 2) ∞ S.curve U) |
| 43 | (P : Fin 2 → ∀ s, TangentSpace (𝓡 2) (S.curve s)) |
| 44 | (hP : ∀ i, IsAdaptedFieldOn K.flow 0 S.curve (P i) U) |
| 45 | (horth : ∀ s ∈ Icc 0 (Real.sqrt τ), ∀ i j, |
| 46 | (K.flow.metric (0 - s ^ 2)).inner (S.curve s) (P i s) (P j s) = |
| 47 | if i = j then 1 else 0) : |
| 48 | τ * (K.flow.connection (-τ)).scalarCurvature (S.curve (Real.sqrt τ)) + m ≤ 2 := by |
| 49 | classical |
| 50 | let c := Real.sqrt τ |
| 51 | let C := Icc (0 : ℝ) c |
| 52 | have hc : 0 < c := Real.sqrt_pos.mpr hτ |
| 53 | let EP (i : Fin 2) : ParametricAlongCurveExtensionOn U S.curve (P i) := |
| 54 | Classical.choice (exists_parametricSectionExtension hU S.curve hα (P i) (hP i).smooth) |
| 55 | let Y (i : Fin 2) : ∀ s, TangentSpace (𝓡 2) (S.curve s) := fun s ↦ (s / c) • P i s |
| 56 | let HY (i : Fin 2) : ParametricAlongCurveExtensionOn U S.curve (Y i) := |
| 57 | smulParametricExtension (EP i) (fun s ↦ s / c) (contDiff_id.div_const c) |
| 58 | let H (i : Fin 2) : ParametricAlongCurveExtensionOn C S.curve (Y i) := |
| 59 | restrictParametricSectionExtension hCU (HY i) |
| 60 | let d (i : Fin 2) := fieldIndexDensity K.flow 0 S.curve C (Y i) (H i) |
| 61 | let D := fun s ↦ ∑ i : Fin 2, d i s |
| 62 | have hindex (i : Fin 2) : IntervalIntegrable (d i) volume 0 c ∧ |
| 63 | 0 ≤ ∫ s in (0 : ℝ)..c, d i s := by |
| 64 | exact K.fieldIndexDensity_integrable_and_integral_nonneg S E hmin heuler hterminal |
| 65 | (Y i) U hU hCU (parametricExtension_field_contMDiffOn (HY i) hα) |
| 66 | (by simp only [Y, zero_div, zero_smul]) (H i) |
| 67 | have hD : IntervalIntegrable D volume 0 c := |
| 68 | IntervalIntegrable.sum Finset.univ (fun i _ ↦ (hindex i).1) |
| 69 | have hnonneg : 0 ≤ ∫ s in (0 : ℝ)..c, D s := by |
| 70 | rw [show D = fun s ↦ ∑ i : Fin 2, d i s from rfl, |
| 71 | intervalIntegral.integral_finsetSum (fun i _ ↦ (hindex i).1)] |
| 72 | exact Finset.sum_nonneg (fun i _ ↦ (hindex i).2) |
| 73 | apply K.curvature_add_minimum_le_two_of_index_trace hτ q S E heuler hterminal |
| 74 | haction D hD ?_ hnonneg |
| 75 | intro s hs |
| 76 | have hsC : s ∈ C := Ioo_subset_Icc_self hs |
| 77 | have hCs : UniqueDiffWithinAt ℝ C s := uniqueDiffOn_Icc hc s hsC |
| 78 | let A := curveVelocityWithin (n := 2) S.curve C s |
| 79 | let L := K.flow.connection (0 - s ^ 2) |
| 80 | have hDY (i : Fin 2) : |
| 81 | pullbackCovariantDerivative K.flow (fun r ↦ 0 - r ^ 2) S.curve (Y i) C (H i) s = |
| 82 | (1 / c - s * (s / c) * L.scalarCurvature (S.curve s)) • P i s := by |
| 83 | exact pullback_scaled_adapted_surface K.flow 0 S.curve (P i) |
| 84 | (restrictParametricSectionExtension hCU (EP i)) c (H i) hU hα (hP i) |
| 85 | hsC (hCU hsC) hCs (ancient_squareTime_mem_interior s) |
| 86 | obtain ⟨e, he⟩ := exists_orthonormalBasis_eq (K.flow.metric (0 - s ^ 2)) |
| 87 | (S.curve s) (fun i ↦ P i s) (horth s hsC) |
| 88 | have htrace := surface_scaled_index_trace L (S.curve s) A s (ne_of_gt hc) e |
| 89 | simp only [he] at htrace |
| 90 | have hsum : c ^ 2 * D s = |
| 91 | 2 - 4 * s ^ 2 * L.scalarCurvature (S.curve s) + |
| 92 | 2 * s ^ 4 * (L.laplacian L.scalarCurvature (S.curve s) + |
| 93 | L.scalarCurvature (S.curve s) ^ 2) - s ^ 2 * L.ricci (S.curve s) A A := by |
| 94 | convert htrace using 1 |
| 95 | congr 1 |
| 96 | apply Finset.sum_congr rfl |
| 97 | intro i _ |
| 98 | dsimp only [d, fieldIndexDensity] |
| 99 | rw [hDY i] |
| 100 | exact hsum.trans (congrArg (fun t : ℝ ↦ |
| 101 | 2 - 4 * s ^ 2 * (K.flow.connection t).scalarCurvature (S.curve s) + |
| 102 | 2 * s ^ 4 * ((K.flow.connection t).laplacian |
| 103 | (K.flow.connection t).scalarCurvature (S.curve s) + |
| 104 | (K.flow.connection t).scalarCurvature (S.curve s) ^ 2) - |
| 105 | s ^ 2 * (K.flow.connection t).ricci (S.curve s) A A) (zero_sub (s ^ 2))) |
| 106 | |
| 107 | end PoincareMT.AncientKappaSolution |