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 Mathlib.Geometry.Manifold.PartitionOfUnity |
| 2 | import Mathlib.Geometry.Manifold.Instances.Real |
| 3 | |
| 4 | /-! # Compactly supported smooth cutoffs on manifolds -/ |
| 5 | |
| 6 | set_option autoImplicit false |
| 7 | |
| 8 | open Set Filter |
| 9 | open scoped Manifold ContDiff Topology BigOperators |
| 10 | |
| 11 | namespace PoincareMT |
| 12 | |
| 13 | universe u v |
| 14 | |
| 15 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [T3Space M] |
| 16 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 17 | |
| 18 | /-- A finite compactly supported smooth partition subordinate to an open cover |
| 19 | of a compact set, without countability assumptions on the manifold. -/ |
| 20 | theorem exists_finite_bump_partition {K : Set M} (hK : IsCompact K) |
| 21 | {α : Type v} (U : α → Set M) (hU : ∀ i, IsOpen (U i)) |
| 22 | (hcover : K ⊆ ⋃ i, U i) : |
| 23 | ∃ (s : Finset K) (c : s → α) (V : Set M), IsOpen V ∧ K ⊆ V ∧ |
| 24 | ∃ ρ : SmoothPartitionOfUnity s (𝓡 n) M V, |
| 25 | (∀ i, HasCompactSupport (ρ i : M → ℝ)) ∧ |
| 26 | (∀ i, tsupport (ρ i : M → ℝ) ⊆ U (c i)) := by |
| 27 | classical |
| 28 | have hex (x : K) : ∃ i, (x : M) ∈ U i := mem_iUnion.mp (hcover x.property) |
| 29 | choose c hc using hex |
| 30 | have hb (x : K) : ∃ b : SmoothBumpFunction (𝓡 n) (x : M), |
| 31 | tsupport b ⊆ U (c x) := by |
| 32 | obtain ⟨b, -, hb⟩ := (SmoothBumpFunction.nhds_basis_tsupport (I := 𝓡 n) |
| 33 | (x : M)).mem_iff.mp ((hU (c x)).mem_nhds (hc x)) |
| 34 | exact ⟨b, hb⟩ |
| 35 | choose b hb using hb |
| 36 | let W : K → Set M := fun x => interior {y | b x y = 1} |
| 37 | have hW (x : K) : (x : M) ∈ W x := |
| 38 | mem_interior_iff_mem_nhds.mpr (b x).eventuallyEq_one |
| 39 | obtain ⟨s, hs⟩ := hK.elim_finite_subcover W (fun _ => isOpen_interior) |
| 40 | (fun x hx => mem_iUnion.mpr ⟨⟨x, hx⟩, hW ⟨x, hx⟩⟩) |
| 41 | let V := ⋃ i : s, W i.val |
| 42 | have hKV : K ⊆ V := by |
| 43 | intro x hx |
| 44 | obtain ⟨i, hi, hxi⟩ := mem_iUnion₂.mp (hs hx) |
| 45 | exact mem_iUnion.mpr ⟨⟨i, hi⟩, hxi⟩ |
| 46 | let B : BumpCovering s M V := |
| 47 | { toFun := fun i => ⟨b i.val, (b i.val).continuous⟩ |
| 48 | locallyFinite' := locallyFinite_of_finite _ |
| 49 | nonneg' := fun i x => (b i.val).nonneg |
| 50 | le_one' := fun i x => (b i.val).le_one |
| 51 | eventuallyEq_one' := by |
| 52 | intro x hx |
| 53 | obtain ⟨i, hi⟩ := mem_iUnion.mp hx |
| 54 | exact ⟨i, mem_interior_iff_mem_nhds.mp hi⟩ } |
| 55 | let ρ := B.toSmoothPartitionOfUnity (fun i => (b i.val).contMDiff) |
| 56 | have hsub (i : s) : tsupport (ρ i : M → ℝ) ⊆ tsupport (b i.val) := by |
| 57 | exact closure_mono (B.support_toPartitionOfUnity_subset i) |
| 58 | refine ⟨s, fun i => c i.val, V, isOpen_iUnion (fun _ => isOpen_interior), hKV, |
| 59 | ρ, fun i => ?_, fun i => (hsub i).trans (hb i.val)⟩ |
| 60 | exact (b i.val).hasCompactSupport.mono' ((subset_tsupport (ρ i)).trans (hsub i)) |
| 61 | |
| 62 | /-- A smooth compactly supported cutoff can be chosen inside any open |
| 63 | neighborhood of a compact set, without countability assumptions. -/ |
| 64 | theorem exists_contMDiff_cutoff_of_isCompact {K U : Set M} (hK : IsCompact K) |
| 65 | (hU : IsOpen U) (hKU : K ⊆ U) : |
| 66 | ∃ χ : M → ℝ, ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ χ ∧ HasCompactSupport χ ∧ |
| 67 | tsupport χ ⊆ U ∧ (∀ x, 0 ≤ χ x ∧ χ x ≤ 1) ∧ |
| 68 | ∀ x ∈ K, χ =ᶠ[𝓝 x] 1 := by |
| 69 | classical |
| 70 | obtain ⟨s, c, V, hVo, hKV, ρ, hρc, hρU⟩ := |
| 71 | exists_finite_bump_partition (n := n) hK (fun _ : Unit => U) |
| 72 | (fun _ => hU) (fun x hx => mem_iUnion.mpr ⟨(), hKU hx⟩) |
| 73 | refine ⟨fun x => ∑ i, ρ i x, ?_, ?_, ?_, ?_, ?_⟩ |
| 74 | · simpa only [finsum_eq_sum_of_fintype] using ρ.contMDiff_sum |
| 75 | · convert HasCompactSupport.finset_sum (s := Finset.univ) (fun i _ => hρc i) using 1 |
| 76 | · rfl |
| 77 | · ext x |
| 78 | simp |
| 79 | · have hsub : tsupport (fun x => ∑ i, ρ i x) ⊆ ⋃ i, tsupport (ρ i : M → ℝ) := by |
| 80 | apply closure_minimal |
| 81 | · intro x hx |
| 82 | by_contra h |
| 83 | have hzero (i : s) : ρ i x = 0 := |
| 84 | image_eq_zero_of_notMem_tsupport (fun hi => h (mem_iUnion.mpr ⟨i, hi⟩)) |
| 85 | exact hx (by simp [hzero]) |
| 86 | · exact isClosed_iUnion_of_finite fun i => isClosed_tsupport _ |
| 87 | exact hsub.trans (iUnion_subset fun i => hρU i) |
| 88 | · intro x |
| 89 | simpa only [finsum_eq_sum_of_fintype] using |
| 90 | And.intro (ρ.sum_nonneg x) (ρ.sum_le_one x) |
| 91 | · intro x hx |
| 92 | filter_upwards [hVo.mem_nhds (hKV hx)] with y hy |
| 93 | simpa only [finsum_eq_sum_of_fintype, Pi.one_apply] using ρ.sum_eq_one hy |
| 94 | |
| 95 | end PoincareMT |