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.IntrinsicComparison.Normal.RayEmbedding |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Global.CollisionFocusing |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Local.CurvatureArc |
| 4 | |
| 5 | /-! Embeddedness of every good stopped normal ray from original data. |
| 6 | Source: MT Lemma 19.53, p. 478; local-inverse-self-return derivation, |
| 7 | Sections 1-4. The local collision premise is discharged by actual focusing. -/ |
| 8 | |
| 9 | noncomputable section |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open Set |
| 14 | open scoped Topology ContDiff Manifold Bundle Matrix |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 19 | normedSpaceTangentSpaceVectorSpace |
| 20 | |
| 21 | /-- The original uniform normal family has embedded good rays through their closed stopping |
| 22 | endpoints. Essential loops and returns to the initial point are covered without a supplied |
| 23 | slit compactification. Source: MT Lemma 19.53; local-inverse-self-return derivation, |
| 24 | Sections 1-4. Source/construction: |
| 25 | proof-work/tasks/M64/derivations/2026-09-27-local-inverse-self-return.md, Sections 1-4. -/ |
| 26 | theorem m64Intrinsic_good_normal_ray_injOn |
| 27 | (N : IntrinsicAnnulus) {K delta r q mu alpha h : ℝ} |
| 28 | (hK : N.GaussianCurvatureBound K) (hdelta : 0 < delta) (hdeltaSmall : delta < 1 / 100) |
| 29 | (hq : 0 < q) (hqr : 2 * q ≤ r) (hhq : h ≤ q / 100) |
| 30 | (hturn : N.SmallBoundaryTurning delta r) (halpha : 100 * delta / q ≤ alpha) |
| 31 | (hsmall : 4 * (q / 10) * alpha < 1) |
| 32 | (hfirst : 2 * q < intrinsicBoundaryLength N.metric 1 0 rampPeriod) |
| 33 | (harea : intrinsicAnnulusArea N.metric < mu) |
| 34 | (hbudget : max K 0 * mu + delta ≤ Real.pi / 2) |
| 35 | (hmodel : Real.sqrt (max K 1) * q ≤ 1 / 2) |
| 36 | (hareaLoss : intrinsicAnnulusArea N.metric < (1 - delta) ^ 2 * h * (q / 10)) |
| 37 | (e : AnnulusCoordinates → AnnulusCoordinates) (he : ContDiff ℝ ∞ e) |
| 38 | (normal : ℝ → AnnulusCoordinates) (height : ℝ → ℝ) |
| 39 | (hbase : ∀ p, e !₂[p, 0] = intrinsicAnnulusBoundary 1 p) |
| 40 | (hderiv : ∀ p, HasDerivAt (fun t => e !₂[p, t]) (normal p) 0) |
| 41 | (hunit0 : ∀ p, N.metric.inner (intrinsicAnnulusBoundary 1 p) (normal p) (normal p) = 1) |
| 42 | (horth0 : ∀ p, N.metric.inner (intrinsicAnnulusBoundary 1 p) |
| 43 | (deriv (intrinsicAnnulusBoundary 1) p) (normal p) = 0) |
| 44 | (hinward0 : ∀ p, 0 < inner ℝ (intrinsicAnnulusBoundary 1 p) (normal p)) |
| 45 | (hAnn : ∀ p, 0 < height p ∧ |
| 46 | (height p = h ∨ ‖e !₂[p, height p]‖ = 1 ∨ ‖e !₂[p, height p]‖ = 2)) |
| 47 | (hcap : ∀ p, height p ≤ h) |
| 48 | (hinterior : ∀ p, ∀ t ∈ Ioo 0 (height p), 1 < ‖e !₂[p, t]‖ ∧ ‖e !₂[p, t]‖ < 2) |
| 49 | (hgeodesic : ∀ p, N.metric.IsGeodesicOn (fun t => e !₂[p, t]) (Icc 0 (height p))) |
| 50 | (hmetric : ∀ p, intrinsicGeodesicCurvature N.metric N.connection 1 p ≤ alpha → |
| 51 | ∀ t ∈ Icc 0 (height p), ∀ v : AnnulusCoordinates, |
| 52 | (1 - delta) ^ 2 * |
| 53 | (intrinsicBoundarySpeed N.metric 1 p ^ 2 * (v 0) ^ 2 + (v 1) ^ 2) ≤ |
| 54 | N.metric.inner (e !₂[p, t]) |
| 55 | (fderiv ℝ e !₂[p, t] v) (fderiv ℝ e !₂[p, t] v)) |
| 56 | {a : ℝ} (ha : intrinsicGeodesicCurvature N.metric N.connection 1 a ≤ alpha) : |
| 57 | InjOn (fun t => e !₂[a, t]) (Icc 0 (height a)) := by |
| 58 | have halphaPos : 0 < alpha := (div_pos (mul_pos (by norm_num) hdelta) hq).trans_le halpha |
| 59 | obtain ⟨l, u, hla, hau, hperiod, hgap, hcurv⟩ := |
| 60 | m64Intrinsic_exists_local_curvature_arc N |
| 61 | (ha.trans_lt (by linarith only [halphaPos] : alpha < 2 * alpha)) |
| 62 | (sub_pos.mpr hfirst) |
| 63 | have hkappa : 0 < Real.sqrt (max K 1) := |
| 64 | Real.sqrt_pos.mpr (zero_lt_one.trans_le (le_max_right K 1)) |
| 65 | have hangle : Real.sqrt (max K 1) * (q / 10) ≤ Real.pi / 4 := by |
| 66 | nlinarith only [hmodel, Real.pi_gt_three] |
| 67 | have hcritical : 2 * (q / 10) * (2 * alpha) < 1 := by nlinarith only [hsmall] |
| 68 | have hbefore (p A : ℝ) (hA : A < h) |
| 69 | (hinside : ∀ t ∈ Ioc 0 A, 1 < ‖e !₂[p, t]‖ ∧ ‖e !₂[p, t]‖ < 2) : |
| 70 | A ≤ height p := by |
| 71 | by_contra hn |
| 72 | have hlt : height p < A := lt_of_not_ge hn |
| 73 | have hi := hinside (height p) ⟨(hAnn p).1, hlt.le⟩ |
| 74 | rcases (hAnn p).2 with heq | heq | heq |
| 75 | · linarith only [heq, hlt, hA] |
| 76 | · rw [heq] at hi |
| 77 | exact (lt_irrefl (1 : ℝ)) hi.1 |
| 78 | · rw [heq] at hi |
| 79 | exact (lt_irrefl (2 : ℝ)) hi.2 |
| 80 | have hordered (p w : ℝ) (hp : p ∈ Ioo l u) (hw : w ∈ Ioo l u) (hpw : p < w) |
| 81 | (A B : ℝ) (hA : A ∈ Ioo 0 h) (hB : B ∈ Ioo 0 h) |
| 82 | (hiA : InjOn (fun t => e !₂[p, t]) (Icc 0 A)) |
| 83 | (hiB : InjOn (fun t => e !₂[w, t]) (Icc 0 B)) |
| 84 | (hinsideA : ∀ t ∈ Ioc 0 A, 1 < ‖e !₂[p, t]‖ ∧ ‖e !₂[p, t]‖ < 2) |
| 85 | (hinsideB : ∀ t ∈ Ioc 0 B, 1 < ‖e !₂[w, t]‖ ∧ ‖e !₂[w, t]‖ < 2) : |
| 86 | e !₂[p, A] ≠ e !₂[w, B] := by |
| 87 | intro hmeet |
| 88 | have hfocus := m64Intrinsic_embedded_normal_collision_cyclic_focusing N |
| 89 | hK hdelta hdeltaSmall hq hqr hhq hturn halpha harea hbudget hmodel hareaLoss |
| 90 | e he normal height hbase hderiv hunit0 horth0 hinward0 hAnn hgeodesic hmetric |
| 91 | hpw (by linarith only [hperiod, hp.1, hw.2]) hA.2.le hB.2.le |
| 92 | (hbefore p A hA.2 hinsideA) (hbefore w B hB.2 hinsideB) hiA hiB |
| 93 | (fun t ht => ⟨(hinsideA t ht).1, (hinsideA t ht).2.le⟩) |
| 94 | (fun t ht => ⟨(hinsideB t ht).1, (hinsideB t ht).2.le⟩) |
| 95 | ⟨A, ⟨hA.1.le, le_rfl⟩, B, ⟨hB.1.le, le_rfl⟩, hmeet⟩ |
| 96 | have hlength := (m64Intrinsic_boundaryLength_subarc_quantitative N one_ne_zero |
| 97 | hp.1.le hpw.le hw.2.le).1 |
| 98 | have hleft := m64Intrinsic_boundaryLength_nonneg N 1 l p hp.1.le |
| 99 | exact m64Intrinsic_no_local_cyclic_focusing N hpw (by positivity) hkappa hangle hcritical |
| 100 | (fun x hx => hcurv x ⟨hp.1.le.trans hx.1, hx.2.trans hw.2.le⟩) |
| 101 | (by linarith only [hlength, hleft, hgap]) hfocus |
| 102 | have hreg : ∀ t ∈ Icc 0 (height a), |
| 103 | Function.Injective (mfderiv (𝓡 2) (𝓡 2) e !₂[a, t]) := by |
| 104 | intro t ht |
| 105 | have hc : 0 < 1 - delta := by linarith only [hdeltaSmall] |
| 106 | have hi := m64Intrinsic_normal_map_injective_of_metric_lower N hc |
| 107 | (x := !₂[a, t]) (by |
| 108 | simpa only [Matrix.cons_val_zero] using hmetric a ha t ht) |
| 109 | simpa only [TangentSpace, mfderiv_eq_fderiv] using hi |
| 110 | apply m64Intrinsic_normal_ray_injOn_of_local_prefix_separation he hbase (hAnn a).1 (hcap a) |
| 111 | (by rw [(hderiv a).deriv]; exact hinward0 a) (hinterior a) hreg isOpen_Ioo ⟨hla, hau⟩ |
| 112 | intro p hp w hw hpw A hA B hB hiA hiB hinsideA hinsideB |
| 113 | rcases lt_or_gt_of_ne hpw with hpw | hwp |
| 114 | · exact hordered p w hp hw hpw A B hA hB hiA hiB hinsideA hinsideB |
| 115 | · exact (hordered w p hw hp hwp B A hB hA hiB hiA hinsideB hinsideA).symm |
| 116 | |
| 117 | end PoincareMT |