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 | /- |
| 2 | Adapted from AxelWorkspace revision f1cdb30cabdc8781d2d3dec86d3d99ab1820f30e. |
| 3 | Source and SHA-256: references/analysis/axel-workspace/weak-parabolic-regularity-sources.json. |
| 4 | Apache-2.0; see the license in that source directory. |
| 5 | -/ |
| 6 | import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts |
| 7 | import Mathlib.MeasureTheory.Function.L2Space |
| 8 | import Mathlib.Analysis.InnerProductSpace.Dual |
| 9 | import Mathlib.Analysis.Normed.Module.WeakDual |
| 10 | import Mathlib.MeasureTheory.Function.Holder |
| 11 | import Mathlib.Topology.Order.LiminfLimsup |
| 12 | |
| 13 | /-! |
| 14 | # Distributional derivatives on an open Euclidean domain |
| 15 | |
| 16 | The integration-by-parts identity is derived from classical C1 regularity on |
| 17 | the open domain. There is no regularity assumption on the extension outside |
| 18 | that domain: each test function has compact support in its interior. |
| 19 | -/ |
| 20 | |
| 21 | open Set Filter MeasureTheory |
| 22 | open scoped ContDiff Topology ENNReal |
| 23 | |
| 24 | noncomputable section |
| 25 | |
| 26 | namespace Poincare.Analysis.Sobolev.WeakCompactness |
| 27 | |
| 28 | /-- **Math.** Weak convergence against every continuous real linear functional. -/ |
| 29 | def WeakConverges {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 30 | (u : ℕ → F) (v : F) : Prop := |
| 31 | ∀ L : StrongDual ℝ F, Tendsto (fun n => L (u n)) atTop (𝓝 (L v)) |
| 32 | |
| 33 | section Hilbert |
| 34 | |
| 35 | variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F] [CompleteSpace F] |
| 36 | |
| 37 | private theorem weakConverges_iff_inner {u : ℕ → F} {v : F} : |
| 38 | WeakConverges u v ↔ ∀ z : F, |
| 39 | Tendsto (fun n => inner ℝ (u n) z) atTop (𝓝 (inner ℝ v z)) := by |
| 40 | constructor |
| 41 | · intro hu z |
| 42 | simpa only [InnerProductSpace.toDual_apply_apply, real_inner_comm] using |
| 43 | hu ((InnerProductSpace.toDual ℝ F) z) |
| 44 | · intro hu A |
| 45 | let z := (InnerProductSpace.toDual ℝ F).symm A |
| 46 | simpa only [← InnerProductSpace.toDual_symm_apply, real_inner_comm] using hu z |
| 47 | |
| 48 | -- The separable-span argument is reused from GilbargTrudinger's |
| 49 | -- Foundations/HilbertSpaces.lean, without adding a sibling Lake dependency. |
| 50 | private theorem extract_hilbert (u : ℕ → F) (hu : Bornology.IsBounded (range u)) : |
| 51 | ∃ v : F, ∃ k : ℕ → ℕ, StrictMono k ∧ WeakConverges (fun n => u (k n)) v := by |
| 52 | let S : Submodule ℝ F := (Submodule.span ℝ (range u)).topologicalClosure |
| 53 | have huS (n : ℕ) : u n ∈ S := |
| 54 | subset_closure (Submodule.subset_span ⟨n, rfl⟩) |
| 55 | let uS : ℕ → S := fun n => ⟨u n, huS n⟩ |
| 56 | letI : IsClosed (S : Set F) := Submodule.isClosed_topologicalClosure _ |
| 57 | letI : CompleteSpace S := IsClosed.completeSpace_coe |
| 58 | have hsep : TopologicalSpace.IsSeparable (S : Set F) := by |
| 59 | rw [show (S : Set F) = closure (Submodule.span ℝ (range u) : Set F) from |
| 60 | Submodule.topologicalClosure_coe _] |
| 61 | exact (Set.countable_range u).isSeparable.span.closure |
| 62 | letI : TopologicalSpace.SeparableSpace S := hsep.separableSpace |
| 63 | have hb : Bornology.IsBounded (range uS) := by |
| 64 | rw [Metric.isBounded_range_iff] at hu ⊢ |
| 65 | obtain ⟨B, hB⟩ := hu |
| 66 | exact ⟨B, fun i j => hB i j⟩ |
| 67 | obtain ⟨B, hB⟩ := (Metric.isBounded_iff_subset_closedBall (0 : S)).mp hb |
| 68 | let a : ℕ → WeakDual ℝ S := fun n => |
| 69 | StrongDual.toWeakDual ((InnerProductSpace.toDual ℝ S) (uS n)) |
| 70 | have ha : ∀ n, a n ∈ WeakDual.toStrongDual ⁻¹' Metric.closedBall 0 B := by |
| 71 | intro n |
| 72 | change dist ((InnerProductSpace.toDual ℝ S) (uS n)) 0 ≤ B |
| 73 | simpa only [LinearIsometryEquiv.norm_map, Metric.mem_closedBall, dist_zero_right] |
| 74 | using hB ⟨n, rfl⟩ |
| 75 | obtain ⟨L, -, k, hk, hlim⟩ := (WeakDual.isSeqCompact_closedBall ℝ S 0 B) ha |
| 76 | let v : S := (InnerProductSpace.toDual ℝ S).symm (WeakDual.toStrongDual L) |
| 77 | have hv (z : S) : Tendsto (fun n => inner ℝ (uS (k n)) z) atTop |
| 78 | (𝓝 (inner ℝ v z)) := by |
| 79 | have hz := tendsto_iff_forall_eval_tendsto_topDualPairing.mp hlim z |
| 80 | change Tendsto (fun n => ((InnerProductSpace.toDual ℝ S) (uS (k n))) z) |
| 81 | atTop (𝓝 ((WeakDual.toStrongDual L) z)) at hz |
| 82 | simpa only [InnerProductSpace.toDual_apply_apply, v, |
| 83 | InnerProductSpace.toDual_symm_apply] using hz |
| 84 | refine ⟨v, k, hk, fun A => ?_⟩ |
| 85 | have hw := weakConverges_iff_inner.mpr hv (A.comp S.subtypeL) |
| 86 | simpa only [ContinuousLinearMap.comp_apply, Submodule.subtypeL_apply, uS] using hw |
| 87 | |
| 88 | /-- **Math.** The squared Hilbert norm is lower semicontinuous along a bounded |
| 89 | weakly convergent sequence. -/ |
| 90 | theorem norm_sq_le_liminf {u : ℕ → F} {v : F} (hw : WeakConverges u v) |
| 91 | {B : ℝ} (hB : ∀ n, ‖u n‖ ^ 2 ≤ B) : |
| 92 | ‖v‖ ^ 2 ≤ liminf (fun n => ‖u n‖ ^ 2) atTop := by |
| 93 | have ht := (hw ((InnerProductSpace.toDual ℝ F) v)).const_mul 2 |
| 94 | have ht' : Tendsto (fun n => 2 * inner ℝ v (u n) - ‖v‖ ^ 2) atTop |
| 95 | (𝓝 (‖v‖ ^ 2)) := by |
| 96 | have heq : 2 * ((InnerProductSpace.toDual ℝ F) v) v - ‖v‖ ^ 2 = ‖v‖ ^ 2 := by |
| 97 | rw [InnerProductSpace.toDual_apply_apply, real_inner_self_eq_norm_sq] |
| 98 | ring |
| 99 | have hh := ht.sub_const (‖v‖ ^ 2) |
| 100 | rw [heq] at hh |
| 101 | exact hh |
| 102 | have hle : ∀ n, 2 * inner ℝ v (u n) - ‖v‖ ^ 2 ≤ ‖u n‖ ^ 2 := by |
| 103 | intro n |
| 104 | have h := sq_nonneg ‖v - u n‖ |
| 105 | rw [norm_sub_sq_real] at h |
| 106 | linarith |
| 107 | rw [← ht'.liminf_eq] |
| 108 | exact liminf_le_liminf (Eventually.of_forall hle) ht'.isBoundedUnder_ge |
| 109 | ((isBoundedUnder_of_eventually_le (Eventually.of_forall hB)).isCoboundedUnder_ge) |
| 110 | |
| 111 | end Hilbert |
| 112 | |
| 113 | section Pairing |
| 114 | |
| 115 | variable {X : Type*} [MeasurableSpace X] {μ : Measure X} |
| 116 | {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F] [CompleteSpace F] |
| 117 | |
| 118 | /-- **Math.** Integration against an L2 scalar test is a continuous linear map |
| 119 | on vector-valued L2. -/ |
| 120 | def testIntegral (phi : X → ℝ) (hphi : MemLp phi 2 μ) : Lp F 2 μ →L[ℝ] F := |
| 121 | (ContinuousLinearMap.lsmul ℝ ℝ).lpPairing μ 2 2 (hphi.toLp phi) |
| 122 | |
| 123 | /-- **Math.** The continuous pairing is the actual Bochner integral. -/ |
| 124 | theorem testIntegral_apply (phi : X → ℝ) (hphi : MemLp phi 2 μ) (u : Lp F 2 μ) : |
| 125 | testIntegral phi hphi u = ∫ x, phi x • u x ∂μ := by |
| 126 | rw [testIntegral, ContinuousLinearMap.lpPairing_eq_integral] |
| 127 | apply integral_congr_ae |
| 128 | filter_upwards [hphi.coeFn_toLp] with x hx |
| 129 | simp only [ContinuousLinearMap.lsmul_apply, hx] |
| 130 | |
| 131 | /-- **Math.** On a represented classical function, the pairing is its classical |
| 132 | test integral; this does not identify representatives pointwise. -/ |
| 133 | theorem testIntegral_toLp (phi : X → ℝ) (hphi : MemLp phi 2 μ) |
| 134 | (u : X → F) (hu : MemLp u 2 μ) : |
| 135 | testIntegral phi hphi (hu.toLp u) = ∫ x, phi x • u x ∂μ := by |
| 136 | rw [testIntegral_apply] |
| 137 | exact integral_congr_ae (hu.coeFn_toLp.mono fun x hx => |
| 138 | congrArg (fun v => phi x • v) hx) |
| 139 | |
| 140 | /-- **Math.** An identity between continuous vector-valued linear observations |
| 141 | passes to actual weak limits, by testing all scalar functionals. -/ |
| 142 | theorem weak_limit_linear_identity {u v : ℕ → Lp F 2 μ} {u0 v0 : Lp F 2 μ} |
| 143 | (hu : WeakConverges u u0) (hv : WeakConverges v v0) |
| 144 | (A B : Lp F 2 μ →L[ℝ] F) (hid : ∀ n, A (v n) = -B (u n)) : |
| 145 | A v0 = -B u0 := by |
| 146 | apply ext_inner_left ℝ |
| 147 | intro z |
| 148 | let L := (InnerProductSpace.toDual ℝ F) z |
| 149 | have ha := hv (L.comp A) |
| 150 | have hb := (hu (L.comp B)).neg |
| 151 | have heq : (fun n => L (A (v n))) = (fun n => -L (B (u n))) := by |
| 152 | funext n; rw [hid, map_neg] |
| 153 | change Tendsto (fun n => L (A (v n))) atTop (𝓝 (L (A v0))) at ha |
| 154 | rw [heq] at ha |
| 155 | have hh := tendsto_nhds_unique ha hb |
| 156 | simpa only [L, ContinuousLinearMap.comp_apply, InnerProductSpace.toDual_apply_apply, |
| 157 | inner_neg_right] using hh |
| 158 | |
| 159 | end Pairing |
| 160 | |
| 161 | variable {D : Type*} [NormedAddCommGroup D] [InnerProductSpace ℝ D] |
| 162 | [FiniteDimensional ℝ D] [MeasurableSpace D] [BorelSpace D] |
| 163 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] |
| 164 | |
| 165 | omit [CompleteSpace E] in |
| 166 | /-- **Math.** A compactly supported scalar test makes a locally continuous vector field |
| 167 | integrable; values of the field outside the domain are immaterial. -/ |
| 168 | theorem integrable_test_smul {s : Set D} (hs : IsOpen s) |
| 169 | {phi : D → ℝ} (hphi : Continuous phi) (hc : HasCompactSupport phi) |
| 170 | (hsub : tsupport phi ⊆ s) {u : D → E} (hu : ContinuousOn u s) : |
| 171 | Integrable (fun x => phi x • u x) := by |
| 172 | have hcont : Continuous (fun x => phi x • u x) := |
| 173 | (hphi.continuousOn.smul hu).continuous_of_tsupport_subset hs |
| 174 | ((tsupport_smul_subset_left phi u).trans hsub) |
| 175 | exact hcont.integrable_of_hasCompactSupport hc.smul_right |
| 176 | |
| 177 | omit [CompleteSpace E] in |
| 178 | /-- **Math.** Classical C1 derivatives satisfy the vector distributional identity for |
| 179 | every smooth compactly supported scalar test in the domain. -/ |
| 180 | theorem integral_test_fderiv {s : Set D} (hs : IsOpen s) {u : D → E} |
| 181 | (hu : ContDiffOn ℝ 1 u s) {phi : D → ℝ} (hphi : ContDiff ℝ ∞ phi) |
| 182 | (hc : HasCompactSupport phi) (hsub : tsupport phi ⊆ s) (v : D) : |
| 183 | (∫ x, phi x • fderiv ℝ u x v) = -(∫ x, fderiv ℝ phi x v • u x) := by |
| 184 | have hdu : ContinuousOn (fun x => fderiv ℝ u x v) s := |
| 185 | (hu.continuousOn_fderiv_of_isOpen hs le_rfl).clm_apply continuousOn_const |
| 186 | have hdphi : Continuous (fun x => fderiv ℝ phi x v) := |
| 187 | (hphi.continuous_fderiv (by norm_num)).clm_apply continuous_const |
| 188 | apply integral_smul_fderiv_eq_neg_fderiv_smul_of_integrable |
| 189 | · exact integrable_test_smul hs hdphi (hc.fderiv_apply ℝ v) |
| 190 | ((tsupport_fderiv_apply_subset ℝ v).trans hsub) hu.continuousOn |
| 191 | · exact integrable_test_smul hs hphi.continuous hc hsub hdu |
| 192 | · exact integrable_test_smul hs hphi.continuous hc hsub hu.continuousOn |
| 193 | · intro x _ |
| 194 | exact hphi.differentiable (by norm_num) x |
| 195 | · intro x hx |
| 196 | exact (hu.contDiffAt (hs.mem_nhds (hsub hx))).differentiableAt (by norm_num) |
| 197 | |
| 198 | omit [CompleteSpace E] in |
| 199 | /-- **Math.** The classical vector identity holds on the restricted measure of |
| 200 | the domain, because both scalar tests vanish outside it. -/ |
| 201 | theorem setIntegral_test_fderiv {s : Set D} (hs : IsOpen s) {u : D → E} |
| 202 | (hu : ContDiffOn ℝ 1 u s) {phi : D → ℝ} (hphi : ContDiff ℝ ∞ phi) |
| 203 | (hc : HasCompactSupport phi) (hsub : tsupport phi ⊆ s) (v : D) : |
| 204 | (∫ x in s, phi x • fderiv ℝ u x v) = -(∫ x in s, fderiv ℝ phi x v • u x) := by |
| 205 | rw [setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx => by |
| 206 | rw [image_eq_zero_of_notMem_tsupport (fun ht => hx (hsub ht)), zero_smul])] |
| 207 | rw [setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx => by |
| 208 | rw [image_eq_zero_of_notMem_tsupport |
| 209 | (fun ht => hx (hsub (tsupport_fderiv_apply_subset ℝ v ht))), zero_smul])] |
| 210 | exact integral_test_fderiv hs hu hphi hc hsub v |
| 211 | |
| 212 | /-- **Math.** Actual classical directional derivatives satisfy the distributional |
| 213 | identity at their produced weak limits. -/ |
| 214 | theorem distributional_identity_of_weak_limits {s : Set D} (hs : IsOpen s) |
| 215 | (f : ℕ → D → E) (hf : ∀ n, ContDiffOn ℝ 1 (f n) s) (v : D) |
| 216 | (hU : ∀ n, MemLp (f n) 2 (volume.restrict s)) |
| 217 | (hV : ∀ n, MemLp (fun x => fderiv ℝ (f n) x v) 2 (volume.restrict s)) |
| 218 | {u V : Lp E 2 (volume.restrict s)} |
| 219 | (hu : WeakConverges (fun n => (hU n).toLp (f n)) u) |
| 220 | (hv : WeakConverges (fun n => (hV n).toLp (fun x => fderiv ℝ (f n) x v)) V) |
| 221 | {phi : D → ℝ} (hphi : ContDiff ℝ ∞ phi) (hc : HasCompactSupport phi) |
| 222 | (hsub : tsupport phi ⊆ s) : |
| 223 | (∫ x in s, phi x • V x) = -(∫ x in s, fderiv ℝ phi x v • u x) := by |
| 224 | have hphi2 : MemLp phi 2 (volume.restrict s) := |
| 225 | hphi.continuous.memLp_of_hasCompactSupport hc |
| 226 | have hdphi2 : MemLp (fun x => fderiv ℝ phi x v) 2 (volume.restrict s) := |
| 227 | ((hphi.continuous_fderiv (by norm_num)).clm_apply continuous_const).memLp_of_hasCompactSupport |
| 228 | (hc.fderiv_apply ℝ v) |
| 229 | have hh := weak_limit_linear_identity hu hv |
| 230 | (testIntegral phi hphi2) (testIntegral (fun x => fderiv ℝ phi x v) hdphi2) |
| 231 | (fun n => by |
| 232 | rw [testIntegral_toLp, testIntegral_toLp] |
| 233 | exact setIntegral_test_fderiv hs (hf n) hphi hc hsub v) |
| 234 | simpa only [testIntegral_apply] using hh |
| 235 | |
| 236 | /-- **Math.** Bounded classical C1 maps and their actual derivative columns |
| 237 | produce one subsequence, an L2 map, and L2 distributional derivatives. The sum |
| 238 | of squared derivative norms is lower semicontinuous along this subsequence. -/ |
| 239 | theorem weak_w12_subsequence {s : Set D} (hs : IsOpen s) |
| 240 | (f : ℕ → D → E) (hf : ∀ n, ContDiffOn ℝ 1 (f n) s) |
| 241 | {ι : Type*} [Fintype ι] (b : ι → D) |
| 242 | (hU : ∀ n, MemLp (f n) 2 (volume.restrict s)) |
| 243 | (hV : ∀ n i, MemLp (fun x => fderiv ℝ (f n) x (b i)) 2 (volume.restrict s)) |
| 244 | {A B : ℝ} (hA : ∀ n, ‖(hU n).toLp (f n)‖ ≤ A) |
| 245 | (hB : ∀ n, (∑ i, ‖(hV n i).toLp (fun x => fderiv ℝ (f n) x (b i))‖ ^ 2) ≤ B) : |
| 246 | ∃ u : Lp E 2 (volume.restrict s), ∃ V : ι → Lp E 2 (volume.restrict s), |
| 247 | ∃ k : ℕ → ℕ, StrictMono k ∧ |
| 248 | WeakConverges (fun n => (hU (k n)).toLp (f (k n))) u ∧ |
| 249 | (∀ i, WeakConverges |
| 250 | (fun n => (hV (k n) i).toLp (fun x => fderiv ℝ (f (k n)) x (b i))) (V i)) ∧ |
| 251 | (∀ i (phi : D → ℝ), ContDiff ℝ ∞ phi → HasCompactSupport phi → tsupport phi ⊆ s → |
| 252 | (∫ x in s, phi x • V i x) = -(∫ x in s, fderiv ℝ phi x (b i) • u x)) ∧ |
| 253 | (∑ i, ‖V i‖ ^ 2) ≤ liminf |
| 254 | (fun n => ∑ i, ‖(hV (k n) i).toLp (fun x => fderiv ℝ (f (k n)) x (b i))‖ ^ 2) atTop ∧ |
| 255 | (∑ i, ‖V i‖ ^ 2) ≤ B := by |
| 256 | let U := fun n => (hU n).toLp (f n) |
| 257 | have hUb : Bornology.IsBounded (range U) := |
| 258 | (Metric.isBounded_iff_subset_closedBall (0 : Lp E 2 (volume.restrict s))).mpr |
| 259 | ⟨A, by rintro _ ⟨n, rfl⟩; simpa only [Metric.mem_closedBall, dist_zero_right] using hA n⟩ |
| 260 | obtain ⟨u, k0, hk0, hu⟩ := extract_hilbert U hUb |
| 261 | let W : ℕ → PiLp 2 (fun _ : ι => Lp E 2 (volume.restrict s)) := fun n => |
| 262 | WithLp.toLp 2 (fun i => (hV (k0 n) i).toLp (fun x => fderiv ℝ (f (k0 n)) x (b i))) |
| 263 | have hWsq : ∀ n, ‖W n‖ ^ 2 ≤ B := by |
| 264 | intro n |
| 265 | rw [PiLp.norm_sq_eq_of_L2] |
| 266 | exact hB (k0 n) |
| 267 | have hWb : Bornology.IsBounded (range W) := |
| 268 | (Metric.isBounded_iff_subset_closedBall (0 : PiLp 2 (fun _ : ι => Lp E 2 (volume.restrict s)))).mpr |
| 269 | ⟨Real.sqrt B, by |
| 270 | rintro _ ⟨n, rfl⟩ |
| 271 | simpa only [Metric.mem_closedBall, dist_zero_right] using Real.le_sqrt_of_sq_le (hWsq n)⟩ |
| 272 | obtain ⟨V, k1, hk1, hv⟩ := extract_hilbert W hWb |
| 273 | have hu' : WeakConverges (fun n => U (k0 (k1 n))) u := |
| 274 | fun L => (hu L).comp hk1.tendsto_atTop |
| 275 | have hv' (i : ι) : WeakConverges |
| 276 | (fun n => (hV (k0 (k1 n)) i).toLp |
| 277 | (fun x => fderiv ℝ (f (k0 (k1 n))) x (b i))) (V i) := by |
| 278 | intro L |
| 279 | exact hv (L.comp (PiLp.proj 2 (fun _ : ι => Lp E 2 (volume.restrict s)) i)) |
| 280 | have hls := norm_sq_le_liminf hv (fun n => hWsq (k1 n)) |
| 281 | simp only [PiLp.norm_sq_eq_of_L2] at hls |
| 282 | refine ⟨u, fun i => V i, k0 ∘ k1, hk0.comp hk1, hu', hv', ?_, hls, ?_⟩ |
| 283 | · intro i phi hphi hc hsub |
| 284 | exact distributional_identity_of_weak_limits hs (fun n => f (k0 (k1 n))) |
| 285 | (fun n => hf _) (b i) (fun n => hU _) (fun n => hV _ i) hu' (hv' i) hphi hc hsub |
| 286 | · apply hls.trans |
| 287 | apply liminf_le_of_le (isBoundedUnder_of_eventually_ge |
| 288 | (Eventually.of_forall (fun n => Finset.sum_nonneg (fun i _ => sq_nonneg _)))) |
| 289 | intro a ha |
| 290 | obtain ⟨n, hn⟩ := ha.exists |
| 291 | exact hn.trans (hB (k0 (k1 n))) |
| 292 | |
| 293 | end Poincare.Analysis.Sobolev.WeakCompactness |