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.Variation.Extension.CompactPerturbation |
| 2 | |
| 3 | /-! |
| 4 | # Actual C1 paths joining two admissible outer pieces |
| 5 | |
| 6 | The admissibility step in the corner approximation for Morgan-Tian |
| 7 | Proposition 6.30, pp. 118-119. The constructed curve is required to be |
| 8 | C1 on its whole interior. Its two unchanged outer pieces retain their |
| 9 | integrable actions, while the compact middle piece has continuous |
| 10 | action density. A raw corner is not admitted as a path. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter MeasureTheory |
| 16 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 23 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 24 | {T τ₁ c τ₂ : ℝ} {x z₁ z₂ y : G.Point} |
| 25 | |
| 26 | /-- A C1 curve retaining the two admissible outer pieces has integrable |
| 27 | actual action, the path construction in Proposition 6.30, pp. 118-119. -/ |
| 28 | theorem joinedCurve_action_integrable (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 29 | (p : M14BackwardPath G T τ₁ c x z₁) (q : M14BackwardPath G T c τ₂ z₂ y) |
| 30 | (γ : ℝ → G.Point) {a b : ℝ} |
| 31 | (ha : τ₁ < a) (hac : a < c) (hcb : c < b) (hb : b < τ₂) |
| 32 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) 1 γ (Ioo τ₁ τ₂)) |
| 33 | (hleft : ∀ t ≤ a, γ t = p.curve t) (hright : ∀ t, b ≤ t → γ t = q.curve t) : |
| 34 | IntervalIntegrable (M14RawLIntegrand G γ (projectedCurveVelocity G γ)) volume τ₁ τ₂ := by |
| 35 | have hab : a < b := hac.trans hcb |
| 36 | have hmiddle : IntervalIntegrable (M14RawLIntegrand G γ (projectedCurveVelocity G γ)) |
| 37 | volume a b := ((rawLIntegrand_projectedVelocity_continuousOn hM12 isOpen_Ioo hγ).mono |
| 38 | (fun _ ht => ⟨ha.trans_le ht.1, ht.2.trans_lt hb⟩)).intervalIntegrable_of_Icc hab.le |
| 39 | have hleftOld := p.action_integrable.mono_set |
| 40 | (show uIcc τ₁ a ⊆ uIcc τ₁ c by |
| 41 | rw [uIcc_of_le ha.le, uIcc_of_le p.tau_lt.le] |
| 42 | exact Icc_subset_Icc_right hac.le) |
| 43 | have hleftNew : IntervalIntegrable (M14RawLIntegrand G γ (projectedCurveVelocity G γ)) |
| 44 | volume τ₁ a := hleftOld.congr_uIoo (by |
| 45 | intro s hs |
| 46 | rw [uIoo_of_le ha.le] at hs |
| 47 | symm |
| 48 | apply rawLIntegrand_eq_backward_of_eventuallyEq p ⟨hs.1, hs.2.trans hac⟩ |
| 49 | filter_upwards [gt_mem_nhds hs.2] with t ht |
| 50 | exact hleft t ht.le) |
| 51 | have hrightOld := q.action_integrable.mono_set |
| 52 | (show uIcc b τ₂ ⊆ uIcc c τ₂ by |
| 53 | rw [uIcc_of_le hb.le, uIcc_of_le q.tau_lt.le] |
| 54 | exact Icc_subset_Icc_left hcb.le) |
| 55 | have hrightNew : IntervalIntegrable (M14RawLIntegrand G γ (projectedCurveVelocity G γ)) |
| 56 | volume b τ₂ := hrightOld.congr_uIoo (by |
| 57 | intro s hs |
| 58 | rw [uIoo_of_le hb.le] at hs |
| 59 | symm |
| 60 | apply rawLIntegrand_eq_backward_of_eventuallyEq q ⟨hcb.trans hs.1, hs.2⟩ |
| 61 | filter_upwards [lt_mem_nhds hs.1] with t ht |
| 62 | exact hright t ht.le) |
| 63 | exact hleftNew.trans (hmiddle.trans hrightNew) |
| 64 | |
| 65 | /-- A continuous C1 joining curve with the actual clock gives an |
| 66 | admissible path with the prescribed outer endpoints, the competitor |
| 67 | construction for Proposition 6.30, pp. 118-119. -/ |
| 68 | noncomputable def pathOfC1Join (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 69 | (p : M14BackwardPath G T τ₁ c x z₁) (q : M14BackwardPath G T c τ₂ z₂ y) |
| 70 | (γ : ℝ → G.Point) {a b : ℝ} |
| 71 | (ha : τ₁ < a) (hac : a < c) (hcb : c < b) (hb : b < τ₂) |
| 72 | (hcont : ContinuousOn γ (Icc τ₁ τ₂)) |
| 73 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) 1 γ (Ioo τ₁ τ₂)) |
| 74 | (hclock : ∀ t ∈ Icc τ₁ τ₂, G.spacetime.timeFunction (γ t) = T - t) |
| 75 | (hleft : ∀ t ≤ a, γ t = p.curve t) (hright : ∀ t, b ≤ t → γ t = q.curve t) : |
| 76 | M14BackwardPath G T τ₁ τ₂ x y where |
| 77 | tau_nonneg := p.tau_nonneg |
| 78 | tau_lt := p.tau_lt.trans q.tau_lt |
| 79 | base_time := p.base_time |
| 80 | endpoint_time := q.endpoint_time |
| 81 | curve := γ |
| 82 | curve_start := (hleft τ₁ ha.le).trans p.curve_start |
| 83 | curve_end := (hright τ₂ hb.le).trans q.curve_end |
| 84 | curve_time := hclock |
| 85 | curve_continuous := hcont |
| 86 | curve_regular := hγ |
| 87 | horizontal_velocity := projectedCurveVelocity G γ |
| 88 | derivative_eq := by |
| 89 | intro s hs |
| 90 | apply projectedCurveVelocity_derivative_eq (T := T) |
| 91 | (((hγ s hs).contMDiffAt (isOpen_Ioo.mem_nhds hs)).mdifferentiableAt (by simp)) |
| 92 | filter_upwards [isOpen_Ioo.mem_nhds hs] with t ht |
| 93 | exact hclock t (Ioo_subset_Icc_self ht) |
| 94 | action_integrable := joinedCurve_action_integrable hM12 p q γ ha hac hcb hb hγ hleft hright |
| 95 | |
| 96 | /-- The actual joined action is the sum of the two unchanged exterior |
| 97 | actions and the C1 transition action, Proposition 6.30, pp. 118-119. -/ |
| 98 | theorem action_pathOfC1Join (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 99 | (p : M14BackwardPath G T τ₁ c x z₁) (q : M14BackwardPath G T c τ₂ z₂ y) |
| 100 | (γ : ℝ → G.Point) {a b : ℝ} |
| 101 | (ha : τ₁ < a) (hac : a < c) (hcb : c < b) (hb : b < τ₂) |
| 102 | (hcont : ContinuousOn γ (Icc τ₁ τ₂)) |
| 103 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) 1 γ (Ioo τ₁ τ₂)) |
| 104 | (hclock : ∀ t ∈ Icc τ₁ τ₂, G.spacetime.timeFunction (γ t) = T - t) |
| 105 | (hleft : ∀ t ≤ a, γ t = p.curve t) (hright : ∀ t, b ≤ t → γ t = q.curve t) : |
| 106 | M14BackwardLAction G (pathOfC1Join hM12 p q γ ha hac hcb hb hcont hγ hclock hleft hright) = |
| 107 | (∫ t in τ₁..a, M14BackwardLIntegrand G p t) + |
| 108 | (∫ t in a..b, M14RawLIntegrand G γ (projectedCurveVelocity G γ) t) + |
| 109 | ∫ t in b..τ₂, M14BackwardLIntegrand G q t := by |
| 110 | let F := M14RawLIntegrand G γ (projectedCurveVelocity G γ) |
| 111 | have hab : a < b := hac.trans hcb |
| 112 | have hwhole := joinedCurve_action_integrable hM12 p q γ ha hac hcb hb hγ hleft hright |
| 113 | have ht : τ₁ < τ₂ := p.tau_lt.trans q.tau_lt |
| 114 | have hleftI : IntervalIntegrable F volume τ₁ a := hwhole.mono_set (by |
| 115 | rw [uIcc_of_le ha.le, uIcc_of_le ht.le] |
| 116 | exact Icc_subset_Icc_right (hab.le.trans hb.le)) |
| 117 | have hmiddleI : IntervalIntegrable F volume a b := hwhole.mono_set (by |
| 118 | rw [uIcc_of_le hab.le, uIcc_of_le ht.le] |
| 119 | exact Icc_subset_Icc ha.le hb.le) |
| 120 | have hrightI : IntervalIntegrable F volume b τ₂ := hwhole.mono_set (by |
| 121 | rw [uIcc_of_le hb.le, uIcc_of_le ht.le] |
| 122 | exact Icc_subset_Icc_left (ha.le.trans hab.le)) |
| 123 | have hleftEq : (∫ t in τ₁..a, F t) = ∫ t in τ₁..a, M14BackwardLIntegrand G p t := by |
| 124 | apply intervalIntegral.integral_congr_Ioo_of_le ha.le |
| 125 | intro s hs |
| 126 | apply rawLIntegrand_eq_backward_of_eventuallyEq p ⟨hs.1, hs.2.trans hac⟩ |
| 127 | filter_upwards [gt_mem_nhds hs.2] with t ht |
| 128 | exact hleft t ht.le |
| 129 | have hrightEq : (∫ t in b..τ₂, F t) = ∫ t in b..τ₂, M14BackwardLIntegrand G q t := by |
| 130 | apply intervalIntegral.integral_congr_Ioo_of_le hb.le |
| 131 | intro s hs |
| 132 | apply rawLIntegrand_eq_backward_of_eventuallyEq q ⟨hcb.trans hs.1, hs.2⟩ |
| 133 | filter_upwards [lt_mem_nhds hs.1] with t ht |
| 134 | exact hright t ht.le |
| 135 | change (∫ t in τ₁..τ₂, F t) = _ |
| 136 | rw [← intervalIntegral.integral_add_adjacent_intervals (hleftI.trans hmiddleI) hrightI, |
| 137 | ← intervalIntegral.integral_add_adjacent_intervals hleftI hmiddleI, hleftEq, hrightEq] |
| 138 | |
| 139 | end PoincareMT.M14 |