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 | |
| 5 | /-! |
| 6 | # Variations from smooth square-time families |
| 7 | |
| 8 | Every slice has integrable action by the actual ancient square-time potential |
| 9 | and metric regularity. The center retains the original backward path globally. |
| 10 | |
| 11 | Adapted from Mapher `Proofs/M09/SmoothSquareVariation.lean:25-114`, commit |
| 12 | `49331b7d7ecad38f53e4300c3b35d6a84b2cc648`, using an arbitrary backward path |
| 13 | and the retained ancient flow in place of an exponential-family service. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | noncomputable section |
| 20 | |
| 21 | open Set Filter Topology MeasureTheory |
| 22 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 23 | |
| 24 | namespace PoincareMT.AncientKappaSolution |
| 25 | |
| 26 | open ReducedLengthMinimum.Variational ReducedLengthMinimum.Variation.Geometry |
| 27 | |
| 28 | variable {M : Type*} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 30 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 31 | [SecondCountableTopology M] [ConnectedSpace M] |
| 32 | |
| 33 | theorem regularizedLIntegrand_contDiffOn_of_smooth (K : AncientKappaSolution 2 M) |
| 34 | (α : ℝ → M) {U : Set ℝ} (hU : IsOpen U) |
| 35 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 2) ∞ α U) : |
| 36 | ContDiffOn ℝ ∞ (regularizedLIntegrand K.flow 0 α) U := by |
| 37 | have hA : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 2).prod (𝓡 2)) ∞ |
| 38 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin 2)) (α s) |
| 39 | (curveVelocity (n := 2) α s)) U := |
| 40 | contMDiffOn_mfderiv_const_apply hU α hα 1 |
| 41 | have ht : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) ∞ |
| 42 | (fun s : ℝ ↦ 0 - s ^ 2) U := |
| 43 | (contDiff_const.sub (contDiff_id.pow 2)).contMDiff.contMDiffOn |
| 44 | have hmem : MapsTo (fun s : ℝ ↦ 0 - s ^ 2) U (Iic 0) := by |
| 45 | intro s _ |
| 46 | exact sub_nonpos.mpr (sq_nonneg s) |
| 47 | have hg := (movingMetric_pair_contMDiffOn K.flow (fun s : ℝ ↦ 0 - s ^ 2) α |
| 48 | (curveVelocity (n := 2) α) (curveVelocity (n := 2) α) ht hα hA hA hmem).contDiffOn |
| 49 | have hV := (K.regularizedPotential_contMDiff.comp_contMDiffOn |
| 50 | (contMDiffOn_id.prodMk hα)).contDiffOn |
| 51 | exact hV.add (contDiffOn_const.mul hg) |
| 52 | |
| 53 | theorem regularizedLIntegrand_intervalIntegrable_of_smooth (K : AncientKappaSolution 2 M) |
| 54 | (α : ℝ → M) {U : Set ℝ} (hU : IsOpen U) |
| 55 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 2) ∞ α U) |
| 56 | {τ : ℝ} (hI : Icc 0 (Real.sqrt τ) ⊆ U) : |
| 57 | IntervalIntegrable (regularizedLIntegrand K.flow 0 α) volume 0 (Real.sqrt τ) := by |
| 58 | have hcont : ContinuousOn (regularizedLIntegrand K.flow 0 α) (Icc 0 (Real.sqrt τ)) := |
| 59 | (K.regularizedLIntegrand_contDiffOn_of_smooth α hU hα).continuousOn.mono hI |
| 60 | exact hcont.intervalIntegrable_of_Icc (Real.sqrt_nonneg τ) |
| 61 | |
| 62 | /-- A smooth square family supplies every frozen variation obligation. -/ |
| 63 | theorem exists_lVariation_of_smoothSquareFamily (K : AncientKappaSolution 2 M) |
| 64 | {τ : ℝ} (p : BackwardTimePath K.flow 0 0 τ) |
| 65 | (f : ℝ × ℝ → M) (U : Set (ℝ × ℝ)) (hU : IsOpen U) |
| 66 | (hf : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (𝓡 2) ∞ f U) |
| 67 | (ρ : ℝ) (hρ : 0 < ρ) |
| 68 | (hI : Icc 0 (Real.sqrt τ) ×ˢ Ioo (-ρ) ρ ⊆ U) |
| 69 | (hcenter : ∀ s ∈ Icc 0 (Real.sqrt τ), f (s, 0) = p.curve (s ^ 2)) : |
| 70 | ∃ V : LVariation K.flow 0 0 τ p, |
| 71 | V.radius = ρ ∧ (∀ s u, V.squareFamily s u = f (s, u)) ∧ |
| 72 | (∀ u, EqOn (fun t ↦ V.family t u) (fun t ↦ f (Real.sqrt t, u)) (Icc 0 τ)) ∧ |
| 73 | ∀ u, variationLLength V u = |
| 74 | backwardLLength K.flow 0 0 τ (fun t ↦ f (Real.sqrt t, u)) := by |
| 75 | classical |
| 76 | let family : ℝ → ℝ → M := fun t u ↦ if u = 0 then p.curve t else f (Real.sqrt t, u) |
| 77 | have heq (u : ℝ) : EqOn (fun t ↦ family t u) |
| 78 | (fun t ↦ f (Real.sqrt t, u)) (Icc 0 τ) := by |
| 79 | intro t ht |
| 80 | by_cases hu : u = 0 |
| 81 | · subst u |
| 82 | simp only [family, if_pos rfl] |
| 83 | have hs : Real.sqrt t ∈ Icc 0 (Real.sqrt τ) := |
| 84 | ⟨Real.sqrt_nonneg t, Real.sqrt_le_sqrt ht.2⟩ |
| 85 | simpa only [Real.sq_sqrt ht.1] using (hcenter (Real.sqrt t) hs).symm |
| 86 | · simp only [family, if_neg hu] |
| 87 | let V : LVariation K.flow 0 0 τ p := { |
| 88 | family := family |
| 89 | at_zero := fun t ↦ by simp only [family, if_pos rfl] |
| 90 | radius := ρ |
| 91 | radius_pos := hρ |
| 92 | squareFamily := fun s u ↦ f (s, u) |
| 93 | squareDomain := U |
| 94 | square_open := hU |
| 95 | square_contains := by simpa only [sqrtParameterInterval, Real.sqrt_zero] using hI |
| 96 | square_smooth := hf |
| 97 | square_agrees := by |
| 98 | intro s hs u _ |
| 99 | have hs0 : 0 ≤ s := by |
| 100 | simpa only [sqrtParameterInterval, Real.sqrt_zero] using hs.1 |
| 101 | have hsτ : s ^ 2 ≤ τ := by |
| 102 | have h := mul_self_le_mul_self hs0 hs.2 |
| 103 | simpa only [← pow_two, Real.sq_sqrt p.ordered.le] using h |
| 104 | have h := heq u (show s ^ 2 ∈ Icc 0 τ from ⟨sq_nonneg s, hsτ⟩) |
| 105 | simpa only [Real.sqrt_sq hs0] using h.symm |
| 106 | l_integrable := by |
| 107 | intro u hu |
| 108 | by_cases hu0 : u = 0 |
| 109 | · subst u |
| 110 | simpa only [family, if_pos rfl] using p.l_integrable |
| 111 | · let D := (fun s : ℝ ↦ (s, u)) ⁻¹' U |
| 112 | have hD : IsOpen D := hU.preimage (continuous_id.prodMk continuous_const) |
| 113 | have hDI : Icc 0 (Real.sqrt τ) ⊆ D := fun s hs ↦ hI ⟨hs, hu⟩ |
| 114 | have hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 2) ∞ (fun s ↦ f (s, u)) D := |
| 115 | hf.comp (contMDiff_id.prodMk contMDiff_const).contMDiffOn (fun s hs ↦ hs) |
| 116 | have hcont : ContinuousOn (fun s ↦ f (s, u)) (Icc (Real.sqrt 0) (Real.sqrt τ)) := by |
| 117 | simpa only [Real.sqrt_zero] using hα.continuousOn.mono hDI |
| 118 | have hreg : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 2) 1 (fun s ↦ f (s, u)) |
| 119 | (Ioo (Real.sqrt 0) (Real.sqrt τ)) := by |
| 120 | simpa only [Real.sqrt_zero] using |
| 121 | (hα.of_le (by simp)).mono (Ioo_subset_Icc_self.trans hDI) |
| 122 | have hint : IntervalIntegrable (regularizedLIntegrand K.flow 0 (fun s ↦ f (s, u))) |
| 123 | volume (Real.sqrt 0) (Real.sqrt τ) := by |
| 124 | simpa only [Real.sqrt_zero] using |
| 125 | K.regularizedLIntegrand_intervalIntegrable_of_smooth (fun s ↦ f (s, u)) hD hα hDI |
| 126 | let Q := backwardPathOfSqrt K.flow 0 0 τ p.nonnegative p.ordered p.terminal_mem |
| 127 | p.time_mem (fun s ↦ f (s, u)) hcont hreg hint |
| 128 | simpa only [Q, backwardPathOfSqrt, family, if_neg hu0] using Q.l_integrable |
| 129 | } |
| 130 | refine ⟨V, rfl, fun _ _ ↦ rfl, heq, ?_⟩ |
| 131 | intro u |
| 132 | change backwardLLength K.flow 0 0 τ (fun t ↦ family t u) = _ |
| 133 | unfold backwardLLength |
| 134 | apply intervalIntegral.integral_congr_Ioo_of_le p.ordered.le |
| 135 | intro t ht |
| 136 | have hnear : (fun r ↦ family r u) =ᶠ[𝓝 t] (fun r ↦ f (Real.sqrt r, u)) := by |
| 137 | filter_upwards [isOpen_Ioo.mem_nhds ht] with r hr |
| 138 | exact heq u (Ioo_subset_Icc_self hr) |
| 139 | have hd := hnear.mfderiv_eq (I := 𝓘(ℝ, ℝ)) (I' := 𝓡 2) |
| 140 | have hvalue : family t u = f (Real.sqrt t, u) := heq u (Ioo_subset_Icc_self ht) |
| 141 | simp only [backwardLIntegrand, curveVelocity, hd] |
| 142 | rw [hvalue] |
| 143 | |
| 144 | /-- Fixing the initial square-time row gives an actual initial-fixed variation. -/ |
| 145 | theorem exists_initialFixedLVariation_of_smoothSquareFamily (K : AncientKappaSolution 2 M) |
| 146 | {τ : ℝ} (p : BackwardTimePath K.flow 0 0 τ) |
| 147 | (f : ℝ × ℝ → M) (U : Set (ℝ × ℝ)) (hU : IsOpen U) |
| 148 | (hf : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (𝓡 2) ∞ f U) |
| 149 | (ρ : ℝ) (hρ : 0 < ρ) |
| 150 | (hI : Icc 0 (Real.sqrt τ) ×ˢ Ioo (-ρ) ρ ⊆ U) |
| 151 | (hcenter : ∀ s ∈ Icc 0 (Real.sqrt τ), f (s, 0) = p.curve (s ^ 2)) |
| 152 | (hleft : ∀ u ∈ Ioo (-ρ) ρ, f (0, u) = f (0, 0)) : |
| 153 | ∃ V : InitialFixedLVariation K.flow 0 0 τ p, |
| 154 | V.radius = ρ ∧ (∀ s u, V.squareFamily s u = f (s, u)) ∧ |
| 155 | (∀ u, EqOn (fun t ↦ V.family t u) (fun t ↦ f (Real.sqrt t, u)) (Icc 0 τ)) ∧ |
| 156 | ∀ u, variationLLength V.toLVariation u = |
| 157 | backwardLLength K.flow 0 0 τ (fun t ↦ f (Real.sqrt t, u)) := by |
| 158 | obtain ⟨V, hVr, hVf, hVeq, hVa⟩ := |
| 159 | K.exists_lVariation_of_smoothSquareFamily p f U hU hf ρ hρ hI hcenter |
| 160 | have hfix : ∀ u ∈ Ioo (-V.radius) V.radius, V.family 0 u = p.curve 0 := by |
| 161 | intro u hu |
| 162 | have hu' : u ∈ Ioo (-ρ) ρ := by simpa only [hVr] using hu |
| 163 | have h1 := hVeq u (show (0 : ℝ) ∈ Icc 0 τ from ⟨le_rfl, p.ordered.le⟩) |
| 164 | have h0 := hVeq 0 (show (0 : ℝ) ∈ Icc 0 τ from ⟨le_rfl, p.ordered.le⟩) |
| 165 | dsimp only at h1 h0 |
| 166 | rw [Real.sqrt_zero, hleft u hu'] at h1 |
| 167 | rw [Real.sqrt_zero, V.at_zero] at h0 |
| 168 | exact h1.trans h0.symm |
| 169 | exact ⟨{ toLVariation := V, fixed_left := hfix }, hVr, hVf, hVeq, hVa⟩ |
| 170 | |
| 171 | end PoincareMT.AncientKappaSolution |