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.Variation.Extension.SmoothSectionExtension |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.SmoothEndpointExtension |
| 3 | |
| 4 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/ClosedSectionExtension.lean` at |
| 5 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 6 | |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | open Set Filter |
| 14 | open scoped Manifold ContDiff Bundle Topology |
| 15 | |
| 16 | universe u v |
| 17 | |
| 18 | namespace PoincareMT.LGeometry |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | |
| 23 | def gluedClosedParametricSectionExtension {ι : Type v} {C : Set ℝ} |
| 24 | (O : TopologicalSpace.Opens ℝ) (hCO : C ⊆ O) |
| 25 | (ρ : SmoothPartitionOfUnity ι (𝓘(ℝ, ℝ)) O univ) |
| 26 | (V : ι → Set ℝ) (α : ℝ → M) (Y : ∀ s, TangentSpace (𝓡 n) (α s)) |
| 27 | (E : ∀ i, ParametricAlongCurveExtensionOn (C ∩ V i) α Y) |
| 28 | (hgraph : ∀ i s, s ∈ V i → (s, α s) ∈ (E i).domain) |
| 29 | (hρ : ρ.IsSubordinate (fun i ↦ (Subtype.val : O → ℝ) ⁻¹' V i)) : |
| 30 | ParametricAlongCurveExtensionOn C α Y where |
| 31 | extension := parametricWeightedSum O ρ (fun i ↦ (E i).extension) |
| 32 | domain := curveGluingDomain O ρ (fun i ↦ (E i).domain) |
| 33 | open_domain := curveGluingDomain_open O ρ _ (fun i ↦ (E i).open_domain) |
| 34 | graph_mem s hs := curveGluingDomain_graph_mem O ρ _ α |
| 35 | (fun t i ht ↦ hgraph i t (hρ i ht)) ⟨s, hCO hs⟩ |
| 36 | smooth z hz := by |
| 37 | rcases hz with ⟨⟨s, x⟩, hz, rfl⟩ |
| 38 | have hdomain := (mem_curveGluingRelativeDomain O ρ (fun i ↦ (E i).domain)).mp hz |
| 39 | have hpieces : ∀ i ∈ ρ.fintsupport s, |
| 40 | ContMDiffAt ((𝓘(ℝ, ℝ)).prod (𝓡 n)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 41 | (fun w : ℝ × M ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) w.2 |
| 42 | (timePartitionWeight O ρ i w.1 • (E i).extension w.1 w.2)) ((s : ℝ), x) := by |
| 43 | intro i hi |
| 44 | exact parametricExtension_contMDiffAt_smul_reparam (E i) (f := id) |
| 45 | (hdomain i ((ρ.mem_fintsupport_iff s i).mp hi)) contDiffAt_id |
| 46 | (timePartitionWeight_contDiffAt O ρ i s) |
| 47 | have hsum := contMDiffAt_sum_parametric (ρ.fintsupport s) |
| 48 | (fun i r y ↦ timePartitionWeight O ρ i r • (E i).extension r y) hpieces |
| 49 | apply ContMDiffAt.contMDiffWithinAt |
| 50 | apply hsum.congr_of_eventuallyEq |
| 51 | have hnear : ∀ᶠ w : ℝ × M in 𝓝 ((s : ℝ), x), ∀ y : M, |
| 52 | parametricWeightedSum O ρ (fun i ↦ (E i).extension) w.1 y = |
| 53 | ∑ i ∈ ρ.fintsupport s, timePartitionWeight O ρ i w.1 • |
| 54 | (E i).extension w.1 y := |
| 55 | (continuous_fst.continuousAt : ContinuousAt (Prod.fst : ℝ × M → ℝ) |
| 56 | ((s : ℝ), x)).eventually |
| 57 | (parametricWeightedSum_eventually_eq_sum O ρ (fun i ↦ (E i).extension) s) |
| 58 | filter_upwards [hnear] with w hw |
| 59 | exact congrArg (fun v : TangentSpace (𝓡 n) w.2 ↦ |
| 60 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) w.2 v) (hw w.2) |
| 61 | agrees t ht := by |
| 62 | let s : O := ⟨t, hCO ht⟩ |
| 63 | have hS := (timePartitionWeight_eventually_support_subset O ρ s).self_of_nhds |
| 64 | rw [parametricWeightedSum_eq_sum O ρ (fun i ↦ (E i).extension) (α t) hS] |
| 65 | calc |
| 66 | (∑ i ∈ ρ.fintsupport s, timePartitionWeight O ρ i t • (E i).extension t (α t)) = |
| 67 | ∑ i ∈ ρ.fintsupport s, timePartitionWeight O ρ i t • Y t := by |
| 68 | apply Finset.sum_congr rfl |
| 69 | intro i hi |
| 70 | rw [(E i).agrees t ⟨ht, hρ i ((ρ.mem_fintsupport_iff s i).mp hi)⟩] |
| 71 | _ = (∑ i ∈ ρ.fintsupport s, timePartitionWeight O ρ i t) • Y t := |
| 72 | (Finset.sum_smul ..).symm |
| 73 | _ = Y t := by rw [timePartitionWeight_sum_eq_one O ρ s hS, one_smul] |
| 74 | |
| 75 | theorem exists_closedSectionExtension_of_local {C : Set ℝ} |
| 76 | (α : ℝ → M) (Y : ∀ s, TangentSpace (𝓡 n) (α s)) |
| 77 | (hloc : ∀ s ∈ C, ∃ V : Set ℝ, IsOpen V ∧ s ∈ V ∧ |
| 78 | ∃ E : ParametricAlongCurveExtensionOn (C ∩ V) α Y, |
| 79 | ∀ t ∈ V, (t, α t) ∈ E.domain) : |
| 80 | Nonempty (ParametricAlongCurveExtensionOn C α Y) := by |
| 81 | classical |
| 82 | choose V hV hsV E hgraph using fun s : C ↦ hloc s s.property |
| 83 | let O : TopologicalSpace.Opens ℝ := ⟨⋃ i : C, V i, isOpen_iUnion hV⟩ |
| 84 | have hCO : C ⊆ O := fun s hs ↦ mem_iUnion.mpr ⟨⟨s, hs⟩, hsV ⟨s, hs⟩⟩ |
| 85 | let : LocallyCompactSpace O := O.isOpen.locallyCompactSpace |
| 86 | have hcover : (univ : Set O) ⊆ ⋃ i : C, (Subtype.val : O → ℝ) ⁻¹' V i := by |
| 87 | intro s _ |
| 88 | obtain ⟨i, hi⟩ := mem_iUnion.mp s.property |
| 89 | exact mem_iUnion.mpr ⟨i, hi⟩ |
| 90 | obtain ⟨ρ, hρ⟩ : ∃ ρ : SmoothPartitionOfUnity C (𝓘(ℝ, ℝ)) O univ, |
| 91 | ρ.IsSubordinate (fun i ↦ (Subtype.val : O → ℝ) ⁻¹' V i) := |
| 92 | SmoothPartitionOfUnity.exists_isSubordinate (𝓘(ℝ, ℝ)) isClosed_univ _ |
| 93 | (fun i ↦ (hV i).preimage continuous_subtype_val) hcover |
| 94 | exact ⟨gluedClosedParametricSectionExtension O hCO ρ V α Y E hgraph hρ⟩ |
| 95 | |
| 96 | set_option maxHeartbeats 1000000 in |
| 97 | theorem exists_local_closedSectionExtension {a b : ℝ} (hab : a < b) |
| 98 | {U : Set ℝ} (hU : IsOpen U) (hCU : Icc a b ⊆ U) |
| 99 | (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 100 | (Y : ∀ s, TangentSpace (𝓡 n) (α s)) |
| 101 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 102 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (Y s)) (Icc a b)) |
| 103 | {s : ℝ} (hs : s ∈ Icc a b) : |
| 104 | ∃ V : Set ℝ, IsOpen V ∧ s ∈ V ∧ |
| 105 | ∃ E : ParametricAlongCurveExtensionOn (Icc a b ∩ V) α Y, |
| 106 | ∀ t ∈ V, (t, α t) ∈ E.domain := by |
| 107 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) (α s) |
| 108 | have hnear : U ∩ α ⁻¹' e.baseSet ∈ 𝓝 s := by |
| 109 | refine inter_mem (hU.mem_nhds (hCU hs)) ?_ |
| 110 | exact ((hα s (hCU hs)).contMDiffAt (hU.mem_nhds (hCU hs))).continuousAt.preimage_mem_nhds |
| 111 | (e.open_baseSet.mem_nhds (mem_baseSet_trivializationAt _ _ _)) |
| 112 | obtain ⟨l, r, ⟨hls, hsr⟩, hchart⟩ := mem_nhds_iff_exists_Ioo_subset.mp hnear |
| 113 | let l' := (l + s) / 2 |
| 114 | let r' := (s + r) / 2 |
| 115 | let c := max a l' |
| 116 | let d := min b r' |
| 117 | have hll : l < l' := by dsimp only [l']; linarith |
| 118 | have hls' : l' < s := by dsimp only [l']; linarith |
| 119 | have hsr' : s < r' := by dsimp only [r']; linarith |
| 120 | have hrr : r' < r := by dsimp only [r']; linarith |
| 121 | have hcd : c < d := max_lt |
| 122 | (lt_min hab (hs.1.trans_lt hsr')) |
| 123 | (lt_min (hls'.trans_le hs.2) (hls'.trans hsr')) |
| 124 | have hsub : Icc c d ⊆ Icc a b := |
| 125 | Icc_subset_Icc (le_max_left _ _) (min_le_left _ _) |
| 126 | have hsrc : ∀ t ∈ Icc c d, α t ∈ e.baseSet := by |
| 127 | intro t ht |
| 128 | exact (hchart ⟨hll.trans_le ((le_max_right _ _).trans ht.1), |
| 129 | (ht.2.trans (min_le_right _ _)).trans_lt hrr⟩).2 |
| 130 | let y := fun t ↦ (e (Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α t) (Y t))).2 |
| 131 | have hpair := e.contMDiffOn.comp (hY.mono hsub) |
| 132 | (fun t ht ↦ e.mem_source.mpr (hsrc t ht)) |
| 133 | have hy : ContDiffOn ℝ ∞ y (Icc c d) := |
| 134 | ContMDiffOn.contDiffOn (fun t ht ↦ (hpair t ht).snd) |
| 135 | obtain ⟨g, hg, hgy⟩ := exists_smooth_extension_Icc hcd y hy |
| 136 | let V := Ioo l' r' |
| 137 | have hVsrc : ∀ t ∈ V, α t ∈ e.baseSet := fun t ht ↦ |
| 138 | (hchart ⟨hll.trans ht.1, ht.2.trans hrr⟩).2 |
| 139 | have hVsub : Icc a b ∩ V ⊆ Icc c d := fun t ht ↦ |
| 140 | ⟨max_le ht.1.1 ht.2.1.le, le_min ht.1.2 ht.2.2.le⟩ |
| 141 | let E : ParametricAlongCurveExtensionOn (Icc a b ∩ V) α Y := |
| 142 | parametricExtensionInChart e g isOpen_Ioo inter_subset_right |
| 143 | (fun t ht ↦ hVsrc t ht.2) hg.contMDiff.contMDiffOn (by |
| 144 | intro t ht |
| 145 | rw [hgy (hVsub ht)] |
| 146 | exact e.symm_apply_apply_mk (hVsrc t ht.2) (Y t)) |
| 147 | exact ⟨V, isOpen_Ioo, ⟨hls', hsr'⟩, E, fun t ht ↦ ⟨ht, hVsrc t ht⟩⟩ |
| 148 | |
| 149 | theorem exists_closedSectionExtension {a b : ℝ} (hab : a < b) |
| 150 | {U : Set ℝ} (hU : IsOpen U) (hCU : Icc a b ⊆ U) |
| 151 | (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 152 | (Y : ∀ s, TangentSpace (𝓡 n) (α s)) |
| 153 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 154 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (Y s)) (Icc a b)) : |
| 155 | Nonempty (ParametricAlongCurveExtensionOn (Icc a b) α Y) := |
| 156 | exists_closedSectionExtension_of_local α Y |
| 157 | (fun _ hs ↦ exists_local_closedSectionExtension hab hU hCU α hα Y hY hs) |
| 158 | |
| 159 | end PoincareMT.LGeometry |