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.Minimum.Variation.Geometry.TraceDerivatives |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variation.Geometry.Action |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variation.TraceComparison |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.CompactTime |
| 5 | |
| 6 | /-! |
| 7 | # Integrating the actual surface index trace |
| 8 | |
| 9 | A smooth square-time path, its actual velocity extension, and the intrinsic |
| 10 | Euler equation supply the scalar and speed derivatives. Closed-interval |
| 11 | continuity and the action substitution are proved here. The remaining input |
| 12 | is the traced index density and nonnegativity of its integral. |
| 13 | |
| 14 | Morgan--Tian, Lemma 6.48, p. 130, and Claim 7.11, pp. 155--156. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | noncomputable section |
| 21 | |
| 22 | open Set Filter Topology MeasureTheory |
| 23 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.ReducedLengthMinimum.Variation.Geometry |
| 28 | |
| 29 | open ReducedLengthMinimum.Variational |
| 30 | |
| 31 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 32 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 33 | |
| 34 | /-- The nonsingular action of a smooth square-time representative is the |
| 35 | frozen backward action, including the original endpoint at zero. -/ |
| 36 | theorem sqrtRegularPath_action {J : Set ℝ} {F : RicciFlow n M J} |
| 37 | {T τ : ℝ} {q : BackwardTimePath F T 0 τ} (S : SqrtRegularPath q) : |
| 38 | regularizedLAction F T τ S.curve = backwardLLength F T 0 τ q.curve := by |
| 39 | rw [← (squarePath_action q).2] |
| 40 | apply intervalIntegral.integral_congr_Ioo_of_le (Real.sqrt_nonneg τ) |
| 41 | intro s hs |
| 42 | have heq : S.curve =ᶠ[𝓝 s] fun r => q.curve (r ^ 2) := by |
| 43 | filter_upwards [isOpen_Ioo.mem_nhds hs] with r hr |
| 44 | exact S.agrees r (by simpa only [sqrtParameterInterval, Real.sqrt_zero] |
| 45 | using Ioo_subset_Icc_self hr) |
| 46 | have hd := heq.mfderiv_eq (I := 𝓘(ℝ, ℝ)) (I' := 𝓡 n) |
| 47 | simp only [regularizedLIntegrand, curveVelocity, hd, heq.eq_of_nhds] |
| 48 | congr 2 |
| 49 | exact congrArg (fun x : M => (F.metric (T - s ^ 2)).inner x |
| 50 | ((mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) (fun r => q.curve (r ^ 2)) s) 1) |
| 51 | ((mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) (fun r => q.curve (r ^ 2)) s) 1)) heq.eq_of_nhds |
| 52 | |
| 53 | end PoincareMT.ReducedLengthMinimum.Variation.Geometry |
| 54 | |
| 55 | namespace PoincareMT.AncientKappaSolution |
| 56 | |
| 57 | open ReducedLengthMinimum ReducedLengthMinimum.Variational |
| 58 | open ReducedLengthMinimum.Variation ReducedLengthMinimum.Variation.Geometry |
| 59 | |
| 60 | variable {M : Type u} [TopologicalSpace M] |
| 61 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 62 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 63 | [SecondCountableTopology M] [ConnectedSpace M] |
| 64 | |
| 65 | private theorem continuousOn_squareSpeed (K : AncientKappaSolution 2 M) |
| 66 | {C : Set ℝ} {α : ℝ → M} (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 2) ∞ α C) |
| 67 | (E : ParametricAlongCurveExtensionOn C α (curveVelocityWithin (n := 2) α C)) : |
| 68 | ContinuousOn (fun s => (K.flow.metric (-(s ^ 2))).inner (α s) |
| 69 | (curveVelocityWithin (n := 2) α C s) (curveVelocityWithin (n := 2) α C s)) C := by |
| 70 | have hfield := E.smooth.comp (contMDiffOn_id.prodMk hα) (fun s hs => E.graph_mem s hs) |
| 71 | have hA : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 2).prod (𝓡 2)) ∞ |
| 72 | (fun s => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin 2)) (α s) |
| 73 | (curveVelocityWithin (n := 2) α C s)) C := by |
| 74 | apply hfield.congr |
| 75 | intro s hs |
| 76 | dsimp only [Function.comp_def, id_eq] |
| 77 | rw [E.agrees s hs] |
| 78 | exact (movingMetric_pair_contMDiffOn K.flow (fun s : ℝ => -(s ^ 2)) α |
| 79 | (fun s => curveVelocityWithin (n := 2) α C s) |
| 80 | (fun s => curveVelocityWithin (n := 2) α C s) |
| 81 | (contMDiffOn_id.pow 2).neg hα hA hA |
| 82 | (fun s _ => neg_nonpos.mpr (sq_nonneg s))).continuousOn |
| 83 | |
| 84 | private theorem continuousOn_scalar_squareCurve (K : AncientKappaSolution 2 M) |
| 85 | {τ : ℝ} (hτ : 0 < τ) {α : ℝ → M} |
| 86 | (hα : ContinuousOn α (Icc 0 (Real.sqrt τ))) : |
| 87 | ContinuousOn (fun s => (K.flow.connection (-(s ^ 2))).scalarCurvature (α s)) |
| 88 | (Icc 0 (Real.sqrt τ)) := by |
| 89 | apply (K.continuousOn_scalarCurvature_spacetime_Icc hτ).comp |
| 90 | ((continuous_id.pow 2).neg.continuousOn.prodMk hα) |
| 91 | intro s hs |
| 92 | have hsq := (sq_le_sq₀ hs.1 (Real.sqrt_nonneg τ)).mpr hs.2 |
| 93 | rw [Real.sq_sqrt hτ.le] at hsq |
| 94 | exact ⟨⟨neg_le_neg hsq, neg_nonpos.mpr (sq_nonneg s)⟩, mem_univ _⟩ |
| 95 | |
| 96 | /-- The geometric scalar and speed equations integrate the actual surface |
| 97 | index trace to the curvature-plus-minimum inequality. The supplied index is |
| 98 | the remaining second-variation input. -/ |
| 99 | theorem curvature_add_minimum_le_two_of_index_trace (K : AncientKappaSolution 2 M) |
| 100 | {τ m : ℝ} (hτ : 0 < τ) (q : BackwardTimePath K.flow 0 0 τ) |
| 101 | (S : SqrtRegularPath q) |
| 102 | (E : ParametricAlongCurveExtensionOn (Icc 0 (Real.sqrt τ)) S.curve |
| 103 | (curveVelocityWithin (n := 2) S.curve (Icc 0 (Real.sqrt τ)))) |
| 104 | (heuler : ∀ s ∈ Ioo 0 (Real.sqrt τ), |
| 105 | regularizedLGeodesicEquation K.flow 0 S.curve (Icc 0 (Real.sqrt τ)) E s) |
| 106 | (hterminal : curveVelocityWithin (n := 2) S.curve (Icc 0 (Real.sqrt τ)) (Real.sqrt τ) = 0) |
| 107 | (haction : backwardLLength K.flow 0 0 τ q.curve = 2 * Real.sqrt τ * m) |
| 108 | (D : ℝ → ℝ) (hD : IntervalIntegrable D volume 0 (Real.sqrt τ)) |
| 109 | (htrace : ∀ s ∈ Ioo 0 (Real.sqrt τ), |
| 110 | (Real.sqrt τ) ^ 2 * D s = |
| 111 | 2 - 4 * s ^ 2 * (K.flow.connection (-(s ^ 2))).scalarCurvature (S.curve s) + |
| 112 | 2 * s ^ 4 * ((K.flow.connection (-(s ^ 2))).laplacian |
| 113 | (K.flow.connection (-(s ^ 2))).scalarCurvature (S.curve s) + |
| 114 | (K.flow.connection (-(s ^ 2))).scalarCurvature (S.curve s) ^ 2) - |
| 115 | s ^ 2 * (K.flow.connection (-(s ^ 2))).ricci (S.curve s) |
| 116 | (curveVelocityWithin (n := 2) S.curve (Icc 0 (Real.sqrt τ)) s) |
| 117 | (curveVelocityWithin (n := 2) S.curve (Icc 0 (Real.sqrt τ)) s)) |
| 118 | (hindex : 0 ≤ ∫ s in 0..Real.sqrt τ, D s) : |
| 119 | τ * (K.flow.connection (-τ)).scalarCurvature (S.curve (Real.sqrt τ)) + m ≤ 2 := by |
| 120 | let c := Real.sqrt τ |
| 121 | let C := Icc (0 : ℝ) c |
| 122 | let A := curveVelocityWithin (n := 2) S.curve C |
| 123 | let R := fun s => (K.flow.connection (-(s ^ 2))).scalarCurvature (S.curve s) |
| 124 | let V := fun s => (K.flow.metric (-(s ^ 2))).inner (S.curve s) (A s) (A s) |
| 125 | let reaction := fun s => (K.flow.connection (-(s ^ 2))).laplacian |
| 126 | (K.flow.connection (-(s ^ 2))).scalarCurvature (S.curve s) + R s ^ 2 |
| 127 | let gradient := fun s => |
| 128 | mvfderiv (𝓡 2) (K.flow.connection (-(s ^ 2))).scalarCurvature (S.curve s) (A s) |
| 129 | let ricci := fun s => (K.flow.connection (-(s ^ 2))).ricci (S.curve s) (A s) (A s) |
| 130 | have hc : 0 < c := Real.sqrt_pos.mpr hτ |
| 131 | have hCdom : C ⊆ S.domain := by |
| 132 | simpa only [C, c, sqrtParameterInterval, Real.sqrt_zero] using S.interval_subset |
| 133 | have hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 2) ∞ S.curve C := S.smooth.mono hCdom |
| 134 | have hRc : ContinuousOn R C := K.continuousOn_scalar_squareCurve hτ hα.continuousOn |
| 135 | have hVc : ContinuousOn V C := K.continuousOn_squareSpeed hα E |
| 136 | have hαat (s : ℝ) (hs : s ∈ Ioo 0 c) : |
| 137 | MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 2) S.curve s := |
| 138 | ((S.smooth s (hCdom (Ioo_subset_Icc_self hs))).contMDiffAt |
| 139 | (S.open_domain.mem_nhds (hCdom (Ioo_subset_Icc_self hs)))).mdifferentiableAt (by simp) |
| 140 | have hR (s : ℝ) (hs : s ∈ Ioo 0 c) : |
| 141 | HasDerivAt R (-2 * s * reaction s + gradient s) s := by |
| 142 | exact K.hasDerivAt_scalarCurvature_square_curve_within |
| 143 | (by simpa only [C, interior_Icc] using hs) (ne_of_gt hs.1) (hαat s hs) |
| 144 | have hV (s : ℝ) (hs : s ∈ Ioo 0 c) : |
| 145 | HasDerivAt V (-4 * s * ricci s + 4 * s ^ 2 * gradient s) s := by |
| 146 | exact K.hasDerivAt_speed_square_curve_of_euler E |
| 147 | (by simpa only [C, interior_Icc] using hs) (ne_of_gt hs.1) (hαat s hs) (heuler s hs) |
| 148 | have hVterminal : V c = 0 := by |
| 149 | simp only [V, A, C, c, hterminal, map_zero] |
| 150 | have hact : (∫ s in 0..c, V s / 2 + 2 * s ^ 2 * R s) = 2 * c * m := by |
| 151 | calc |
| 152 | _ = regularizedLAction K.flow 0 τ S.curve := by |
| 153 | apply intervalIntegral.integral_congr_Ioo_of_le hc.le |
| 154 | intro s hs |
| 155 | have hvel : A s = curveVelocity (n := 2) S.curve s := by |
| 156 | simp only [A, C, curveVelocityWithin, curveVelocity, |
| 157 | mfderivWithin_of_mem_nhds (Icc_mem_nhds hs.1 hs.2)] |
| 158 | have hscalar := congrArg (fun t : ℝ => (K.flow.connection t).scalarCurvature (S.curve s)) |
| 159 | (zero_sub (s ^ 2)) |
| 160 | simp only [regularizedLIntegrand, V, R, hvel, zero_sub, hscalar] |
| 161 | ring |
| 162 | _ = backwardLLength K.flow 0 0 τ q.curve := sqrtRegularPath_action S |
| 163 | _ = 2 * c * m := haction |
| 164 | have hbound := ReducedLengthMinimum.Variation.curvature_add_minimum_le_two hc |
| 165 | (Real.sq_sqrt hτ.le).symm R V reaction gradient ricci D |
| 166 | hRc hVc hR hV hD htrace hVterminal hact hindex |
| 167 | have hclock : -(c ^ 2) = -τ := congrArg Neg.neg (Real.sq_sqrt hτ.le) |
| 168 | have hend := congrArg (fun t : ℝ => (K.flow.connection t).scalarCurvature (S.curve c)) hclock |
| 169 | change τ * (K.flow.connection (-(c ^ 2))).scalarCurvature (S.curve c) + m ≤ 2 at hbound |
| 170 | rw [hend] at hbound |
| 171 | exact hbound |
| 172 | |
| 173 | end PoincareMT.AncientKappaSolution |