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 Mathlib.Analysis.InnerProductSpace.Basic |
| 2 | import Mathlib.Topology.Order.Compact |
| 3 | |
| 4 | /-! |
| 5 | # Uniform strict chord bounds for compact subsets of the unit ball |
| 6 | |
| 7 | The equality case at distance two requires opposite unit vectors. Its |
| 8 | exclusion on two compact sets gives a uniform strict bound. These are the |
| 9 | finite-dimensional estimates used in the minimal-contact-regularity |
| 10 | derivation for MT Claim 19.40, pp. 470-471. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | |
| 17 | private theorem norm_sub_lt_two_of_no_opposite_unit |
| 18 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {v w : E} |
| 19 | (hv : ‖v‖ ≤ 1) (hw : ‖w‖ ≤ 1) |
| 20 | (hne : ‖v‖ = 1 → ‖w‖ = 1 → w ≠ -v) : ‖w - v‖ < 2 := by |
| 21 | by_contra h |
| 22 | have htwo : 2 ≤ ‖w - v‖ := le_of_not_gt h |
| 23 | have htri := norm_sub_le w v |
| 24 | have hv' : ‖v‖ = 1 := by linarith |
| 25 | have hw' : ‖w‖ = 1 := by linarith |
| 26 | have hd : ‖w - v‖ = 2 := by linarith |
| 27 | have heq : ‖(-v) + w‖ = ‖-v‖ + ‖w‖ := by |
| 28 | simpa only [sub_eq_add_neg, add_comm, norm_neg, hv', hw', one_add_one_eq_two] using hd |
| 29 | have hsame := (norm_add_eq_iff_real.mp heq).symm |
| 30 | exact hne hv' hw' (by simpa only [norm_neg, hv', hw', one_smul] using hsame) |
| 31 | |
| 32 | /-- Two compact subsets of the unit ball have a uniform chord bound strictly below two when |
| 33 | they contain no opposite pair of unit vectors. The sets need not be convex and the ambient |
| 34 | dimension is unrestricted. Source: MT Claim 19.40, pp. 470-471; |
| 35 | derivations/2026-09-27-minimal-contact-regularity.md, Sections 2-3. -/ |
| 36 | theorem m64Compact_exists_uniform_strict_chord_bound |
| 37 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 38 | {S T : Set E} (hS : IsCompact S) (hT : IsCompact T) |
| 39 | (hneS : S.Nonempty) (hneT : T.Nonempty) |
| 40 | (hSball : ∀ v ∈ S, ‖v‖ ≤ 1) (hTball : ∀ w ∈ T, ‖w‖ ≤ 1) |
| 41 | (hopp : ∀ v ∈ S, ∀ w ∈ T, ‖v‖ = 1 → ‖w‖ = 1 → w ≠ -v) : |
| 42 | ∃ d : ℝ, 0 ≤ d ∧ d < 2 ∧ ∀ v ∈ S, ∀ w ∈ T, ‖w - v‖ ≤ d := by |
| 43 | obtain ⟨p, hp, hmax⟩ := (hS.prod hT).exists_isMaxOn (hneS.prod hneT) |
| 44 | (show ContinuousOn (fun q : E × E => ‖q.2 - q.1‖) (S ×ˢ T) from |
| 45 | (continuous_snd.sub continuous_fst).norm.continuousOn) |
| 46 | refine ⟨‖p.2 - p.1‖, norm_nonneg _, |
| 47 | norm_sub_lt_two_of_no_opposite_unit (hSball _ hp.1) (hTball _ hp.2) |
| 48 | (hopp _ hp.1 _ hp.2), ?_⟩ |
| 49 | intro v hv w hw |
| 50 | exact hmax (show (v, w) ∈ S ×ˢ T from ⟨hv, hw⟩) |