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.Sobolev.ProfileCalculus |
| 2 | import PoincareLib.Analysis.Elliptic.Regularity.Iteration.DifferentiatedEquation |
| 3 | |
| 4 | /-! |
| 5 | # Quantitative bounds for differentiated elliptic sources |
| 6 | |
| 7 | The coefficients and the precompact coordinate set determine every multiplier |
| 8 | constant before the smooth solution or right-hand side is introduced. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | open MeasureTheory Set |
| 14 | open scoped ENNReal |
| 15 | open Poincare.Analysis.Elliptic.Iteration |
| 16 | |
| 17 | namespace Poincare.Analysis.Elliptic.InteriorEstimates |
| 18 | |
| 19 | variable {d : ℕ} [NeZero d] |
| 20 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 21 | |
| 22 | omit [NeZero d] in |
| 23 | /-- A fixed smooth coefficient acts boundedly on each profile on a precompact |
| 24 | open set. The bound is obtained from its derivatives on the compact closure. -/ |
| 25 | theorem exists_derivativeProfile_mul_bound {V : Set E} (hV : IsOpen V) |
| 26 | (hc : IsCompact (closure V)) (r : ℕ) {a : E → ℝ} |
| 27 | (ha : ContDiff ℝ (⊤ : ℕ∞) a) : |
| 28 | ∃ C : ℝ, 0 ≤ C ∧ ∀ {p : ℝ≥0∞}, 1 ≤ p → |
| 29 | ∀ {u : E → ℝ}, ContDiff ℝ (⊤ : ℕ∞) u → |
| 30 | derivativeProfile p V r (fun x => a x * u x) ≤ |
| 31 | ENNReal.ofReal C * derivativeProfile p V r u := by |
| 32 | classical |
| 33 | have hbounds : ∀ j : ℕ, ∃ A : ℝ, ∀ x ∈ closure V, ‖iteratedFDeriv ℝ j a x‖ ≤ A := by |
| 34 | intro j |
| 35 | exact hc.exists_bound_of_continuousOn |
| 36 | (ha.continuous_iteratedFDeriv (by exact_mod_cast le_top)).continuousOn |
| 37 | choose A hA using hbounds |
| 38 | let B := ∑ j ∈ Finset.range (r + 1), max 0 (A j) |
| 39 | have hB : 0 ≤ B := Finset.sum_nonneg fun j hj => le_max_left _ _ |
| 40 | have hbound : ∀ j ≤ r, ∀ x ∈ V, ‖iteratedFDeriv ℝ j a x‖ ≤ B := by |
| 41 | intro j hj x hx |
| 42 | exact ((hA j x (subset_closure hx)).trans (le_max_right _ _)).trans |
| 43 | (Finset.single_le_sum (fun i hi => le_max_left _ _) |
| 44 | (Finset.mem_range.mpr (Nat.lt_succ_of_le hj))) |
| 45 | refine ⟨cutoffMultiplier r B, cutoffMultiplier_nonneg r hB, ?_⟩ |
| 46 | intro p hp u hu |
| 47 | exact derivativeProfile_mul_le hV hp r ha hu hB hbound |
| 48 | |
| 49 | /-- The scalar source produced by differentiating the elliptic equation has |
| 50 | a uniform profile bound in terms of the solution and original source. -/ |
| 51 | theorem differentiatedSource_profile_le {V : Set E} (hV : IsOpen V) |
| 52 | (hc : IsCompact (closure V)) |
| 53 | (A : E → Matrix (Fin d) (Fin d) ℝ) |
| 54 | (hA : ∀ i j, ContDiff ℝ (⊤ : ℕ∞) (fun x => A x i j)) |
| 55 | (r : ℕ) (k : Fin d) : |
| 56 | ∃ C : ℝ, 0 ≤ C ∧ ∀ {u f : E → ℝ}, |
| 57 | ContDiff ℝ (⊤ : ℕ∞) u → ContDiff ℝ (⊤ : ℕ∞) f → |
| 58 | derivativeProfile 2 V r |
| 59 | (differentiatedSource A (fun j => Iteration.partialDeriv j u) |
| 60 | (fun i j => Iteration.partialDeriv i (Iteration.partialDeriv j u)) |
| 61 | (Iteration.partialDeriv k f) k) ≤ |
| 62 | ENNReal.ofReal C * |
| 63 | (derivativeProfile 2 V (r + 2) u + derivativeProfile 2 V (r + 1) f) := by |
| 64 | classical |
| 65 | choose C hC hboundC using fun i j => |
| 66 | exists_derivativeProfile_mul_bound hV hc r (contDiff_partial (hA i j) k) |
| 67 | choose D hD hboundD using fun i j => |
| 68 | exists_derivativeProfile_mul_bound hV hc r |
| 69 | (contDiff_partial (contDiff_partial (hA i j) k) i) |
| 70 | let S : ℝ := ∑ i, ∑ j, (C i j + D i j) |
| 71 | have hS : 0 ≤ S := Finset.sum_nonneg fun i hi => |
| 72 | Finset.sum_nonneg fun j hj => add_nonneg (hC i j) (hD i j) |
| 73 | refine ⟨1 + S, by positivity, ?_⟩ |
| 74 | intro u f hu hf |
| 75 | let U := derivativeProfile 2 V (r + 2) u |
| 76 | let F := derivativeProfile 2 V (r + 1) f |
| 77 | let term : Fin d → Fin d → E → ℝ := fun i j x => |
| 78 | Iteration.partialDeriv k (fun y => A y i j) x * |
| 79 | Iteration.partialDeriv i (Iteration.partialDeriv j u) x + |
| 80 | Iteration.partialDeriv i (Iteration.partialDeriv k (fun y => A y i j)) x * |
| 81 | Iteration.partialDeriv j u x |
| 82 | have hterm (i j) : ContDiff ℝ (⊤ : ℕ∞) (term i j) := |
| 83 | ((contDiff_partial (hA i j) k).mul (contDiff_partial (contDiff_partial hu j) i)).add |
| 84 | ((contDiff_partial (contDiff_partial (hA i j) k) i).mul (contDiff_partial hu j)) |
| 85 | have htermBound (i j) : derivativeProfile 2 V r (term i j) ≤ |
| 86 | ENNReal.ofReal (C i j + D i j) * U := by |
| 87 | have hfirst := hboundC i j (by norm_num : (1 : ℝ≥0∞) ≤ 2) |
| 88 | (contDiff_partial (contDiff_partial hu j) i) |
| 89 | have hsecond := hboundD i j (by norm_num : (1 : ℝ≥0∞) ≤ 2) |
| 90 | (contDiff_partial hu j) |
| 91 | have hdu : derivativeProfile 2 V r (Iteration.partialDeriv j u) ≤ U := |
| 92 | (derivativeProfile_partial_le r j hu).trans |
| 93 | (derivativeProfile_mono_order (Nat.le_succ (r + 1)) u) |
| 94 | have hddu : derivativeProfile 2 V r |
| 95 | (Iteration.partialDeriv i (Iteration.partialDeriv j u)) ≤ U := |
| 96 | (derivativeProfile_partial_le r i (contDiff_partial hu j)).trans |
| 97 | (derivativeProfile_partial_le (r + 1) j hu) |
| 98 | calc |
| 99 | derivativeProfile 2 V r (term i j) ≤ |
| 100 | derivativeProfile 2 V r (fun x => Iteration.partialDeriv k (fun y => A y i j) x * |
| 101 | Iteration.partialDeriv i (Iteration.partialDeriv j u) x) + |
| 102 | derivativeProfile 2 V r (fun x => |
| 103 | Iteration.partialDeriv i (Iteration.partialDeriv k (fun y => A y i j)) x * |
| 104 | Iteration.partialDeriv j u x) := |
| 105 | derivativeProfile_add_le hV (by norm_num) r |
| 106 | ((contDiff_partial (hA i j) k).mul (contDiff_partial (contDiff_partial hu j) i)) |
| 107 | ((contDiff_partial (contDiff_partial (hA i j) k) i).mul (contDiff_partial hu j)) |
| 108 | _ ≤ ENNReal.ofReal (C i j) * U + ENNReal.ofReal (D i j) * U := by |
| 109 | gcongr |
| 110 | · exact hfirst.trans (by gcongr) |
| 111 | · exact hsecond.trans (by gcongr) |
| 112 | _ = ENNReal.ofReal (C i j + D i j) * U := by |
| 113 | rw [ENNReal.ofReal_add (hC i j) (hD i j), add_mul] |
| 114 | have hsum : derivativeProfile 2 V r (fun x => ∑ i, ∑ j, term i j x) ≤ |
| 115 | ENNReal.ofReal S * U := by |
| 116 | apply (derivativeProfile_finset_sum_le hV (by norm_num) r Finset.univ |
| 117 | (fun i hi => ContDiff.sum (fun j hj => hterm i j))).trans |
| 118 | change (∑ i, derivativeProfile 2 V r (fun x => ∑ j, term i j x)) ≤ |
| 119 | ENNReal.ofReal (∑ i, ∑ j, (C i j + D i j)) * U |
| 120 | rw [ENNReal.ofReal_sum_of_nonneg |
| 121 | (fun i hi => Finset.sum_nonneg fun j hj => add_nonneg (hC i j) (hD i j)), |
| 122 | Finset.sum_mul] |
| 123 | apply Finset.sum_le_sum |
| 124 | intro i hi |
| 125 | apply (derivativeProfile_finset_sum_le hV (by norm_num) r Finset.univ |
| 126 | (fun j hj => hterm i j)).trans |
| 127 | rw [ENNReal.ofReal_sum_of_nonneg (fun j hj => add_nonneg (hC i j) (hD i j)), |
| 128 | Finset.sum_mul] |
| 129 | exact Finset.sum_le_sum fun j hj => htermBound i j |
| 130 | have hsmoothSum : ContDiff ℝ (⊤ : ℕ∞) (fun x => ∑ i, ∑ j, term i j x) := |
| 131 | ContDiff.sum (fun i hi => ContDiff.sum (fun j hj => hterm i j)) |
| 132 | have hsource := derivativeProfile_add_le hV (by norm_num : (1 : ℝ≥0∞) ≤ 2) r |
| 133 | (contDiff_partial hf k) |
| 134 | hsmoothSum |
| 135 | change derivativeProfile 2 V r (fun x => Iteration.partialDeriv k f x + |
| 136 | ∑ i, ∑ j, term i j x) ≤ _ |
| 137 | apply hsource.trans |
| 138 | apply (add_le_add (derivativeProfile_partial_le r k hf) hsum).trans |
| 139 | rw [ENNReal.ofReal_add (by norm_num : (0 : ℝ) ≤ 1) hS, ENNReal.ofReal_one] |
| 140 | calc |
| 141 | F + ENNReal.ofReal S * U ≤ (1 + ENNReal.ofReal S) * F + |
| 142 | (1 + ENNReal.ofReal S) * U := by |
| 143 | apply add_le_add |
| 144 | · calc |
| 145 | F = 1 * F := (one_mul F).symm |
| 146 | _ ≤ (1 + ENNReal.ofReal S) * F := by gcongr; exact le_self_add |
| 147 | · gcongr; exact le_add_self |
| 148 | _ = (1 + ENNReal.ofReal S) * (U + F) := by ring |
| 149 | |
| 150 | end Poincare.Analysis.Elliptic.InteriorEstimates |