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.ReducedLength.Calculus.SquareScalarDerivative |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Action.SquareEnergyRegularity |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Exponential.FamilySquareVelocity |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.FrameForms |
| 5 | |
| 6 | /-! |
| 7 | # Integrability of the weighted Harnack density |
| 8 | |
| 9 | The actual weighted density equals a continuous expression in square-time |
| 10 | scalar curvature and energy derivatives. Only endpoint values are discarded. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option maxSynthPendingDepth 3 |
| 15 | set_option maxHeartbeats 800000 |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedLength |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 25 | [IsManifold (𝓡 n) ∞ M] |
| 26 | |
| 27 | noncomputable def backwardScalarEvolutionAlong {J : Set ℝ} |
| 28 | (F : RicciFlow n M J) (T : ℝ) (γ : ℝ → M) (t : ℝ) : ℝ := |
| 29 | -((F.connection (T - t)).laplacian (F.connection (T - t)).scalarCurvature (γ t) + |
| 30 | 2 * (F.connection (T - t)).ricciNormSq (γ t)) |
| 31 | |
| 32 | set_option backward.isDefEq.respectTransparency false in |
| 33 | theorem lExponentialFamily_weightedHarnack_square {J : Set ℝ} {F : RicciFlow n M J} |
| 34 | (hM04 : RicciFlowCurvatureTheory.{u}) {T τmax : ℝ} |
| 35 | (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 36 | {p : M} (A : LExponentialFamily F T τmax p) |
| 37 | (Z : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) |
| 38 | (s : ℝ) (hs : s ∈ Set.Ioo 0 (Real.sqrt b)) : |
| 39 | s ^ 2 * s * reducedHarnackDensity F T (A.gamma Z) |
| 40 | (backwardScalarEvolutionAlong F T (A.gamma Z)) (s ^ 2) = |
| 41 | -s * (F.connection (T - s ^ 2)).scalarCurvature (A.squareFamily Z s) - |
| 42 | (s ^ 2 / 2) * deriv (fun r ↦ |
| 43 | (F.connection (T - r ^ 2)).scalarCurvature (A.squareFamily Z r)) s - |
| 44 | deriv (regularizedCurveEnergy F T (A.squareFamily Z)) s / 8 := by |
| 45 | have hsmax : s ∈ Set.Ioo 0 (Real.sqrt τmax) := |
| 46 | ⟨hs.1, hs.2.trans (Real.sqrt_lt_sqrt hb.le hmax)⟩ |
| 47 | have hbase := A.square_agrees Z s ⟨hs.1.le, hsmax.2⟩ |
| 48 | have hvel := lExponentialFamily_square_velocity_eq A Z s hsmax |
| 49 | have hα := (lExponentialFamily_squareSlice_contMDiffAt A Z s |
| 50 | ⟨hs.1.le, hsmax.2⟩).mdifferentiableAt (by simp) |
| 51 | have hS := (squareTime_scalar_along_hasDerivAt F hM04 T τmax b hb hmax hwindow |
| 52 | (A.squareFamily Z) s hs hα).deriv |
| 53 | have hE := (lExponentialFamily_squareEnergy_hasDerivAt hM04 hτmax hwindow |
| 54 | A Z b hb hmax s (Set.Ioo_subset_Icc_self hs)).deriv |
| 55 | let g := F.metric (T - s ^ 2) |
| 56 | let D := F.connection (T - s ^ 2) |
| 57 | let q := A.gamma Z (s ^ 2) |
| 58 | let B := tensorBilinear g D.ricciEvaluation (hM04.tensor_calculus n M g D).2.1 q |
| 59 | have hB (v w : TangentSpace (𝓡 n) q) : D.ricci q v w = B v w := |
| 60 | (tensorBilinear_apply g D.ricciEvaluation (hM04.tensor_calculus n M g D).2.1 q v w).symm |
| 61 | have hRic (v : TangentSpace (𝓡 n) q) : |
| 62 | D.ricci q ((2 * s) • v) ((2 * s) • v) = (2 * s) ^ 2 * D.ricci q v v := by |
| 63 | rw [hB, hB] |
| 64 | simp only [map_smul, ContinuousLinearMap.smul_apply, smul_eq_mul] |
| 65 | ring |
| 66 | rw [hbase] at hS hE ⊢ |
| 67 | rw [hvel, map_smul, smul_eq_mul] at hS hE |
| 68 | rw [hRic] at hE |
| 69 | rw [hS, hE] |
| 70 | unfold reducedHarnackDensity backwardScalarEvolutionAlong |
| 71 | dsimp only [D, q] at * |
| 72 | field_simp [hs.1.ne'] <;> ring |
| 73 | |
| 74 | theorem lExponentialFamily_harnack_integrable {J : Set ℝ} {F : RicciFlow n M J} |
| 75 | (hM04 : RicciFlowCurvatureTheory.{u}) {T τmax : ℝ} |
| 76 | (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 77 | {p : M} (A : LExponentialFamily F T τmax p) |
| 78 | (Z : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 79 | IntervalIntegrable (fun t ↦ t * Real.sqrt t * reducedHarnackDensity F T (A.gamma Z) |
| 80 | (backwardScalarEvolutionAlong F T (A.gamma Z)) t) MeasureTheory.volume 0 b := by |
| 81 | let U := ((fun s : ℝ ↦ (Z, s)) ⁻¹' A.squareDomain) ∩ |
| 82 | Set.Ioo (-Real.sqrt τmax) (Real.sqrt τmax) |
| 83 | have hU : IsOpen U := (A.square_open.preimage |
| 84 | (continuous_const.prodMk continuous_id)).inter isOpen_Ioo |
| 85 | have hKU : Set.Icc 0 (Real.sqrt b) ⊆ U := by |
| 86 | intro s hs |
| 87 | have hsmax := hs.2.trans_lt (Real.sqrt_lt_sqrt hb.le hmax) |
| 88 | exact ⟨A.square_contains ⟨Set.mem_univ _, hs.1, hsmax⟩, |
| 89 | (neg_lt_zero.mpr (Real.sqrt_pos.mpr hτmax)).trans_le hs.1, hsmax⟩ |
| 90 | have hα := (lExponentialFamily_squareSlice_contMDiffOn A Z).mono |
| 91 | (show U ⊆ (fun s : ℝ ↦ (Z, s)) ⁻¹' A.squareDomain from Set.inter_subset_left) |
| 92 | let S : ℝ → ℝ := fun s ↦ (F.connection (T - s ^ 2)).scalarCurvature (A.squareFamily Z s) |
| 93 | let E := regularizedCurveEnergy F T (A.squareFamily Z) |
| 94 | have hS : ContDiffOn ℝ ∞ S U := |
| 95 | ((squareTime_scalar_smooth F hM04 T τmax hτmax hwindow).comp |
| 96 | (contMDiffOn_id.prodMk hα) (fun s hs ↦ ⟨hs.2, Set.mem_univ _⟩)).contDiffOn |
| 97 | have hE : ContDiffOn ℝ ∞ E U := regularizedCurveEnergy_contDiffOn F T τmax hτmax hwindow |
| 98 | (A.squareFamily Z) U hU hα Set.inter_subset_right |
| 99 | let H : ℝ → ℝ := fun s ↦ -s * S s - (s ^ 2 / 2) * deriv S s - deriv E s / 8 |
| 100 | have hH : ContinuousOn H U := |
| 101 | ((continuousOn_id.neg.mul hS.continuousOn).sub |
| 102 | (((continuousOn_id.pow 2).div_const 2).mul |
| 103 | (hS.deriv_of_isOpen hU (m := ∞) (by simp)).continuousOn)).sub |
| 104 | ((hE.deriv_of_isOpen hU (m := ∞) (by simp)).continuousOn.div_const 8) |
| 105 | have hcomp : ContinuousOn (fun t ↦ H (Real.sqrt t)) (Set.Icc 0 b) := |
| 106 | (hH.mono hKU).comp Real.continuous_sqrt.continuousOn |
| 107 | (fun t ht ↦ ⟨Real.sqrt_nonneg t, Real.sqrt_le_sqrt ht.2⟩) |
| 108 | apply (hcomp.intervalIntegrable_of_Icc hb.le).congr_uIoo |
| 109 | intro t ht |
| 110 | have ht' : t ∈ Set.Ioo 0 b := by simpa only [Set.uIoo_of_le hb.le] using ht |
| 111 | have h := lExponentialFamily_weightedHarnack_square hM04 hτmax hwindow A Z b hb hmax |
| 112 | (Real.sqrt t) ⟨Real.sqrt_pos.mpr ht'.1, Real.sqrt_lt_sqrt ht'.1.le ht'.2⟩ |
| 113 | simpa only [H, S, E, Real.sq_sqrt ht'.1.le] using h.symm |
| 114 | |
| 115 | end PoincareMT.ReducedLength |