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.Action |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variational.Recovery.BackwardPath |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variational.Regularity |
| 4 | import PoincareLib.Geometry.Riemannian.Comparison.Volume.Conjugate.Variation.Energy |
| 5 | |
| 6 | /-! |
| 7 | # Action derivatives at free-endpoint minima |
| 8 | |
| 9 | Every variation slice is an actual backward path. Free-endpoint path |
| 10 | minimality therefore gives a local minimum of its square-time action. |
| 11 | |
| 12 | Adapted from Mapher `Proofs/M08/VariationPaths.lean:27-83` and |
| 13 | `Proofs/M08/RegularizedAction.lean:71-137`, commit |
| 14 | `49331b7d7ecad38f53e4300c3b35d6a84b2cc648`, using initial-fixed variations. |
| 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 | namespace PoincareMT.ReducedLengthMinimum.Variation |
| 26 | |
| 27 | open Geometry Variational |
| 28 | |
| 29 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 31 | |
| 32 | /-- The literal backward-time slice is admissible inside the parameter interval. -/ |
| 33 | def variationPath {J : Set ℝ} {F : RicciFlow n M J} |
| 34 | {T a b : ℝ} {p : BackwardTimePath F T a b} |
| 35 | (V : LVariation F T a b p) {u : ℝ} (hu : u ∈ V.parameterDomain) : |
| 36 | BackwardTimePath F T a b := by |
| 37 | have hmaps : MapsTo (fun t : ℝ ↦ (Real.sqrt t, u)) (Icc a b) V.squareDomain := by |
| 38 | intro t ht |
| 39 | exact V.square_contains ⟨⟨Real.sqrt_le_sqrt ht.1, Real.sqrt_le_sqrt ht.2⟩, hu⟩ |
| 40 | have hagrees (t : ℝ) (ht : t ∈ Icc a b) : |
| 41 | V.squareFamily (Real.sqrt t) u = V.family t u := by |
| 42 | have ht0 : 0 ≤ t := p.nonnegative.trans ht.1 |
| 43 | simpa only [Real.sq_sqrt ht0] using V.square_agrees (Real.sqrt t) |
| 44 | ⟨Real.sqrt_le_sqrt ht.1, Real.sqrt_le_sqrt ht.2⟩ u hu |
| 45 | refine { |
| 46 | curve := fun t ↦ V.family t u |
| 47 | nonnegative := p.nonnegative |
| 48 | ordered := p.ordered |
| 49 | terminal_mem := p.terminal_mem |
| 50 | time_mem := p.time_mem |
| 51 | continuous := ?_ |
| 52 | regular := ?_ |
| 53 | l_integrable := V.l_integrable u hu } |
| 54 | · exact (V.square_smooth.continuousOn.comp |
| 55 | (Real.continuous_sqrt.prodMk continuous_const).continuousOn hmaps).congr |
| 56 | (fun t ht ↦ (hagrees t ht).symm) |
| 57 | · have hsqrt : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) 1 Real.sqrt (Ioo a b) := by |
| 58 | intro t ht |
| 59 | exact (Real.contDiffAt_sqrt |
| 60 | (ne_of_gt (p.nonnegative.trans_lt ht.1))).contMDiffAt.contMDiffWithinAt |
| 61 | exact ((V.square_smooth.of_le (by simp)).comp |
| 62 | (hsqrt.prodMk contMDiffOn_const) (hmaps.mono_left Ioo_subset_Icc_self)).congr |
| 63 | (fun t ht ↦ (hagrees t (Ioo_subset_Icc_self ht)).symm) |
| 64 | |
| 65 | /-- Square-time action is the action of the admissible variation slice. -/ |
| 66 | theorem variationSquareAction_eq_variationLLength {J : Set ℝ} {F : RicciFlow n M J} |
| 67 | {T a b : ℝ} {p : BackwardTimePath F T a b} |
| 68 | (V : LVariation F T a b p) {u : ℝ} (hu : u ∈ V.parameterDomain) : |
| 69 | variationSquareAction V u = variationLLength V u := by |
| 70 | let q := variationPath V hu |
| 71 | change (∫ s in Real.sqrt a..Real.sqrt b, |
| 72 | regularizedLIntegrand F T (fun r ↦ V.squareFamily r u) s) = |
| 73 | backwardLLength F T a b q.curve |
| 74 | rw [backwardLLength_eq_transformed q] |
| 75 | apply intervalIntegral.integral_congr_Ioo_of_le (Real.sqrt_le_sqrt p.ordered.le) |
| 76 | intro s hs |
| 77 | have hs0 := (sq_mem_backward_interior p.nonnegative hs).1 |
| 78 | have ht := (sq_mem_backward_interior p.nonnegative hs).2 |
| 79 | have hbase : V.squareFamily s u = q.curve (s ^ 2) := |
| 80 | V.square_agrees s (Ioo_subset_Icc_self hs) u hu |
| 81 | have hnear : (fun r ↦ V.squareFamily r u) =ᶠ[𝓝 s] fun r ↦ q.curve (r ^ 2) := by |
| 82 | filter_upwards [isOpen_Ioo.mem_nhds hs] with r hr |
| 83 | exact V.square_agrees r (Ioo_subset_Icc_self hr) u hu |
| 84 | have hreg := (q.regular (s ^ 2) ht).contMDiffAt (isOpen_Ioo.mem_nhds ht) |
| 85 | have hvel : curveVelocity (n := n) (fun r ↦ V.squareFamily r u) s = |
| 86 | (2 * s) • curveVelocity (n := n) q.curve (s ^ 2) := by |
| 87 | have heq : curveVelocity (n := n) (fun r ↦ V.squareFamily r u) s = |
| 88 | curveVelocity (n := n) (fun r ↦ q.curve (r ^ 2)) s := by |
| 89 | unfold curveVelocity |
| 90 | rw [hnear.mfderiv_eq] |
| 91 | rfl |
| 92 | exact heq.trans (curveVelocity_comp_sq (hreg.mdifferentiableAt one_ne_zero)) |
| 93 | unfold regularizedLIntegrand backwardLIntegrand |
| 94 | dsimp only |
| 95 | rw [Real.sqrt_sq hs0.le] |
| 96 | simp only [hvel, map_smul, smul_apply, smul_eq_mul] |
| 97 | rw [hbase] |
| 98 | ring |
| 99 | |
| 100 | /-- Free-endpoint minimality transfers to the square-time action of every initial-fixed variation. -/ |
| 101 | theorem isLocalMin_variationSquareAction {J : Set ℝ} {F : RicciFlow n M J} |
| 102 | {T a b : ℝ} {p : BackwardTimePath F T a b} |
| 103 | (hmin : ∀ q : BackwardTimePath F T a b, q.curve a = p.curve a → |
| 104 | backwardLLength F T a b p.curve ≤ backwardLLength F T a b q.curve) |
| 105 | (V : InitialFixedLVariation F T a b p) : |
| 106 | IsLocalMin (variationSquareAction V.toLVariation) 0 := by |
| 107 | have hzero : (0 : ℝ) ∈ V.toLVariation.parameterDomain := |
| 108 | ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩ |
| 109 | have hbase : variationLLength V.toLVariation 0 = backwardLLength F T a b p.curve := by |
| 110 | have hcurve : (fun t ↦ V.family t 0) = p.curve := funext V.at_zero |
| 111 | simp only [variationLLength, hcurve] |
| 112 | change ∀ᶠ u in 𝓝 (0 : ℝ), |
| 113 | variationSquareAction V.toLVariation 0 ≤ variationSquareAction V.toLVariation u |
| 114 | filter_upwards [isOpen_Ioo.mem_nhds hzero] with u hu |
| 115 | rw [variationSquareAction_eq_variationLLength V.toLVariation hzero, |
| 116 | variationSquareAction_eq_variationLLength V.toLVariation hu, hbase] |
| 117 | exact hmin (variationPath V.toLVariation hu) (V.fixed_left u hu) |
| 118 | |
| 119 | theorem hasDerivAt_variationSquareAction_eq_zero {J : Set ℝ} {F : RicciFlow n M J} |
| 120 | {T a b : ℝ} {p : BackwardTimePath F T a b} |
| 121 | (hmin : ∀ q : BackwardTimePath F T a b, q.curve a = p.curve a → |
| 122 | backwardLLength F T a b p.curve ≤ backwardLLength F T a b q.curve) |
| 123 | (V : InitialFixedLVariation F T a b p) {d : ℝ} |
| 124 | (hd : HasDerivAt (variationSquareAction V.toLVariation) d 0) : d = 0 := |
| 125 | (isLocalMin_variationSquareAction hmin V).hasDerivAt_eq_zero hd |
| 126 | |
| 127 | theorem deriv_variationSquareAction_eq_zero {J : Set ℝ} {F : RicciFlow n M J} |
| 128 | {T a b : ℝ} {p : BackwardTimePath F T a b} |
| 129 | (hmin : ∀ q : BackwardTimePath F T a b, q.curve a = p.curve a → |
| 130 | backwardLLength F T a b p.curve ≤ backwardLLength F T a b q.curve) |
| 131 | (V : InitialFixedLVariation F T a b p) : |
| 132 | deriv (variationSquareAction V.toLVariation) 0 = 0 := |
| 133 | (isLocalMin_variationSquareAction hmin V).deriv_eq_zero |
| 134 | |
| 135 | theorem secondVariation_nonneg {J : Set ℝ} {F : RicciFlow n M J} |
| 136 | {T a b : ℝ} {p : BackwardTimePath F T a b} |
| 137 | (hmin : ∀ q : BackwardTimePath F T a b, q.curve a = p.curve a → |
| 138 | backwardLLength F T a b p.curve ≤ backwardLLength F T a b q.curve) |
| 139 | (V : InitialFixedLVariation F T a b p) {d q : ℝ} |
| 140 | (hd : HasDerivAt (variationSquareAction V.toLVariation) d 0) |
| 141 | (hdd : HasDerivAt (deriv (variationSquareAction V.toLVariation)) q 0) : |
| 142 | 0 ≤ q := by |
| 143 | have h := ConjugateVariation.deriv_deriv_nonneg_of_isLocalMin |
| 144 | (isLocalMin_variationSquareAction hmin V) hd.continuousAt |
| 145 | rwa [hdd.deriv] at h |
| 146 | |
| 147 | end PoincareMT.ReducedLengthMinimum.Variation |
| 148 | |
| 149 | namespace PoincareMT.AncientKappaSolution |
| 150 | |
| 151 | open ReducedLengthMinimum.Variation ReducedLengthMinimum.Variation.Geometry |
| 152 | |
| 153 | variable {M : Type*} [TopologicalSpace M] |
| 154 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 155 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 156 | [SecondCountableTopology M] [ConnectedSpace M] |
| 157 | |
| 158 | /-- Actual ancient action regularity supplies the continuity in the second-derivative test. -/ |
| 159 | theorem secondVariation_nonneg (K : AncientKappaSolution 2 M) |
| 160 | {τ : ℝ} {p : BackwardTimePath K.flow 0 0 τ} |
| 161 | (hmin : ∀ q : BackwardTimePath K.flow 0 0 τ, q.curve 0 = p.curve 0 → |
| 162 | backwardLLength K.flow 0 0 τ p.curve ≤ backwardLLength K.flow 0 0 τ q.curve) |
| 163 | (V : InitialFixedLVariation K.flow 0 0 τ p) {q : ℝ} |
| 164 | (hdd : HasDerivAt (deriv (variationSquareAction V.toLVariation)) q 0) : |
| 165 | 0 ≤ q := by |
| 166 | have hzero : (0 : ℝ) ∈ V.toLVariation.parameterDomain := |
| 167 | ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩ |
| 168 | exact ReducedLengthMinimum.Variation.secondVariation_nonneg hmin V |
| 169 | (hasDerivAt_variationSquareAction_integral K.regularizedPotential_contMDiff |
| 170 | V.toLVariation hzero) hdd |
| 171 | |
| 172 | end PoincareMT.AncientKappaSolution |