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.Operators.Commutator |
| 2 | import PoincareLib.Analysis.Elliptic.Regularity.InteriorEstimates.Operators.Basic |
| 3 | |
| 4 | /-! |
| 5 | # The lower-order correction to the principal divergence source |
| 6 | -/ |
| 7 | |
| 8 | noncomputable section |
| 9 | |
| 10 | open Set MeasureTheory |
| 11 | open scoped ENNReal ContDiff |
| 12 | open Poincare.Analysis.Elliptic.Iteration |
| 13 | open Poincare.Analysis.Sobolev.NirenbergEuclidean |
| 14 | |
| 15 | namespace Poincare.Analysis.Elliptic.InteriorEstimates |
| 16 | |
| 17 | variable {d : ℕ} |
| 18 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 19 | |
| 20 | def driftCorrection (a : E → Matrix (Fin d) (Fin d) ℝ) |
| 21 | (b : Fin d → E → ℝ) (j : Fin d) : E → ℝ := fun x => |
| 22 | b j x - ∑ i, partialDeriv i (fun y => a y i j) x |
| 23 | |
| 24 | theorem contDiff_driftCorrection |
| 25 | {a : E → Matrix (Fin d) (Fin d) ℝ} {b : Fin d → E → ℝ} |
| 26 | (ha : ∀ i j, ContDiff ℝ ∞ (fun x => a x i j)) |
| 27 | (hb : ∀ i, ContDiff ℝ ∞ (b i)) (j : Fin d) : |
| 28 | ContDiff ℝ ∞ (driftCorrection a b j) := |
| 29 | (hb j).sub (ContDiff.sum (fun i _ => contDiff_partial (ha i j) i)) |
| 30 | |
| 31 | theorem contDiff_principalSource |
| 32 | {a : E → Matrix (Fin d) (Fin d) ℝ} |
| 33 | (ha : ∀ i j, ContDiff ℝ ∞ (fun x => a x i j)) |
| 34 | {u : E → ℝ} (hu : ContDiff ℝ ∞ u) : |
| 35 | ContDiff ℝ ∞ (principalSource a u) := |
| 36 | (ContDiff.sum (fun i _ => contDiff_partial |
| 37 | (ContDiff.sum (fun j _ => (ha i j).mul (contDiff_partial hu j))) i)).neg |
| 38 | |
| 39 | theorem derivativeProfile_neg (p : ℝ≥0∞) (V : Set E) (r : ℕ) (u : E → ℝ) : |
| 40 | derivativeProfile p V r (fun x => -u x) = derivativeProfile p V r u := by |
| 41 | change derivativeProfile p V r (-u) = _ |
| 42 | simp only [derivativeProfile, iteratedFDeriv_neg_apply, norm_neg] |
| 43 | |
| 44 | theorem exists_principalSource_profile_le [NeZero d] |
| 45 | {V : Set E} (hV : IsOpen V) (hVc : IsCompact (closure V)) |
| 46 | (a : E → Matrix (Fin d) (Fin d) ℝ) (b : Fin d → E → ℝ) |
| 47 | (ha : ∀ i j, ContDiff ℝ ∞ (fun x => a x i j)) |
| 48 | (hb : ∀ i, ContDiff ℝ ∞ (b i)) (r : ℕ) : |
| 49 | ∃ C : ℝ, 0 ≤ C ∧ ∀ {u : E → ℝ}, ContDiff ℝ ∞ u → |
| 50 | derivativeProfile 2 V r (principalSource a u) ≤ ENNReal.ofReal C * |
| 51 | (derivativeProfile 2 V r (secondOrderOperator a b u) + |
| 52 | derivativeProfile 2 V (r + 1) u) := by |
| 53 | choose A hA hbound using fun i => exists_derivativeProfile_mul_bound |
| 54 | hV hVc r (contDiff_driftCorrection ha hb i) |
| 55 | let S : ℝ := ∑ i, A i |
| 56 | have hS : 0 ≤ S := Finset.sum_nonneg (fun i _ => hA i) |
| 57 | refine ⟨1 + S, by positivity, ?_⟩ |
| 58 | intro u hu |
| 59 | have hL := contDiff_secondOrderOperator ha hb hu |
| 60 | have hsum : ContDiff ℝ ∞ (fun x => ∑ i, driftCorrection a b i x * partialDeriv i u x) := |
| 61 | ContDiff.sum (fun i _ => (contDiff_driftCorrection ha hb i).mul (contDiff_partial hu i)) |
| 62 | have hid : principalSource a u = fun x => -secondOrderOperator a b u x + |
| 63 | ∑ i, driftCorrection a b i x * partialDeriv i u x := by |
| 64 | funext x |
| 65 | exact principalSource_eq_secondOrderOperator b ha hu x |
| 66 | have hsumBound : derivativeProfile 2 V r |
| 67 | (fun x => ∑ i, driftCorrection a b i x * partialDeriv i u x) ≤ |
| 68 | ENNReal.ofReal S * derivativeProfile 2 V (r + 1) u := by |
| 69 | apply (derivativeProfile_finset_sum_le hV (by norm_num) r Finset.univ |
| 70 | (fun i _ => (contDiff_driftCorrection ha hb i).mul (contDiff_partial hu i))).trans |
| 71 | rw [show ENNReal.ofReal S = ∑ i, ENNReal.ofReal (A i) from |
| 72 | ENNReal.ofReal_sum_of_nonneg (fun i _ => hA i), Finset.sum_mul] |
| 73 | apply Finset.sum_le_sum |
| 74 | intro i hi |
| 75 | apply (hbound i (by norm_num : (1 : ℝ≥0∞) ≤ 2) (contDiff_partial hu i)).trans |
| 76 | gcongr |
| 77 | exact derivativeProfile_partial_le r i hu |
| 78 | rw [hid] |
| 79 | apply (derivativeProfile_add_le hV (by norm_num) r hL.neg hsum).trans |
| 80 | rw [derivativeProfile_neg] |
| 81 | apply (add_le_add le_rfl hsumBound).trans |
| 82 | rw [ENNReal.ofReal_add (by norm_num : (0 : ℝ) ≤ 1) hS, ENNReal.ofReal_one, mul_add] |
| 83 | apply add_le_add |
| 84 | · exact le_mul_of_one_le_left' (by exact le_self_add) |
| 85 | · gcongr |
| 86 | exact le_add_self |
| 87 | |
| 88 | end Poincare.Analysis.Elliptic.InteriorEstimates |