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.Paths.SquareRoot.Action.SquareRootAction |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareCurve |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareRootComparison |
| 4 | |
| 5 | /-! |
| 6 | # Closed smoothness and congruence of the actual square density |
| 7 | |
| 8 | Morgan-Tian equation (6.2) and Lemma 6.8, pp. 106, 108-109. |
| 9 | The prescribed square velocity equals the projected actual within |
| 10 | derivative. The square density is therefore smooth on the closed |
| 11 | interval and agrees for equal curves on common regular subsets. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff |
| 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 | |
| 26 | private theorem inner_heq {x y : G.Point} (h : x = y) |
| 27 | {v : G.Horizontal x} {w : G.Horizontal y} (hv : HEq v w) : |
| 28 | G.spacetime.horizontalMetric.inner x v v = G.spacetime.horizontalMetric.inner y w w := by |
| 29 | cases h |
| 30 | cases hv |
| 31 | rfl |
| 32 | |
| 33 | /-- The actual square-root action density is smooth on its full |
| 34 | closed parameter interval, including initial time zero, |
| 35 | equation (6.2) and Lemma 6.8, pp. 106, 108-109. -/ |
| 36 | theorem squareRootLIntegrand_contDiffOn |
| 37 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 38 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 39 | (R : M14SquareRootPath G p) : |
| 40 | ContDiffOn ℝ ∞ (squareRootLIntegrand R) (M14SqrtParameterInterval a b) := by |
| 41 | apply (squareCurveDensity_contDiffOn hM12 |
| 42 | (uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt)) |
| 43 | (R.smooth.mono R.interval_subset)).congr |
| 44 | intro s hs |
| 45 | simp only [squareRootLIntegrand, squareCurveDensity, |
| 46 | squareRoot_horizontalVelocity_eq_projection R hs, projectedCurveVelocityWithin, |
| 47 | M14SqrtParameterInterval] |
| 48 | |
| 49 | /-- Actual square densities agree on a common uniquely differentiable |
| 50 | subset when the actual curves agree, including its closed endpoints, |
| 51 | equation (6.2) and Lemma 6.8, pp. 106, 108-109. -/ |
| 52 | theorem squareRootLIntegrand_eq_on_subset |
| 53 | {T₁ T₂ a b c d : ℝ} {x₁ y₁ x₂ y₂ : G.Point} |
| 54 | {p : M14BackwardPath G T₁ a b x₁ y₁} {q : M14BackwardPath G T₂ c d x₂ y₂} |
| 55 | (R : M14SquareRootPath G p) (S : M14SquareRootPath G q) {K : Set ℝ} |
| 56 | (hKR : K ⊆ M14SqrtParameterInterval a b) (hKS : K ⊆ M14SqrtParameterInterval c d) |
| 57 | (heq : EqOn R.curve S.curve K) {s : ℝ} (hs : s ∈ K) |
| 58 | (hK : UniqueDiffWithinAt ℝ K s) : squareRootLIntegrand R s = squareRootLIntegrand S s := by |
| 59 | have hv := squareRoot_horizontalVelocity_heq_on_subset R S hKR hKS heq hs hK |
| 60 | have hinner := inner_heq (G := G) (heq hs) hv |
| 61 | unfold squareRootLIntegrand |
| 62 | rw [hinner, heq hs] |
| 63 | |
| 64 | end PoincareMT.M14 |