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.Variation.Pullback.PullbackCongruence |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareRootVelocityExtension |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Euler.EulerResidual |
| 4 | |
| 5 | /-! |
| 6 | # Independence of the square-root representative |
| 7 | |
| 8 | Morgan-Tian Definition 6.7 and Lemma 6.8, pp. 108-109. Representatives |
| 9 | of the same backward path have identical actual within velocities on |
| 10 | the closed square interval. Their actual Euler residuals agree after |
| 11 | fiber transport, with arbitrary velocity extension witnesses. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 23 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 24 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 25 | |
| 26 | /-- Square-root representatives of the same path agree on the closed |
| 27 | parameter interval, Definition 6.7 and Lemma 6.8, pp. 108-109. -/ |
| 28 | theorem squareRoot_curve_eqOn (R S : M14SquareRootPath G p) : |
| 29 | Set.EqOn R.curve S.curve (M14SqrtParameterInterval τ₁ τ₂) := |
| 30 | fun s hs => (R.agrees s hs).trans (S.agrees s hs).symm |
| 31 | |
| 32 | private theorem horizontalProjection_heq {q r : G.Point} (h : q = r) |
| 33 | {v : TangentSpace (spacetimeModel n) q} {w : TangentSpace (spacetimeModel n) r} |
| 34 | (hv : HEq v w) : |
| 35 | HEq (G.spacetime.horizontalProjection q v) (G.spacetime.horizontalProjection r w) := by |
| 36 | cases h |
| 37 | cases hv |
| 38 | rfl |
| 39 | |
| 40 | /-- The actual horizontal velocities of square-root representatives |
| 41 | agree at every closed point, Lemma 6.8, pp. 108-109. -/ |
| 42 | theorem squareRoot_horizontalVelocity_heq (R S : M14SquareRootPath G p) |
| 43 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) : |
| 44 | HEq (R.horizontal_velocity s) (S.horizontal_velocity s) := by |
| 45 | rw [squareRoot_horizontalVelocity_eq_projection R hs, |
| 46 | squareRoot_horizontalVelocity_eq_projection S hs] |
| 47 | have hd := mfderivWithin_congr_of_mem (I := 𝓘(ℝ, ℝ)) (I' := spacetimeModel n) |
| 48 | (squareRoot_curve_eqOn R S) hs |
| 49 | exact horizontalProjection_heq (G := G) (squareRoot_curve_eqOn R S hs) |
| 50 | (heq_of_eq (congrArg (fun A => A (1 : ℝ)) hd)) |
| 51 | |
| 52 | private theorem squareEulerPair_heq {q r : G.Point} (h : q = r) |
| 53 | {A V W : G.Horizontal q} {A' V' W' : G.Horizontal r} |
| 54 | (hA : HEq A A') (hV : HEq V V') (hW : HEq W W') (s : ℝ) : |
| 55 | G.spacetime.horizontalMetric.inner q A W - |
| 56 | 2 * s ^ 2 * M14HorizontalScalarDifferential G q W.val + |
| 57 | 4 * s * horizontalRicci G.leafwise q V W = |
| 58 | G.spacetime.horizontalMetric.inner r A' W' - |
| 59 | 2 * s ^ 2 * M14HorizontalScalarDifferential G r W'.val + |
| 60 | 4 * s * horizontalRicci G.leafwise r V' W' := by |
| 61 | cases h |
| 62 | cases hA |
| 63 | cases hV |
| 64 | cases hW |
| 65 | rfl |
| 66 | |
| 67 | /-- The paired Euler residual is independent of the square-root |
| 68 | representative and extension, Lemma 6.8, pp. 108-109. -/ |
| 69 | theorem squareRootEulerResidual_congr (R S : M14SquareRootPath G p) |
| 70 | (E : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 71 | R.horizontal_velocity) |
| 72 | (F : M14PullbackExtension G S.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 73 | S.horizontal_velocity) {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) |
| 74 | {W : G.Horizontal (R.curve s)} {W' : G.Horizontal (S.curve s)} (hW : HEq W W') : |
| 75 | M14SquareRootEulerResidual G R E s W = M14SquareRootEulerResidual G S F s W' := by |
| 76 | let E' := pullbackExtensionCongrOn E (squareRoot_curve_eqOn R S) |
| 77 | (fun _ ht => squareRoot_horizontalVelocity_heq R S ht) |
| 78 | have hd := horizontalCovariantDerivative_congrOn E (squareRoot_curve_eqOn R S) |
| 79 | (fun _ ht => squareRoot_horizontalVelocity_heq R S ht) hs |
| 80 | have hp := squareEulerPair_heq (G := G) (squareRoot_curve_eqOn R S hs) hd |
| 81 | (squareRoot_horizontalVelocity_heq R S hs) hW s |
| 82 | change M14SquareRootEulerResidual G R E s W = |
| 83 | M14SquareRootEulerResidual G S E' s W' at hp |
| 84 | exact hp.trans (squareRootEulerResidual_extension_independent E' F hs W') |
| 85 | |
| 86 | end PoincareMT.M14 |