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.Variation.Fields.PullbackFieldCongruence |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Index.AdaptedIndexTrace |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Exponential.FamilySlices |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.VelocityRestriction |
| 5 | |
| 6 | /-! |
| 7 | # The actual index density of a realized field |
| 8 | |
| 9 | The derivative data from second variation may use any extension. Its |
| 10 | pullback derivative equals that of the prescribed field on the interval. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option maxSynthPendingDepth 3 |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.ReducedLength |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 24 | [IsManifold (𝓡 n) ∞ M] |
| 25 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 26 | |
| 27 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 28 | |
| 29 | set_option backward.isDefEq.respectTransparency false in |
| 30 | theorem realized_variation_indexDensity |
| 31 | (A : LExponentialFamily F T τmax p) (Z : TangentSpace (𝓡 n) p) |
| 32 | (b : ℝ) (hb : 0 < b) (hmax : b < τmax) |
| 33 | (Y : ∀ s, TangentSpace (𝓡 n) (A.squareFamily Z s)) |
| 34 | (HY : ParametricAlongCurveExtensionOn (n := n) (sqrtParameterInterval 0 b) |
| 35 | (A.squareFamily Z) Y) |
| 36 | (V : LVariation F T 0 b (A.path Z b hb hmax)) |
| 37 | (hbase : V.baseSquareCurve = A.squareFamily Z) |
| 38 | (hfield : ∀ s ∈ sqrtParameterInterval 0 b, (squareVariationField V s : E) = Y s) |
| 39 | (D : LVariationDerivativeData V) (s : ℝ) (hs : s ∈ sqrtParameterInterval 0 b) : |
| 40 | secondVariationIndexDensity V D s = |
| 41 | pointwiseSecondVariationDensity F T (A.squareFamily Z s) s |
| 42 | (curveVelocity (A.squareFamily Z) s) (Y s) |
| 43 | (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) (A.squareFamily Z) Y |
| 44 | (sqrtParameterInterval 0 b) HY s) := by |
| 45 | have hKd : UniqueDiffOn ℝ (sqrtParameterInterval 0 b) := |
| 46 | uniqueDiffOn_Icc (Real.sqrt_lt_sqrt (le_refl 0) hb) |
| 47 | have hs' : s ∈ Set.Ico 0 (Real.sqrt τmax) := |
| 48 | ⟨by simpa only [sqrtParameterInterval, Real.sqrt_zero] using hs.1, |
| 49 | hs.2.trans_lt (Real.sqrt_lt_sqrt hb.le hmax)⟩ |
| 50 | have hα := (lExponentialFamily_squareSlice_contMDiffAt A Z s hs').mdifferentiableAt |
| 51 | (by simp) |
| 52 | have hpull := pullbackCovariantDerivative_curve_field_congr F (fun r ↦ T - r ^ 2) |
| 53 | V.baseSquareCurve (A.squareFamily Z) (squareVariationField V) Y |
| 54 | (sqrtParameterInterval 0 b) D.variation_extension HY hbase hfield s hs (hKd s hs) hα |
| 55 | have hvel : (curveVelocityWithin V.baseSquareCurve (sqrtParameterInterval 0 b) s : E) = |
| 56 | curveVelocity (A.squareFamily Z) s := by |
| 57 | rw [hbase] |
| 58 | exact curveVelocityWithin_eq_curveVelocity _ _ _ (hKd s hs) hα |
| 59 | rw [secondVariationIndexDensity_eq_pointwise] |
| 60 | let Q : M → E → E → E → ℝ := fun q a y w ↦ |
| 61 | pointwiseSecondVariationDensity F T q s a y w |
| 62 | exact congrArg₂ (fun q a ↦ Q q a |
| 63 | (squareVariationField V s) (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) |
| 64 | V.baseSquareCurve (squareVariationField V) (sqrtParameterInterval 0 b) |
| 65 | D.variation_extension s)) (congrFun hbase s) hvel |>.trans |
| 66 | (congrArg₂ (Q (A.squareFamily Z s) (curveVelocity (A.squareFamily Z) s)) |
| 67 | (hfield s hs) hpull) |
| 68 | |
| 69 | end PoincareMT.ReducedLength |