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.Extinction.Width.ScalarClock.Comparison |
| 2 | import PoincareLib.Geometry.RicciFlow.Extinction.Width.ScalarClock.FiniteRestart |
| 3 | import PoincareLib.Geometry.RicciFlow.Extinction.Width.Profile.Theory |
| 4 | |
| 5 | set_option autoImplicit false |
| 6 | |
| 7 | open Set Filter |
| 8 | open scoped Topology |
| 9 | |
| 10 | universe u |
| 11 | |
| 12 | namespace PoincareMT |
| 13 | |
| 14 | /-- A comparison which can cross one regular piece and its terminal event |
| 15 | propagates across any finite set of interior events. -/ |
| 16 | theorem m68_finite_event_propagation |
| 17 | {L U : ℝ} {E : Set ℝ} {f G : ℝ → ℝ} |
| 18 | (hpiece : ∀ a b, L ≤ a → a < b → b ≤ U → |
| 19 | Disjoint E (Ioo a b) → f a ≤ G a → f b ≤ G b) |
| 20 | (s : Finset ℝ) : |
| 21 | ∀ a b, L ≤ a → a ≤ b → b ≤ U → |
| 22 | (∀ x, x ∈ Ioo a b → x ∈ E → x ∈ s) → |
| 23 | f a ≤ G a → f b ≤ G b := by |
| 24 | classical |
| 25 | induction s using Finset.induction_on with |
| 26 | | empty => |
| 27 | intro a b ha hab hb hcover hinit |
| 28 | rcases hab.eq_or_lt with hab | hab |
| 29 | · simpa [← hab] using hinit |
| 30 | · apply hpiece a b ha hab hb ?_ hinit |
| 31 | exact Set.disjoint_left.mpr (fun x hx hxab => by |
| 32 | simpa using hcover x hxab hx) |
| 33 | | @insert e s hes ih => |
| 34 | intro a b ha hab hb hcover hinit |
| 35 | by_cases he : e ∈ Ioo a b |
| 36 | · have hleft : f e ≤ G e := by |
| 37 | apply ih a e ha he.1.le (he.2.le.trans hb) ?_ hinit |
| 38 | intro x hx hxE |
| 39 | have hmem := hcover x ⟨hx.1, hx.2.trans he.2⟩ hxE |
| 40 | exact (Finset.mem_insert.mp hmem).resolve_left (ne_of_lt hx.2) |
| 41 | apply ih e b (ha.trans he.1.le) he.2.le hb ?_ hleft |
| 42 | intro x hx hxE |
| 43 | have hmem := hcover x ⟨he.1.trans hx.1, hx.2⟩ hxE |
| 44 | exact (Finset.mem_insert.mp hmem).resolve_left (ne_of_gt hx.1) |
| 45 | · apply ih a b ha hab hb ?_ hinit |
| 46 | intro x hx hxE |
| 47 | have hmem := hcover x hx hxE |
| 48 | exact (Finset.mem_insert.mp hmem).resolve_left (fun hxe => he (hxe ▸ hx)) |
| 49 | |
| 50 | /-- The scalar-clock profile bounds an M67 width path, with the surgery |
| 51 | lower-limit estimate providing the value from which the next piece restarts. -/ |
| 52 | theorem m68_scalar_clock_statement : M68ScalarClockStatement := by |
| 53 | classical |
| 54 | intro g₀ D W T P K C H B A q hM61 hM64 hM65 X HX I |
| 55 | let f : ℝ → ℝ := fun x => |
| 56 | if hx : x ∈ Icc (0 : ℝ) T then X.width ⟨x, hx⟩ else 0 |
| 57 | have hf (t : Icc (0 : ℝ) T) : f t.1 = X.width t := by |
| 58 | simp only [f, dif_pos t.property] |
| 59 | have hpiece : ∀ a b, I.T₁ ≤ a → a < b → b ≤ I.T₂ → |
| 60 | Disjoint D.flow.surgery_times (Ioo a b) → |
| 61 | f a ≤ m68Profile I a → f b ≤ m68Profile I b := by |
| 62 | intro a b ha hab hb hJ hinit |
| 63 | have ha0 : 0 ≤ a := I.ordered.1.trans ha |
| 64 | have haT : a ≤ T := hab.le.trans (hb.trans I.ordered.2.2) |
| 65 | have hb0 : 0 ≤ b := ha0.trans hab.le |
| 66 | have hbT : b ≤ T := hb.trans I.ordered.2.2 |
| 67 | have hcompare (c : ℝ) (hac : a < c) (hcb : c ≤ b) |
| 68 | (hJc : Disjoint D.flow.surgery_times (Ioc a c)) : |
| 69 | f c ≤ m68Profile I c := by |
| 70 | have hinit' : X.width (M68ProfileInput.time I |
| 71 | ⟨a, ⟨ha, hac.le.trans (hcb.trans hb)⟩⟩) ≤ m68Profile I a := by |
| 72 | simpa only [f, dif_pos (show a ∈ Icc (0 : ℝ) T from ⟨ha0, haT⟩), |
| 73 | M68ProfileInput.time] using hinit |
| 74 | have hc := m68_no_event_interval_bound HX I ha0 hac (hcb.trans hb) ha hJc |
| 75 | hinit' ⟨c, hac.le, le_rfl⟩ |
| 76 | rw [hf ⟨c, ha0.trans hac.le, hcb.trans hbT⟩] |
| 77 | exact hc |
| 78 | by_cases hbe : b ∈ D.flow.surgery_times |
| 79 | · apply m68_event_restart_bound hab |
| 80 | · intro c hc |
| 81 | apply hcompare c hc.1 hc.2.le |
| 82 | apply Set.disjoint_left.mpr |
| 83 | intro x hxE hx |
| 84 | exact Set.disjoint_left.mp hJ hxE ⟨hx.1, hx.2.trans_lt hc.2⟩ |
| 85 | · intro ε hε |
| 86 | have hbP : b ∈ (↑P.surgery_times : Set ℝ) := by |
| 87 | rw [P.surgery_times_eq] |
| 88 | exact ⟨hbe, hb0, hbT⟩ |
| 89 | obtain ⟨δ, hδ, hbound⟩ := HX.surgery_lower_limit ⟨b, hb0, hbT⟩ hbP ε hε |
| 90 | refine ⟨δ, hδ, ?_⟩ |
| 91 | intro c hc hnear hbefore |
| 92 | have hc0T : c ∈ Icc (0 : ℝ) T := |
| 93 | ⟨ha0.trans hc.1, hc.2.trans hbT⟩ |
| 94 | rw [hf ⟨b, hb0, hbT⟩, hf ⟨c, hc0T⟩] |
| 95 | exact hbound ⟨c, hc0T⟩ hnear hbefore |
| 96 | · exact (m68_profile_equation I ⟨b, ha.trans hab.le, hb⟩).continuousAt |
| 97 | · apply hcompare b hab le_rfl |
| 98 | apply Set.disjoint_left.mpr |
| 99 | intro x hxE hx |
| 100 | rcases hx.2.eq_or_lt with hxb | hxb |
| 101 | · exact hbe (hxb ▸ hxE) |
| 102 | · exact Set.disjoint_left.mp hJ hxE ⟨hx.1, hxb⟩ |
| 103 | refine ⟨{ |
| 104 | clock_positive := ?_ |
| 105 | profile_initial := m68_profile_initial I |
| 106 | profile_equation := m68_profile_equation I |
| 107 | width_bound := ?_ |
| 108 | }⟩ |
| 109 | · intro t |
| 110 | have ht0 : 0 ≤ t.1 := I.ordered.1.trans t.2.1 |
| 111 | linarith |
| 112 | · intro t |
| 113 | have hinit : f I.T₁ ≤ m68Profile I I.T₁ := by |
| 114 | rw [m68_profile_initial I] |
| 115 | exact le_of_eq (hf I.start) |
| 116 | have hfinal := m68_finite_event_propagation hpiece |
| 117 | (Finset.univ.image I.chronology.time) I.T₁ t.1 le_rfl t.2.1 t.2.2 |
| 118 | (by |
| 119 | intro x hx hxE |
| 120 | have hx0T : x ∈ Icc (0 : ℝ) T := |
| 121 | ⟨I.ordered.1.trans hx.1.le, hx.2.le.trans (t.2.2.trans I.ordered.2.2)⟩ |
| 122 | have hxP : x ∈ (↑P.surgery_times : Set ℝ) := by |
| 123 | rw [P.surgery_times_eq] |
| 124 | exact ⟨hxE, hx0T⟩ |
| 125 | have hxrange : x ∈ Set.range I.chronology.time := by |
| 126 | rw [I.chronology.complete] |
| 127 | exact ⟨hxP, hx.1, hx.2.trans_le t.2.2⟩ |
| 128 | obtain ⟨i, rfl⟩ := hxrange |
| 129 | exact Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩) hinit |
| 130 | change f (M68ProfileInput.time I t).1 ≤ m68Profile I t.1 at hfinal |
| 131 | rw [hf (M68ProfileInput.time I t)] at hfinal |
| 132 | exact hfinal |
| 133 | |
| 134 | end PoincareMT |