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.SquareCurve |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareRootConstruction |
| 3 | |
| 4 | /-! |
| 5 | # Actual backward paths from smooth square curves |
| 6 | |
| 7 | Morgan-Tian Definition 6.7 and Lemma 6.8, pp. 108-109. A smooth |
| 8 | square curve with the exact backward clock gives an actual original |
| 9 | path and a square-root representative. Action integrability at zero |
| 10 | comes from the proved square substitution, without an Euler assumption. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | -- The original and square curve records retain their actual tangent models. |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff 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 | |
| 27 | /-- A smooth square curve with its exact clock gives the frozen |
| 28 | backward path between its actual endpoints. Integrability includes |
| 29 | initial time zero, Definition 6.7 and Lemma 6.8, pp. 108-109. -/ |
| 30 | noncomputable def backwardPathOfSquareCurve |
| 31 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) {T a b : ℝ} (ha : 0 ≤ a) (hab : a < b) |
| 32 | (α : ℝ → G.Point) |
| 33 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ α (M14SqrtParameterInterval a b)) |
| 34 | (hclock : ∀ s ∈ M14SqrtParameterInterval a b, |
| 35 | G.spacetime.timeFunction (α s) = T - s ^ 2) : |
| 36 | M14BackwardPath G T a b (α (Real.sqrt a)) (α (Real.sqrt b)) := by |
| 37 | let γ := fun τ => α (Real.sqrt τ) |
| 38 | have hγ := sqrtPullback_contMDiffOn ha hα |
| 39 | have hγclock (τ : ℝ) (hτ : τ ∈ Icc a b) : G.spacetime.timeFunction (γ τ) = T - τ := by |
| 40 | dsimp only [γ] |
| 41 | rw [hclock _ ⟨Real.sqrt_le_sqrt hτ.1, Real.sqrt_le_sqrt hτ.2⟩, |
| 42 | Real.sq_sqrt (ha.trans hτ.1)] |
| 43 | refine { |
| 44 | tau_nonneg := ha |
| 45 | tau_lt := hab |
| 46 | base_time := hγclock a ⟨le_rfl, hab.le⟩ |
| 47 | endpoint_time := hγclock b ⟨hab.le, le_rfl⟩ |
| 48 | curve := γ |
| 49 | curve_start := rfl |
| 50 | curve_end := rfl |
| 51 | curve_time := hγclock |
| 52 | curve_continuous := hα.continuousOn.comp Real.continuous_sqrt.continuousOn |
| 53 | (fun τ hτ => ⟨Real.sqrt_le_sqrt hτ.1, Real.sqrt_le_sqrt hτ.2⟩) |
| 54 | curve_regular := hγ.of_le (by simp) |
| 55 | horizontal_velocity := projectedCurveVelocity G γ |
| 56 | derivative_eq := ?_ |
| 57 | action_integrable := sqrtPullback_action_integrable hM12 ha hab hα } |
| 58 | intro τ hτ |
| 59 | apply projectedCurveVelocity_derivative_eq (T := T) |
| 60 | (((hγ τ hτ).contMDiffAt (isOpen_Ioo.mem_nhds hτ)).mdifferentiableAt (by simp)) |
| 61 | filter_upwards [isOpen_Ioo.mem_nhds hτ] with t ht |
| 62 | exact hγclock t (Ioo_subset_Icc_self ht) |
| 63 | |
| 64 | /-- Smoothness of a path's actual square curve suffices to construct |
| 65 | its square-root record, with no Euler hypothesis. This is the |
| 66 | packaging step of Definition 6.7 and Lemma 6.8, pp. 108-109. -/ |
| 67 | noncomputable def squareRootPathOfSmoothSquare |
| 68 | {T a b : ℝ} {x y : G.Point} (p : M14BackwardPath G T a b x y) |
| 69 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ (fun s => p.curve (s ^ 2)) |
| 70 | (M14SqrtParameterInterval a b)) : M14SquareRootPath G p where |
| 71 | curve s := p.curve (s ^ 2) |
| 72 | domain := M14SqrtParameterInterval a b |
| 73 | interval_subset := Subset.rfl |
| 74 | smooth := hγ |
| 75 | agrees _ _ := rfl |
| 76 | curve_time s hs := p.curve_time _ (squarePath_parameter_mem p hs) |
| 77 | horizontal_velocity := projectedCurveVelocityWithin G (fun s => p.curve (s ^ 2)) |
| 78 | (M14SqrtParameterInterval a b) |
| 79 | horizontal_agrees s hs := by |
| 80 | change projectedCurveVelocityWithin G (fun r => p.curve (r ^ 2)) |
| 81 | (M14SqrtParameterInterval a b) s = (2 * s) • p.horizontal_velocity (s ^ 2) |
| 82 | unfold projectedCurveVelocityWithin |
| 83 | rw [mfderivWithin_of_mem_nhds (I := 𝓘(ℝ, ℝ)) (I' := spacetimeModel n) |
| 84 | (show M14SqrtParameterInterval a b ∈ 𝓝 s from Icc_mem_nhds hs.1 hs.2)] |
| 85 | exact squarePath_projectedVelocity p hs |
| 86 | derivative_eq s hs := squarePath_within_velocity_decomposition p hγ hs |
| 87 | |
| 88 | variable (hM12 : GeneralizedRicciGaugeTheory.{u} n) {T a b : ℝ} (ha : 0 ≤ a) (hab : a < b) |
| 89 | (α : ℝ → G.Point) |
| 90 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ α (M14SqrtParameterInterval a b)) |
| 91 | (hclock : ∀ s ∈ M14SqrtParameterInterval a b, |
| 92 | G.spacetime.timeFunction (α s) = T - s ^ 2) |
| 93 | |
| 94 | /-- The actual square-root representative of the path constructed |
| 95 | from a smooth square curve, Definition 6.7 and Lemma 6.8, pp. 108-109. -/ |
| 96 | noncomputable def squareRootPathOfSquareCurve : |
| 97 | M14SquareRootPath G (backwardPathOfSquareCurve hM12 ha hab α hα hclock) := |
| 98 | squareRootPathOfSmoothSquare _ (hα.congr (fun s hs => by |
| 99 | change α (Real.sqrt (s ^ 2)) = α s |
| 100 | rw [Real.sqrt_sq ((Real.sqrt_nonneg a).trans hs.1)])) |
| 101 | |
| 102 | /-- The constructed square-root representative is the prescribed |
| 103 | square curve at every closed parameter point, including zero, |
| 104 | Definition 6.7 and Lemma 6.8, pp. 108-109. -/ |
| 105 | theorem squareRootPathOfSquareCurve_curve {s : ℝ} (hs : s ∈ M14SqrtParameterInterval a b) : |
| 106 | (squareRootPathOfSquareCurve hM12 ha hab α hα hclock).curve s = α s := by |
| 107 | change α (Real.sqrt (s ^ 2)) = α s |
| 108 | rw [Real.sqrt_sq ((Real.sqrt_nonneg a).trans hs.1)] |
| 109 | |
| 110 | end PoincareMT.M14 |