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.Induction.Noncollapse.LGeometry.Variation.MinimumComparison |
| 2 | |
| 3 | /-! |
| 4 | # Scalar comparison with an inactive constant cap |
| 5 | |
| 6 | Morgan--Tian Proposition 16.4, pp. 389-391. In square-root time an |
| 7 | active free minimum has derivative at most (3-2l)/s; the constant |
| 8 | action cap has normalized derivative -l/s. Both upper competitors |
| 9 | point strictly below every constant level above 3/2. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Topology |
| 16 | |
| 17 | namespace PoincareMT.Proofs.M46 |
| 18 | |
| 19 | /-- The scalar threshold is preserved with either an actual minimizing |
| 20 | branch or the inactive constant-action cap as upper competitor. -/ |
| 21 | theorem capped_minimum_le_of_upper_competitors {f : ℝ → ℝ} {a b : ℝ} |
| 22 | (ha : 0 < a) (hf : ContinuousOn f (Icc a b)) (hstart : f a ≤ 3 / 2) |
| 23 | (hcontact : ∀ t ∈ Ico a b, ∃ phi : ℝ → ℝ, ∃ d : ℝ, |
| 24 | HasDerivAt phi d t ∧ phi t = f t ∧ |
| 25 | (∀ᶠ s in 𝓝[>] t, f s ≤ phi s) ∧ |
| 26 | d ≤ max ((3 - 2 * f t) / t) (-f t / t)) : |
| 27 | ∀ t ∈ Icc a b, f t ≤ 3 / 2 := by |
| 28 | have hslope : ∀ t ∈ Ico a b, ∀ r, |
| 29 | max ((3 - 2 * f t) / t) (-f t / t) < r → |
| 30 | ∃ᶠ s in 𝓝[>] t, slope f t s < r := by |
| 31 | intro t ht |
| 32 | obtain ⟨phi, d, hphi, heq, hnear, hd⟩ := hcontact t ht |
| 33 | exact right_slope_bound_of_upper_competitor hphi heq hnear hd |
| 34 | intro t ht |
| 35 | apply le_of_forall_pos_le_add |
| 36 | intro epsilon hepsilon |
| 37 | apply image_le_of_liminf_slope_right_lt_deriv_boundary hf hslope |
| 38 | (B := fun _ => 3 / 2 + epsilon) (B' := fun _ => 0) |
| 39 | (hstart.trans (le_add_of_nonneg_right hepsilon.le)) |
| 40 | (fun s => hasDerivAt_const s (3 / 2 + epsilon)) _ ht |
| 41 | intro s hs heq |
| 42 | have hspos : 0 < s := ha.trans_le hs.1 |
| 43 | rw [heq] |
| 44 | exact max_lt (div_neg_of_neg_of_pos (by linarith) hspos) |
| 45 | (div_neg_of_neg_of_pos (by linarith) hspos) |
| 46 | |
| 47 | end PoincareMT.Proofs.M46 |