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.Parabolic.Interior.CompactSlices |
| 2 | import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension |
| 3 | |
| 4 | /-! |
| 5 | # Localization of smooth interior solutions |
| 6 | |
| 7 | A smooth cutoff supported inside an open smoothness domain extends the |
| 8 | localized function smoothly to the entire ambient space. On a neighborhood |
| 9 | where the cutoff is one, all derivatives of the original function are kept. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Filter Set |
| 15 | open scoped ContDiff Topology |
| 16 | |
| 17 | namespace Poincare.Parabolic.Interior |
| 18 | |
| 19 | variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 20 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 21 | |
| 22 | theorem contDiff_smul_cutoff {U : Set E} (hU : IsOpen U) |
| 23 | {f : E → F} (hf : ContDiffOn ℝ ∞ f U) |
| 24 | {χ : E → ℝ} (hχ : ContDiff ℝ ∞ χ) (hsupp : tsupport χ ⊆ U) : |
| 25 | ContDiff ℝ ∞ (fun x => χ x • f x) := by |
| 26 | apply contDiff_iff_contDiffAt.mpr |
| 27 | intro x |
| 28 | by_cases hx : x ∈ tsupport χ |
| 29 | · exact hχ.contDiffAt.smul ((hf x (hsupp hx)).contDiffAt (hU.mem_nhds (hsupp hx))) |
| 30 | · apply (contDiffAt_const (c := (0 : F))).congr_of_eventuallyEq |
| 31 | filter_upwards [(notMem_tsupport_iff_eventuallyEq.mp hx)] with y hy |
| 32 | simp only [hy, Pi.zero_apply, zero_smul] |
| 33 | |
| 34 | omit [NormedSpace ℝ E] in |
| 35 | theorem hasCompactSupport_smul_cutoff {χ : E → ℝ} (hχ : HasCompactSupport χ) |
| 36 | (f : E → F) : HasCompactSupport (fun x => χ x • f x) := |
| 37 | hχ.smul_right |
| 38 | |
| 39 | omit [NormedSpace ℝ E] in |
| 40 | theorem smul_cutoff_eventuallyEq {χ : E → ℝ} {x : E} |
| 41 | (hχ : χ =ᶠ[𝓝 x] fun _ => 1) (f : E → F) : |
| 42 | (fun y => χ y • f y) =ᶠ[𝓝 x] f := by |
| 43 | filter_upwards [hχ] with y hy |
| 44 | simp only [hy, one_smul] |
| 45 | |
| 46 | theorem fderiv_smul_cutoff {χ : E → ℝ} {x : E} |
| 47 | (hχ : χ =ᶠ[𝓝 x] fun _ => 1) (f : E → F) : |
| 48 | fderiv ℝ (fun y => χ y • f y) x = fderiv ℝ f x := |
| 49 | (smul_cutoff_eventuallyEq hχ f).fderiv_eq |
| 50 | |
| 51 | theorem fderiv_fderiv_smul_cutoff {χ : E → ℝ} {x : E} |
| 52 | (hχ : χ =ᶠ[𝓝 x] fun _ => 1) (f : E → F) : |
| 53 | fderiv ℝ (fderiv ℝ (fun y => χ y • f y)) x = fderiv ℝ (fderiv ℝ f) x := |
| 54 | ((smul_cutoff_eventuallyEq hχ f).fderiv).fderiv_eq |
| 55 | |
| 56 | end Poincare.Parabolic.Interior |