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.Coordinates.GaugeVelocity |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareRootVelocityExtension |
| 3 | |
| 4 | /-! |
| 5 | # Comparing square-root velocities on a common parameter subset |
| 6 | |
| 7 | Morgan-Tian Lemma 6.8 and Lemma 6.18, pp. 108-109, 113-114. |
| 8 | The prescribed horizontal velocity equals the projection of the |
| 9 | actual derivative restricted to any uniquely differentiable subset. |
| 10 | Equality of paths on that subset therefore identifies their velocities. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff |
| 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 | |
| 25 | /-- Restriction of the actual within derivative preserves the |
| 26 | supplied square-root horizontal velocity, including closed endpoints, |
| 27 | Lemma 6.8, pp. 108-109. -/ |
| 28 | theorem squareRoot_projectedVelocityWithin_subset |
| 29 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 30 | (R : M14SquareRootPath G p) {J : Set ℝ} |
| 31 | (hsub : J ⊆ M14SqrtParameterInterval τ₁ τ₂) {s : ℝ} (hs : s ∈ J) |
| 32 | (hJ : UniqueDiffWithinAt ℝ J s) : |
| 33 | projectedCurveVelocityWithin G R.curve J s = R.horizontal_velocity s := by |
| 34 | unfold projectedCurveVelocityWithin |
| 35 | rw [mfderivWithin_subset hsub hJ.uniqueMDiffWithinAt |
| 36 | ((R.smooth.mono R.interval_subset s (hsub hs)).mdifferentiableWithinAt (by simp))] |
| 37 | exact (squareRoot_horizontalVelocity_eq_projection R (hsub hs)).symm |
| 38 | |
| 39 | /-- Square-root paths equal on a uniquely differentiable common |
| 40 | subset have the same actual horizontal velocities there, the |
| 41 | derivative comparison used in Lemma 6.18, pp. 113-114. -/ |
| 42 | theorem squareRoot_horizontalVelocity_heq_on_subset |
| 43 | {T₁ T₂ τ₁ τ₂ σ₁ σ₂ : ℝ} {x₁ y₁ x₂ y₂ : G.Point} |
| 44 | {p₁ : M14BackwardPath G T₁ τ₁ τ₂ x₁ y₁} {p₂ : M14BackwardPath G T₂ σ₁ σ₂ x₂ y₂} |
| 45 | (R₁ : M14SquareRootPath G p₁) (R₂ : M14SquareRootPath G p₂) {J : Set ℝ} |
| 46 | (hsub₁ : J ⊆ M14SqrtParameterInterval τ₁ τ₂) |
| 47 | (hsub₂ : J ⊆ M14SqrtParameterInterval σ₁ σ₂) |
| 48 | (heq : EqOn R₁.curve R₂.curve J) {s : ℝ} (hs : s ∈ J) |
| 49 | (hJ : UniqueDiffWithinAt ℝ J s) : |
| 50 | HEq (R₁.horizontal_velocity s) (R₂.horizontal_velocity s) := by |
| 51 | rw [← squareRoot_projectedVelocityWithin_subset R₁ hsub₁ hs hJ, |
| 52 | ← squareRoot_projectedVelocityWithin_subset R₂ hsub₂ hs hJ] |
| 53 | exact projectedCurveVelocityWithin_congrOn heq hs |
| 54 | |
| 55 | end PoincareMT.M14 |