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.Annular.NormalReturn |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Forward.BoundaryParameter |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Regional.NormalCalculus |
| 4 | |
| 5 | /-! Exclusion of transverse inner endpoints of embedded good normal rays. |
| 6 | Source: MT Lemmas 19.46 and 19.53, pp. 474-478; |
| 7 | local-inverse-self-return derivation, Section 5. -/ |
| 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 | /-- An embedded good normal ray with transverse regular inner contacts cannot stop on the |
| 22 | inner boundary. The endpoint parameter and the return region are constructed from the |
| 23 | original ray. Source: MT Lemmas 19.46 and 19.53; local-inverse-self-return, Section 5. |
| 24 | Source/construction: |
| 25 | proof-work/tasks/M64/derivations/2026-09-27-local-inverse-self-return.md, Section 5. -/ |
| 26 | theorem m64Intrinsic_no_transverse_inner_endpoint |
| 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) (hh : 0 < h) (hhq : h ≤ q / 100) |
| 30 | (hturn : N.SmallBoundaryTurning delta r) (halpha : 100 * delta / q ≤ alpha) |
| 31 | (harea : intrinsicAnnulusArea N.metric < mu) |
| 32 | (hbudget : max K 0 * mu + delta ≤ Real.pi / 2) |
| 33 | (hmodel : Real.sqrt (max K 1) * q ≤ 1 / 2) |
| 34 | (hareaLoss : intrinsicAnnulusArea N.metric < (1 - delta) ^ 2 * h * (q / 10)) |
| 35 | (e : AnnulusCoordinates → AnnulusCoordinates) (he : ContDiff ℝ ∞ e) |
| 36 | (normal : ℝ → AnnulusCoordinates) (height : ℝ → ℝ) |
| 37 | (hbase : ∀ p, e !₂[p, 0] = intrinsicAnnulusBoundary 1 p) |
| 38 | (hderiv : ∀ p, HasDerivAt (fun t => e !₂[p, t]) (normal p) 0) |
| 39 | (hunit0 : ∀ p, N.metric.inner (intrinsicAnnulusBoundary 1 p) (normal p) (normal p) = 1) |
| 40 | (horth0 : ∀ p, N.metric.inner (intrinsicAnnulusBoundary 1 p) |
| 41 | (deriv (intrinsicAnnulusBoundary 1) p) (normal p) = 0) |
| 42 | (hinward0 : ∀ p, 0 < inner ℝ (intrinsicAnnulusBoundary 1 p) (normal p)) |
| 43 | (hAnn : ∀ p, 0 < height p ∧ |
| 44 | (height p = h ∨ ‖e !₂[p, height p]‖ = 1 ∨ ‖e !₂[p, height p]‖ = 2)) |
| 45 | (hgeodesic : ∀ p, N.metric.IsGeodesicOn (fun t => e !₂[p, t]) (Icc 0 (height p))) |
| 46 | (hmetric : ∀ p, intrinsicGeodesicCurvature N.metric N.connection 1 p ≤ alpha → |
| 47 | ∀ t ∈ Icc 0 (height p), ∀ v : AnnulusCoordinates, |
| 48 | (1 - delta) ^ 2 * |
| 49 | (intrinsicBoundarySpeed N.metric 1 p ^ 2 * (v 0) ^ 2 + (v 1) ^ 2) ≤ |
| 50 | N.metric.inner (e !₂[p, t]) |
| 51 | (fderiv ℝ e !₂[p, t] v) (fderiv ℝ e !₂[p, t] v)) |
| 52 | {a : ℝ} (ha : a ∈ Ico (0 : ℝ) rampPeriod) |
| 53 | (hgood : intrinsicGeodesicCurvature N.metric N.connection 1 a ≤ alpha) |
| 54 | (hcap : height a ≤ h) |
| 55 | (hinside : ∀ t ∈ Ioo 0 (height a), 1 < ‖e !₂[a, t]‖ ∧ ‖e !₂[a, t]‖ < 2) |
| 56 | (hinj : InjOn (fun t => e !₂[a, t]) (Icc 0 (height a))) |
| 57 | (htransverse : ∀ t b : ℝ, e !₂[a, t] = intrinsicAnnulusBoundary 1 b → |
| 58 | Function.Injective (mfderiv (𝓡 2) (𝓡 2) e !₂[a, t]) → |
| 59 | LinearIndependent ℝ |
| 60 | (![deriv (intrinsicAnnulusBoundary 1) b, fderiv ℝ e !₂[a, t] !₂[0, 1]] : |
| 61 | Fin 2 → AnnulusCoordinates)) : ‖e !₂[a, height a]‖ ≠ 1 := by |
| 62 | intro hinner |
| 63 | have hneq : e !₂[a, height a] ≠ intrinsicAnnulusBoundary 1 a := by |
| 64 | intro heq |
| 65 | have ht := hinj ⟨(hAnn a).1.le, le_rfl⟩ ⟨le_rfl, (hAnn a).1.le⟩ |
| 66 | (heq.trans (hbase a).symm) |
| 67 | exact (ne_of_gt (hAnn a).1) ht |
| 68 | obtain ⟨b, hab, hperiod, hb⟩ := m64Intrinsic_exists_forward_boundary_parameter ha hinner hneq |
| 69 | have hreg : Function.Injective (mfderiv (𝓡 2) (𝓡 2) e !₂[a, height a]) := by |
| 70 | have hc : 0 < 1 - delta := by linarith only [hdeltaSmall] |
| 71 | have hi := m64Intrinsic_normal_map_injective_of_metric_lower N hc |
| 72 | (x := !₂[a, height a]) (by |
| 73 | simpa only [Matrix.cons_val_zero] using |
| 74 | hmetric a hgood (height a) ⟨(hAnn a).1.le, le_rfl⟩) |
| 75 | simpa only [TangentSpace, mfderiv_eq_fderiv] using hi |
| 76 | have hterminal : LinearIndependent ℝ |
| 77 | (![deriv (intrinsicAnnulusBoundary 1) b, |
| 78 | deriv (fun t => e !₂[a, t]) (height a)] : Fin 2 → AnnulusCoordinates) := by |
| 79 | rw [m64Intrinsic_coordinate_normal_ray_deriv |
| 80 | (he.differentiable (by simp) !₂[a, height a])] |
| 81 | exact htransverse (height a) b hb hreg |
| 82 | have hsmooth : ContDiff ℝ ∞ (fun t => e !₂[a, t]) := he.comp (by |
| 83 | apply (contDiff_piLp 2).mpr |
| 84 | intro i |
| 85 | fin_cases i |
| 86 | · exact contDiff_const |
| 87 | · exact contDiff_id) |
| 88 | exact m64Intrinsic_no_annular_normal_return N hK hdelta hdeltaSmall hq hqr hh hhq |
| 89 | hturn halpha harea hbudget hmodel hareaLoss hsmooth hab hperiod (hAnn a).1 hcap |
| 90 | hinj (hbase a) hb hinside (hgeodesic a) |
| 91 | (by rw [(hderiv a).deriv, hbase a]; exact hunit0 a) |
| 92 | (by rw [(hderiv a).deriv]; exact horth0 a) |
| 93 | (by rw [(hderiv a).deriv]; exact hinward0 a) hterminal |
| 94 | e he normal height hbase hderiv hunit0 horth0 hinward0 hAnn hgeodesic hmetric |
| 95 | |
| 96 | end PoincareMT |