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 | /- Adapted from Mapher `PoincareMT/Proofs/M03/GlobalDifferenceEnergy.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.RicciFlow.Local.Energy.Comparison.ScalarEnergyComparison |
| 6 | |
| 7 | /-! |
| 8 | # Scalar closure for the coupled difference energy |
| 9 | |
| 10 | The geometric rate producers reserve half of the curvature dissipation for |
| 11 | the connection estimate. This file contains the purely scalar coupling and |
| 12 | the endpoint-safe interval adapter used after those producers are available. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | |
| 19 | namespace PoincareMT.RicciFlow.Local |
| 20 | |
| 21 | /- The three component inequalities retain one half of the dissipation. -/ |
| 22 | theorem energy_rate_le_of_coupled_component_rates |
| 23 | {rH rA rS CH CA CS E D : ℝ} |
| 24 | (hH : rH ≤ CH * E) |
| 25 | (hA : rA ≤ CA * E + (1 / 2 : ℝ) * D) |
| 26 | (hS : rS ≤ CS * E - D) : |
| 27 | rH + rA + rS ≤ (CH + CA + CS) * E - (1 / 2 : ℝ) * D := by |
| 28 | linarith |
| 29 | |
| 30 | /- |
| 31 | The rate hypotheses are stated on the actual overlap. Order-connectedness |
| 32 | places every compact slab from zero inside that overlap, while strict |
| 33 | intermediate times lie in its interior. The scalar comparison theorem then |
| 34 | closes each slab and continuity supplies an included common endpoint. |
| 35 | -/ |
| 36 | theorem energy_eq_zero_on_common_interval_of_interior_slabs |
| 37 | {E : ℝ → ℝ} {J K : Set ℝ} |
| 38 | (hJ : J.OrdConnected) (hK : K.OrdConnected) |
| 39 | (hJ0 : IsLeast J 0) (hK0 : IsLeast K 0) (hE0 : E 0 = 0) |
| 40 | (hcont : ContinuousOn E (J ∩ K)) |
| 41 | (hnonneg : ∀ t ∈ J ∩ K, 0 ≤ E t) |
| 42 | (hslab : ∀ b ∈ interior (J ∩ K), 0 < b → ∃ C : ℝ, ∃ rate : ℝ → ℝ, |
| 43 | (∀ t ∈ Ioo 0 b, HasDerivWithinAt E (rate t) (J ∩ K) t) ∧ |
| 44 | (∀ t ∈ Ioo 0 b, rate t ≤ C * E t)) : |
| 45 | EqOn E (fun _ => 0) (J ∩ K) := by |
| 46 | have hcommon {b : ℝ} (hb : b ∈ J ∩ K) : Icc 0 b ⊆ J ∩ K := by |
| 47 | intro s hs |
| 48 | exact ⟨hJ.out hJ0.1 hb.1 hs, hK.out hK0.1 hb.2 hs⟩ |
| 49 | have hinterior {b : ℝ} (hb : b ∈ J ∩ K) : |
| 50 | Ioo 0 b ⊆ interior (J ∩ K) := by |
| 51 | apply interior_maximal |
| 52 | (Ioo_subset_Icc_self.trans (hcommon hb)) |
| 53 | isOpen_Ioo |
| 54 | intro t ht |
| 55 | have ht0 : 0 ≤ t := hJ0.2 ht.1 |
| 56 | rcases eq_or_lt_of_le ht0 with rfl | htpos |
| 57 | · exact hE0 |
| 58 | have hzero_lt : ∀ s ∈ Ioo 0 t, E s = 0 := by |
| 59 | intro s hs |
| 60 | let b := (s + t) / 2 |
| 61 | have hbpos : 0 < b := by |
| 62 | dsimp [b] |
| 63 | linarith [hs.1] |
| 64 | have hsb : s < b := by |
| 65 | dsimp [b] |
| 66 | linarith [hs.2] |
| 67 | have hbt : b < t := by |
| 68 | dsimp [b] |
| 69 | linarith [hs.2] |
| 70 | have hbdom : b ∈ J ∩ K := hcommon ht ⟨hbpos.le, hbt.le⟩ |
| 71 | have hbint : b ∈ interior (J ∩ K) := hinterior ht ⟨hbpos, hbt⟩ |
| 72 | obtain ⟨C, rate, hderiv, hbound⟩ := hslab b hbint hbpos |
| 73 | have hIcc : Icc 0 b ⊆ J ∩ K := hcommon hbdom |
| 74 | have hcont' : ContinuousOn E (Icc 0 b) := hcont.mono hIcc |
| 75 | have hnonneg' : ∀ r ∈ Icc 0 b, 0 ≤ E r := fun r hr => |
| 76 | hnonneg r (hIcc hr) |
| 77 | have hdiff : ∀ r ∈ Ioo 0 b, DifferentiableAt ℝ E r := by |
| 78 | intro r hr |
| 79 | have hd := (hderiv r hr).mono hIcc |
| 80 | exact (hd.hasDerivAt (Icc_mem_nhds hr.1 hr.2)).differentiableAt |
| 81 | have hrate : ∀ r ∈ Ioo 0 b, deriv E r ≤ C * E r := by |
| 82 | intro r hr |
| 83 | have hd := (hderiv r hr).mono hIcc |
| 84 | rw [(hd.hasDerivAt (Icc_mem_nhds hr.1 hr.2)).deriv] |
| 85 | exact hbound r hr |
| 86 | have hzero := eq_zero_on_interval_of_deriv_le_mul hcont' hdiff hE0 |
| 87 | hnonneg' hrate |
| 88 | exact hzero ⟨hs.1.le, hsb.le⟩ |
| 89 | have hzero_co : EqOn E (fun _ => 0) (Ico 0 t) := by |
| 90 | intro s hs |
| 91 | rcases hs.1.eq_or_lt with rfl | hspos |
| 92 | · exact hE0 |
| 93 | · exact hzero_lt s ⟨hspos, hs.2⟩ |
| 94 | have hzero_cc := hzero_co.of_subset_closure (hcont.mono (hcommon ht)) |
| 95 | continuousOn_const Ico_subset_Icc_self (by rw [closure_Ico htpos.ne]) |
| 96 | simpa only using hzero_cc ⟨htpos.le, le_rfl⟩ |
| 97 | |
| 98 | end PoincareMT.RicciFlow.Local |