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.Geometry.RicciFlow.ReducedGeometry.LGeometry.Basic |
| 2 | import Mathlib.Geometry.Manifold.ContMDiffMFDeriv |
| 3 | import Mathlib.Geometry.Manifold.VectorBundle.ContMDiffSection |
| 4 | import Mathlib.Topology.Algebra.Support |
| 5 | |
| 6 | /-! |
| 7 | # Finite sums of locally defined parametric spatial fields |
| 8 | |
| 9 | The weighted sum is lifted to a genuine product tangent section before being |
| 10 | projected back to the spatial tangent bundle. Terms vanish on the complement |
| 11 | of their weight support, so the construction remains smooth on the stated |
| 12 | open domain. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option maxSynthPendingDepth 3 |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle Topology BigOperators |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.ReducedLengthMinimum.Variation.Geometry |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 26 | [IsManifold (𝓡 n) ∞ M] |
| 27 | |
| 28 | local notation "V" => EuclideanSpace ℝ (Fin n) |
| 29 | local notation "P" => ModelWithCorners.prod (𝓘(ℝ, ℝ)) (𝓡 n) |
| 30 | |
| 31 | set_option backward.isDefEq.respectTransparency false in |
| 32 | theorem parametricField_lift_smooth |
| 33 | (X : ℝ → (x : M) → TangentSpace (𝓡 n) x) (D : Set (ℝ × M)) |
| 34 | (hX : ContMDiffOn P ((𝓡 n).prod (𝓡 n)) ∞ |
| 35 | (fun z : ℝ × M ↦ (⟨z.2, X z.1 z.2⟩ : TangentBundle (𝓡 n) M)) D) : |
| 36 | ContMDiffOn P ((P).prod (𝓘(ℝ, ℝ × V))) ∞ |
| 37 | (fun z : ℝ × M ↦ (⟨z, (0, X z.1 z.2)⟩ : TangentBundle P (ℝ × M))) D := by |
| 38 | have htime : ContMDiff P ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) ∞ |
| 39 | (fun z : ℝ × M ↦ (⟨z.1, (0 : ℝ)⟩ : TangentBundle (𝓘(ℝ, ℝ)) ℝ)) := |
| 40 | (Bundle.contMDiff_zeroSection (IB := 𝓘(ℝ, ℝ)) (F := ℝ) (𝕜 := ℝ) |
| 41 | (E := (TangentSpace (𝓘(ℝ, ℝ)) : ℝ → Type _))).comp contMDiff_fst |
| 42 | exact contMDiff_equivTangentBundleProd_symm.comp_contMDiffOn |
| 43 | (htime.contMDiffOn.prodMk hX) |
| 44 | |
| 45 | set_option backward.isDefEq.respectTransparency false in |
| 46 | theorem weightedParametricField_smooth {ι : Type*} [Fintype ι] |
| 47 | (ρ : ι → ℝ → ℝ) (hρ : ∀ i, ContDiff ℝ ∞ (ρ i)) |
| 48 | (U : ι → Set ℝ) (O : ι → Set M) (hU : ∀ i, IsOpen (U i)) (hO : ∀ i, IsOpen (O i)) |
| 49 | (X : ι → ℝ → (x : M) → TangentSpace (𝓡 n) x) |
| 50 | (hX : ∀ i, ContMDiffOn P ((𝓡 n).prod (𝓡 n)) ∞ |
| 51 | (fun z : ℝ × M ↦ (⟨z.2, X i z.1 z.2⟩ : TangentBundle (𝓡 n) M)) (U i ×ˢ O i)) : |
| 52 | ContMDiffOn P ((𝓡 n).prod (𝓡 n)) ∞ |
| 53 | (fun z : ℝ × M ↦ |
| 54 | (⟨z.2, ∑ i, ρ i z.1 • X i z.1 z.2⟩ : TangentBundle (𝓡 n) M)) |
| 55 | (⋂ i, ((tsupport (ρ i))ᶜ ×ˢ Set.univ) ∪ (U i ×ˢ O i)) := by |
| 56 | classical |
| 57 | let D : Set (ℝ × M) := ⋂ i, ((tsupport (ρ i))ᶜ ×ˢ Set.univ) ∪ (U i ×ˢ O i) |
| 58 | let A : ι → (z : ℝ × M) → TangentSpace P z := fun i z ↦ (0, X i z.1 z.2) |
| 59 | have hAi (i : ι) : ContMDiffOn P ((P).prod (𝓘(ℝ, ℝ × V))) ∞ |
| 60 | (fun z : ℝ × M ↦ (⟨z, ρ i z.1 • A i z⟩ : TangentBundle P (ℝ × M))) D := by |
| 61 | intro z hz |
| 62 | have hz' := Set.mem_iInter.mp hz i |
| 63 | rcases hz' with hz0 | hzU |
| 64 | · have hN : IsOpen ((tsupport (ρ i))ᶜ ×ˢ (Set.univ : Set M)) := |
| 65 | (isClosed_tsupport (ρ i)).isOpen_compl.prod isOpen_univ |
| 66 | apply (Bundle.contMDiffAt_zeroSection (IB := P) (F := ℝ × V) |
| 67 | (E := TangentSpace P) (n := ∞) (x := z)).congr_of_eventuallyEq |
| 68 | (f₁ := fun w : ℝ × M ↦ (⟨w, ρ i w.1 • A i w⟩ : TangentBundle P (ℝ × M))) ?_ |
| 69 | |>.contMDiffWithinAt |
| 70 | filter_upwards [hN.mem_nhds hz0] with w hw |
| 71 | have hzero : ρ i w.1 = 0 := by |
| 72 | by_contra hn |
| 73 | exact hw.1 (subset_tsupport (ρ i) (Function.mem_support.mpr hn)) |
| 74 | simp [hzero, Bundle.zeroSection] |
| 75 | · have hs := ((hρ i).contMDiff.comp contMDiff_fst).contMDiffOn.smul_section |
| 76 | (parametricField_lift_smooth (X i) (U i ×ˢ O i) (hX i)) |
| 77 | exact (hs.contMDiffAt ((hU i).prod (hO i) |>.mem_nhds hzU)).contMDiffWithinAt |
| 78 | have hsum : ContMDiffOn P ((P).prod (𝓘(ℝ, ℝ × V))) ∞ |
| 79 | (fun z : ℝ × M ↦ |
| 80 | (⟨z, ∑ i, ρ i z.1 • A i z⟩ : TangentBundle P (ℝ × M))) D := |
| 81 | ContMDiffOn.sum_section (fun i _ ↦ hAi i) |
| 82 | have hproj : ContMDiff ((P).prod (𝓘(ℝ, ℝ × V))) ((𝓡 n).prod (𝓡 n)) ∞ |
| 83 | (tangentMap P (𝓡 n) (@Prod.snd ℝ M)) := |
| 84 | (contMDiff_snd (n := ∞)).contMDiff_tangentMap (by simp) |
| 85 | have h := hproj.comp_contMDiffOn hsum |
| 86 | apply h.congr |
| 87 | intro z hz |
| 88 | change (⟨z.2, ∑ i, ρ i z.1 • X i z.1 z.2⟩ : TangentBundle (𝓡 n) M) = |
| 89 | tangentMap P (𝓡 n) (@Prod.snd ℝ M) ⟨z, ∑ i, ρ i z.1 • A i z⟩ |
| 90 | rw [tangentMap_prodSnd] |
| 91 | apply congrArg (fun v : TangentSpace (𝓡 n) z.2 ↦ |
| 92 | (⟨z.2, v⟩ : TangentBundle (𝓡 n) M)) |
| 93 | change (∑ i, ρ i z.1 • X i z.1 z.2) = (∑ i, ρ i z.1 • A i z).2 |
| 94 | calc |
| 95 | _ = ∑ i, (ContinuousLinearMap.snd ℝ ℝ V) (ρ i z.1 • A i z) := rfl |
| 96 | _ = _ := (map_sum (ContinuousLinearMap.snd ℝ ℝ V) _ _).symm |
| 97 | |
| 98 | end PoincareMT.ReducedLengthMinimum.Variation.Geometry |