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.CurveShortening.Comparison.Analysis.Shifted.WeightedFocusingCover |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Focusing.Loss |
| 3 | |
| 4 | /-! |
| 5 | # Actual retained normal domains over a short boundary arc |
| 6 | |
| 7 | Collision inequalities on the specified ordered subarcs construct a |
| 8 | measurable focusing cover. Removing it makes the whole variable-height |
| 9 | normal strip injective, and its weighted loss is charged only to the |
| 10 | turning of the local arc. This is the local construction in Morgan--Tian, |
| 11 | Lemma 19.46, Case (ii), printed pp. 475-477. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set MeasureTheory |
| 18 | open scoped Matrix |
| 19 | |
| 20 | namespace PoincareMT |
| 21 | |
| 22 | /-- Actual collision inequalities construct a measurable exceptional set |
| 23 | on any boundary parameter interval and an injective retained strip. The |
| 24 | bound uses only that interval's literal absolute turning. Individual-ray |
| 25 | injectivity and focusing on the specified ordered subarc remain inputs. |
| 26 | Source: Morgan--Tian, Lemma 19.46, Case (ii), printed pp. 475-477. -/ |
| 27 | theorem m64Intrinsic_exists_local_arc_retained_normal_domain |
| 28 | (N : IntrinsicAnnulus) (e : AnnulusCoordinates → AnnulusCoordinates) |
| 29 | (height : ℝ → ℝ) {l u : ℝ} (hlu : l < u) |
| 30 | {X : Set ℝ} (hX : X ⊆ Ioo l u) |
| 31 | {A τ : ℝ} (hA : 0 ≤ A) (hτ : 3 < τ) |
| 32 | (hray : ∀ a ∈ X, InjOn (fun t => e !₂[a, t]) (Icc 0 (height a))) |
| 33 | (hfocus : ∀ a ∈ X, ∀ b ∈ X, a < b → |
| 34 | (∃ t ∈ Icc 0 (height a), ∃ s ∈ Icc 0 (height b), e !₂[a, t] = e !₂[b, s]) → |
| 35 | intrinsicBoundaryLength N.metric 1 a b ≤ |
| 36 | A * intrinsicGeodesicCurvatureIntegral N.metric N.connection 1 a b) : |
| 37 | ∃ E : Set ℝ, MeasurableSet E ∧ E ⊆ Icc l u ∧ |
| 38 | (∫ x in E, intrinsicBoundarySpeed N.metric 1 x) ≤ |
| 39 | (τ * A) * intrinsicGeodesicCurvatureIntegral N.metric N.connection 1 l u ∧ |
| 40 | InjOn e {z : AnnulusCoordinates | z 0 ∈ X \ E ∧ z 1 ∈ Icc 0 (height (z 0))} := by |
| 41 | let T : Set (ℝ × ℝ) := {p | p.1 ∈ X ∧ p.2 ∈ X ∧ p.1 < p.2 ∧ |
| 42 | ∃ t ∈ Icc 0 (height p.1), ∃ s ∈ Icc 0 (height p.2), e !₂[p.1, t] = e !₂[p.2, s]} |
| 43 | have hT (p : ℝ × ℝ) (hp : p ∈ T) : |
| 44 | l ≤ p.1 ∧ p.1 < p.2 ∧ p.2 ≤ u := |
| 45 | ⟨(hX hp.1).1.le, hp.2.2.1, (hX hp.2.1).2.le⟩ |
| 46 | obtain ⟨E, hE, hEsub, hcover, hbound⟩ := |
| 47 | m64_exists_shifted_weighted_focusing_cover |
| 48 | (m64Intrinsic_contDiff_boundarySpeed N (by norm_num : (1 : ℝ) ≠ 0)).continuous |
| 49 | (m64Intrinsic_boundarySpeed_pos N (by norm_num : (1 : ℝ) ≠ 0)) |
| 50 | (m64Intrinsic_continuous_turning_density N (by norm_num : (1 : ℝ) ≠ 0)) |
| 51 | (fun _ => mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _)) |
| 52 | hlu hA hτ T hT (fun p hp => hfocus p.1 hp.1 p.2 hp.2.1 hp.2.2.1 hp.2.2.2) |
| 53 | refine ⟨E, hE, hEsub, hbound, ?_⟩ |
| 54 | have hrepr (z : AnnulusCoordinates) : !₂[z 0, z 1] = z := by |
| 55 | ext i |
| 56 | fin_cases i <;> rfl |
| 57 | intro x hx y hy hxy |
| 58 | have heq : x 0 = y 0 := by |
| 59 | rcases lt_trichotomy (x 0) (y 0) with hlt | heq | hlt |
| 60 | · have hpair : (x 0, y 0) ∈ T := |
| 61 | ⟨hx.1.1, hy.1.1, hlt, x 1, hx.2, y 1, hy.2, by simpa only [hrepr] using hxy⟩ |
| 62 | exact False.elim (hx.1.2 (hcover _ hpair ⟨le_rfl, hlt.le⟩)) |
| 63 | · exact heq |
| 64 | · have hpair : (y 0, x 0) ∈ T := |
| 65 | ⟨hy.1.1, hx.1.1, hlt, y 1, hy.2, x 1, hx.2, by simpa only [hrepr] using hxy.symm⟩ |
| 66 | exact False.elim (hy.1.2 (hcover _ hpair ⟨le_rfl, hlt.le⟩)) |
| 67 | have hyrepr : !₂[x 0, y 1] = y := by rw [heq, hrepr] |
| 68 | have ht : x 1 = y 1 := hray (x 0) hx.1.1 hx.2 |
| 69 | (by simpa only [heq] using hy.2) (by simpa only [hrepr, hyrepr] using hxy) |
| 70 | ext i |
| 71 | fin_cases i |
| 72 | · exact heq |
| 73 | · exact ht |
| 74 | |
| 75 | /-- Local sine focusing constructs an injective retained normal strip |
| 76 | whose removed weighted length is at most eight times the focusing radius |
| 77 | times the actual turning of the chosen arc. No loss bound is assumed. |
| 78 | Source: Morgan--Tian, Lemma 19.46, Case (ii), printed pp. 475-477. -/ |
| 79 | theorem m64Intrinsic_exists_local_arc_retained_domain_with_sine_focusing |
| 80 | (N : IntrinsicAnnulus) (e : AnnulusCoordinates → AnnulusCoordinates) |
| 81 | (height : ℝ → ℝ) {l u : ℝ} (hlu : l < u) |
| 82 | {X : Set ℝ} (hX : X ⊆ Ioo l u) |
| 83 | {rho kappa : ℝ} (hrho : 0 < rho) (hkappa : 0 < kappa) |
| 84 | (hangle : kappa * rho ≤ Real.pi / 4) |
| 85 | (hray : ∀ a ∈ X, InjOn (fun t => e !₂[a, t]) (Icc 0 (height a))) |
| 86 | (hfocus : ∀ a ∈ X, ∀ b ∈ X, a < b → |
| 87 | (∃ t ∈ Icc 0 (height a), ∃ s ∈ Icc 0 (height b), e !₂[a, t] = e !₂[b, s]) → |
| 88 | Real.cos (kappa * rho) * intrinsicBoundaryLength N.metric 1 a b ≤ |
| 89 | (Real.sin (kappa * rho) / kappa) * |
| 90 | intrinsicGeodesicCurvatureIntegral N.metric N.connection 1 a b) : |
| 91 | ∃ E : Set ℝ, MeasurableSet E ∧ E ⊆ Icc l u ∧ |
| 92 | (∫ x in E, intrinsicBoundarySpeed N.metric 1 x) ≤ |
| 93 | 8 * rho * intrinsicGeodesicCurvatureIntegral N.metric N.connection 1 l u ∧ |
| 94 | InjOn e {z : AnnulusCoordinates | z 0 ∈ X \ E ∧ z 1 ∈ Icc 0 (height (z 0))} := by |
| 95 | obtain ⟨E, hE, hEsub, hbound, hinj⟩ := |
| 96 | m64Intrinsic_exists_local_arc_retained_normal_domain N e height hlu hX |
| 97 | (A := 2 * rho) (τ := 4) (by positivity) (by norm_num) hray |
| 98 | (fun a ha b hb hab hmeet => |
| 99 | m64Intrinsic_sine_focusing_length_le_twice_radius_turning hrho hkappa hangle |
| 100 | (m64Intrinsic_boundaryLength_nonneg N 1 a b hab.le) |
| 101 | (m64Intrinsic_geodesicCurvatureIntegral_nonneg N 1 a b hab.le) |
| 102 | (hfocus a ha b hb hab hmeet)) |
| 103 | refine ⟨E, hE, hEsub, ?_, hinj⟩ |
| 104 | simpa only [show (4 : ℝ) * (2 * rho) = 8 * rho by ring] using hbound |
| 105 | |
| 106 | end PoincareMT |