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.Compactness.GeometricLimit.Overlap.Gluing |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.Overlap.SourceSmooth |
| 3 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.Overlap.SmoothLimit |
| 4 | import PoincareLib.Geometry.Manifold.Gluing.Smooth |
| 5 | |
| 6 | /-! |
| 7 | # Smoothness of distance-limit overlaps |
| 8 | |
| 9 | The eventual source domains are constructed by metric confinement. Bounds for |
| 10 | their coordinate derivatives then make the zero-distance transition smooth. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | open Set Filter Metric Poincare.Gluing Poincare.Analysis.Calculus |
| 15 | open scoped Topology NNReal Manifold ContDiff |
| 16 | |
| 17 | namespace PoincareMT.ChartDistance |
| 18 | |
| 19 | variable {ι : Type*} {n : ℕ} |
| 20 | (U : ι → Set (EuclideanSpace ℝ (Fin n))) (hU : ∀ i, IsOpen (U i)) |
| 21 | [∀ i, Nonempty (Piece U i)] |
| 22 | |
| 23 | noncomputable def coordinateRepresentative {i j : ι} (f : Piece U i → Piece U j) |
| 24 | (x : EuclideanSpace ℝ (Fin n)) : EuclideanSpace ℝ (Fin n) := |
| 25 | f ((hU i).isOpenEmbedding_subtypeVal.toOpenPartialHomeomorph.symm x) |
| 26 | |
| 27 | @[simp] theorem coordinateRepresentative_apply {i j : ι} |
| 28 | (f : Piece U i → Piece U j) (x : Piece U i) : |
| 29 | coordinateRepresentative U hU f x = (f x : EuclideanSpace ℝ (Fin n)) := by |
| 30 | simp [coordinateRepresentative, Topology.IsOpenEmbedding.toOpenPartialHomeomorph_left_inv] |
| 31 | |
| 32 | theorem contDiffOn_coordinateRepresentative {i j : ι} {f : Piece U i → Piece U j} |
| 33 | {V : Set (Piece U i)} |
| 34 | (hf : letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 35 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 36 | ContMDiffOn (𝓡 n) (𝓡 n) ∞ f V) : |
| 37 | ContDiffOn ℝ ∞ (coordinateRepresentative U hU f) (Subtype.val '' V) := by |
| 38 | let : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 39 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 40 | have hinv := contMDiffOn_isOpenEmbedding_symm (I := 𝓡 n) (n := ∞) |
| 41 | (hU i).isOpenEmbedding_subtypeVal |
| 42 | have hval := contMDiff_isOpenEmbedding (I := 𝓡 n) (n := ∞) |
| 43 | (hU j).isOpenEmbedding_subtypeVal |
| 44 | have hmap : MapsTo ((hU i).isOpenEmbedding_subtypeVal.toOpenPartialHomeomorph.symm) |
| 45 | (Subtype.val '' V) V := by |
| 46 | rintro _ ⟨x, hx, rfl⟩ |
| 47 | simpa only [Topology.IsOpenEmbedding.toOpenPartialHomeomorph_left_inv] using hx |
| 48 | exact (hval.comp_contMDiffOn |
| 49 | (hf.comp (hinv.mono (image_subset_range _ _)) hmap)).contDiffOn |
| 50 | |
| 51 | theorem contMDiffOn_of_coordinateRepresentative {i j : ι} {f : Piece U i → Piece U j} |
| 52 | {V : Set (Piece U i)} |
| 53 | (hf : ContDiffOn ℝ ∞ (coordinateRepresentative U hU f) (Subtype.val '' V)) : |
| 54 | letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 55 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 56 | ContMDiffOn (𝓡 n) (𝓡 n) ∞ f V := by |
| 57 | let : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 58 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 59 | have hval := contMDiff_isOpenEmbedding (I := 𝓡 n) (n := ∞) |
| 60 | (hU i).isOpenEmbedding_subtypeVal |
| 61 | have hcoord := hf.contMDiffOn.comp hval.contMDiffOn (mapsTo_image _ _) |
| 62 | have hinv := contMDiffOn_isOpenEmbedding_symm (I := 𝓡 n) (n := ∞) |
| 63 | (hU j).isOpenEmbedding_subtypeVal |
| 64 | have hmap : MapsTo (fun x : Piece U i => coordinateRepresentative U hU f x) |
| 65 | V (range (Subtype.val : Piece U j → EuclideanSpace ℝ (Fin n))) := by |
| 66 | intro x hx |
| 67 | exact ⟨f x, (coordinateRepresentative_apply U hU f x).symm⟩ |
| 68 | apply (hinv.comp hcoord hmap).congr |
| 69 | intro x hx |
| 70 | simp only [Function.comp_apply, coordinateRepresentative_apply, |
| 71 | Topology.IsOpenEmbedding.toOpenPartialHomeomorph_left_inv] |
| 72 | |
| 73 | set_option backward.isDefEq.respectTransparency false in |
| 74 | theorem mfderiv_eq_coordinateRepresentative {i j : ι} {f : Piece U i → Piece U j} |
| 75 | (x : Piece U i) |
| 76 | (hf : letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 77 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 78 | MDifferentiableAt (𝓡 n) (𝓡 n) f x) : |
| 79 | letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 80 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 81 | mfderiv (𝓡 n) (𝓡 n) f x = fderiv ℝ (coordinateRepresentative U hU f) x := by |
| 82 | let : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 83 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 84 | rw [mfderiv, if_pos hf] |
| 85 | change fderivWithin ℝ (coordinateRepresentative U hU f) (range id) x = _ |
| 86 | rw [range_id, fderivWithin_univ] |
| 87 | |
| 88 | variable {M : ℕ → Type*} [∀ k, MetricSpace (M k)] |
| 89 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin n)) (M k)] |
| 90 | [∀ k, IsManifold (𝓡 n) ∞ (M k)] |
| 91 | {e : ∀ k i, Piece U i → M k} |
| 92 | {D : ∀ i j, C(Piece U i × Piece U j, ℝ)} |
| 93 | (hD : ∀ i j x y, Tendsto (fun k => dist (e k i x) (e k j y)) atTop |
| 94 | (𝓝 (D i j (x, y)))) |
| 95 | (L : ι → ℝ≥0) (he : ∀ k i, LipschitzWith (L i) (e k i)) |
| 96 | (c : ι → ℝ) (hc : ∀ i, 0 < c i) |
| 97 | (hlower : ∀ k i x y, c i * dist x y ≤ dist (e k i x) (e k i y)) |
| 98 | (hopen : ∀ k i, Topology.IsOpenEmbedding (e k i)) |
| 99 | (hconn : ∀ k (p : M k) r, IsPreconnected (ball p r)) |
| 100 | (hsmooth : letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 101 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 102 | ∀ k i, IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ (e k i)) |
| 103 | |
| 104 | include hD he hc hlower hopen hconn in |
| 105 | omit [∀ k, IsManifold (𝓡 n) ∞ (M k)] |
| 106 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin n)) (M k)] in |
| 107 | theorem coordinate_source_transition_tendsto (i j : ι) |
| 108 | {x : EuclideanSpace ℝ (Fin n)} |
| 109 | (hx : x ∈ Subtype.val '' overlap (fun i j => D i j) i j) : |
| 110 | Tendsto (fun k => coordinateRepresentative U hU |
| 111 | (fun y => Function.invFun (e k j) (e k i y)) x) atTop |
| 112 | (𝓝 (coordinateRepresentative U hU (transition (fun i j => D i j) i j) x)) := by |
| 113 | let : ∀ i, LocallyCompactSpace (Piece U i) := fun i => (hU i).locallyCompactSpace |
| 114 | obtain ⟨x, hx, rfl⟩ := hx |
| 115 | simp only [coordinateRepresentative_apply] |
| 116 | exact continuous_subtype_val.continuousAt.tendsto.comp |
| 117 | (tendsto_source_transition hD L he c hc hlower hopen hconn hx) |
| 118 | |
| 119 | include hD he hc hlower hopen hconn hsmooth in |
| 120 | theorem exists_eventually_contDiffOn_coordinate_source_transition (i j : ι) |
| 121 | {x : EuclideanSpace ℝ (Fin n)} |
| 122 | (hx : x ∈ Subtype.val '' overlap (fun i j => D i j) i j) : |
| 123 | ∃ V : Set (EuclideanSpace ℝ (Fin n)), IsOpen V ∧ x ∈ V ∧ |
| 124 | V ⊆ Subtype.val '' overlap (fun i j => D i j) i j ∧ |
| 125 | ∀ᶠ k in atTop, ContDiffOn ℝ ∞ |
| 126 | (coordinateRepresentative U hU (fun y => Function.invFun (e k j) (e k i y))) V := by |
| 127 | let : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 128 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 129 | let : ∀ i, IsManifold (𝓡 n) ∞ (Piece U i) := |
| 130 | fun i => (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 131 | let : ∀ i, LocallyCompactSpace (Piece U i) := fun i => (hU i).locallyCompactSpace |
| 132 | obtain ⟨x, hx, rfl⟩ := hx |
| 133 | obtain ⟨V, hV, hxV, hVoverlap, hVsmooth⟩ := |
| 134 | exists_eventually_smooth_source_transition hD L he c hc hlower hopen hconn hsmooth hx |
| 135 | refine ⟨Subtype.val '' V, (hU i).isOpenEmbedding_subtypeVal.isOpenMap _ hV, |
| 136 | mem_image_of_mem _ hxV, image_mono hVoverlap, ?_⟩ |
| 137 | exact hVsmooth.mono fun k hk => contDiffOn_coordinateRepresentative U hU hk |
| 138 | |
| 139 | include hD he hc hlower hopen hconn hsmooth in |
| 140 | theorem overlapSystem_smooth |
| 141 | (hbound : ∀ i j, LocallyEventuallyBoundedDerivatives |
| 142 | (Subtype.val '' overlap (fun i j => D i j) i j) |
| 143 | (fun k => coordinateRepresentative U hU |
| 144 | (fun x => Function.invFun (e k j) (e k i x)))) : |
| 145 | letI : ∀ i, LocallyCompactSpace (Piece U i) := fun i => (hU i).locallyCompactSpace |
| 146 | SmoothOverlap U hU (overlapSystem hD L he c hc hlower hopen hconn) := by |
| 147 | let : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 148 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 149 | let : ∀ i, IsManifold (𝓡 n) ∞ (Piece U i) := |
| 150 | fun i => (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 151 | let : ∀ i, LocallyCompactSpace (Piece U i) := fun i => (hU i).locallyCompactSpace |
| 152 | intro i j |
| 153 | apply contMDiffOn_of_coordinateRepresentative U hU |
| 154 | exact contDiffOn_of_locally_eventually_smooth |
| 155 | (fun _ hx => coordinate_source_transition_tendsto U hU hD L he c hc hlower hopen hconn |
| 156 | i j hx) |
| 157 | (fun _ hx => exists_eventually_contDiffOn_coordinate_source_transition U hU hD L he c hc |
| 158 | hlower hopen hconn hsmooth i j hx) (hbound i j) |
| 159 | |
| 160 | include hD he hc hlower hopen hconn hsmooth in |
| 161 | theorem tendsto_coordinate_source_transition_jet (i j : ι) |
| 162 | (hbound : LocallyEventuallyBoundedDerivatives |
| 163 | (Subtype.val '' overlap (fun i j => D i j) i j) |
| 164 | (fun k => coordinateRepresentative U hU |
| 165 | (fun x => Function.invFun (e k j) (e k i x)))) |
| 166 | (m : ℕ) {x : EuclideanSpace ℝ (Fin n)} |
| 167 | (hx : x ∈ Subtype.val '' overlap (fun i j => D i j) i j) : |
| 168 | Tendsto (fun k => iteratedFDeriv ℝ m (coordinateRepresentative U hU |
| 169 | (fun y => Function.invFun (e k j) (e k i y))) x) atTop |
| 170 | (𝓝 (iteratedFDeriv ℝ m |
| 171 | (coordinateRepresentative U hU (transition (fun i j => D i j) i j)) x)) := |
| 172 | tendsto_iteratedFDeriv_of_locally_eventually_smooth |
| 173 | (fun _ hx => coordinate_source_transition_tendsto U hU hD L he c hc hlower hopen hconn |
| 174 | i j hx) |
| 175 | (fun _ hx => exists_eventually_contDiffOn_coordinate_source_transition U hU hD L he c hc |
| 176 | hlower hopen hconn hsmooth i j hx) hbound m hx |
| 177 | |
| 178 | include hD he hc hlower hopen hconn hsmooth in |
| 179 | theorem tendstoUniformlyOn_coordinate_source_transition_jet (i j : ι) |
| 180 | (hbound : LocallyEventuallyBoundedDerivatives |
| 181 | (Subtype.val '' overlap (fun i j => D i j) i j) |
| 182 | (fun k => coordinateRepresentative U hU |
| 183 | (fun x => Function.invFun (e k j) (e k i x)))) |
| 184 | (m : ℕ) {K : Set (EuclideanSpace ℝ (Fin n))} (hK : IsCompact K) |
| 185 | (hKU : K ⊆ Subtype.val '' overlap (fun i j => D i j) i j) : |
| 186 | TendstoUniformlyOn (fun k => iteratedFDeriv ℝ m (coordinateRepresentative U hU |
| 187 | (fun y => Function.invFun (e k j) (e k i y)))) |
| 188 | (iteratedFDeriv ℝ m |
| 189 | (coordinateRepresentative U hU (transition (fun i j => D i j) i j))) atTop K := by |
| 190 | apply (tendstoLocallyUniformlyOn_iff_tendstoUniformlyOn_of_compact hK).mp |
| 191 | exact (tendstoLocallyUniformlyOn_iteratedFDeriv_of_locally_eventually_smooth |
| 192 | (fun _ hx => coordinate_source_transition_tendsto U hU hD L he c hc hlower hopen hconn |
| 193 | i j hx) |
| 194 | (fun _ hx => exists_eventually_contDiffOn_coordinate_source_transition U hU hD L he c hc |
| 195 | hlower hopen hconn hsmooth i j hx) hbound m).mono hKU |
| 196 | |
| 197 | end PoincareMT.ChartDistance |