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.Basic |
| 2 | import PoincareLib.Analysis.Elliptic.Regularity.Coefficients |
| 3 | |
| 4 | /-! |
| 5 | # Extensions preserving local elliptic powers |
| 6 | |
| 7 | Fixed cutoffs extend locally smooth coefficients and functions without |
| 8 | changing any differential-operator iterate on the fixed inner open set. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | open Set Filter Topology |
| 14 | open scoped ContDiff |
| 15 | open Poincare.Analysis.Sobolev.NirenbergEuclidean |
| 16 | |
| 17 | namespace Poincare.Analysis.Elliptic.InteriorEstimates |
| 18 | |
| 19 | variable {d : ℕ} |
| 20 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 21 | |
| 22 | theorem exists_smooth_extension_on_precompact |
| 23 | {O V : Set E} (hO : IsOpen O) (hVc : IsCompact (closure V)) |
| 24 | (hVO : closure V ⊆ O) {u : E → ℝ} (hu : ContDiffOn ℝ ∞ u O) : |
| 25 | ∃ v : E → ℝ, ContDiff ℝ ∞ v ∧ EqOn v u V := by |
| 26 | obtain ⟨χ, hχ, _, _, hχone, hχsupp⟩ := |
| 27 | SmoothEllipticBilinearForm.exists_cutoff hVc hO hVO |
| 28 | refine ⟨fun x => χ x * u x, contDiff_cutoff_mul hO hχ hu hχsupp, ?_⟩ |
| 29 | intro x hx |
| 30 | simp only [hχone x (subset_closure hx), one_mul] |
| 31 | |
| 32 | theorem exists_secondOrderOperator_extension [NeZero d] |
| 33 | {O V : Set E} (hO : IsOpen O) (hVc : IsCompact (closure V)) |
| 34 | (hVO : closure V ⊆ O) (a : E → Matrix (Fin d) (Fin d) ℝ) |
| 35 | (b : Fin d → E → ℝ) |
| 36 | (ha : ∀ i j, ContDiffOn ℝ ∞ (fun x => a x i j) O) |
| 37 | (hpos : ∀ x ∈ O, (a x).PosDef) |
| 38 | (hb : ∀ i, ContDiffOn ℝ ∞ (b i) O) : |
| 39 | ∃ (B : SmoothEllipticBilinearForm d univ) (b' : Fin d → E → ℝ), |
| 40 | (∀ i, ContDiff ℝ ∞ (b' i)) ∧ EqOn B.a a V ∧ (∀ i, EqOn (b' i) (b i) V) := by |
| 41 | obtain ⟨U, _, hVU, _, _, B, hBa, _⟩ := |
| 42 | exists_global_elliptic_extension hO hVc hVO a (fun _ => 0) |
| 43 | ha hpos contDiffOn_const |
| 44 | choose b' hb' heq using fun i => exists_smooth_extension_on_precompact hO hVc hVO (hb i) |
| 45 | exact ⟨B, b', hb', hBa.mono (subset_closure.trans hVU), heq⟩ |
| 46 | |
| 47 | end Poincare.Analysis.Elliptic.InteriorEstimates |