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.SquareScalarEnergy |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquarePullback |
| 3 | |
| 4 | /-! |
| 5 | # Integrability of the actual weighted Harnack density |
| 6 | |
| 7 | The frozen density agrees in the strict interior with a continuous |
| 8 | expression in closed square-time scalar and kinetic derivatives. |
| 9 | Morgan-Tian equation (6.15), p. 127, and Lemmas 6.47-6.48, p. 130. |
| 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.M14 |
| 20 | |
| 21 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 22 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 23 | |
| 24 | private theorem scalar_transport_smul {q r : G.Point} (h : q = r) |
| 25 | (v : G.Horizontal r) (c : ℝ) : |
| 26 | M14HorizontalScalarDifferential G q (h.symm ▸ (c • v)).val = |
| 27 | c * M14HorizontalScalarDifferential G r v.val := by |
| 28 | cases h |
| 29 | change M14HorizontalScalarDifferential G q (c • v.val) = _ |
| 30 | rw [map_smul, smul_eq_mul] |
| 31 | |
| 32 | private theorem ricci_transport_smul (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 33 | {q r : G.Point} (h : q = r) (v : G.Horizontal r) (c : ℝ) : |
| 34 | horizontalRicci G.leafwise q (h.symm ▸ (c • v)) (h.symm ▸ (c • v)) = |
| 35 | c ^ 2 * horizontalRicci G.leafwise r v v := by |
| 36 | cases h |
| 37 | rw [horizontalRicci_smul_left hM12, horizontalRicci_smul_right hM12] |
| 38 | ring |
| 39 | |
| 40 | variable {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 41 | |
| 42 | /-- The actual weighted Harnack density in square time is a continuous |
| 43 | closed-derivative expression on the strict interior, equation (6.15) and |
| 44 | Lemma 6.48, pp. 127, 130. -/ |
| 45 | theorem squareRoot_weightedHarnack_eq |
| 46 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (R : M14SquareRootPath G p) |
| 47 | (E : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 48 | R.horizontal_velocity) {s : ℝ} |
| 49 | (hs : s ∈ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) |
| 50 | (hEuler : ∀ W, M14SquareRootEulerResidual G R E s W = 0) : |
| 51 | s ^ 2 * s * M14GeneralizedHarnackDensity G p |
| 52 | (fun t => M14BackwardTimeDerivative G (horizontalScalarCurvature G.leafwise) |
| 53 | (p.curve t)) (s ^ 2) = |
| 54 | -s * horizontalScalarCurvature G.leafwise (R.curve s) - |
| 55 | (s ^ 2 / 2) * derivWithin |
| 56 | (fun r => horizontalScalarCurvature G.leafwise (R.curve r)) |
| 57 | (M14SqrtParameterInterval τ₁ τ₂) s - |
| 58 | derivWithin (fun r => G.spacetime.horizontalMetric.inner (R.curve r) |
| 59 | (R.horizontal_velocity r) (R.horizontal_velocity r)) |
| 60 | (M14SqrtParameterInterval τ₁ τ₂) s / 8 := by |
| 61 | have hsC : s ∈ M14SqrtParameterInterval τ₁ τ₂ := Ioo_subset_Icc_self hs |
| 62 | have hC := uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt) |
| 63 | have hS := (squareRoot_scalar_hasDerivWithinAt hM12 R hsC).derivWithin (hC s hsC) |
| 64 | have hE := (squareRoot_energy_hasDerivWithinAt R E hsC hEuler).derivWithin (hC s hsC) |
| 65 | have hbase := R.agrees s hsC |
| 66 | have hscalar : M14HorizontalScalarDifferential G (R.curve s) (R.horizontal_velocity s).val = |
| 67 | (2 * s) * M14HorizontalScalarDifferential G (p.curve (s ^ 2)) |
| 68 | (p.horizontal_velocity (s ^ 2)).val := by |
| 69 | rw [R.horizontal_agrees s hs] |
| 70 | exact scalar_transport_smul hbase _ _ |
| 71 | have hricci : horizontalRicci G.leafwise (R.curve s) |
| 72 | (R.horizontal_velocity s) (R.horizontal_velocity s) = |
| 73 | (2 * s) ^ 2 * horizontalRicci G.leafwise (p.curve (s ^ 2)) |
| 74 | (p.horizontal_velocity (s ^ 2)) (p.horizontal_velocity (s ^ 2)) := by |
| 75 | rw [R.horizontal_agrees s hs] |
| 76 | exact ricci_transport_smul hM12 hbase _ _ |
| 77 | rw [hS, hE, hscalar, hricci, hbase] |
| 78 | unfold M14GeneralizedHarnackDensity M14HorizontalScalarDifferential |
| 79 | have hs0 : s ≠ 0 := ((Real.sqrt_nonneg τ₁).trans_lt hs.1).ne' |
| 80 | field_simp [hs0] |
| 81 | ring |
| 82 | |
| 83 | /-- The actual Harnack density with weight tau sqrt(tau) is integrable, |
| 84 | including at initial time zero, Lemmas 6.47-6.48, p. 130. -/ |
| 85 | theorem squareRoot_weightedHarnack_intervalIntegrable |
| 86 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (R : M14SquareRootPath G p) |
| 87 | (E : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 88 | R.horizontal_velocity) |
| 89 | (hEuler : ∀ s ∈ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂), |
| 90 | ∀ W, M14SquareRootEulerResidual G R E s W = 0) : |
| 91 | IntervalIntegrable (fun t => t * Real.sqrt t * M14GeneralizedHarnackDensity G p |
| 92 | (fun r => M14BackwardTimeDerivative G (horizontalScalarCurvature G.leafwise) |
| 93 | (p.curve r)) t) MeasureTheory.volume τ₁ τ₂ := by |
| 94 | let C := M14SqrtParameterInterval τ₁ τ₂ |
| 95 | let S : ℝ → ℝ := fun s => horizontalScalarCurvature G.leafwise (R.curve s) |
| 96 | let K : ℝ → ℝ := fun s => G.spacetime.horizontalMetric.inner (R.curve s) |
| 97 | (R.horizontal_velocity s) (R.horizontal_velocity s) |
| 98 | let H : ℝ → ℝ := fun s => -s * S s - (s ^ 2 / 2) * derivWithin S C s - |
| 99 | derivWithin K C s / 8 |
| 100 | have hC : UniqueDiffOn ℝ C := uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt) |
| 101 | have hS : ContDiffOn ℝ ∞ S C := squareRoot_scalar_contDiffOn hM12 R |
| 102 | have hK : ContDiffOn ℝ ∞ K C := squareRoot_energy_contDiffOn R |
| 103 | have hH : ContinuousOn H C := |
| 104 | ((continuousOn_id.neg.mul hS.continuousOn).sub |
| 105 | (((continuousOn_id.pow 2).div_const 2).mul |
| 106 | (hS.derivWithin hC (m := ∞) (by simp)).continuousOn)).sub |
| 107 | ((hK.derivWithin hC (m := ∞) (by simp)).continuousOn.div_const 8) |
| 108 | have hcomp : ContinuousOn (fun t => H (Real.sqrt t)) (Icc τ₁ τ₂) := |
| 109 | hH.comp Real.continuous_sqrt.continuousOn |
| 110 | (fun _ ht => ⟨Real.sqrt_le_sqrt ht.1, Real.sqrt_le_sqrt ht.2⟩) |
| 111 | apply (hcomp.intervalIntegrable_of_Icc p.tau_lt.le).congr_uIoo |
| 112 | intro t ht |
| 113 | rw [uIoo_of_le p.tau_lt.le] at ht |
| 114 | have ht0 : 0 < t := p.tau_nonneg.trans_lt ht.1 |
| 115 | have hs : Real.sqrt t ∈ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂) := |
| 116 | ⟨Real.sqrt_lt_sqrt p.tau_nonneg ht.1, Real.sqrt_lt_sqrt ht0.le ht.2⟩ |
| 117 | have h := squareRoot_weightedHarnack_eq hM12 R E hs (hEuler _ hs) |
| 118 | simpa only [H, S, K, C, Real.sq_sqrt ht0.le] using h.symm |
| 119 | |
| 120 | end PoincareMT.M14 |