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.GlobalSchedule.Parameters.Parameters |
| 2 | |
| 3 | /-! |
| 4 | # Earlier prefix controls on the same observed flow |
| 5 | |
| 6 | Morgan--Tian Definition 15.7, pp. 360-361, and Section 17.2, p. 409. |
| 7 | Earlier entries end before the prefix boundary. Changing the observation |
| 8 | does not change the flow, its cylinders or any earlier parameter value. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set |
| 14 | open scoped ENNReal |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT |
| 19 | |
| 20 | private theorem entry_time_lt {j : ℕ} {t : ℝ} |
| 21 | (ht : t ∈ surgeryEpochEntry j) : t < surgeryEpochStart j := by |
| 22 | by_cases hj : j = 0 |
| 23 | · subst j |
| 24 | exact ht.2 |
| 25 | · exact (show t ∈ Ico (surgeryEpochStart (j - 1)) (surgeryEpochStart j) from |
| 26 | by simpa [surgeryEpochEntry, hj] using ht).2 |
| 27 | |
| 28 | private theorem observed_old_entry {K : MetricSurgeryConstants} |
| 29 | {p : SurgeryParameterPrefix K} {F : SurgeryFlowData.{u}} |
| 30 | {O : SurgeryObservation F} (hH : O.H ≤ surgeryEpochStart p.i) |
| 31 | {t : ℝ} (ht : t ∈ surgeryObservationInterval O) : |
| 32 | ∃ j : Fin (p.i + 1), t ∈ surgeryEpochEntry j.val := by |
| 33 | have hj := M51Numerical.epochIndex_le (ht.2.trans_le hH) |
| 34 | exact ⟨⟨M51Numerical.epochIndex t, Nat.lt_succ_of_le hj⟩, |
| 35 | M51Numerical.mem_epochEntry_index ht.1⟩ |
| 36 | |
| 37 | /-- All earlier entries remain controlled on any observation of this same |
| 38 | flow. Whole-flow pinching supplies the enlarged observed pinching clause. -/ |
| 39 | theorem SurgeryPrefixControls.observePastPrefix |
| 40 | {K : MetricSurgeryConstants} {p : SurgeryParameterPrefix K} |
| 41 | {F : SurgeryFlowData.{u}} {O : SurgeryObservation F} |
| 42 | (old : SurgeryPrefixControls p F O) (O' : SurgeryObservation F) |
| 43 | (hstart : surgeryEpochStart p.i ≤ O.H) (hpinched : SurgeryFlowPinched F) : |
| 44 | SurgeryPrefixControls p F O' := by |
| 45 | have htime {j : Fin (p.i + 1)} {t : ℝ} |
| 46 | (ht : t ∈ surgeryObservationInterval O' ∩ surgeryEpochEntry j.val) : |
| 47 | t ∈ surgeryObservationInterval O ∩ surgeryEpochEntry j.val := by |
| 48 | refine ⟨⟨ht.1.1, ?_⟩, ht.2⟩ |
| 49 | exact (entry_time_lt ht.2).trans_le |
| 50 | ((M51Numerical.epochStart_strictMono.monotone |
| 51 | (Nat.le_of_lt_succ j.isLt)).trans hstart) |
| 52 | exact { |
| 53 | standard_initial_eq := old.standard_initial_eq |
| 54 | local_constants_eq := old.local_constants_eq |
| 55 | epsilon_eq := old.epsilon_eq |
| 56 | C_eq := old.C_eq |
| 57 | admissible := old.admissible |
| 58 | pinched := fun t _ ht => hpinched t ht |
| 59 | canonical := fun j hj t ht => old.canonical j hj t (htime ht) |
| 60 | noncollapsed := fun j hj t ht => old.noncollapsed j hj t (htime ht) |
| 61 | delta_bound := fun j hj t ht => old.delta_bound j hj t (htime ht) |
| 62 | r_schedule := fun j hj t ht => old.r_schedule j hj t (htime ht) |
| 63 | kappa_schedule := fun j hj t ht => old.kappa_schedule j hj t (htime ht) |
| 64 | h_schedule := fun j hj t ht => old.h_schedule j hj t (htime ht) } |
| 65 | |
| 66 | /-- At the prefix boundary, the smaller next radius tests only points |
| 67 | already controlled by their actual earlier entry. -/ |
| 68 | theorem SurgeryPrefixControls.canonicalBeforePrefix |
| 69 | {K : MetricSurgeryConstants} {p : SurgeryParameterPrefix K} |
| 70 | {F : SurgeryFlowData.{u}} {O : SurgeryObservation F} |
| 71 | (old : SurgeryPrefixControls p F O) (hH : O.H ≤ surgeryEpochStart p.i) |
| 72 | {Q : SurgeryNoncollapseExtension.{u} p} (R : SurgeryCanonicalExtension p Q) : |
| 73 | SurgeryCanonicalOn F (surgeryObservationInterval O) R.rNext := by |
| 74 | intro t ht htF x hx |
| 75 | obtain ⟨j, hj⟩ := observed_old_entry hH ht |
| 76 | have hji : j.val ≤ p.i := Nat.le_of_lt_succ j.isLt |
| 77 | have hr : R.rNext ≤ p.r j := R.r_le_last.trans (p.r_antitone hji) |
| 78 | have hinv : (p.r j)⁻¹ ≤ R.rNext⁻¹ := (inv_le_inv₀ (p.r_pos j) R.r_pos).2 hr |
| 79 | have hsquare := pow_le_pow_left₀ (inv_nonneg.mpr (p.r_pos j).le) hinv 2 |
| 80 | exact old.canonical j hji t ⟨ht, hj⟩ htF x (hsquare.trans hx) |
| 81 | |
| 82 | /-- The uniform next kappa is no larger than any earlier entry. The closed |
| 83 | backward cylinder and positive-component exclusion remain the original ones. -/ |
| 84 | theorem SurgeryPrefixControls.noncollapsedBeforePrefix |
| 85 | {K : MetricSurgeryConstants} {p : SurgeryParameterPrefix K} |
| 86 | {F : SurgeryFlowData.{u}} {O : SurgeryObservation F} |
| 87 | (old : SurgeryPrefixControls p F O) (hH : O.H ≤ surgeryEpochStart p.i) |
| 88 | (Q : SurgeryNoncollapseExtension.{u} p) : |
| 89 | SurgeryNoncollapsedOn F (surgeryObservationInterval O) Q.kappaNew := by |
| 90 | intro t ht htF x hx r hr hre e hzero hcurv |
| 91 | obtain ⟨j, hj⟩ := observed_old_entry hH ht |
| 92 | have hji : j.val ≤ p.i := Nat.le_of_lt_succ j.isLt |
| 93 | have hk : Q.kappaNew ≤ p.kappa j := Q.kappa_le_last.trans (p.kappa_antitone hji) |
| 94 | exact (ENNReal.ofReal_le_ofReal |
| 95 | (mul_le_mul_of_nonneg_right hk (pow_nonneg hr.le 3))).trans |
| 96 | (old.noncollapsed j hji t ⟨ht, hj⟩ htF x hx r hr hre e hzero hcurv) |
| 97 | |
| 98 | /-- Recover the actual earlier kappa profile, without replacing it by the |
| 99 | smaller next-step constant. -/ |
| 100 | theorem SurgeryPrefixControls.noncollapsedProfileBeforePrefix |
| 101 | {K : MetricSurgeryConstants} {p : SurgeryParameterPrefix K} |
| 102 | {F : SurgeryFlowData.{u}} {O : SurgeryObservation F} |
| 103 | (old : SurgeryPrefixControls p F O) (hH : O.H ≤ surgeryEpochStart p.i) : |
| 104 | SurgeryNoncollapsedAssumptionOn F (surgeryObservationInterval O) := by |
| 105 | intro t ht htF x hx r hr hre e hzero hcurv |
| 106 | obtain ⟨j, hj⟩ := observed_old_entry hH ht |
| 107 | have hji : j.val ≤ p.i := Nat.le_of_lt_succ j.isLt |
| 108 | have hv := old.noncollapsed j hji t ⟨ht, hj⟩ htF x hx r hr hre e hzero hcurv |
| 109 | simpa only [old.kappa_schedule j hji t ⟨ht, hj⟩] using hv |
| 110 | |
| 111 | end PoincareMT |