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.Analysis.Elliptic.Regularity.InteriorEstimates.Energy.SecondDerivative |
| 2 | import PoincareLib.Analysis.Elliptic.Regularity.InteriorEstimates.Sobolev.L2 |
| 3 | import PoincareLib.Analysis.Elliptic.Regularity.LocalEquation |
| 4 | import PoincareLib.Analysis.Elliptic.Regularity.Iteration.TestCalculus |
| 5 | |
| 6 | /-! |
| 7 | # Uniform local second-derivative estimates |
| 8 | |
| 9 | The cutoffs and the Nirenberg constant are fixed before the smooth solution. |
| 10 | Only local square integrability of the source is needed. This implements the |
| 11 | localization in Evans, *Partial Differential Equations*, second edition, |
| 12 | Section 6.3.1, Theorem 1, printed p. 327. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | open Set MeasureTheory Function Filter Topology |
| 18 | open scoped ENNReal ContDiff |
| 19 | open Poincare.Analysis.Sobolev |
| 20 | open Poincare.Analysis.Sobolev.Weak |
| 21 | open Poincare.Analysis.Sobolev.NirenbergEuclidean |
| 22 | open Poincare.Analysis.Sobolev.NirenbergCrossBoundsNonSmooth |
| 23 | open Poincare.Analysis.Elliptic.Iteration |
| 24 | |
| 25 | namespace Poincare.Analysis.Elliptic.InteriorEstimates |
| 26 | |
| 27 | variable {d : ℕ} [NeZero d] |
| 28 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 29 | |
| 30 | omit [NeZero d] in |
| 31 | private theorem partial_eqOn {U : Set E} (hU : IsOpen U) {u v : E → ℝ} |
| 32 | (heq : EqOn u v U) (i : Fin d) : EqOn (partialDeriv i u) (partialDeriv i v) U := by |
| 33 | intro x hx |
| 34 | have hloc : u =ᶠ[𝓝 x] v := Filter.mem_of_superset (hU.mem_nhds hx) heq |
| 35 | exact congrArg (fun A : E →L[ℝ] ℝ => A (EuclideanSpace.single i 1)) hloc.fderiv_eq |
| 36 | |
| 37 | private theorem localized_principal_equation |
| 38 | {Ω V U : Set E} (B : SmoothEllipticBilinearForm d Ω) |
| 39 | (hU : IsOpen U) (hUV : U ⊆ V) {u v f : E → ℝ} |
| 40 | (huv : EqOn v u U) |
| 41 | (heq : ∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ V → |
| 42 | (∫ x in V, B.principalIntegrand u φ x) = ∫ x in V, f x * φ x) : |
| 43 | ∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ U → |
| 44 | (∫ x in U, ∑ j : Fin d, (∑ i : Fin d, B.a x i j * partialDeriv i v x) * |
| 45 | partialDeriv j φ x) = ∫ x in U, U.indicator f x * φ x := by |
| 46 | intro φ hφ hφc hφU |
| 47 | have hraw : ∀ ψ : E → ℝ, ContDiff ℝ ∞ ψ → HasCompactSupport ψ → tsupport ψ ⊆ V → |
| 48 | (∫ x in V, ∑ i : Fin d, ∑ j : Fin d, B.a x i j * partialDeriv j u x * |
| 49 | fderiv ℝ ψ x (EuclideanSpace.single i 1)) = ∫ x in V, f x * ψ x := by |
| 50 | intro ψ hψ hψc hψV |
| 51 | rw [← heq ψ hψ hψc hψV] |
| 52 | apply integral_congr_ae |
| 53 | filter_upwards [] with x |
| 54 | simp only [SmoothEllipticBilinearForm.principalIntegrand, partialDeriv] |
| 55 | rw [Finset.sum_comm] |
| 56 | simp only [B.symm] |
| 57 | have hloc := weakEquation_congr_restrict hUV (show EqOn B.a B.a U from fun _ _ => rfl) |
| 58 | (fun i => partial_eqOn hU huv i) hraw φ hφ hφc hφU |
| 59 | calc |
| 60 | _ = ∫ x in U, f x * φ x := by simpa only [B.symm, partialDeriv] using hloc |
| 61 | _ = _ := by |
| 62 | apply integral_congr_ae |
| 63 | filter_upwards [ae_restrict_mem hU.measurableSet] with x hx |
| 64 | simp [hx] |
| 65 | |
| 66 | theorem principal_equation_restrict |
| 67 | {Ω V U : Set E} (B : SmoothEllipticBilinearForm d Ω) |
| 68 | (hU : IsOpen U) (hUV : U ⊆ V) {u f : E → ℝ} |
| 69 | (heq : ∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ V → |
| 70 | (∫ x in V, B.principalIntegrand u φ x) = ∫ x in V, f x * φ x) : |
| 71 | ∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ U → |
| 72 | (∫ x in U, B.principalIntegrand u φ x) = ∫ x in U, f x * φ x := by |
| 73 | intro φ hφ hφc hφU |
| 74 | have h := localized_principal_equation B hU hUV (fun _ _ => rfl) heq φ hφ hφc hφU |
| 75 | calc |
| 76 | _ = ∫ x in U, ∑ j : Fin d, (∑ i : Fin d, B.a x i j * partialDeriv i u x) * |
| 77 | partialDeriv j φ x := by |
| 78 | apply integral_congr_ae |
| 79 | filter_upwards [] with x |
| 80 | simp only [SmoothEllipticBilinearForm.principalIntegrand, partialDeriv, |
| 81 | Finset.sum_mul] |
| 82 | rw [Finset.sum_comm] |
| 83 | _ = ∫ x in U, U.indicator f x * φ x := h |
| 84 | _ = _ := by |
| 85 | apply integral_congr_ae |
| 86 | filter_upwards [ae_restrict_mem hU.measurableSet] with x hx |
| 87 | simp [hx] |
| 88 | |
| 89 | /-- Fixed nested sets give a uniform second-derivative energy estimate for every |
| 90 | smooth solution, without any global integrability assumption. -/ |
| 91 | theorem exists_hessian_integral_le_of_weakEquation |
| 92 | {Ω V W : Set E} (B : SmoothEllipticBilinearForm d Ω) |
| 93 | (hV : IsOpen V) (hVc : IsCompact (closure V)) (hVΩ : closure V ⊆ Ω) |
| 94 | (hW : IsOpen W) (hWc : IsCompact (closure W)) (hWV : closure W ⊆ V) : |
| 95 | ∃ C : ℝ, 0 ≤ C ∧ ∀ {u f : E → ℝ}, ContDiff ℝ ∞ u → |
| 96 | MemLp f 2 (volume.restrict V) → |
| 97 | (∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ V → |
| 98 | (∫ x in V, B.principalIntegrand u φ x) = ∫ x in V, f x * φ x) → |
| 99 | (∫ x in W, ∑ k : Fin d, ∑ i : Fin d, (partialDeriv k (partialDeriv i u) x) ^ 2) ≤ |
| 100 | C * ((∫ x in V, ∑ i : Fin d, (partialDeriv i u x) ^ 2) + |
| 101 | (∫ x in V, u x ^ 2) + ∫ x in V, f x ^ 2) := by |
| 102 | obtain ⟨η, hη, hηc, hηrange, hηone, hηV, N, hN, hDη⟩ := |
| 103 | SmoothEllipticBilinearForm.exists_cutoff_with_fderiv_bound hWc hV hWV |
| 104 | obtain ⟨R, hR, hRV⟩ := hηc.isCompact.exists_cthickening_subset_open hV hηV |
| 105 | obtain ⟨χ, hχ, hχc, _, hχone, _⟩ := |
| 106 | SmoothEllipticBilinearForm.exists_cutoff hVc isOpen_univ (subset_univ _) |
| 107 | let c : Fin d → ℝ := fun k => 2 * nirenbergMasterYoungConstant B N hVc k / B.lam |
| 108 | have hc (k : Fin d) : 0 ≤ c k := |
| 109 | div_nonneg (mul_nonneg (by norm_num) |
| 110 | (nirenbergMasterYoungConstant_nonneg B hN hVc k)) B.hlam_pos.le |
| 111 | refine ⟨(d : ℝ) * ∑ k : Fin d, c k, |
| 112 | mul_nonneg (Nat.cast_nonneg _) (Finset.sum_nonneg (fun k _ => hc k)), ?_⟩ |
| 113 | intro u f hu hf heq |
| 114 | let u₀ : E → ℝ := fun x => χ x * u x |
| 115 | let p₀ : Fin d → E → ℝ := fun i => partialDeriv i u₀ |
| 116 | let f₀ : E → ℝ := V.indicator f |
| 117 | have hu₀ : ContDiff ℝ ∞ u₀ := hχ.mul hu |
| 118 | have hu₀c : HasCompactSupport u₀ := hχc.mul_right |
| 119 | have hu₀m : MemLp u₀ 2 volume := hu₀.continuous.memLp_of_hasCompactSupport hu₀c |
| 120 | have hp₀ (i : Fin d) : ContDiff ℝ ∞ (p₀ i) := contDiff_partial hu₀ i |
| 121 | have hp₀c (i : Fin d) : HasCompactSupport (p₀ i) := hasCompactSupport_partial hu₀c i |
| 122 | have hp₀m (i : Fin d) : MemLp (p₀ i) 2 volume := |
| 123 | (hp₀ i).continuous.memLp_of_hasCompactSupport (hp₀c i) |
| 124 | have hf₀ : MemLp f₀ 2 volume := |
| 125 | (memLp_indicator_iff_restrict hV.measurableSet).mpr hf |
| 126 | have hF (j : Fin d) : MemLp (fun x => ∑ i : Fin d, B.a x i j * p₀ i x) 2 volume := |
| 127 | memLp_finsetSum _ (fun i _ => memLp_continuous_mul_of_hasCompactSupport |
| 128 | (B.continuous_a i j) (hp₀m i) (hp₀c i)) |
| 129 | have huEq : EqOn u₀ u V := fun x hx => by |
| 130 | dsimp [u₀] |
| 131 | rw [hχone x (subset_closure hx), one_mul] |
| 132 | have hpEq (i : Fin d) : EqOn (p₀ i) (partialDeriv i u) V := partial_eqOn hV huEq i |
| 133 | have hppEq (i k : Fin d) : EqOn (partialDeriv k (p₀ i)) |
| 134 | (partialDeriv k (partialDeriv i u)) V := partial_eqOn hV (hpEq i) k |
| 135 | have hpint : (∫ x in V, ∑ i : Fin d, (p₀ i x) ^ 2) = |
| 136 | ∫ x in V, ∑ i : Fin d, (partialDeriv i u x) ^ 2 := by |
| 137 | apply integral_congr_ae |
| 138 | filter_upwards [ae_restrict_mem hV.measurableSet] with x hx |
| 139 | simp only [hpEq _ hx] |
| 140 | have huint : (∫ x in V, u₀ x ^ 2) = ∫ x in V, u x ^ 2 := by |
| 141 | apply integral_congr_ae |
| 142 | filter_upwards [ae_restrict_mem hV.measurableSet] with x hx |
| 143 | rw [huEq hx] |
| 144 | have hfint : (∫ x in V, f₀ x ^ 2) = ∫ x in V, f x ^ 2 := by |
| 145 | apply integral_congr_ae |
| 146 | filter_upwards [ae_restrict_mem hV.measurableSet] with x hx |
| 147 | simp [f₀, hx] |
| 148 | let energy : ℝ := (∫ x in V, ∑ i : Fin d, (partialDeriv i u x) ^ 2) + |
| 149 | (∫ x in V, u x ^ 2) + ∫ x in V, f x ^ 2 |
| 150 | have hbound (i k : Fin d) : |
| 151 | (∫ x in W, (partialDeriv k (partialDeriv i u) x) ^ 2) ≤ c k * energy := by |
| 152 | have h := classicalPartial_integral_sq_le_nirenberg B hV hu₀m hf₀ hp₀m |
| 153 | (fun i => (hp₀ i).of_le (by simp)) |
| 154 | (fun i => HasWeakPartialDeriv.of_contDiff isOpen_univ (hu₀.of_le (by simp))) |
| 155 | hF (localized_principal_equation B hV (Subset.rfl) huEq heq) |
| 156 | hη hηc hηrange hN hDη hV hVΩ hVc (Subset.rfl) hR |
| 157 | (fun {h} hh => (Metric.cthickening_mono hh _).trans hRV) |
| 158 | (fun x hx => hηone x (subset_closure hx)) hW hWc i k |
| 159 | rw [hpint, huint, hfint] at h |
| 160 | change (∫ x in W, (partialDeriv k (p₀ i) x) ^ 2) ≤ c k * energy at h |
| 161 | convert h using 1 |
| 162 | apply integral_congr_ae |
| 163 | filter_upwards [ae_restrict_mem hW.measurableSet] with x hx |
| 164 | rw [hppEq i k (hWV (subset_closure hx))] |
| 165 | have hint (i k : Fin d) : Integrable |
| 166 | (fun x => (partialDeriv k (partialDeriv i u) x) ^ 2) (volume.restrict W) := |
| 167 | ((continuous_memLp_on_compact (contDiff_partial (contDiff_partial hu i) k).continuous |
| 168 | hWc).mono_measure (Measure.restrict_mono subset_closure le_rfl)).integrable_sq |
| 169 | rw [integral_finsetSum _ (fun k _ => integrable_finsetSum _ (fun i _ => hint i k))] |
| 170 | calc |
| 171 | _ ≤ ∑ k : Fin d, ∑ _i : Fin d, c k * energy := by |
| 172 | apply Finset.sum_le_sum |
| 173 | intro k _ |
| 174 | rw [integral_finsetSum _ (fun i _ => hint i k)] |
| 175 | exact Finset.sum_le_sum (fun i _ => hbound i k) |
| 176 | _ = _ := by simp [Finset.mul_sum, Finset.sum_mul, mul_assoc, energy] |
| 177 | |
| 178 | end Poincare.Analysis.Elliptic.InteriorEstimates |