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.ReducedVolume.Minimum.Compactness.SquarePathEnergy |
| 2 | |
| 3 | /-! |
| 4 | # Bounding square-path energy by the actual action |
| 5 | |
| 6 | Only the continuous terminal kinetic energy is integrated here. The |
| 7 | supplied actual action primitive retains the scalar term in its pointwise |
| 8 | derivative, so bounded scalar curvature needs no separate integrability |
| 9 | assertion for this comparison. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | open scoped Manifold ContDiff Bundle |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedVolume |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 24 | |
| 25 | /-- The actual corrected action controls terminal-metric square-path energy. -/ |
| 26 | theorem integral_terminalSquareEnergy_le |
| 27 | (G : LExponentialGeometry F T τmax p) (Z : TangentSpace (𝓡 n) p) |
| 28 | {τ C Q : ℝ} (hτ : 0 < τ) (hmax : τ < τmax) (hQ : 0 < Q) |
| 29 | (hR : ∀ r ∈ Icc 0 τ, ∀ q : M, -C ≤ (F.connection (T - r)).scalarCurvature q) |
| 30 | (hmetric : ∀ r ∈ Icc 0 τ, ∀ q : M, ∀ v : TangentSpace (𝓡 n) q, |
| 31 | (F.metric T).inner q v v ≤ Q * (F.metric (T - r)).inner q v v) : |
| 32 | (∫ s in 0..Real.sqrt τ, terminalSquareEnergy G Z s) ≤ |
| 33 | 2 * Q * (G.toLExponentialFamily.action Z τ + (2 * C / 3) * τ * Real.sqrt τ) := by |
| 34 | let H := fun s : ℝ ↦ G.toLExponentialFamily.action Z (s ^ 2) + (2 * C / 3) * s ^ 3 |
| 35 | let D := fun s : ℝ ↦ 2 * s ^ 2 * |
| 36 | ((F.connection (T - s ^ 2)).scalarCurvature (G.gamma Z (s ^ 2)) + |
| 37 | (F.metric (T - s ^ 2)).inner (G.gamma Z (s ^ 2)) |
| 38 | (curveVelocity (G.gamma Z) (s ^ 2)) (curveVelocity (G.gamma Z) (s ^ 2)) + C) |
| 39 | have hc : ContinuousOn H (Icc 0 (Real.sqrt τ)) := by |
| 40 | apply ContinuousOn.add _ (by fun_prop) |
| 41 | apply (action_continuousOn_initial G Z hτ hmax).comp (by fun_prop) |
| 42 | intro s hs |
| 43 | exact ⟨sq_nonneg s, by nlinarith [Real.sq_sqrt hτ.le, hs.1, hs.2]⟩ |
| 44 | have hd (s : ℝ) (hs : s ∈ Ioo 0 (Real.sqrt τ)) : HasDerivAt H (D s) s := by |
| 45 | apply corrected_square_action_hasDerivAt G Z C hs.1 |
| 46 | have hsτ : s ^ 2 ≤ τ := by nlinarith [Real.sq_sqrt hτ.le, hs.1, hs.2] |
| 47 | exact hsτ.trans_lt hmax |
| 48 | have henergy (s : ℝ) (hs : s ∈ Ioo 0 (Real.sqrt τ)) : |
| 49 | terminalSquareEnergy G Z s ≤ 2 * Q * D s := by |
| 50 | have hsτ : s ^ 2 ∈ Icc 0 τ := |
| 51 | ⟨sq_nonneg s, by nlinarith [Real.sq_sqrt hτ.le, hs.1, hs.2]⟩ |
| 52 | have hsmax : s ∈ Ioo 0 (Real.sqrt τmax) := |
| 53 | ⟨hs.1, hs.2.trans (Real.sqrt_lt_sqrt hτ.le hmax)⟩ |
| 54 | rw [terminalSquareEnergy_eq_speed G Z hsmax] |
| 55 | have hscalar := hR (s ^ 2) hsτ (G.gamma Z (s ^ 2)) |
| 56 | have hk := mul_le_mul_of_nonneg_left |
| 57 | (hmetric (s ^ 2) hsτ (G.gamma Z (s ^ 2)) (curveVelocity (G.gamma Z) (s ^ 2))) |
| 58 | (sq_nonneg (2 * s)) |
| 59 | apply hk.trans |
| 60 | dsimp only [D] |
| 61 | calc |
| 62 | _ = 2 * Q * (2 * s ^ 2 * |
| 63 | (F.metric (T - s ^ 2)).inner (G.gamma Z (s ^ 2)) |
| 64 | (curveVelocity (G.gamma Z) (s ^ 2)) (curveVelocity (G.gamma Z) (s ^ 2))) := by ring |
| 65 | _ ≤ _ := mul_le_mul_of_nonneg_left |
| 66 | (mul_le_mul_of_nonneg_left (by linarith only [hscalar]) |
| 67 | (mul_nonneg (by norm_num) (sq_nonneg s))) (mul_nonneg (by norm_num) hQ.le) |
| 68 | have hint := (terminalSquareEnergy_continuousOn G Z hτ hmax).integrableOn_Icc |
| 69 | (μ := MeasureTheory.volume) |
| 70 | have hbound := intervalIntegral.integral_le_sub_of_hasDeriv_right_of_le |
| 71 | (Real.sqrt_nonneg τ) (hc.const_mul (2 * Q)) |
| 72 | (fun s hs ↦ ((hd s hs).const_mul (2 * Q)).hasDerivWithinAt) hint henergy |
| 73 | have hzero : H 0 = 0 := by |
| 74 | simp only [H, zero_pow (by omega : (2 : ℕ) ≠ 0), zero_pow (by omega : (3 : ℕ) ≠ 0), |
| 75 | LExponentialFamily.action, backwardLLength, intervalIntegral.integral_same, |
| 76 | mul_zero, add_zero] |
| 77 | have hend : H (Real.sqrt τ) = |
| 78 | G.toLExponentialFamily.action Z τ + (2 * C / 3) * τ * Real.sqrt τ := by |
| 79 | dsimp only [H] |
| 80 | rw [Real.sq_sqrt hτ.le] |
| 81 | rw [show (Real.sqrt τ) ^ 3 = τ * Real.sqrt τ by |
| 82 | rw [pow_succ, Real.sq_sqrt hτ.le]] |
| 83 | ring |
| 84 | simpa only [hzero, hend, mul_zero, sub_zero] using hbound |
| 85 | |
| 86 | end PoincareMT.ReducedVolume |