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.GradientCompactness.FluxBound |
| 2 | |
| 3 | /-! |
| 4 | # Gradient energy controlled by elliptic flux comparison |
| 5 | |
| 6 | The coercive part controls actual coordinate derivatives. The coefficient |
| 7 | error is uniform and requires no derivatives of the coefficient matrices. |
| 8 | -/ |
| 9 | |
| 10 | noncomputable section |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open Set MeasureTheory Filter |
| 14 | open scoped Topology ENNReal NNReal BigOperators |
| 15 | open Poincare.Analysis.Sobolev.Weak |
| 16 | |
| 17 | namespace Poincare.Analysis.Elliptic |
| 18 | |
| 19 | variable {d : ℕ} |
| 20 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 21 | |
| 22 | /-- Uniform ellipticity converts the flux energy into square-gradient energy. -/ |
| 23 | theorem integral_partial_sq_le_flux_energy |
| 24 | {O : Set E} (hO : IsOpen O) [IsFiniteMeasure (volume.restrict O)] |
| 25 | {F G : Fin d → E → ℝ} {u v φ : E → ℝ} |
| 26 | {A B : E → Fin d → Fin d → ℝ} {L : ℝ≥0} {c δ : ℝ} |
| 27 | (hF : ∀ i, MemLp (F i) 2 (volume.restrict O)) |
| 28 | (hG : ∀ i, MemLp (G i) 2 (volume.restrict O)) |
| 29 | (hu : LipschitzOnWith L u O) (hv : LipschitzOnWith L v O) |
| 30 | (hp : MemLp φ ∞ (volume.restrict O)) |
| 31 | (hp0 : ∀ x ∈ O, 0 ≤ φ x) (hp1 : ∀ x ∈ O, φ x ≤ 1) |
| 32 | (hδ : 0 ≤ δ) |
| 33 | (hcoeff : ∀ x ∈ O, ∀ i j, |A x i j - B x i j| ≤ δ) |
| 34 | (hell : ∀ x ∈ O, ∀ w : Fin d → ℝ, |
| 35 | c * ∑ i, (w i) ^ 2 ≤ ∑ i, ∑ j, A x i j * w j * w i) |
| 36 | (hFid : ∀ x ∈ O, ∀ i, F i x = |
| 37 | -(∑ j, A x i j * fderiv ℝ u x (EuclideanSpace.single j 1))) |
| 38 | (hGid : ∀ x ∈ O, ∀ i, G i x = |
| 39 | -(∑ j, B x i j * fderiv ℝ v x (EuclideanSpace.single j 1))) : |
| 40 | c * (∫ x in O, φ x * ∑ i, |
| 41 | (fderiv ℝ u x (EuclideanSpace.single i 1) - |
| 42 | fderiv ℝ v x (EuclideanSpace.single i 1)) ^ 2) ≤ |
| 43 | (∫ x in O, φ x * ∑ i, (G i x - F i x) * |
| 44 | (fderiv ℝ u x (EuclideanSpace.single i 1) - |
| 45 | fderiv ℝ v x (EuclideanSpace.single i 1))) + |
| 46 | (d : ℝ) ^ 2 * δ * (2 * (L : ℝ) ^ 2) * volume.real O := by |
| 47 | let du := fun i x => fderiv ℝ u x (EuclideanSpace.single i 1) |
| 48 | let dv := fun i x => fderiv ℝ v x (EuclideanSpace.single i 1) |
| 49 | let q := fun x => φ x * ∑ i, (du i x - dv i x) ^ 2 |
| 50 | let energy := fun x => φ x * ∑ i, (G i x - F i x) * (du i x - dv i x) |
| 51 | let error := (d : ℝ) ^ 2 * δ * (2 * (L : ℝ) ^ 2) |
| 52 | have hd (i) : MemLp (fun x => du i x - dv i x) ∞ (volume.restrict O) := |
| 53 | (memLp_top_fderiv_apply_of_lipschitzOn hO hu _).sub |
| 54 | (memLp_top_fderiv_apply_of_lipschitzOn hO hv _) |
| 55 | have hq : MemLp q ∞ (volume.restrict O) := by |
| 56 | have hsum : MemLp (fun x => ∑ i, (du i x - dv i x) ^ 2) |
| 57 | ∞ (volume.restrict O) := by |
| 58 | apply memLp_finsetSum |
| 59 | intro i _ |
| 60 | simpa only [pow_two] using (hd i).mul' (r := ∞) (hd i) |
| 61 | exact hsum.mul' hp |
| 62 | have he : MemLp energy 2 (volume.restrict O) := by |
| 63 | have hsum : MemLp (fun x => ∑ i, (G i x - F i x) * (du i x - dv i x)) |
| 64 | 2 (volume.restrict O) := by |
| 65 | apply memLp_finsetSum |
| 66 | intro i _ |
| 67 | exact (hd i).mul' ((hG i).sub (hF i)) |
| 68 | exact hsum.mul' hp |
| 69 | have herror : 0 ≤ error := by dsimp only [error]; positivity |
| 70 | have hpoint (x) (hx : x ∈ O) : c * q x ≤ energy x + error := by |
| 71 | have h := matrix_flux_coercivity L.coe_nonneg hδ (hell x hx) |
| 72 | (fun i => abs_partial_le_of_lipschitzOn hO hu hx i) |
| 73 | (fun i => abs_partial_le_of_lipschitzOn hO hv hx i) (hcoeff x hx) |
| 74 | have hid : (∑ i, ((∑ j, A x i j * du j x) - ∑ j, B x i j * dv j x) * |
| 75 | (du i x - dv i x)) = ∑ i, (G i x - F i x) * (du i x - dv i x) := by |
| 76 | apply Finset.sum_congr rfl |
| 77 | intro i _ |
| 78 | rw [hFid x hx i, hGid x hx i, neg_sub_neg] |
| 79 | change c * (∑ i, (du i x - dv i x) ^ 2) ≤ _ + error at h |
| 80 | rw [hid] at h |
| 81 | have hmul := mul_le_mul_of_nonneg_left h (hp0 x hx) |
| 82 | have he' : φ x * error ≤ error := by |
| 83 | simpa only [one_mul] using mul_le_mul_of_nonneg_right (hp1 x hx) herror |
| 84 | dsimp only [q, energy] |
| 85 | nlinarith |
| 86 | have h := setIntegral_mono_on ((hq.const_mul c).integrable le_top) |
| 87 | ((he.integrable (by norm_num)).add (integrable_const error)) hO.measurableSet hpoint |
| 88 | change c * (∫ x in O, q x) ≤ (∫ x in O, energy x) + error * volume.real O |
| 89 | simpa only [Pi.add_apply, integral_const_mul, integral_add (he.integrable (by norm_num)) |
| 90 | (integrable_const error), integral_const, smul_eq_mul, |
| 91 | measureReal_restrict_apply_univ, mul_comm (volume.real O) error] using h |
| 92 | |
| 93 | end Poincare.Analysis.Elliptic |