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.Manifold.Flow.TimeDependent.Local |
| 2 | import PoincareLib.Geometry.Manifold.Flow.TimeDependent.Uniqueness |
| 3 | |
| 4 | /-! |
| 5 | # Gluing and restarting time-dependent smooth integral families |
| 6 | |
| 7 | Local uniqueness glues overlapping families without changing their actual |
| 8 | time variable. Restarting composes a local initial-value family with a smooth |
| 9 | spatial slice of the preceding family. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter Bundle |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | namespace Poincare.Manifold |
| 20 | |
| 21 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | {X : ℝ → (x : M) → TangentSpace (𝓡 n) x} |
| 24 | |
| 25 | /-- A jointly smooth family solving the specified time-dependent ODE. -/ |
| 26 | structure SmoothTimeDependentIntegralFamily |
| 27 | (X : ℝ → (x : M) → TangentSpace (𝓡 n) x) |
| 28 | (V : Set M) (I : Set ℝ) (Φ : ℝ × M → M) : Prop where |
| 29 | smooth : ContMDiffOn (𝓘(ℝ, ℝ).prod (𝓡 n)) (𝓡 n) ∞ Φ (I ×ˢ V) |
| 30 | orbit : ∀ y ∈ V, ∀ t ∈ I, HasMFDerivAt 𝓘(ℝ, ℝ) (𝓡 n) (fun r => Φ (r, y)) t |
| 31 | ((1 : ℝ →L[ℝ] ℝ).smulRight (X t (Φ (t, y)))) |
| 32 | |
| 33 | omit [IsManifold (𝓡 n) ∞ M] in |
| 34 | theorem SmoothTimeDependentIntegralFamily.mono |
| 35 | {V W : Set M} {I J : Set ℝ} {Φ : ℝ × M → M} |
| 36 | (h : SmoothTimeDependentIntegralFamily X V I Φ) (hW : W ⊆ V) (hJ : J ⊆ I) : |
| 37 | SmoothTimeDependentIntegralFamily X W J Φ := |
| 38 | ⟨h.smooth.mono (prod_mono hJ hW), fun y hy t ht => h.orbit y (hW hy) t (hJ ht)⟩ |
| 39 | |
| 40 | omit [IsManifold (𝓡 n) ∞ M] in |
| 41 | theorem SmoothTimeDependentIntegralFamily.smooth_orbit |
| 42 | {V : Set M} {I : Set ℝ} {Φ : ℝ × M → M} |
| 43 | (h : SmoothTimeDependentIntegralFamily X V I Φ) {y : M} (hy : y ∈ V) : |
| 44 | ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 n) ∞ (fun t => Φ (t, y)) I := |
| 45 | h.smooth.comp (contMDiff_id.prodMk contMDiff_const).contMDiffOn (fun _ ht => ⟨ht, hy⟩) |
| 46 | |
| 47 | /-- Solution families agreeing at one common time glue on overlapping open |
| 48 | convex time domains. -/ |
| 49 | theorem SmoothTimeDependentIntegralFamily.glue [T2Space M] |
| 50 | {J I L : Set ℝ} |
| 51 | (hX : ContMDiffOn (𝓘(ℝ, ℝ).prod (𝓡 n)) ((𝓡 n).prod (𝓡 n)) 1 |
| 52 | (fun tx : ℝ × M => (⟨tx.2, X tx.1 tx.2⟩ : TangentBundle (𝓡 n) M)) |
| 53 | (J ×ˢ univ)) |
| 54 | (hI : IsOpen I) (hcI : Convex ℝ I) (hIJ : I ⊆ J) |
| 55 | (hL : IsOpen L) (hcL : Convex ℝ L) |
| 56 | {V : Set M} (hV : IsOpen V) {s : ℝ} {Φ Ψ : ℝ × M → M} |
| 57 | (hΦ : SmoothTimeDependentIntegralFamily X V I Φ) |
| 58 | (hΨ : SmoothTimeDependentIntegralFamily X V L Ψ) |
| 59 | (hs : s ∈ I ∩ L) (he : ∀ y ∈ V, Φ (s, y) = Ψ (s, y)) : |
| 60 | ∃ Ξ : ℝ × M → M, SmoothTimeDependentIntegralFamily X V (I ∪ L) Ξ ∧ |
| 61 | EqOn Ξ Φ (I ×ˢ V) ∧ EqOn Ξ Ψ (L ×ˢ V) := by |
| 62 | classical |
| 63 | let Ξ : ℝ × M → M := fun p => if p.1 ∈ I then Φ p else Ψ p |
| 64 | have heΦ : EqOn Ξ Φ (I ×ˢ V) := fun _ hp => if_pos hp.1 |
| 65 | have heΨ : EqOn Ξ Ψ (L ×ˢ V) := by |
| 66 | rintro ⟨t, y⟩ ⟨ht, hy⟩ |
| 67 | by_cases htI : t ∈ I |
| 68 | · change (if t ∈ I then Φ (t, y) else Ψ (t, y)) = Ψ (t, y) |
| 69 | rw [if_pos htI] |
| 70 | exact timeDependent_integralCurve_eqOn (hI.inter hL) |
| 71 | (hcI.inter hcL).isPreconnected |
| 72 | (hX.mono (prod_mono (inter_subset_left.trans hIJ) subset_rfl)) |
| 73 | (fun r hr => hΦ.orbit y hy r hr.1) |
| 74 | (fun r hr => hΨ.orbit y hy r hr.2) hs (he y hy) ⟨htI, ht⟩ |
| 75 | · exact if_neg htI |
| 76 | have hlocal {D : Set ℝ} (hD : IsOpen D) {F : ℝ × M → M} |
| 77 | (hF : SmoothTimeDependentIntegralFamily X V D F) |
| 78 | (heF : EqOn Ξ F (D ×ˢ V)) : |
| 79 | SmoothTimeDependentIntegralFamily X V D Ξ := by |
| 80 | refine ⟨?_, ?_⟩ |
| 81 | · rintro ⟨t, y⟩ ⟨ht, hy⟩ |
| 82 | have hev : Ξ =ᶠ[𝓝 (t, y)] F := |
| 83 | Filter.Eventually.mono ((hD.prod hV).mem_nhds ⟨ht, hy⟩) (fun _ hp => heF hp) |
| 84 | exact ((hF.smooth.contMDiffAt ((hD.prod hV).mem_nhds ⟨ht, hy⟩)).congr_of_eventuallyEq |
| 85 | hev).contMDiffWithinAt |
| 86 | · intro y hy t ht |
| 87 | have hev : (fun r => Ξ (r, y)) =ᶠ[𝓝 t] (fun r => F (r, y)) := |
| 88 | Filter.Eventually.mono (hD.mem_nhds ht) (fun r hr => heF ⟨hr, hy⟩) |
| 89 | have heval : Ξ (t, y) = F (t, y) := heF ⟨ht, hy⟩ |
| 90 | apply ((hF.orbit y hy t ht).congr_of_eventuallyEq hev).congr_mfderiv |
| 91 | rw [heval] |
| 92 | have hleft := hlocal hI hΦ heΦ |
| 93 | have hright := hlocal hL hΨ heΨ |
| 94 | refine ⟨Ξ, ⟨?_, ?_⟩, heΦ, heΨ⟩ |
| 95 | · rintro ⟨t, y⟩ ⟨ht | ht, hy⟩ |
| 96 | · exact (hleft.smooth.contMDiffAt ((hI.prod hV).mem_nhds ⟨ht, hy⟩)).contMDiffWithinAt |
| 97 | · exact (hright.smooth.contMDiffAt ((hL.prod hV).mem_nhds ⟨ht, hy⟩)).contMDiffWithinAt |
| 98 | · intro y hy t ht |
| 99 | rcases ht with ht | ht |
| 100 | · exact hleft.orbit y hy t ht |
| 101 | · exact hright.orbit y hy t ht |
| 102 | |
| 103 | omit [IsManifold (𝓡 n) ∞ M] in |
| 104 | /-- Restart a family from one of its spatial slices, retaining absolute time. -/ |
| 105 | theorem SmoothTimeDependentIntegralFamily.restart |
| 106 | {V W : Set M} {I L : Set ℝ} {s : ℝ} {Φ Ψ : ℝ × M → M} |
| 107 | (hV : IsOpen V) (hW : IsOpen W) (hI : IsOpen I) (hL : IsOpen L) (hs : s ∈ I) |
| 108 | (hΦ : SmoothTimeDependentIntegralFamily X V I Φ) |
| 109 | (hΨ : SmoothTimeDependentIntegralFamily X W L Ψ) : |
| 110 | IsOpen (V ∩ (fun y => Φ (s, y)) ⁻¹' W) ∧ |
| 111 | SmoothTimeDependentIntegralFamily X (V ∩ (fun y => Φ (s, y)) ⁻¹' W) |
| 112 | L (fun p => Ψ (p.1, Φ (s, p.2))) := by |
| 113 | have hslice (y : M) (hy : y ∈ V) : |
| 114 | ContMDiffAt (𝓡 n) (𝓡 n) ∞ (fun z => Φ (s, z)) y := |
| 115 | (hΦ.smooth.contMDiffAt ((hI.prod hV).mem_nhds ⟨hs, hy⟩)).comp y |
| 116 | (contMDiffAt_const.prodMk contMDiffAt_id) |
| 117 | refine ⟨(show ContinuousOn (fun y => Φ (s, y)) V from |
| 118 | fun y hy => (hslice y hy).continuousAt.continuousWithinAt).isOpen_inter_preimage hV hW, |
| 119 | ⟨?_, ?_⟩⟩ |
| 120 | · rintro ⟨t, y⟩ ⟨ht, hy⟩ |
| 121 | have hsecond : ContMDiffAt (𝓘(ℝ, ℝ).prod (𝓡 n)) (𝓡 n) ∞ |
| 122 | (fun p : ℝ × M => Φ (s, p.2)) (t, y) := |
| 123 | (hΦ.smooth.contMDiffAt ((hI.prod hV).mem_nhds |
| 124 | (show (s, y) ∈ I ×ˢ V from ⟨hs, hy.1⟩))).comp |
| 125 | (t, y) (contMDiffAt_const.prodMk contMDiffAt_snd) |
| 126 | exact ((hΨ.smooth.contMDiffAt ((hL.prod hW).mem_nhds |
| 127 | (show (t, Φ (s, y)) ∈ L ×ˢ W from ⟨ht, hy.2⟩))).comp |
| 128 | (t, y) (contMDiffAt_fst.prodMk hsecond)).contMDiffWithinAt |
| 129 | · exact fun y hy t ht => hΨ.orbit _ hy.2 t ht |
| 130 | |
| 131 | end Poincare.Manifold |