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.Generalized.ReducedGeometry.Paths.Joining.PrefixJoinGauge |
| 2 | |
| 3 | /-! |
| 4 | # A common compact gauge region for the two joining pieces |
| 5 | |
| 6 | Actual endpoint continuity places both pieces in one inverse-gauge |
| 7 | image with a compact convex spatial region. The strict interior join |
| 8 | gives positive margins on both sides. Morgan-Tian Proposition 6.30, |
| 9 | pp. 118-119; no minimizing-path or endpoint-speed assumption is used. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter Metric |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.M14 |
| 20 | |
| 21 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 22 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 23 | {T τ₁ τ₂ c : ℝ} {x y : G.Point} |
| 24 | |
| 25 | /-- Every admissible competing prefix at a strict interior point of |
| 26 | a full path admits fixed compact gauge data for the one-sided splice, |
| 27 | Proposition 6.30, pp. 118-119. -/ |
| 28 | theorem prefixJoinGauge_nonempty (q : M14BackwardPath G T τ₁ τ₂ x y) |
| 29 | (p : M14BackwardPath G T τ₁ c x (q.curve c)) (hc : c < τ₂) : |
| 30 | Nonempty (PrefixJoinGauge q p) := by |
| 31 | obtain ⟨b, N, lift, hN, hqN, hlift, hrec, htime⟩ := exists_smooth_gauge_lift G (q.curve c) |
| 32 | let z := (lift (q.curve c)).2.val |
| 33 | obtain ⟨ε, hε, hball⟩ := Metric.mem_nhds_iff.mp |
| 34 | ((G.gaugeCover.spatial b).isOpen.mem_nhds (lift (q.curve c)).2.property) |
| 35 | let K := closedBall z (ε / 2) |
| 36 | have hKsub : K ⊆ G.gaugeCover.spatial b := |
| 37 | (closedBall_subset_ball (by linarith : ε / 2 < ε)).trans hball |
| 38 | let V := N ∩ (fun w => (lift w).2.val) ⁻¹' ball z (ε / 2) |
| 39 | have hcoords : ContinuousOn (fun w => (lift w).2.val) N := |
| 40 | continuous_subtype_val.comp_continuousOn hlift.continuousOn.snd |
| 41 | have hV : IsOpen V := hcoords.isOpen_inter_preimage hN isOpen_ball |
| 42 | have hqV : q.curve c ∈ V := ⟨hqN, mem_ball_self (by linarith)⟩ |
| 43 | have hpV : p.curve c ∈ V := by rw [p.curve_end]; exact hqV |
| 44 | have hpnear := (p.curve_continuous c ⟨p.tau_lt.le, le_rfl⟩).preimage_mem_nhdsWithin |
| 45 | (hV.mem_nhds hpV) |
| 46 | obtain ⟨P, hP, hcP, hPV⟩ := mem_nhdsWithin.mp hpnear |
| 47 | have hqnear : q.curve ⁻¹' V ∈ 𝓝 c := |
| 48 | (q.curve_continuous.continuousAt (Icc_mem_nhds p.tau_lt hc)).preimage_mem_nhds |
| 49 | (hV.mem_nhds hqV) |
| 50 | have hnear : P ∩ q.curve ⁻¹' V ∩ Ioo τ₁ τ₂ ∈ 𝓝 c := |
| 51 | inter_mem (inter_mem (hP.mem_nhds hcP) hqnear) (Ioo_mem_nhds p.tau_lt hc) |
| 52 | obtain ⟨δ, hδ, hδsub⟩ := Metric.mem_nhds_iff.mp hnear |
| 53 | let r := δ / 2 |
| 54 | have hr : 0 < r := by dsimp only [r]; linarith |
| 55 | have hwindow : Icc (c - r) (c + r) ⊆ P ∩ q.curve ⁻¹' V ∩ Ioo τ₁ τ₂ := by |
| 56 | intro s hs |
| 57 | apply hδsub |
| 58 | change dist s c < δ |
| 59 | rw [Real.dist_eq, abs_lt] |
| 60 | dsimp only [r] at hs |
| 61 | constructor <;> linarith [hs.1, hs.2] |
| 62 | have hprefix : ∀ s ∈ Icc (c - r) c, p.curve s ∈ V := by |
| 63 | intro s hs |
| 64 | have hw := hwindow (show s ∈ Icc (c - r) (c + r) from ⟨hs.1, by linarith [hs.2]⟩) |
| 65 | exact hPV ⟨hw.1.1, hw.2.1.le, hs.2⟩ |
| 66 | refine ⟨{ |
| 67 | index := b |
| 68 | image := V |
| 69 | image_open := hV |
| 70 | lift := lift |
| 71 | lift_smooth := hlift.mono inter_subset_left |
| 72 | lift_right := fun w hw => hrec w hw.1 |
| 73 | lift_time := fun w hw => htime w hw.1 |
| 74 | radius := r |
| 75 | radius_pos := hr |
| 76 | left_margin := (hwindow (show c - r ∈ Icc (c - r) (c + r) from |
| 77 | ⟨le_rfl, by linarith⟩)).2.1 |
| 78 | right_margin := (hwindow (show c + r ∈ Icc (c - r) (c + r) from |
| 79 | ⟨by linarith, le_rfl⟩)).2.2 |
| 80 | spatialRegion := K |
| 81 | region_compact := isCompact_closedBall _ _ |
| 82 | region_convex := convex_closedBall _ _ |
| 83 | region_subset := hKsub |
| 84 | image_coordinates := fun _ hw => ball_subset_closedBall hw.2 |
| 85 | prefix_in_image := hprefix |
| 86 | continuation_in_image := fun _ hs => (hwindow hs).1.2 }⟩ |
| 87 | |
| 88 | end PoincareMT.M14 |