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.Regularity.Hessian.SharpIndexAffine |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.Index.IndexPositivity |
| 4 | |
| 5 | /-! |
| 6 | # Stationarity at equality in a Hessian index bound |
| 7 | |
| 8 | An initial-zero field attaining a universal quadratic endpoint bound |
| 9 | has the corresponding mixed index identity against every initial-zero |
| 10 | test field. The terminal value of the attaining field need not vanish. |
| 11 | Morgan-Tian Lemma 6.40, Proposition 6.43 and Claim 6.44, pp. 126-128. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff intervalIntegral |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 26 | (R : M14SquareRootPath G p) |
| 27 | |
| 28 | /-- Equality in a universal symmetric endpoint bound forces the |
| 29 | actual mixed index identity, Lemma 6.40, Proposition 6.43 and |
| 30 | Claim 6.44, pp. 126-128. -/ |
| 31 | theorem pullbackIndexIntegral_eq_of_hessian_bound |
| 32 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 33 | (B : LinearMap.BilinForm ℝ (G.Horizontal (R.curve (Real.sqrt b)))) |
| 34 | (hB : ∀ v w, B v w = B w v) (k : ℝ) |
| 35 | (hbound : ∀ (W : ∀ s, G.Horizontal (R.curve s)) |
| 36 | (EW : M14PullbackExtension G R.curve (M14SqrtParameterInterval a b) W), |
| 37 | W (Real.sqrt a) = 0 → k * B (W (Real.sqrt b)) (W (Real.sqrt b)) ≤ |
| 38 | ∫ s in Real.sqrt a..Real.sqrt b, pullbackIndexPairDensity R EW EW s) |
| 39 | {Y Z : ∀ s, G.Horizontal (R.curve s)} |
| 40 | (EY : M14PullbackExtension G R.curve (M14SqrtParameterInterval a b) Y) |
| 41 | (EZ : M14PullbackExtension G R.curve (M14SqrtParameterInterval a b) Z) |
| 42 | (hY : Y (Real.sqrt a) = 0) (hZ : Z (Real.sqrt a) = 0) |
| 43 | (heq : (∫ s in Real.sqrt a..Real.sqrt b, pullbackIndexPairDensity R EY EY s) = |
| 44 | k * B (Y (Real.sqrt b)) (Y (Real.sqrt b))) : |
| 45 | (∫ s in Real.sqrt a..Real.sqrt b, pullbackIndexPairDensity R EY EZ s) = |
| 46 | k * B (Y (Real.sqrt b)) (Z (Real.sqrt b)) := by |
| 47 | apply sub_eq_zero.mp |
| 48 | apply M08.mixedTerm_eq_zero_of_quadratic_nonneg |
| 49 | (C := (∫ s in Real.sqrt a..Real.sqrt b, pullbackIndexPairDensity R EZ EZ s) - |
| 50 | k * B (Z (Real.sqrt b)) (Z (Real.sqrt b))) |
| 51 | intro c |
| 52 | have hc := hbound (fun s => Y s + c • Z s) (affinePullbackExtension EY EZ c) |
| 53 | (by simp only [hY, hZ, smul_zero, add_zero]) |
| 54 | rw [pullbackIndexIntegral_affine R hM04 hM12 EY EZ c, heq] at hc |
| 55 | simp only [map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply, smul_eq_mul] at hc |
| 56 | rw [hB (Z (Real.sqrt b)) (Y (Real.sqrt b))] at hc |
| 57 | nlinarith only [hc] |
| 58 | |
| 59 | end PoincareMT.M14 |