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.Equation.SquareEulerInterior |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Euler.EulerContinuity |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Manifold.SectionThroughVector |
| 4 | |
| 5 | /-! |
| 6 | # The exact square-root Euler statement |
| 7 | |
| 8 | Morgan-Tian Definition 6.7 and Lemma 6.8, pp. 108-109. The interior |
| 9 | variation argument and continuity of the actual geometric residual |
| 10 | give the Euler equation on the entire closed square interval for a |
| 11 | supplied smooth representative of a minimizing path. The existing |
| 12 | closed velocity extension gives the frozen existential witness. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M14 |
| 23 | |
| 24 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 25 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 26 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 27 | {R : M14SquareRootPath G p} |
| 28 | |
| 29 | /-- The actual paired Euler equation holds on the whole closed square |
| 30 | interval for every base extension of a smooth minimizing representative, |
| 31 | Definition 6.7 and Lemma 6.8, pp. 108-109. -/ |
| 32 | theorem squareRootEulerResidual_eq_zero_of_minimizing |
| 33 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 34 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (hmin : M14IsMinimizing p) |
| 35 | (E : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 36 | R.horizontal_velocity) {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) |
| 37 | (W : G.Horizontal (R.curve s)) : M14SquareRootEulerResidual G R E s W = 0 := by |
| 38 | obtain ⟨Z, hZ, hZs⟩ := FiberBundle.exists_contMDiff_section_through |
| 39 | (I := spacetimeModel n) (F := EuclideanSpace ℝ (Fin n)) W |
| 40 | have hcont := squareRootEulerResidual_stationary_continuousOn hM12 E Z hZ |
| 41 | have hzero : EqOn (fun r => M14SquareRootEulerResidual G R E r (Z (R.curve r))) |
| 42 | (fun _ => 0) (Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) := by |
| 43 | intro r hr |
| 44 | exact squareRootEulerResidual_eq_zero_of_minimizing_interior hCoordinates hM12 hmin E hr _ |
| 45 | have hclosed := hzero.of_subset_closure hcont continuousOn_const Ioo_subset_Icc_self |
| 46 | (show M14SqrtParameterInterval τ₁ τ₂ ⊆ closure (Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) by |
| 47 | rw [closure_Ioo (Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt).ne] |
| 48 | exact Subset.rfl) |
| 49 | simpa only [hZs] using hclosed hs |
| 50 | |
| 51 | /-- The exact frozen square-root Euler statement, including both |
| 52 | closed endpoints and initial time zero, Definition 6.7 and |
| 53 | Lemma 6.8, pp. 108-109. -/ |
| 54 | theorem squareRootEulerStatement (hCoordinates : M12MetricPredecessors.{0} n) |
| 55 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) : M14SquareRootEulerStatement G := by |
| 56 | intro T τ₁ τ₂ x y p R hmin |
| 57 | obtain ⟨E⟩ := exists_squareRoot_velocity_extension R |
| 58 | exact ⟨E, fun _ hs W => |
| 59 | squareRootEulerResidual_eq_zero_of_minimizing hCoordinates hM12 hmin E hs W⟩ |
| 60 | |
| 61 | end PoincareMT.M14 |