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.StandardCap.Uniqueness.Imports |
| 2 | import Mathlib.Algebra.Order.Field.Basic |
| 3 | import Mathlib.Order.Interval.Set.Defs |
| 4 | import Mathlib.Tactic.Linarith |
| 5 | |
| 6 | /-! |
| 7 | # An affine backward interval inclusion |
| 8 | |
| 9 | The real-variable interval calculation used in Morgan-Tian, Theorem 12.28, |
| 10 | pp. 323-324, when realizing finite normalized past intervals of the actual flow. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | |
| 17 | /-- A finite normalized past remains in the original half-open time interval. |
| 18 | Used in Theorem 12.28, pp. 323-324. -/ |
| 19 | theorem add_div_mem_Ico_of_mem_Icc {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] |
| 20 | [IsStrictOrderedRing 𝕜] {L a Q T s : 𝕜} (ha : a ∈ Ico 0 L) |
| 21 | (hQ : 0 < Q) (hT : T ≤ Q * a) (hs : s ∈ Icc (-T) 0) : |
| 22 | a + s / Q ∈ Ico 0 L := by |
| 23 | have hlo : -a ≤ s / Q := (le_div_iff₀ hQ).2 (by nlinarith [hs.1]) |
| 24 | have hhi : s / Q ≤ 0 := div_nonpos_of_nonpos_of_nonneg hs.2 hQ.le |
| 25 | exact ⟨by linarith, by linarith [ha.2]⟩ |