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.Surgery.Continuation.Construction.Terminal.Event.Regions |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Construction.Terminal.Gluing.Retained.Boundary |
| 3 | |
| 4 | /-! |
| 5 | # The retained region on the ordinary reference slice |
| 6 | |
| 7 | Composing the actual regular-limit identification with the smooth cut-and-cap |
| 8 | map gives retention on the old carrier. The compact region, its boundary, |
| 9 | the neck sides and its limiting metric are preserved by this composition. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set TopologicalSpace |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.Surgery.Terminal.Gluing |
| 22 | |
| 23 | variable {ι : Type u} [Countable ι] {S A : GeneralizedSliceCarrier.{u}} |
| 24 | {g : RiemannianMetric 3 S.carrier} {K : MetricSurgeryConstants} |
| 25 | {g₀ : StandardInitialMetric} (I : ι → MetricSurgeryInput K g) |
| 26 | (R : ∀ i, MetricSurgeryResult g₀ (I i)) (U : Opens S.carrier) (hU : Nonempty U) |
| 27 | (hd : Pairwise (fun i j => Disjoint ((I i).negativeHalf : Set S.carrier) |
| 28 | ((I j).negativeHalf : Set S.carrier))) |
| 29 | (hc : ∀ i, Disjoint (U : Set S.carrier) (I i).neck.central_sphere) |
| 30 | (hneck : Pairwise (fun i j => Disjoint (I i).neck.carrier (I j).neck.carrier)) |
| 31 | (hUn : ∀ i, (U : Set S.carrier) ∩ (I i).neck.carrier = (I i).negativeHalf) |
| 32 | (hfront : frontier (U : Set S.carrier) ⊆ ⋃ i, (I i).neck.central_sphere) |
| 33 | {Ω : Set A.carrier} (L : SurgeryRegionEquivalence A S Ω univ) |
| 34 | |
| 35 | def referenceRetained : Set A.carrier := L.inverse '' closure (U : Set S.carrier) |
| 36 | |
| 37 | theorem referenceRetained_subset : referenceRetained U L ⊆ Ω := by |
| 38 | rintro _ ⟨x, _, rfl⟩ |
| 39 | exact L.symm.mapsTo (mem_univ x) |
| 40 | |
| 41 | theorem referenceRetained_compact (hcompact : IsCompact (closure (U : Set S.carrier))) : |
| 42 | IsCompact (referenceRetained U L) := |
| 43 | hcompact.image (continuousOn_univ.mp L.inverse_smooth.continuousOn) |
| 44 | |
| 45 | theorem referenceRetained_image : L.map '' referenceRetained U L = closure (U : Set S.carrier) := |
| 46 | (L.symm.restrict (closure (U : Set S.carrier)) (subset_univ _)).symm.map_image |
| 47 | |
| 48 | def referenceRetention : |
| 49 | SurgeryRegionEquivalence A (cutCarrier I R U hU hd hc) (referenceRetained U L) |
| 50 | (retainedMap I R U hU hd hc '' closure (U : Set S.carrier)) := |
| 51 | (L.symm.restrict (closure (U : Set S.carrier)) (subset_univ _)).symm.trans |
| 52 | (retainedRegionEquivalence I R U hU hd hc hneck hUn hfront) |
| 53 | |
| 54 | @[simp] theorem referenceRetention_map (x : A.carrier) : |
| 55 | (referenceRetention I R U hU hd hc hneck hUn hfront L).map x = |
| 56 | retainedMap I R U hU hd hc (L.map x) := rfl |
| 57 | |
| 58 | include R hU hd hc hneck hUn hfront in |
| 59 | theorem referenceRetained_interior : |
| 60 | interior (referenceRetained U L) = L.inverse '' (U : Set S.carrier) := by |
| 61 | have he := (L.symm.restrict (closure (U : Set S.carrier)) (subset_univ _)).image_interior |
| 62 | change L.inverse '' interior (closure (U : Set S.carrier)) = |
| 63 | interior (referenceRetained U L) at he |
| 64 | rw [interior_closure_retained I R U hU hd hc hneck hUn hfront] at he |
| 65 | exact he.symm |
| 66 | |
| 67 | include R hU hd hc hneck hUn hfront in |
| 68 | theorem referenceRetained_frontier (hcompact : IsCompact (closure (U : Set S.carrier))) : |
| 69 | frontier (referenceRetained U L) = ⋃ i, L.inverse '' (I i).neck.central_sphere := by |
| 70 | have he := (L.symm.restrict (closure (U : Set S.carrier)) (subset_univ _)).image_frontier |
| 71 | isClosed_closure (referenceRetained_compact U L hcompact).isClosed |
| 72 | change L.inverse '' frontier (closure (U : Set S.carrier)) = |
| 73 | frontier (referenceRetained U L) at he |
| 74 | rw [frontier_closure_retained I R U hU hd hc hneck hUn hfront, image_iUnion] at he |
| 75 | exact he.symm |
| 76 | |
| 77 | theorem referenceRetention_boundary (i : ι) : |
| 78 | (referenceRetention I R U hU hd hc hneck hUn hfront L).map '' |
| 79 | (L.inverse '' (I i).neck.central_sphere) = |
| 80 | frontier (capChart I R U hU hd hc i).carrier := by |
| 81 | rw [← image_comp] |
| 82 | have he : (referenceRetention I R U hU hd hc hneck hUn hfront L).map ∘ L.inverse = |
| 83 | retainedMap I R U hU hd hc := by |
| 84 | funext x |
| 85 | change retainedMap I R U hU hd hc (L.map (L.inverse x)) = _ |
| 86 | rw [L.right_inverse (mem_univ x)] |
| 87 | rw [he, retainedMap_centralSphere I R U hU hd hc hneck hUn] |
| 88 | |
| 89 | include hUn in |
| 90 | theorem referenceRetained_negative (i : ι) : |
| 91 | ((I i).negativeHalf : Set S.carrier) ⊆ L.map '' referenceRetained U L := by |
| 92 | rw [referenceRetained_image] |
| 93 | exact negativeHalf_subset_closure_retained I U hUn i |
| 94 | |
| 95 | include hUn in |
| 96 | theorem referenceRetained_positive (i : ι) : |
| 97 | Disjoint ((I i).neck.region 0 (I i).neck.epsilon⁻¹) |
| 98 | (L.map '' referenceRetained U L) := by |
| 99 | rw [referenceRetained_image] |
| 100 | exact positiveHalf_disjoint_closure_retained I U hUn i |
| 101 | |
| 102 | theorem referenceRetention_local (i : ι) (x : S.carrier) (hx : x ∈ (I i).negativeHalf) : |
| 103 | capInclusion I R U hU hd hc i ((R i).collapse x) = |
| 104 | (referenceRetention I R U hU hd hc hneck hUn hfront L).map (L.inverse x) := by |
| 105 | rw [referenceRetention_map, L.right_inverse (mem_univ x)] |
| 106 | exact (retainedMap_negativeHalf I R U hU hd hc hneck hUn i x hx).symm |
| 107 | |
| 108 | theorem referenceRetention_metric (hΩ : IsOpen Ω) (x : A.carrier) |
| 109 | (hx : x ∈ referenceRetained U L) (v w : TangentSpace (𝓡 3) x) : |
| 110 | (cutMetric I R U hU hd hc).inner |
| 111 | ((referenceRetention I R U hU hd hc hneck hUn hfront L).map x) |
| 112 | (mfderiv (𝓡 3) (𝓡 3) |
| 113 | (referenceRetention I R U hU hd hc hneck hUn hfront L).map x v) |
| 114 | (mfderiv (𝓡 3) (𝓡 3) |
| 115 | (referenceRetention I R U hU hd hc hneck hUn hfront L).map x w) = |
| 116 | g.inner (L.map x) (mfderiv (𝓡 3) (𝓡 3) L.map x v) |
| 117 | (mfderiv (𝓡 3) (𝓡 3) L.map x w) := by |
| 118 | have hxΩ := referenceRetained_subset U L hx |
| 119 | have hxC : L.map x ∈ closure (U : Set S.carrier) := |
| 120 | (referenceRetained_image U L).subset (mem_image_of_mem _ hx) |
| 121 | have hdL := ((L.map_smooth x hxΩ).contMDiffAt (hΩ.mem_nhds hxΩ)).mdifferentiableAt (by simp) |
| 122 | have hdr := (retainedMap_localDiffeomorphAt I R U hU hd hc hneck hUn (L.map x) |
| 123 | (closure_retained_subset_neighborhood I U hfront hxC)).mdifferentiableAt (by simp) |
| 124 | change (cutMetric I R U hU hd hc).inner (retainedMap I R U hU hd hc (L.map x)) |
| 125 | (mfderiv (𝓡 3) (𝓡 3) (retainedMap I R U hU hd hc ∘ L.map) x v) |
| 126 | (mfderiv (𝓡 3) (𝓡 3) (retainedMap I R U hU hd hc ∘ L.map) x w) = _ |
| 127 | rw [mfderiv_comp_apply x hdr hdL v, mfderiv_comp_apply x hdr hdL w] |
| 128 | exact retainedMap_metric I R U hU hd hc hneck hUn hfront (L.map x) hxC _ _ |
| 129 | |
| 130 | end PoincareMT.Surgery.Terminal.Gluing |