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.Attainment.Minimum.ValueLowerContinuity |
| 2 | |
| 3 | /-! |
| 4 | # Continuity of the capped free-slice action |
| 5 | |
| 6 | Morgan--Tian Proposition 16.4, pp. 389-391. At an active minimum, the |
| 7 | same surviving exponential branch supplies nearby upper competitors. |
| 8 | At the cap, the constant barrier supplies them. Together with compact |
| 9 | strict sublevels this proves continuity on every closed positive interval. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.Proofs.M46 |
| 20 | |
| 21 | variable {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 22 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport 3 X time I} |
| 23 | {T start : ℝ} {x : G.Point} |
| 24 | |
| 25 | /-- Relative survival openness gives upper semicontinuity at every |
| 26 | positive time, including the left physical endpoint of the time strip. -/ |
| 27 | theorem cappedSliceAction_upperSemicontinuousOn |
| 28 | (hM04 : RicciFlowCurvatureTheory.{0}) |
| 29 | (hM12 : GeneralizedRicciGaugeTheory.{u} 3) |
| 30 | (LG : GeneralizedLGeometryConclusion G) |
| 31 | (E : M14ExponentialFamily G T x) (C : ActionConfinement G T start x) |
| 32 | (hstrip : Icc start T ⊆ I.domain) |
| 33 | {a c : ℝ} (ha : 0 < a) (hc : c ^ 2 ≤ T - start) : |
| 34 | UpperSemicontinuousOn (cappedSliceAction G T x C.barrier) (Icc a c) := by |
| 35 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 36 | let : NormedAddCommGroup (G.Horizontal x) := |
| 37 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 38 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 39 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 40 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 41 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := ⟨metric⟩ |
| 42 | have hbound (b : ℝ) (hb : b ∈ Icc a c) : b ^ 2 ≤ T - start := |
| 43 | ((sq_le_sq₀ (ha.trans_le hb.1).le ((ha.trans_le hb.1).le.trans hb.2)).mpr hb.2).trans hc |
| 44 | intro b hb d hd |
| 45 | have hbpos := ha.trans_le hb.1 |
| 46 | by_cases hactive : cappedSliceAction G T x C.barrier b < C.barrier |
| 47 | · obtain ⟨Z, hZ, _, hact⟩ := cappedSliceAction_exponential hM04 hM12 LG E C |
| 48 | hbpos (hbound b hb) hactive |
| 49 | obtain ⟨U, hU, hZU, hsub⟩ := E.domain_relative_open (Z, b) hZ |
| 50 | have hUnear : ∀ᶠ s in 𝓝[Icc a c] b, (Z, s) ∈ U := |
| 51 | mem_nhdsWithin_of_mem_nhds |
| 52 | ((continuous_const.prodMk continuous_id).continuousAt.preimage_mem_nhds |
| 53 | (hU.mem_nhds hZU)) |
| 54 | have hsurv : ∀ᶠ s in 𝓝[Icc a c] b, (Z, s) ∈ E.domain := by |
| 55 | filter_upwards [hUnear, self_mem_nhdsWithin] with s hsU hs |
| 56 | exact hsub ⟨hsU, (ha.trans_le hs.1).le, |
| 57 | hstrip ⟨by linarith [hbound s hs], sub_le_self _ (sq_nonneg s)⟩⟩ |
| 58 | have hpair : Tendsto (fun s : ℝ => (Z, s)) (𝓝[Icc a c] b) |
| 59 | (𝓝[E.domain ∩ {z | 0 < z.2}] (Z, b)) := by |
| 60 | apply tendsto_nhdsWithin_iff.mpr |
| 61 | refine ⟨(continuous_const.prodMk continuous_id).continuousAt.tendsto.mono_left |
| 62 | nhdsWithin_le_nhds, ?_⟩ |
| 63 | filter_upwards [hsurv, self_mem_nhdsWithin] with s hs hsI |
| 64 | exact ⟨hs, ha.trans_le hsI.1⟩ |
| 65 | have hcont := (LG.exponential.action_differential T x E).1.continuousOn |
| 66 | (Z, b) ⟨hZ, hbpos⟩ |
| 67 | have hcost : ∀ᶠ s in 𝓝[Icc a c] b, E.action Z s < d := |
| 68 | (Filter.Tendsto.comp hcont hpair).eventually (Iio_mem_nhds (hact.le.trans_lt hd)) |
| 69 | filter_upwards [hcost, hsurv, self_mem_nhdsWithin] with s hsCost hsSurv hs |
| 70 | have hm := (cappedSliceAction_alternative hM04 hM12 LG E C |
| 71 | (ha.trans_le hs.1) (hbound s hs)).2.1 |
| 72 | (E.gamma Z s) (E.path Z s hsSurv (ha.trans_le hs.1)) |
| 73 | rw [← E.action_eq Z s hsSurv (ha.trans_le hs.1)] at hm |
| 74 | exact hm.trans_lt hsCost |
| 75 | · have heq : cappedSliceAction G T x C.barrier b = C.barrier := |
| 76 | le_antisymm (cappedSliceAction_alternative hM04 hM12 LG E C hbpos (hbound b hb)).1 |
| 77 | (le_of_not_gt hactive) |
| 78 | filter_upwards [self_mem_nhdsWithin] with s hs |
| 79 | exact (cappedSliceAction_alternative hM04 hM12 LG E C |
| 80 | (ha.trans_le hs.1) (hbound s hs)).1.trans_lt (heq ▸ hd) |
| 81 | |
| 82 | /-- The capped actual minimum is continuous without assuming prior |
| 83 | reachability of every slice. Source: Proposition 16.4, pp. 389-391. -/ |
| 84 | theorem cappedSliceAction_continuousOn |
| 85 | (hM04 : RicciFlowCurvatureTheory.{0}) |
| 86 | (hM12 : GeneralizedRicciGaugeTheory.{u} 3) |
| 87 | (LG : GeneralizedLGeometryConclusion G) |
| 88 | (E : M14ExponentialFamily G T x) (C : ActionConfinement G T start x) |
| 89 | (hstrip : Icc start T ⊆ I.domain) |
| 90 | {a c : ℝ} (ha : 0 < a) (hc : c ^ 2 ≤ T - start) : |
| 91 | ContinuousOn (cappedSliceAction G T x C.barrier) (Icc a c) := |
| 92 | continuousOn_iff_lower_upperSemicontinuousOn.mpr |
| 93 | ⟨cappedSliceAction_lowerSemicontinuousOn hM04 hM12 LG E C hstrip ha hc, |
| 94 | cappedSliceAction_upperSemicontinuousOn hM04 hM12 LG E C hstrip ha hc⟩ |
| 95 | |
| 96 | end PoincareMT.Proofs.M46 |