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.StandardCap.Existence.Lifetime.CanonicalGeometry.CapPersistenceRecutOpen |
| 2 | |
| 3 | /-! |
| 4 | # Extending axial reparametrizations across the actual core |
| 5 | |
| 6 | An axial map fixing a lower ray extends by the identity across the |
| 7 | closed core. The proved openness of an inner recut gives a genuine |
| 8 | identity neighborhood at every core boundary point. |
| 9 | Source: Morgan--Tian Proposition 9.79(3), p. 234; |
| 10 | cap-persistence-implementation.md, section 2. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | namespace PoincareMT.CapCertificate |
| 19 | |
| 20 | variable {M : Type*} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 22 | [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 23 | {g : RiemannianMetric 3 M} (N : CapCertificate g) |
| 24 | |
| 25 | /-- Literal axial coordinate conjugation on the end, extended by the |
| 26 | identity elsewhere (Proposition 9.79(3), p. 234). -/ |
| 27 | noncomputable def axialMap (f : ℝ → ℝ) (x : M) : M := by |
| 28 | classical |
| 29 | exact if x ∈ N.end_neck.carrier then |
| 30 | N.end_neck.coordinate_map ((N.end_neck.coordinate_inverse x).1, |
| 31 | f (N.end_neck.coordinate_inverse x).2) else x |
| 32 | |
| 33 | /-- A core point is fixed because the core is disjoint from the actual |
| 34 | end, without a regularity claim for the total inverse off that end. -/ |
| 35 | theorem axialMap_eq_self_of_mem_closed_core (f : ℝ → ℝ) {x : M} |
| 36 | (hx : x ∈ N.closed_core) : N.axialMap f x = x := by |
| 37 | rw [N.closed_core_eq_complement_end] at hx |
| 38 | simp only [axialMap, if_neg hx.2] |
| 39 | |
| 40 | /-- Fixing the lower axial ray fixes the whole inner recut, including |
| 41 | its actual compact core (Proposition 9.79(3), p. 234). -/ |
| 42 | theorem axialMap_eq_self_on_recut {f : ℝ → ℝ} {c : ℝ} |
| 43 | (hf : ∀ s ≤ c, f s = s) : EqOn (N.axialMap f) id (N.recutCarrier c) := by |
| 44 | intro x hx |
| 45 | rcases hx with hx | hx |
| 46 | · exact N.axialMap_eq_self_of_mem_closed_core f hx |
| 47 | · simp only [axialMap, if_pos hx.1, hf _ hx.2.2.le] |
| 48 | exact N.end_neck.coordinate_map_coordinate_inverse hx.1 |
| 49 | |
| 50 | /-- A smooth axial map which fixes a lower ray extends smoothly on any |
| 51 | part of the cap where its displayed coordinate still belongs to the |
| 52 | actual old neck domain (Proposition 9.79(3), p. 234). -/ |
| 53 | theorem axialMap_contMDiffOn {f : ℝ → ℝ} {c : ℝ} {S : Set M} |
| 54 | (hc : -N.epsilon⁻¹ < c) (hc' : c < N.epsilon⁻¹) (hS : S ⊆ N.carrier) |
| 55 | (hf : ContDiff ℝ ∞ f) (hfix : ∀ s ≤ c, f s = s) |
| 56 | (hvalid : ∀ x ∈ S, x ∈ N.end_neck.carrier → |
| 57 | f (N.end_neck.coordinate_inverse x).2 ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹) : |
| 58 | ContMDiffOn (𝓡 3) (𝓡 3) ∞ (N.axialMap f) S := by |
| 59 | intro x hx |
| 60 | by_cases he : x ∈ N.end_neck.carrier |
| 61 | · have hinv := N.end_neck.coordinate_inverse_smooth.contMDiffAt |
| 62 | (N.end_neck.carrier_open.mem_nhds he) |
| 63 | have hp : ContMDiffAt (𝓡 3) ((𝓡 2).prod 𝓘(ℝ, ℝ)) ∞ |
| 64 | (fun y => ((N.end_neck.coordinate_inverse y).1, |
| 65 | f (N.end_neck.coordinate_inverse y).2)) x := |
| 66 | hinv.fst.prodMk (hf.contMDiff.contMDiffAt.comp x hinv.snd) |
| 67 | have hheight : f (N.end_neck.coordinate_inverse x).2 ∈ |
| 68 | Ioo (-N.end_neck.epsilon⁻¹) N.end_neck.epsilon⁻¹ := by |
| 69 | simpa only [N.end_neck_epsilon] using hvalid x hx he |
| 70 | have hm : ContMDiffAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) ∞ |
| 71 | N.end_neck.coordinate_map |
| 72 | ((N.end_neck.coordinate_inverse x).1, f (N.end_neck.coordinate_inverse x).2) := |
| 73 | N.end_neck.coordinate_map_smooth.contMDiffAt |
| 74 | ((isOpen_univ.prod isOpen_Ioo).mem_nhds ⟨mem_univ _, hheight⟩) |
| 75 | apply ((hm.comp x hp).congr_of_eventuallyEq ?_).contMDiffWithinAt |
| 76 | filter_upwards [N.end_neck.carrier_open.mem_nhds he] with y hy |
| 77 | simp only [axialMap, if_pos hy, Function.comp_apply] |
| 78 | · have hy : x ∈ N.closed_core := by |
| 79 | rw [N.closed_core_eq_complement_end] |
| 80 | exact ⟨hS hx, he⟩ |
| 81 | have hU : N.recutCarrier c ∈ 𝓝 x := |
| 82 | (N.recutCarrier_isOpen hc hc').mem_nhds (Or.inl hy) |
| 83 | apply (contMDiffAt_id.congr_of_eventuallyEq ?_).contMDiffWithinAt |
| 84 | filter_upwards [hU] with y hy |
| 85 | exact N.axialMap_eq_self_on_recut hfix hy |
| 86 | |
| 87 | end PoincareMT.CapCertificate |