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.Path.ReferenceEnergy |
| 2 | |
| 3 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/SquareEnergy.lean` at |
| 4 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 5 | |
| 6 | |
| 7 | /-! |
| 8 | # Removing the backward-time energy weight |
| 9 | |
| 10 | All admissible paths, including competitors with no endpoint derivative, |
| 11 | have the stated energy identity after squaring time. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle intervalIntegral Topology |
| 18 | open MeasureTheory |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.LGeometry |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 26 | [IsManifold (𝓡 n) ∞ M] |
| 27 | |
| 28 | theorem squarePath_continuousOn {J : Set ℝ} {F : RicciFlow n M J} |
| 29 | {T τ₁ τ₂ : ℝ} (p : BackwardTimePath F T τ₁ τ₂) : |
| 30 | ContinuousOn (squareReparameterizedCurve p.curve) (sqrtParameterInterval τ₁ τ₂) := by |
| 31 | apply p.continuous.comp (continuous_id.pow 2).continuousOn |
| 32 | intro s hs |
| 33 | change τ₁ ≤ s ^ 2 ∧ s ^ 2 ≤ τ₂ |
| 34 | constructor |
| 35 | · simpa only [Real.sq_sqrt p.nonnegative] using |
| 36 | (sq_le_sq₀ (Real.sqrt_nonneg τ₁) ((Real.sqrt_nonneg τ₁).trans hs.1)).mpr hs.1 |
| 37 | · simpa only [Real.sq_sqrt (p.nonnegative.trans p.ordered.le)] using |
| 38 | (sq_le_sq₀ ((Real.sqrt_nonneg τ₁).trans hs.1) (Real.sqrt_nonneg τ₂)).mpr hs.2 |
| 39 | |
| 40 | theorem squarePath_regular {J : Set ℝ} {F : RicciFlow n M J} |
| 41 | {T τ₁ τ₂ : ℝ} (p : BackwardTimePath F T τ₁ τ₂) : |
| 42 | ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) 1 (squareReparameterizedCurve p.curve) |
| 43 | (Set.Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) := by |
| 44 | exact p.regular.comp ((contDiff_id.pow 2).contMDiff.contMDiffOn) |
| 45 | (fun s hs ↦ (sq_mem_backward_interior p.nonnegative hs).2) |
| 46 | |
| 47 | theorem squarePath_referenceSpeedSq {J : Set ℝ} {F : RicciFlow n M J} |
| 48 | {T τ₁ τ₂ : ℝ} (p : BackwardTimePath F T τ₁ τ₂) |
| 49 | (g : RiemannianMetric n M) {s : ℝ} |
| 50 | (hs : s ∈ Set.Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) : |
| 51 | referenceSpeedSq g (squareReparameterizedCurve p.curve) s = |
| 52 | 2 * ((Real.sqrt (s ^ 2) * referenceSpeedSq g p.curve (s ^ 2)) * (2 * s)) := by |
| 53 | have hpos := (sq_mem_backward_interior p.nonnegative hs).1 |
| 54 | have hτ := (sq_mem_backward_interior p.nonnegative hs).2 |
| 55 | have hγ := (p.regular _ hτ).contMDiffAt (isOpen_Ioo.mem_nhds hτ) |
| 56 | have hv := curveVelocity_comp_sq (hγ.mdifferentiableAt one_ne_zero) |
| 57 | unfold referenceSpeedSq squareReparameterizedCurve |
| 58 | rw [hv, Real.sqrt_sq hpos.le] |
| 59 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 60 | ring |
| 61 | |
| 62 | /-- The squared-time reference energy is twice the weighted original energy. -/ |
| 63 | theorem squarePath_referenceEnergy {J : Set ℝ} {F : RicciFlow n M J} |
| 64 | {T τ₁ τ₂ : ℝ} (p : BackwardTimePath F T τ₁ τ₂) (g : RiemannianMetric n M) |
| 65 | (hW : IntervalIntegrable (fun τ ↦ Real.sqrt τ * referenceSpeedSq g p.curve τ) |
| 66 | volume τ₁ τ₂) : |
| 67 | IntervalIntegrable (referenceSpeedSq g (squareReparameterizedCurve p.curve)) |
| 68 | volume (Real.sqrt τ₁) (Real.sqrt τ₂) ∧ |
| 69 | (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, |
| 70 | referenceSpeedSq g (squareReparameterizedCurve p.curve) s) = |
| 71 | 2 * ∫ τ in τ₁..τ₂, Real.sqrt τ * referenceSpeedSq g p.curve τ := by |
| 72 | let W := fun τ ↦ Real.sqrt τ * referenceSpeedSq g p.curve τ |
| 73 | have hle := Real.sqrt_le_sqrt p.ordered.le |
| 74 | have hderiv (s : ℝ) : HasDerivAt (fun r : ℝ ↦ r ^ 2) (2 * s) s := by |
| 75 | simpa using hasDerivAt_pow 2 s |
| 76 | have hnonneg : ∀ s ∈ Set.uIoo (Real.sqrt τ₁) (Real.sqrt τ₂), 0 ≤ 2 * s := by |
| 77 | intro s hs |
| 78 | rw [Set.uIoo_of_le hle] at hs |
| 79 | exact mul_nonneg (by norm_num) ((Real.sqrt_nonneg τ₁).trans hs.1.le) |
| 80 | have htrans : IntervalIntegrable (fun s ↦ W (s ^ 2) * (2 * s)) |
| 81 | volume (Real.sqrt τ₁) (Real.sqrt τ₂) := by |
| 82 | apply (intervalIntegral.integrable_comp_mul_deriv_iff_of_deriv_nonneg |
| 83 | (f := fun s : ℝ ↦ s ^ 2) (f' := fun s ↦ 2 * s) (g := W) |
| 84 | (continuous_id.pow 2).continuousOn (fun s _ ↦ hderiv s) hnonneg).mpr |
| 85 | simpa only [Real.sq_sqrt p.nonnegative, |
| 86 | Real.sq_sqrt (p.nonnegative.trans p.ordered.le)] using hW |
| 87 | have hidentity : (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, W (s ^ 2) * (2 * s)) = |
| 88 | ∫ τ in τ₁..τ₂, W τ := by |
| 89 | have h := intervalIntegral.integral_comp_mul_deriv_of_deriv_nonneg |
| 90 | (f := fun s : ℝ ↦ s ^ 2) (f' := fun s ↦ 2 * s) (g := W) |
| 91 | (continuous_id.pow 2).continuousOn (fun s _ ↦ hderiv s) hnonneg |
| 92 | simpa only [Function.comp_apply, Real.sq_sqrt p.nonnegative, |
| 93 | Real.sq_sqrt (p.nonnegative.trans p.ordered.le)] using h |
| 94 | constructor |
| 95 | · apply (htrans.const_mul 2).congr_uIoo |
| 96 | intro s hs |
| 97 | rw [Set.uIoo_of_le hle] at hs |
| 98 | exact (squarePath_referenceSpeedSq p g hs).symm |
| 99 | · calc |
| 100 | _ = ∫ s in Real.sqrt τ₁..Real.sqrt τ₂, 2 * (W (s ^ 2) * (2 * s)) := |
| 101 | intervalIntegral.integral_congr_Ioo_of_le hle |
| 102 | (fun s hs ↦ squarePath_referenceSpeedSq p g hs) |
| 103 | _ = 2 * ∫ s in Real.sqrt τ₁..Real.sqrt τ₂, W (s ^ 2) * (2 * s) := |
| 104 | intervalIntegral.integral_const_mul _ _ |
| 105 | _ = _ := by rw [hidentity] |
| 106 | |
| 107 | theorem squarePath_regularizedIntegrand {J : Set ℝ} {F : RicciFlow n M J} |
| 108 | {T τ₁ τ₂ : ℝ} (p : BackwardTimePath F T τ₁ τ₂) {s : ℝ} |
| 109 | (hs : s ∈ Set.Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) : |
| 110 | regularizedLIntegrand F T (squareReparameterizedCurve p.curve) s = |
| 111 | backwardLIntegrand F T p.curve (s ^ 2) * (2 * s) := by |
| 112 | have hpos := (sq_mem_backward_interior p.nonnegative hs).1 |
| 113 | have hτ := (sq_mem_backward_interior p.nonnegative hs).2 |
| 114 | have hγ := (p.regular _ hτ).contMDiffAt (isOpen_Ioo.mem_nhds hτ) |
| 115 | have hv := curveVelocity_comp_sq (hγ.mdifferentiableAt one_ne_zero) |
| 116 | unfold regularizedLIntegrand backwardLIntegrand squareReparameterizedCurve |
| 117 | rw [hv, Real.sqrt_sq hpos.le] |
| 118 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 119 | ring |
| 120 | |
| 121 | /-- The square representative of every frozen competitor has the same action. -/ |
| 122 | theorem squarePath_action {J : Set ℝ} {F : RicciFlow n M J} |
| 123 | {T τ₁ τ₂ : ℝ} (p : BackwardTimePath F T τ₁ τ₂) : |
| 124 | IntervalIntegrable (regularizedLIntegrand F T (squareReparameterizedCurve p.curve)) |
| 125 | volume (Real.sqrt τ₁) (Real.sqrt τ₂) ∧ |
| 126 | regularizedLAction F T τ₁ τ₂ (squareReparameterizedCurve p.curve) = |
| 127 | backwardLLength F T τ₁ τ₂ p.curve := by |
| 128 | have hle := Real.sqrt_le_sqrt p.ordered.le |
| 129 | have htrans : IntervalIntegrable |
| 130 | (fun s ↦ backwardLIntegrand F T p.curve (s ^ 2) * (2 * s)) |
| 131 | volume (Real.sqrt τ₁) (Real.sqrt τ₂) := by |
| 132 | apply (intervalIntegral.integrable_comp_mul_deriv_iff_of_deriv_nonneg |
| 133 | (f := fun s : ℝ ↦ s ^ 2) (f' := fun s ↦ 2 * s) |
| 134 | (g := backwardLIntegrand F T p.curve) (continuous_id.pow 2).continuousOn |
| 135 | (fun s _ ↦ by simpa using hasDerivAt_pow 2 s) ?_).mpr |
| 136 | · simpa only [Real.sq_sqrt p.nonnegative, |
| 137 | Real.sq_sqrt (p.nonnegative.trans p.ordered.le)] using p.l_integrable |
| 138 | · intro s hs |
| 139 | have hspos : 0 < s := (Real.sqrt_nonneg τ₁).trans_lt |
| 140 | (by simpa [min_eq_left hle] using hs.1) |
| 141 | exact mul_nonneg (by norm_num) hspos.le |
| 142 | constructor |
| 143 | · apply htrans.congr_uIoo |
| 144 | intro s hs |
| 145 | rw [Set.uIoo_of_le hle] at hs |
| 146 | exact (squarePath_regularizedIntegrand p hs).symm |
| 147 | · rw [backwardLLength_eq_transformed p] |
| 148 | exact intervalIntegral.integral_congr_Ioo_of_le hle |
| 149 | (fun s hs ↦ squarePath_regularizedIntegrand p hs) |
| 150 | |
| 151 | /- The converse square substitution is needed when a smooth square-root |
| 152 | representative is used to manufacture a `BackwardTimePath`. -/ |
| 153 | theorem intervalIntegrable_of_square_transform {a b : ℝ} (ha : 0 ≤ a) (hab : a ≤ b) |
| 154 | {g r : ℝ → ℝ} |
| 155 | (hr : IntervalIntegrable r volume (Real.sqrt a) (Real.sqrt b)) |
| 156 | (heq : ∀ s ∈ Set.Ioo (Real.sqrt a) (Real.sqrt b), |
| 157 | r s = g (s ^ 2) * (2 * s)) : |
| 158 | IntervalIntegrable g volume a b := by |
| 159 | have hsqrt : Real.sqrt a ≤ Real.sqrt b := Real.sqrt_le_sqrt hab |
| 160 | have hnonneg : ∀ s ∈ Set.uIoo (Real.sqrt a) (Real.sqrt b), 0 ≤ 2 * s := by |
| 161 | intro s hs |
| 162 | rw [Set.uIoo_of_le hsqrt] at hs |
| 163 | exact mul_nonneg (by norm_num) ((Real.sqrt_nonneg a).trans hs.1.le) |
| 164 | have hiff := intervalIntegral.integrable_comp_mul_deriv_iff_of_deriv_nonneg |
| 165 | (f := fun s : ℝ ↦ s ^ 2) (f' := fun s ↦ 2 * s) (g := g) |
| 166 | (continuous_id.pow 2).continuousOn (fun s _ ↦ by simpa using hasDerivAt_pow 2 s) |
| 167 | hnonneg |
| 168 | have htrans : IntervalIntegrable (fun s ↦ g (s ^ 2) * (2 * s)) volume |
| 169 | (Real.sqrt a) (Real.sqrt b) := by |
| 170 | apply hr.congr_uIoo |
| 171 | intro s hs |
| 172 | rw [Set.uIoo_of_le hsqrt] at hs |
| 173 | exact heq s hs |
| 174 | simpa only [Real.sq_sqrt ha, Real.sq_sqrt (ha.trans hab)] using hiff.mp htrans |
| 175 | |
| 176 | end PoincareMT.LGeometry |