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.SmoothDomain |
| 2 | |
| 3 | /-! |
| 4 | # Intrinsic interior of an embedded domain |
| 5 | |
| 6 | A codimension-zero smooth embedding identifies the intrinsic manifold |
| 7 | interior with the ambient topological interior of its image. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | |
| 12 | open Set Filter |
| 13 | open scoped Manifold ContDiff Topology |
| 14 | |
| 15 | namespace Poincare.Manifold |
| 16 | |
| 17 | variable {m : ℕ} {M : Type*} [TopologicalSpace M] |
| 18 | [ChartedSpace (EuclideanSpace ℝ (Fin (m + 1))) M] |
| 19 | {K : Set M} |
| 20 | [ChartedSpace (EuclideanHalfSpace (m + 1)) K] |
| 21 | |
| 22 | private theorem exists_inclusion_charts |
| 23 | (h : _root_.Manifold.IsSmoothEmbedding (𝓡∂ (m + 1)) (𝓡 (m + 1)) ∞ |
| 24 | (Subtype.val : K → M)) (x : K) : |
| 25 | ∃ (φ : OpenPartialHomeomorph K (EuclideanHalfSpace (m + 1))) |
| 26 | (ψ : OpenPartialHomeomorph M (EuclideanSpace ℝ (Fin (m + 1)))) |
| 27 | (A : EuclideanSpace ℝ (Fin (m + 1)) ≃L[ℝ] |
| 28 | EuclideanSpace ℝ (Fin (m + 1))), |
| 29 | x ∈ φ.source ∧ (x : M) ∈ ψ.source ∧ |
| 30 | φ ∈ IsManifold.maximalAtlas (𝓡∂ (m + 1)) ∞ K ∧ |
| 31 | φ.source ⊆ Subtype.val ⁻¹' ψ.source ∧ |
| 32 | EqOn (ψ ∘ Subtype.val) (A ∘ (𝓡∂ (m + 1)) ∘ φ) φ.source := by |
| 33 | have hi := h.isImmersion.isImmersionAt x |
| 34 | let L : EuclideanSpace ℝ (Fin (m + 1)) →ₗ[ℝ] |
| 35 | EuclideanSpace ℝ (Fin (m + 1)) := |
| 36 | hi.equiv.toLinearMap.comp (LinearMap.inl ℝ _ _) |
| 37 | have hL : Function.Injective L := by |
| 38 | intro u v huv |
| 39 | exact congrArg Prod.fst (hi.equiv.injective huv) |
| 40 | let A := (LinearEquiv.ofBijective L |
| 41 | ⟨hL, LinearMap.injective_iff_surjective.mp hL⟩).toContinuousLinearEquiv |
| 42 | refine ⟨hi.domChart, hi.codChart, A, hi.mem_domChart_source, |
| 43 | hi.mem_codChart_source, hi.domChart_mem_maximalAtlas, |
| 44 | hi.source_subset_preimage_source, ?_⟩ |
| 45 | intro y hy |
| 46 | have hz := hi.writtenInCharts |
| 47 | ((hi.domChart.extend (𝓡∂ (m + 1))).map_source (by |
| 48 | simpa only [OpenPartialHomeomorph.extend_source] using hy)) |
| 49 | dsimp only [Function.comp_apply] at hz |
| 50 | rw [hi.domChart.extend_left_inv hy] at hz |
| 51 | exact hz |
| 52 | |
| 53 | /-- The inclusion of an embedded manifold with boundary of the same dimension |
| 54 | identifies its intrinsic interior with the ambient interior. -/ |
| 55 | theorem image_interior_of_isSmoothEmbedding |
| 56 | (h : _root_.Manifold.IsSmoothEmbedding (𝓡∂ (m + 1)) (𝓡 (m + 1)) ∞ |
| 57 | (Subtype.val : K → M)) : |
| 58 | Subtype.val '' (𝓡∂ (m + 1)).interior K = interior K := by |
| 59 | have hpoint (x : K) : |
| 60 | (𝓡∂ (m + 1)).IsInteriorPoint x ↔ (x : M) ∈ interior K := by |
| 61 | obtain ⟨φ, ψ, A, hxφ, hxψ, hφ, hsource, hcoord⟩ := exists_inclusion_charts h x |
| 62 | have hxcoord : ψ x = A ((φ.extend (𝓡∂ (m + 1))) x) := hcoord hxφ |
| 63 | have himage : A '' (φ.extend (𝓡∂ (m + 1))).target = |
| 64 | ψ '' (Subtype.val '' φ.source) := by |
| 65 | rw [φ.extend_target_eq_image_source] |
| 66 | simp only [image_image] |
| 67 | apply image_congr |
| 68 | intro y hy |
| 69 | exact (hcoord hy).symm |
| 70 | rw [ModelWithCorners.isInteriorPoint_iff_of_mem_maximalAtlas |
| 71 | (by simp : (∞ : WithTop ℕ∞) ≠ 0) hφ hxφ, |
| 72 | mem_interior_iff_mem_nhds, mem_interior_iff_mem_nhds] |
| 73 | constructor |
| 74 | · intro ht |
| 75 | have ha := A.toHomeomorph.isOpenMap.image_mem_nhds ht |
| 76 | simp only [ContinuousLinearEquiv.coe_toHomeomorph] at ha |
| 77 | rw [himage, ← hxcoord] at ha |
| 78 | have hb := ψ.symm.image_mem_nhds (ψ.map_source hxψ) ha |
| 79 | rw [ψ.left_inv hxψ] at hb |
| 80 | apply mem_of_superset hb |
| 81 | rintro y ⟨z, ⟨w, ⟨v, hv, rfl⟩, rfl⟩, rfl⟩ |
| 82 | rw [ψ.left_inv (hsource hv)] |
| 83 | exact v.property |
| 84 | · intro hxK |
| 85 | have hs : Subtype.val '' φ.source ∈ 𝓝 (x : M) := by |
| 86 | have hs := image_mem_map (m := (Subtype.val : K → M)) |
| 87 | (φ.open_source.mem_nhds hxφ) |
| 88 | rw [h.isEmbedding.map_nhds_of_mem x (by simpa only [Subtype.range_coe] using hxK)] |
| 89 | at hs |
| 90 | exact hs |
| 91 | have ha := A.symm.toHomeomorph.isOpenMap.image_mem_nhds (ψ.image_mem_nhds hxψ hs) |
| 92 | simp only [ContinuousLinearEquiv.coe_toHomeomorph] at ha |
| 93 | rw [hxcoord, A.symm_apply_apply] at ha |
| 94 | simpa only [← himage, image_image, Function.comp_def, A.symm_apply_apply, |
| 95 | image_id'] using ha |
| 96 | ext x |
| 97 | constructor |
| 98 | · rintro ⟨y, hy, rfl⟩ |
| 99 | exact (hpoint y).mp hy |
| 100 | · intro hx |
| 101 | exact ⟨⟨x, interior_subset hx⟩, (hpoint ⟨x, interior_subset hx⟩).mpr hx, rfl⟩ |
| 102 | |
| 103 | end Poincare.Manifold |