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 PoincareLib.Analysis.Parabolic.WeakRegularity.Interior.Producer |
| 7 | import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension |
| 8 | |
| 9 | /-! |
| 10 | # Compact weak-solution extensions |
| 11 | |
| 12 | A common smooth compact cutoff extends a continuous weak solution and all |
| 13 | smooth coefficient fields from an open spacetime region to compactly |
| 14 | supported global data. On a smaller ball where the cutoff is one, the exact |
| 15 | weak equation is preserved by support and derivative identities. |
| 16 | -/ |
| 17 | |
| 18 | open Set Filter MeasureTheory MeasureTheory.Measure Metric |
| 19 | open scoped Topology ContDiff |
| 20 | |
| 21 | set_option maxHeartbeats 1000000 |
| 22 | |
| 23 | noncomputable section |
| 24 | |
| 25 | namespace Poincare.Analysis.Parabolic.WeakRegularity.Interior |
| 26 | |
| 27 | open Poincare.Analysis.Parabolic.WeakRegularity |
| 28 | open Poincare.Analysis.Parabolic.WeakRegularity.Canonical |
| 29 | |
| 30 | variable {n : ℕ} {U : Set (Spacetime n)} |
| 31 | |
| 32 | local instance : Measure.IsAddHaarMeasure (volume : Measure (Spacetime n)) := by |
| 33 | change ((volume : Measure (Euclid n)).prod (volume : Measure ℝ)).IsAddHaarMeasure |
| 34 | infer_instance |
| 35 | |
| 36 | /-- A continuous weak solution and smooth coefficients admit compactly |
| 37 | supported global extensions agreeing on a smaller neighborhood, with the |
| 38 | same weak equation on that neighborhood. -/ |
| 39 | theorem exists_weak_compact_extension |
| 40 | (hU : IsOpen U) {C : Coefficients n} (hC : C.IsSmoothOn U) |
| 41 | {u : Spacetime n → ℝ} (hu : ContinuousOn u U) |
| 42 | (hw : WeakSolutionOn C u U) {z : Spacetime n} (hz : z ∈ U) : |
| 43 | ∃ (V : Set (Spacetime n)) (C' : Coefficients n) (u' : Spacetime n → ℝ), |
| 44 | IsOpen V ∧ z ∈ V ∧ V ⊆ U ∧ |
| 45 | C'.IsSmoothOn (Set.univ : Set (Spacetime n)) ∧ |
| 46 | (∀ i j, HasCompactSupport (C'.principal i j)) ∧ |
| 47 | (∀ i, HasCompactSupport (C'.drift i)) ∧ |
| 48 | HasCompactSupport C'.zeroth ∧ Continuous u' ∧ HasCompactSupport u' ∧ |
| 49 | (∀ i j, EqOn (C'.principal i j) (C.principal i j) V) ∧ |
| 50 | (∀ i, EqOn (C'.drift i) (C.drift i) V) ∧ |
| 51 | EqOn C'.zeroth C.zeroth V ∧ EqOn u' u V ∧ |
| 52 | WeakSolutionOn C' u' V := by |
| 53 | obtain ⟨δ, hδ, hδU⟩ := Metric.mem_nhds_iff.mp (hU.mem_nhds hz) |
| 54 | let χ : ContDiffBump z := |
| 55 | { rIn := δ / 4 |
| 56 | rOut := δ / 2 |
| 57 | rIn_pos := by positivity |
| 58 | rIn_lt_rOut := by linarith } |
| 59 | let V : Set (Spacetime n) := ball z χ.rIn |
| 60 | have hV : IsOpen V := isOpen_ball |
| 61 | have hzV : z ∈ V := mem_ball_self χ.rIn_pos |
| 62 | have hVU : V ⊆ U := by |
| 63 | intro y hy |
| 64 | apply hδU |
| 65 | exact lt_trans hy (by change δ / 4 < δ; linarith) |
| 66 | have hχU : tsupport χ ⊆ U := by |
| 67 | rw [χ.tsupport_eq] |
| 68 | intro y hy |
| 69 | apply hδU |
| 70 | exact lt_of_le_of_lt (mem_closedBall.mp hy) (by |
| 71 | change δ / 2 < δ |
| 72 | linarith) |
| 73 | let ext (q : Spacetime n → ℝ) : Spacetime n → ℝ := fun y => χ y * q y |
| 74 | have ext_smooth {q : Spacetime n → ℝ} (hq : ContDiffOn ℝ ∞ q U) : |
| 75 | ContDiff ℝ ∞ (ext q) := by |
| 76 | rw [contDiff_iff_contDiffAt] |
| 77 | intro y |
| 78 | by_cases hy : y ∈ tsupport (ext q) |
| 79 | · have hyU : y ∈ U := hχU (tsupport_mul_subset_left hy) |
| 80 | exact χ.contDiff.contDiffAt.mul ((hq y hyU).contDiffAt (hU.mem_nhds hyU)) |
| 81 | · exact contDiffAt_const.congr_of_eventuallyEq (notMem_tsupport_iff_eventuallyEq.mp hy) |
| 82 | have ext_continuous {q : Spacetime n → ℝ} (hq : ContinuousOn q U) : |
| 83 | Continuous (ext q) := by |
| 84 | rw [continuous_iff_continuousAt] |
| 85 | intro y |
| 86 | by_cases hy : y ∈ tsupport (ext q) |
| 87 | · have hyU : y ∈ U := hχU (tsupport_mul_subset_left hy) |
| 88 | exact χ.continuous.continuousAt.mul (hq.continuousAt (hU.mem_nhds hyU)) |
| 89 | · exact continuousAt_const.congr_of_eventuallyEq (notMem_tsupport_iff_eventuallyEq.mp hy) |
| 90 | have ext_eq {q : Spacetime n → ℝ} : EqOn (ext q) q V := by |
| 91 | intro y hy |
| 92 | simp only [ext, χ.one_of_mem_closedBall (ball_subset_closedBall hy), one_mul] |
| 93 | have ext_support {q : Spacetime n → ℝ} : HasCompactSupport (ext q) := |
| 94 | χ.hasCompactSupport.mul_right |
| 95 | let C' : Coefficients n := |
| 96 | { principal := fun i j => ext (C.principal i j) |
| 97 | drift := fun i => ext (C.drift i) |
| 98 | zeroth := ext C.zeroth } |
| 99 | let u' := ext u |
| 100 | have hC'smooth : C'.IsSmoothOn (Set.univ : Set (Spacetime n)) := by |
| 101 | refine ⟨?_, ?_, ?_⟩ |
| 102 | · intro i j |
| 103 | exact ext_smooth (hC.1 i j) |>.contDiffOn |
| 104 | · intro i |
| 105 | exact ext_smooth (hC.2.1 i) |>.contDiffOn |
| 106 | · exact ext_smooth hC.2.2 |>.contDiffOn |
| 107 | have hWeak : WeakSolutionOn C' u' V := by |
| 108 | have hzero {g : Spacetime n → ℝ} {y : Spacetime n} (hy : y ∉ tsupport g) |
| 109 | (v : Spacetime n) : fderiv ℝ g y v = 0 := by |
| 110 | have he : g =ᶠ[𝓝 y] (fun _ : Spacetime n => (0 : ℝ)) := |
| 111 | notMem_tsupport_iff_eventuallyEq.mp hy |
| 112 | have he' : fderiv ℝ g y = |
| 113 | fderiv ℝ (fun _ : Spacetime n => (0 : ℝ)) y := he.fderiv_eq |
| 114 | have hzderiv : fderiv ℝ (fun _ : Spacetime n => (0 : ℝ)) y = 0 := by |
| 115 | exact fderiv_const_apply (𝕜 := ℝ) (E := Spacetime n) (F := ℝ) |
| 116 | (x := y) (0 : ℝ) |
| 117 | rw [hzderiv] at he' |
| 118 | exact congrArg (fun A : Spacetime n →L[ℝ] ℝ => A v) he' |
| 119 | have hadj_zero {K : Coefficients n} {φ : Spacetime n → ℝ} |
| 120 | {y : Spacetime n} (hy : y ∉ tsupport φ) : K.adjoint φ y = 0 := by |
| 121 | simp only [Coefficients.adjoint] |
| 122 | have hφ : φ y = 0 := image_eq_zero_of_notMem_tsupport hy |
| 123 | have ht : timeDeriv φ y = 0 := hzero (g := φ) hy (0, 1) |
| 124 | have hs (i : Fin n) : spatialDeriv i φ y = 0 := hzero (g := φ) hy _ |
| 125 | have hss (i j : Fin n) : |
| 126 | spatialDeriv j (spatialDeriv i (fun x => K.principal i j x * φ x)) y = 0 := by |
| 127 | apply hzero |
| 128 | intro h |
| 129 | apply hy |
| 130 | exact (tsupport_fderiv_apply_subset ℝ (spatialDirection i)).trans |
| 131 | (tsupport_mul_subset_right) h |
| 132 | have hsd (i : Fin n) : |
| 133 | spatialDeriv i (fun x => K.drift i x * φ x) y = 0 := by |
| 134 | have hmul : tsupport (fun x => K.drift i x * φ x) ⊆ tsupport φ := |
| 135 | tsupport_mul_subset_right |
| 136 | exact hzero (g := fun x => K.drift i x * φ x) (fun h => hy (hmul h)) _ |
| 137 | simp only [hφ, ht, hs, hss, hsd, Finset.sum_const_zero, zero_add, |
| 138 | sub_zero, zero_sub, mul_zero] |
| 139 | ring |
| 140 | have hfeq {a b : Spacetime n → ℝ} (hab : EqOn a b V) (y : Spacetime n) |
| 141 | (hy : y ∈ V) (v : Spacetime n) : fderiv ℝ a y v = fderiv ℝ b y v := by |
| 142 | exact congrArg (fun A : Spacetime n →L[ℝ] ℝ => A v) |
| 143 | (hab.eventuallyEq_of_mem (hV.mem_nhds hy)).fderiv_eq |
| 144 | have hadj_eq {φ : Spacetime n → ℝ} {y : Spacetime n} (hy : y ∈ V) : |
| 145 | C'.adjoint φ y = C.adjoint φ y := by |
| 146 | have hP (i j : Fin n) : |
| 147 | EqOn (fun x => C'.principal i j x * φ x) |
| 148 | (fun x => C.principal i j x * φ x) V := by |
| 149 | intro x hx |
| 150 | change C'.principal i j x * φ x = C.principal i j x * φ x |
| 151 | rw [show C'.principal i j x = C.principal i j x from ext_eq hx] |
| 152 | have hD (i : Fin n) : |
| 153 | EqOn (fun x => C'.drift i x * φ x) |
| 154 | (fun x => C.drift i x * φ x) V := by |
| 155 | intro x hx |
| 156 | change C'.drift i x * φ x = C.drift i x * φ x |
| 157 | rw [show C'.drift i x = C.drift i x from ext_eq hx] |
| 158 | have hp (i j : Fin n) : |
| 159 | spatialDeriv j (spatialDeriv i (fun x => C'.principal i j x * φ x)) y = |
| 160 | spatialDeriv j (spatialDeriv i (fun x => C.principal i j x * φ x)) y := |
| 161 | hfeq (fun x hx => hfeq (hP i j) x hx (spatialDirection i)) y hy |
| 162 | (spatialDirection j) |
| 163 | have hd' (i : Fin n) : |
| 164 | spatialDeriv i (fun x => C'.drift i x * φ x) y = |
| 165 | spatialDeriv i (fun x => C.drift i x * φ x) y := |
| 166 | hfeq (hD i) y hy (spatialDirection i) |
| 167 | have hsumP : |
| 168 | (∑ i, ∑ j, spatialDeriv j (spatialDeriv i |
| 169 | (fun x => C'.principal i j x * φ x)) y) = |
| 170 | ∑ i, ∑ j, spatialDeriv j (spatialDeriv i |
| 171 | (fun x => C.principal i j x * φ x)) y := by |
| 172 | apply Finset.sum_congr rfl |
| 173 | intro i hi |
| 174 | apply Finset.sum_congr rfl |
| 175 | intro j hj |
| 176 | exact hp i j |
| 177 | have hsumD : |
| 178 | (∑ i, spatialDeriv i (fun x => C'.drift i x * φ x) y) = |
| 179 | ∑ i, spatialDeriv i (fun x => C.drift i x * φ x) y := by |
| 180 | apply Finset.sum_congr rfl |
| 181 | intro i hi |
| 182 | exact hd' i |
| 183 | simp only [Coefficients.adjoint] |
| 184 | rw [hsumP, hsumD, show C'.zeroth y = C.zeroth y from ext_eq hy] |
| 185 | have hu'cont : Continuous u' := ext_continuous hu |
| 186 | refine ⟨hu'cont.continuousOn.locallyIntegrableOn hV.measurableSet, ?_⟩ |
| 187 | intro φ hφ hφc hφV |
| 188 | have hφU : tsupport φ ⊆ U := hφV.trans hVU |
| 189 | have horig := hw.2 φ hφ hφc hφU |
| 190 | rw [← horig] |
| 191 | apply integral_congr_ae |
| 192 | filter_upwards [] with y |
| 193 | by_cases hy : y ∈ V |
| 194 | · change ext u y * C'.adjoint φ y = u y * C.adjoint φ y |
| 195 | rw [ext_eq hy, hadj_eq hy] |
| 196 | · rw [hadj_zero (K := C') (φ := φ) (fun h => hy (hφV h)), |
| 197 | hadj_zero (K := C) (φ := φ) (fun h => hy (hφV h))] |
| 198 | simp only [mul_zero] |
| 199 | refine ⟨V, C', u', hV, hzV, hVU, hC'smooth, ?_, ?_, ?_, |
| 200 | ext_continuous hu, ext_support, ?_, ?_, ?_, ext_eq, hWeak⟩ |
| 201 | · intro i j |
| 202 | exact ext_support |
| 203 | · intro i |
| 204 | exact ext_support |
| 205 | · exact ext_support |
| 206 | · intro i j |
| 207 | exact ext_eq |
| 208 | · intro i |
| 209 | exact ext_eq |
| 210 | · exact ext_eq |
| 211 | |
| 212 | end Poincare.Analysis.Parabolic.WeakRegularity.Interior |
| 213 |