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.SquareRootVelocityExtension |
| 2 | |
| 3 | /-! |
| 4 | # The retained initial velocity under square reparametrization |
| 5 | |
| 6 | The supplied initial within derivative identifies the genuine square |
| 7 | velocity at the closed endpoint. No interior identity is applied there. |
| 8 | Morgan-Tian equation (6.8), p. 118, and the positive-start correction |
| 9 | following Lemma 6.49, p. 131. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- Within derivatives have the actual common spacetime tangent model. |
| 14 | set_option backward.isDefEq.respectTransparency 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 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 26 | |
| 27 | private theorem projection_heq {q r : G.Point} (h : q = r) |
| 28 | {v : TangentSpace (spacetimeModel n) q} {w : TangentSpace (spacetimeModel n) r} |
| 29 | (hv : HEq v w) : |
| 30 | HEq (G.spacetime.horizontalProjection q v) (G.spacetime.horizontalProjection r w) := by |
| 31 | cases h |
| 32 | cases hv |
| 33 | rfl |
| 34 | |
| 35 | private theorem inner_heq {q r : G.Point} (h : q = r) |
| 36 | {v : G.Horizontal q} {w : G.Horizontal r} (hv : HEq v w) : |
| 37 | G.spacetime.horizontalMetric.inner q v v = |
| 38 | G.spacetime.horizontalMetric.inner r w w := by |
| 39 | cases h |
| 40 | cases hv |
| 41 | rfl |
| 42 | |
| 43 | /-- The actual initial square velocity is the supplied initial |
| 44 | backward velocity scaled by twice the square-root time, provided the |
| 45 | frozen initial within derivative holds, equation (6.8), p. 118. -/ |
| 46 | theorem positiveStart_initial_velocity_heq (R : M14SquareRootPath G p) |
| 47 | (hp : MDifferentiableWithinAt (𝓘(ℝ, ℝ)) (spacetimeModel n) |
| 48 | p.curve (Icc a b) a) |
| 49 | (hderiv : mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) p.curve (Icc a b) a 1 = |
| 50 | -G.spacetime.timeVector (p.curve a) + (p.horizontal_velocity a).val) : |
| 51 | HEq (R.horizontal_velocity (Real.sqrt a)) |
| 52 | ((2 * Real.sqrt a) • p.horizontal_velocity a) := by |
| 53 | let C := M14SqrtParameterInterval a b |
| 54 | have hab := Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt |
| 55 | have hs : Real.sqrt a ∈ C := ⟨le_rfl, hab.le⟩ |
| 56 | have hC : UniqueDiffWithinAt ℝ C (Real.sqrt a) := uniqueDiffOn_Icc hab _ hs |
| 57 | have hmaps : C ⊆ (fun r : ℝ => r ^ 2) ⁻¹' Icc a b := by |
| 58 | intro r hr |
| 59 | have hr0 := (Real.sqrt_nonneg a).trans hr.1 |
| 60 | constructor |
| 61 | · nlinarith [Real.sq_sqrt p.tau_nonneg, Real.sqrt_nonneg a, hr.1] |
| 62 | · nlinarith [Real.sq_sqrt (p.tau_nonneg.trans p.tau_lt.le), |
| 63 | Real.sqrt_nonneg b, hr.2] |
| 64 | have hsq : HasDerivAt (fun r : ℝ => r ^ 2) (2 * Real.sqrt a) (Real.sqrt a) := by |
| 65 | simpa using hasDerivAt_pow 2 (Real.sqrt a) |
| 66 | have hdsq : mfderivWithin (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) (fun r : ℝ => r ^ 2) |
| 67 | C (Real.sqrt a) 1 = 2 * Real.sqrt a := by |
| 68 | have h := congrArg (fun L : ℝ →L[ℝ] ℝ => L 1) |
| 69 | (mfderivWithin_eq_fderivWithin (𝕜 := ℝ) (f := fun r : ℝ => r ^ 2) |
| 70 | (s := C) (x := Real.sqrt a)) |
| 71 | exact h.trans (hsq.hasDerivWithinAt.derivWithin hC) |
| 72 | have hcomp := mfderivWithin_comp_of_eq (I := 𝓘(ℝ, ℝ)) (I' := 𝓘(ℝ, ℝ)) |
| 73 | (I'' := spacetimeModel n) hp hsq.differentiableAt.mdifferentiableAt.mdifferentiableWithinAt |
| 74 | hmaps hC.uniqueMDiffWithinAt (Real.sq_sqrt p.tau_nonneg) |
| 75 | have heq := mfderivWithin_congr_of_mem (I := 𝓘(ℝ, ℝ)) (I' := spacetimeModel n) |
| 76 | R.agrees hs |
| 77 | have hd : mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) R.curve C (Real.sqrt a) 1 = |
| 78 | (2 * Real.sqrt a) • |
| 79 | (-G.spacetime.timeVector (p.curve a) + (p.horizontal_velocity a).val) := by |
| 80 | have h₁ := congrArg (fun L : ℝ →L[ℝ] SpacetimeModelVector n => L 1) heq |
| 81 | have h₂ := congrArg (fun L : ℝ →L[ℝ] SpacetimeModelVector n => L 1) hcomp |
| 82 | change mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) (fun r => p.curve (r ^ 2)) |
| 83 | C (Real.sqrt a) 1 = mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) p.curve |
| 84 | (Icc a b) a (mfderivWithin (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) (fun r : ℝ => r ^ 2) |
| 85 | C (Real.sqrt a) 1) at h₂ |
| 86 | rw [hdsq] at h₂ |
| 87 | apply h₁.trans (h₂.trans ?_) |
| 88 | calc |
| 89 | _ = (2 * Real.sqrt a) • mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) |
| 90 | p.curve (Icc a b) a 1 := by |
| 91 | simpa only [smul_eq_mul, mul_one] using |
| 92 | (mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) p.curve (Icc a b) a).map_smul |
| 93 | (2 * Real.sqrt a) 1 |
| 94 | _ = _ := by rw [hderiv] |
| 95 | have hpoint : R.curve (Real.sqrt a) = p.curve a := by |
| 96 | rw [R.agrees _ hs, Real.sq_sqrt p.tau_nonneg] |
| 97 | rw [squareRoot_horizontalVelocity_eq_projection R hs] |
| 98 | have hproj := projection_heq (G := G) hpoint (heq_of_eq hd) |
| 99 | simpa only [map_smul, map_add, map_neg, horizontalProjection_timeVector_eq_zero, |
| 100 | neg_zero, zero_add, G.spacetime.horizontalProjection_identity] using hproj |
| 101 | |
| 102 | /-- The initial square kinetic energy has exactly the frozen supplied |
| 103 | initial-velocity value, yielding the positive-start boundary correction, |
| 104 | Lemma 6.49 and its positive-start variant, p. 131. -/ |
| 105 | theorem positiveStart_initial_velocity_norm (R : M14SquareRootPath G p) |
| 106 | (hp : MDifferentiableWithinAt (𝓘(ℝ, ℝ)) (spacetimeModel n) |
| 107 | p.curve (Icc a b) a) |
| 108 | (hderiv : mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) p.curve (Icc a b) a 1 = |
| 109 | -G.spacetime.timeVector (p.curve a) + (p.horizontal_velocity a).val) : |
| 110 | G.spacetime.horizontalMetric.inner (R.curve (Real.sqrt a)) |
| 111 | (R.horizontal_velocity (Real.sqrt a)) (R.horizontal_velocity (Real.sqrt a)) = |
| 112 | 4 * a * G.spacetime.horizontalMetric.inner (p.curve a) |
| 113 | (p.horizontal_velocity a) (p.horizontal_velocity a) := by |
| 114 | have hpoint : R.curve (Real.sqrt a) = p.curve a := by |
| 115 | rw [R.agrees _ ⟨le_rfl, Real.sqrt_le_sqrt p.tau_lt.le⟩, |
| 116 | Real.sq_sqrt p.tau_nonneg] |
| 117 | rw [inner_heq hpoint (positiveStart_initial_velocity_heq R hp hderiv)] |
| 118 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 119 | calc |
| 120 | _ = 4 * (Real.sqrt a) ^ 2 * G.spacetime.horizontalMetric.inner (p.curve a) |
| 121 | (p.horizontal_velocity a) (p.horizontal_velocity a) := by ring |
| 122 | _ = _ := by rw [Real.sq_sqrt p.tau_nonneg] |
| 123 | |
| 124 | end PoincareMT.M14 |