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.Induction.Noncollapse.MinimizingRegion.DisplacementAction |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.GaugeLift |
| 3 | |
| 4 | /-! |
| 5 | # Strict action recovery with a moving spacetime endpoint |
| 6 | |
| 7 | Proposition 16.4, p. 369. The inverse-gauge displacement and the square |
| 8 | terminal time vary together. Their actual actions remain below a strict |
| 9 | budget on a relative neighborhood, including a physical time boundary. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.Proofs.M46 |
| 21 | |
| 22 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 23 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 24 | |
| 25 | /-- A smooth represented path below a strict budget has actual nearby |
| 26 | competitors whose terminal times stay in its retained square interval. |
| 27 | Source: Proposition 16.4, p. 369; round-14 relative-openness derivation. -/ |
| 28 | theorem moving_endpoint_recovery |
| 29 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 30 | {T tau b B : ℝ} {x y : G.Point} |
| 31 | (p : M14BackwardPath G T 0 tau x y) (hp : M14BackwardLAction G p < B) |
| 32 | (gamma : ℝ → G.Point) (hs : Real.sqrt tau ≤ b) |
| 33 | (hgamma : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ gamma (Icc 0 b)) |
| 34 | (hclock : ∀ s ∈ Icc 0 b, G.spacetime.timeFunction (gamma s) = T - s ^ 2) |
| 35 | (hx : gamma 0 = x) |
| 36 | (htrace : EqOn p.curve (fun t => gamma (Real.sqrt t)) (Icc 0 tau)) : |
| 37 | ∃ V : Set G.Point, IsOpen V ∧ y ∈ V ∧ |
| 38 | ∀ z ∈ V, 0 < T - G.spacetime.timeFunction z → |
| 39 | Real.sqrt (T - G.spacetime.timeFunction z) ≤ b → |
| 40 | ∃ q : M14BackwardPath G T 0 (T - G.spacetime.timeFunction z) x z, |
| 41 | M14BackwardLAction G q < B := by |
| 42 | let sqtime := fun z : G.Point => Real.sqrt (T - G.spacetime.timeFunction z) |
| 43 | have hsy : sqtime y = Real.sqrt tau := by |
| 44 | dsimp only [sqtime] |
| 45 | rw [p.endpoint_time] |
| 46 | congr 1 |
| 47 | ring |
| 48 | have hc : Real.sqrt tau ∈ Ioc 0 b := ⟨Real.sqrt_pos.mpr p.tau_lt, hs⟩ |
| 49 | have hb : 0 < b := hc.1.trans_le hc.2 |
| 50 | have hgy : gamma (sqtime y) = y := by |
| 51 | rw [hsy] |
| 52 | exact (htrace ⟨p.tau_lt.le, le_rfl⟩).symm.trans p.curve_end |
| 53 | obtain ⟨j, U, lift, hU, hyU, hlift, hright, hliftClock⟩ := M14.exists_smooth_gauge_lift G y |
| 54 | obtain ⟨D⟩ := endpointDisplacementFamily_nonempty gamma hc hgamma hclock |
| 55 | j lift hU hlift hright hliftClock (by rw [← hsy, hgy]; exact hyU) |
| 56 | let K : Set G.Point := {z | sqtime z ∈ Icc 0 b} |
| 57 | have hyK : y ∈ K := by |
| 58 | change sqtime y ∈ Icc 0 b |
| 59 | rw [hsy] |
| 60 | exact ⟨hc.1.le, hc.2⟩ |
| 61 | have htime : Continuous G.spacetime.timeFunction := |
| 62 | (show ContMDiff (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ G.spacetime.timeFunction from |
| 63 | G.spacetime.time_smooth).continuous |
| 64 | have hsqtime : Continuous sqtime := Real.continuous_sqrt.comp (continuous_const.sub htime) |
| 65 | have hg : ContinuousWithinAt (fun z => gamma (sqtime z)) K y := |
| 66 | (hgamma _ hyK).continuousWithinAt.comp hsqtime.continuousAt.continuousWithinAt |
| 67 | (fun _ hz => hz) |
| 68 | have hgU : gamma (sqtime y) ∈ U := hgy.symm ▸ hyU |
| 69 | have hL : ContinuousAt lift y := (hlift y hyU).continuousWithinAt.continuousAt (hU.mem_nhds hyU) |
| 70 | have hLg : ContinuousWithinAt (fun z => lift (gamma (sqtime z))) K y := |
| 71 | ((hlift _ hgU).continuousWithinAt.continuousAt (hU.mem_nhds hgU)).comp_continuousWithinAt |
| 72 | (f := fun z : G.Point => gamma (sqtime z)) hg |
| 73 | have hchi : Continuous (fun z : G.Point => D.cutoff (sqtime z)) := |
| 74 | D.cutoff_smooth.continuous.comp hsqtime |
| 75 | have hchiY : D.cutoff (sqtime y) ≠ 0 := by |
| 76 | rw [hsy, D.cutoff_center] |
| 77 | exact one_ne_zero |
| 78 | let par := fun z : G.Point => (D.cutoff (sqtime z))⁻¹ • |
| 79 | ((lift z).2.val - (lift (gamma (sqtime z))).2.val) |
| 80 | have hpar : ContinuousWithinAt par K y := |
| 81 | (hchi.continuousAt.inv₀ hchiY).continuousWithinAt.smul |
| 82 | ((continuous_subtype_val.continuousAt.comp hL.snd).continuousWithinAt.sub |
| 83 | (continuous_subtype_val.continuousAt.comp_continuousWithinAt hLg.snd)) |
| 84 | have hparY : par y = 0 := by simp only [par, hgy, sub_self, smul_zero] |
| 85 | have hparN : ∀ᶠ z in 𝓝[K] y, par z ∈ D.parameters := |
| 86 | hpar.preimage_mem_nhdsWithin (D.parameters_open.mem_nhds (hparY.symm ▸ D.zero_mem)) |
| 87 | have hpair : Tendsto (fun z => (par z, sqtime z)) (𝓝[K] y) |
| 88 | (𝓝[D.parameters ×ˢ Icc 0 b] (0, Real.sqrt tau)) := by |
| 89 | apply tendsto_nhdsWithin_iff.mpr |
| 90 | constructor |
| 91 | · simpa only [hparY, hsy] using hpar.tendsto.prodMk_nhds |
| 92 | hsqtime.continuousAt.continuousWithinAt.tendsto |
| 93 | · filter_upwards [hparN, self_mem_nhdsWithin] with z hzN hzK |
| 94 | exact ⟨hzN, hzK⟩ |
| 95 | have hcost : Tendsto (fun z => D.cost (par z, sqtime z)) (𝓝[K] y) |
| 96 | (𝓝 (M14BackwardLAction G p)) := by |
| 97 | have hc0 := ((D.cost_contDiffOn hM12 hb).continuousOn |
| 98 | (0, Real.sqrt tau) ⟨D.zero_mem, hc.1.le, hc.2⟩).tendsto |
| 99 | rw [D.cost_zero hM12 p hs hx htrace] at hc0 |
| 100 | exact hc0.comp hpair |
| 101 | have hgood : {z : G.Point | z ∈ U ∧ gamma (sqtime z) ∈ U ∧ |
| 102 | D.cutoff (sqtime z) ≠ 0 ∧ par z ∈ D.parameters ∧ D.cost (par z, sqtime z) < B} |
| 103 | ∈ 𝓝[K] y := by |
| 104 | filter_upwards [mem_nhdsWithin_of_mem_nhds (hU.mem_nhds hyU), |
| 105 | hg.preimage_mem_nhdsWithin (hU.mem_nhds hgU), |
| 106 | mem_nhdsWithin_of_mem_nhds (hchi.continuousAt.eventually_ne hchiY), |
| 107 | hparN, hcost.eventually (Iio_mem_nhds hp)] with z hz hgZ hne hN hB |
| 108 | exact ⟨hz, hgZ, hne, hN, hB⟩ |
| 109 | obtain ⟨V, hV, hyV, hVK⟩ := mem_nhdsWithin.mp hgood |
| 110 | refine ⟨V, hV, hyV, ?_⟩ |
| 111 | intro z hz ht hztime |
| 112 | have hzK : z ∈ K := ⟨Real.sqrt_nonneg _, hztime⟩ |
| 113 | obtain ⟨hzU, hgzU, hchiz, hzN, hzB⟩ := hVK ⟨hz, hzK⟩ |
| 114 | have hend : D.family (sqtime z, par z) = z := |
| 115 | D.target (sqtime z) hzK hgzU hchiz z hzU (by |
| 116 | dsimp only [sqtime] |
| 117 | rw [Real.sq_sqrt ht.le] |
| 118 | ring) |
| 119 | obtain ⟨q, _, hq⟩ := D.exists_path hM12 ht hztime hzN hx hend |
| 120 | exact ⟨q, hq.trans_lt hzB⟩ |
| 121 | |
| 122 | end PoincareMT.Proofs.M46 |