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.ReducedGeometry.LGeometry.Basic |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Pow |
| 3 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts |
| 4 | import Mathlib.Tactic.Ring |
| 5 | |
| 6 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/RegularizedAction.lean` at |
| 7 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 8 | |
| 9 | |
| 10 | /-! |
| 11 | # The action in square-root time |
| 12 | |
| 13 | The change of variables is valid for every admissible backward path with a |
| 14 | smooth square-root representative, including a nonzero initial square-root |
| 15 | velocity at backward time zero. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.LGeometry |
| 26 | |
| 27 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 29 | [IsManifold (𝓡 n) ∞ M] |
| 30 | |
| 31 | /-- The nonsingular Lagrangian after the substitution `τ = s²`. -/ |
| 32 | noncomputable def regularizedLIntegrand {J : Set ℝ} (F : RicciFlow n M J) |
| 33 | (T : ℝ) (α : ℝ → M) (s : ℝ) : ℝ := |
| 34 | 2 * s ^ 2 * (F.connection (T - s ^ 2)).scalarCurvature (α s) + |
| 35 | (1 / 2 : ℝ) * (F.metric (T - s ^ 2)).inner (α s) |
| 36 | (curveVelocity (n := n) α s) (curveVelocity (n := n) α s) |
| 37 | |
| 38 | /-- The regular action on the closed square-root parameter interval. -/ |
| 39 | noncomputable def regularizedLAction {J : Set ℝ} (F : RicciFlow n M J) |
| 40 | (T τ₁ τ₂ : ℝ) (α : ℝ → M) : ℝ := |
| 41 | ∫ s in Real.sqrt τ₁..Real.sqrt τ₂, regularizedLIntegrand F T α s |
| 42 | |
| 43 | /-- Interior square-root parameters correspond to positive interior backward times. -/ |
| 44 | theorem sq_mem_backward_interior {τ₁ τ₂ s : ℝ} (hτ₁ : 0 ≤ τ₁) |
| 45 | (hs : s ∈ Set.Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) : |
| 46 | 0 < s ∧ s ^ 2 ∈ Set.Ioo τ₁ τ₂ := by |
| 47 | have hpos : 0 < s := (Real.sqrt_nonneg τ₁).trans_lt hs.1 |
| 48 | refine ⟨hpos, Real.lt_sq_of_sqrt_lt hs.1, ?_⟩ |
| 49 | exact (Real.lt_sqrt hpos.le).mp hs.2 |
| 50 | |
| 51 | /-- The ordinary tangent velocity obeys the chain rule for squaring. -/ |
| 52 | theorem curveVelocity_comp_sq {γ : ℝ → M} {s : ℝ} |
| 53 | (hγ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ (s ^ 2)) : |
| 54 | curveVelocity (n := n) (fun r ↦ γ (r ^ 2)) s = |
| 55 | (2 * s) • curveVelocity (n := n) γ (s ^ 2) := by |
| 56 | have hsq : HasDerivAt (fun r : ℝ ↦ r ^ 2) (2 * s) s := by |
| 57 | simpa using hasDerivAt_pow 2 s |
| 58 | have hsqmf_apply : mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) |
| 59 | (fun r : ℝ ↦ r ^ 2) s 1 = 2 * s := by |
| 60 | have hm := hsq.hasFDerivAt.hasMFDerivAt.mfderiv |
| 61 | have hv := congrArg (fun L : TangentSpace (𝓘(ℝ, ℝ)) s →L[ℝ] |
| 62 | TangentSpace (𝓘(ℝ, ℝ)) (s ^ 2) ↦ L 1) hm |
| 63 | change (mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) (fun r : ℝ ↦ r ^ 2) s) (1 : ℝ) = |
| 64 | (ContinuousLinearMap.toSpanSingleton ℝ (2 * s)) (1 : ℝ) at hv |
| 65 | simpa only [ContinuousLinearMap.toSpanSingleton_apply, one_smul] using hv |
| 66 | change (mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) (γ ∘ fun r : ℝ ↦ r ^ 2) s) 1 = _ |
| 67 | have hchain := mfderiv_comp_apply s (f := fun r : ℝ ↦ r ^ 2) (g := γ) |
| 68 | hγ hsq.differentiableAt.mdifferentiableAt (1 : TangentSpace (𝓘(ℝ, ℝ)) s) |
| 69 | have hinput : mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) |
| 70 | (fun r : ℝ ↦ r ^ 2) s 1 = |
| 71 | (2 * s) • (1 : TangentSpace (𝓘(ℝ, ℝ)) s) := by |
| 72 | rw [hsqmf_apply] |
| 73 | simp |
| 74 | rw [hinput, map_smul] at hchain |
| 75 | simpa only [curveVelocity, Function.comp_apply] using hchain |
| 76 | |
| 77 | /-- The representative velocity is twice the square-root parameter times the path velocity. -/ |
| 78 | theorem sqrtRegularPath_velocity {J : Set ℝ} {F : RicciFlow n M J} |
| 79 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 80 | (R : SqrtRegularPath p) {s : ℝ} |
| 81 | (hs : s ∈ Set.Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) : |
| 82 | curveVelocity (n := n) R.curve s = |
| 83 | (2 * s) • curveVelocity (n := n) p.curve (s ^ 2) := by |
| 84 | have hτ := (sq_mem_backward_interior p.nonnegative hs).2 |
| 85 | have hbase : R.curve s = p.curve (s ^ 2) := |
| 86 | R.agrees s ⟨hs.1.le, hs.2.le⟩ |
| 87 | have hnear : R.curve =ᶠ[𝓝 s] fun r ↦ p.curve (r ^ 2) := |
| 88 | Filter.eventually_of_mem (Ioo_mem_nhds hs.1 hs.2) |
| 89 | (fun r hr ↦ R.agrees r ⟨hr.1.le, hr.2.le⟩) |
| 90 | have hγ := (p.regular (s ^ 2) hτ).contMDiffAt (Ioo_mem_nhds hτ.1 hτ.2) |
| 91 | have hvel : curveVelocity (n := n) R.curve s = |
| 92 | curveVelocity (n := n) (fun r ↦ p.curve (r ^ 2)) s := by |
| 93 | unfold curveVelocity |
| 94 | rw [hnear.mfderiv_eq] |
| 95 | rfl |
| 96 | exact hvel.trans (curveVelocity_comp_sq (hγ.mdifferentiableAt one_ne_zero)) |
| 97 | |
| 98 | /-- The transformed integrands agree away from the two endpoints. -/ |
| 99 | theorem regularizedLIntegrand_eq_transformed {J : Set ℝ} {F : RicciFlow n M J} |
| 100 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 101 | (R : SqrtRegularPath p) {s : ℝ} |
| 102 | (hs : s ∈ Set.Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) : |
| 103 | regularizedLIntegrand F T R.curve s = |
| 104 | backwardLIntegrand F T p.curve (s ^ 2) * (2 * s) := by |
| 105 | have hpos := (sq_mem_backward_interior p.nonnegative hs).1 |
| 106 | have hbase := R.agrees s ⟨hs.1.le, hs.2.le⟩ |
| 107 | have hvel := sqrtRegularPath_velocity R hs |
| 108 | unfold regularizedLIntegrand backwardLIntegrand |
| 109 | rw [Real.sqrt_sq hpos.le] |
| 110 | rw [hbase] |
| 111 | simp only [hvel, map_smul, smul_apply, smul_eq_mul] |
| 112 | ring |
| 113 | |
| 114 | /-- Squaring transports the action integral even when the original integrand is singular at zero. -/ |
| 115 | theorem backwardLLength_eq_transformed {J : Set ℝ} {F : RicciFlow n M J} |
| 116 | {T τ₁ τ₂ : ℝ} (p : BackwardTimePath F T τ₁ τ₂) : |
| 117 | backwardLLength F T τ₁ τ₂ p.curve = |
| 118 | ∫ s in Real.sqrt τ₁..Real.sqrt τ₂, |
| 119 | backwardLIntegrand F T p.curve (s ^ 2) * (2 * s) := by |
| 120 | have hle := Real.sqrt_le_sqrt p.ordered.le |
| 121 | have hsub := intervalIntegral.integral_comp_mul_deriv_of_deriv_nonneg |
| 122 | (a := Real.sqrt τ₁) (b := Real.sqrt τ₂) |
| 123 | (f := fun s : ℝ ↦ s ^ 2) (f' := fun s ↦ 2 * s) |
| 124 | (g := backwardLIntegrand F T p.curve) (continuous_id.pow 2).continuousOn |
| 125 | (fun s _ ↦ by simpa using hasDerivAt_pow 2 s) |
| 126 | (fun s hs ↦ by |
| 127 | rw [min_eq_left hle, max_eq_right hle] at hs |
| 128 | exact mul_nonneg (by norm_num) ((Real.sqrt_nonneg τ₁).trans hs.1.le)) |
| 129 | simpa only [Real.sq_sqrt p.nonnegative, |
| 130 | Real.sq_sqrt (p.nonnegative.trans p.ordered.le), Function.comp_def, |
| 131 | backwardLLength] using hsub.symm |
| 132 | |
| 133 | /-- The regular action is the frozen backward L-length. -/ |
| 134 | theorem regularizedLAction_eq_backwardLLength {J : Set ℝ} {F : RicciFlow n M J} |
| 135 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 136 | (R : SqrtRegularPath p) : |
| 137 | regularizedLAction F T τ₁ τ₂ R.curve = backwardLLength F T τ₁ τ₂ p.curve := by |
| 138 | rw [backwardLLength_eq_transformed p] |
| 139 | exact intervalIntegral.integral_congr_Ioo_of_le (Real.sqrt_le_sqrt p.ordered.le) |
| 140 | (fun _ hs ↦ regularizedLIntegrand_eq_transformed R hs) |
| 141 | |
| 142 | /-- The regular action density inherits integrability from the admissible backward path. -/ |
| 143 | theorem regularizedLIntegrand_intervalIntegrable {J : Set ℝ} {F : RicciFlow n M J} |
| 144 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 145 | (R : SqrtRegularPath p) : |
| 146 | IntervalIntegrable (regularizedLIntegrand F T R.curve) MeasureTheory.volume |
| 147 | (Real.sqrt τ₁) (Real.sqrt τ₂) := by |
| 148 | have hle := Real.sqrt_le_sqrt p.ordered.le |
| 149 | have hiff := intervalIntegral.integrable_comp_mul_deriv_iff_of_deriv_nonneg |
| 150 | (a := Real.sqrt τ₁) (b := Real.sqrt τ₂) |
| 151 | (f := fun s : ℝ ↦ s ^ 2) (f' := fun s ↦ 2 * s) |
| 152 | (g := backwardLIntegrand F T p.curve) (continuous_id.pow 2).continuousOn |
| 153 | (fun s _ ↦ by simpa using hasDerivAt_pow 2 s) |
| 154 | (fun s hs ↦ by |
| 155 | rw [min_eq_left hle, max_eq_right hle] at hs |
| 156 | exact mul_nonneg (by norm_num) ((Real.sqrt_nonneg τ₁).trans hs.1.le)) |
| 157 | have htrans : IntervalIntegrable |
| 158 | (fun s ↦ backwardLIntegrand F T p.curve (s ^ 2) * (2 * s)) |
| 159 | MeasureTheory.volume (Real.sqrt τ₁) (Real.sqrt τ₂) := by |
| 160 | apply hiff.mpr |
| 161 | simpa only [Real.sq_sqrt p.nonnegative, |
| 162 | Real.sq_sqrt (p.nonnegative.trans p.ordered.le)] using p.l_integrable |
| 163 | apply htrans.congr_uIoo |
| 164 | intro s hs |
| 165 | rw [Set.uIoo_of_le hle] at hs |
| 166 | exact (regularizedLIntegrand_eq_transformed R hs).symm |
| 167 | |
| 168 | end PoincareMT.LGeometry |