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.Triangle.RegionCurvature |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Three.ArcBoundaryTurning |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Normal.Crossing |
| 4 | |
| 5 | /-! The original circle subarc controls the actual collision fan. |
| 6 | Source: MT Claim 19.40; normal-collision-transversality derivation, |
| 7 | Section 9. Both original geodesic sides have zero turning. -/ |
| 8 | |
| 9 | noncomputable section |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open Set MeasureTheory |
| 14 | open scoped Topology ContDiff Manifold Matrix |
| 15 | open PoincareMT.Topology.Surface |
| 16 | |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | /-- The occupied collision angle is bounded by the actual regional Gaussian integral plus |
| 20 | the original circle-subarc turning, with coefficient one. Source: MT Claim 19.40; |
| 21 | normal-collision-transversality derivation, Section 9. Project construction: |
| 22 | `proof-work/tasks/M64/derivations/2026-09-27-normal-collision-transversality.md`, Section 9. -/ |
| 23 | theorem m64Intrinsic_triangle_region_angle_le_original_turning |
| 24 | (N : IntrinsicAnnulus) {U V : Set AnnulusCoordinates} |
| 25 | (R : M64IntrinsicCoordinateTriangulation (closure U)) |
| 26 | {base alpha beta : ℝ → AnnulusCoordinates} {D A B : ℝ} |
| 27 | (hc : ContDiff ℝ ∞ base) (ha : ContDiff ℝ ∞ alpha) (hb : ContDiff ℝ ∞ beta) |
| 28 | (hD : 0 < D) (hA : 0 < A) (hB : 0 < B) |
| 29 | (hci : InjOn base (Icc 0 D)) (hai : InjOn alpha (Icc 0 A)) |
| 30 | (hbi : InjOn beta (Icc 0 B)) |
| 31 | (hcreg : ∀ t ∈ Ioo 0 D, deriv base t ≠ 0) |
| 32 | (hstartA : base 0 = alpha 0) (hstartB : base D = beta 0) |
| 33 | (hmeet : alpha A = beta B) |
| 34 | (hbaseA : ∀ s ∈ Icc 0 D, ∀ t ∈ Icc 0 A, base s = alpha t → s = 0 ∧ t = 0) |
| 35 | (hbaseB : ∀ s ∈ Icc 0 D, ∀ t ∈ Icc 0 B, base s = beta t → s = D ∧ t = 0) |
| 36 | (hsides : ∀ s ∈ Icc 0 A, ∀ t ∈ Icc 0 B, alpha s = beta t → s = A ∧ t = B) |
| 37 | (hreg0 : deriv base 0 ≠ 0) (hreg1 : deriv base D ≠ 0) |
| 38 | (horth0 : N.metric.inner (base 0) (deriv base 0) (deriv alpha 0) = 0) |
| 39 | (horth1 : N.metric.inner (base D) (deriv base D) (deriv beta 0) = 0) |
| 40 | (hageo : N.metric.IsGeodesicOn alpha (Icc 0 A)) |
| 41 | (hbgeo : N.metric.IsGeodesicOn beta (Icc 0 B)) |
| 42 | (haunit : ∀ t ∈ Icc 0 A, N.metric.inner (alpha t) (deriv alpha t) (deriv alpha t) = 1) |
| 43 | (hbunit : ∀ t ∈ Icc 0 B, N.metric.inner (beta t) (deriv beta t) (deriv beta t) = 1) |
| 44 | {a b : ℝ} (habound : a ≤ b) |
| 45 | (hcircleInj : InjOn (intrinsicAnnulusBoundary 1) (Icc a b)) |
| 46 | (hcircle : base '' Icc 0 D = intrinsicAnnulusBoundary 1 '' Icc a b) |
| 47 | (hU : IsOpen U) (hV : IsOpen V) (hUV : Disjoint U V) |
| 48 | (hfront : frontier U = base '' Icc 0 D ∪ (alpha '' Icc 0 A ∪ beta '' Icc 0 B)) |
| 49 | (hfV : frontier V = frontier U) |
| 50 | (hclosure : closure U ∪ closure V = univ) (hVconn : IsPreconnected V) |
| 51 | (hinward0 : 0 < inner ℝ (base 0) (deriv alpha 0)) |
| 52 | (hinward1 : 0 < inner ℝ (base D) (deriv beta 0)) |
| 53 | (hsub : closure U ⊆ standardAnnulusDomain) |
| 54 | (v0 v1 vT : Euler.CoordinateVertex R.coordinates R.basis) |
| 55 | (hv0 : v0.1 = base 0) (hv1 : v1.1 = base D) (hvT : vT.1 = alpha A) : |
| 56 | coordinateVertexAngleContribution N.metric R.coordinates R.basis vT.1 ≤ |
| 57 | (∫ x in closure U, N.connection.scalarCurvature x / 2 ∂N.metric.volumeMeasure) + |
| 58 | intrinsicGeodesicCurvatureIntegral N.metric N.connection 1 a b := by |
| 59 | classical |
| 60 | let Q (i : Fin R.count) := N.metric.alignedChartFrame |
| 61 | (coordinateTriangleChart (R.coordinates i) (R.basis i)) |
| 62 | (coordinateTriangleChart_smooth (R.coordinates i) (R.basis i) (R.inverse_smooth i)) |
| 63 | (coordinateTriangleChart_smooth_symm (R.coordinates i) (R.basis i) (R.smooth i)) |
| 64 | have hnorm (t : ℝ) (ht : t ∈ Icc 0 D) : ‖base t‖ = 1 := by |
| 65 | have hp : base t ∈ intrinsicAnnulusBoundary 1 '' Icc a b := by |
| 66 | rw [← hcircle] |
| 67 | exact mem_image_of_mem base ht |
| 68 | obtain ⟨s, _, hs⟩ := hp |
| 69 | rw [← hs, m64Intrinsic_inner_boundary_norm] |
| 70 | have hareg (t : ℝ) (ht : t ∈ Ioo 0 A) : deriv alpha t ≠ 0 := by |
| 71 | intro hz |
| 72 | have hu := haunit t (Ioo_subset_Icc_self ht) |
| 73 | simp only [hz, map_zero] at hu |
| 74 | norm_num at hu |
| 75 | have hbreg (t : ℝ) (ht : t ∈ Ioo 0 B) : deriv beta t ≠ 0 := by |
| 76 | intro hz |
| 77 | have hu := hbunit t (Ioo_subset_Icc_self ht) |
| 78 | simp only [hz, map_zero] at hu |
| 79 | norm_num at hu |
| 80 | have hangle := m64Intrinsic_triangle_region_angle_le_curvature_turning N R Q hc ha hb |
| 81 | hD hA hB hci hai hbi hcreg hareg hbreg hstartA hstartB hmeet hbaseA hbaseB hsides |
| 82 | hreg0 hreg1 horth0 horth1 hU hV hUV hfront hfV hclosure hVconn |
| 83 | (hnorm 0 ⟨le_rfl, hD.le⟩) (hnorm D ⟨hD.le, le_rfl⟩) hinward0 hinward1 hsub |
| 84 | v0 v1 vT hv0 hv1 hvT |
| 85 | let gamma (e : Bool) := if e then beta else base |
| 86 | let T (e : Bool) := if e then B else D |
| 87 | have hg (e : Bool) : Continuous (gamma e) := by |
| 88 | cases e |
| 89 | · exact hc.continuous |
| 90 | · exact hb.continuous |
| 91 | have hba : ∀ s ∈ Icc 0 B, ∀ t ∈ Icc 0 A, beta s = alpha t → s = B ∧ t = A := by |
| 92 | intro s hs t ht he |
| 93 | exact (hsides t ht s hs he.symm).symm |
| 94 | have hfront' : frontier U = gamma false '' Icc 0 (T false) ∪ |
| 95 | gamma true '' Icc 0 (T true) ∪ alpha '' Icc 0 A := by |
| 96 | change frontier U = base '' Icc 0 D ∪ beta '' Icc 0 B ∪ alpha '' Icc 0 A |
| 97 | exact hfront.trans (by ac_rfl) |
| 98 | let eta (e : Bool) := if e then alpha else beta |
| 99 | let L (e : Bool) := if e then A else B |
| 100 | have he (e : Bool) : ContDiff ℝ ∞ (eta e) := by |
| 101 | cases e |
| 102 | · exact hb |
| 103 | · exact ha |
| 104 | have hegeo (e : Bool) : N.metric.IsGeodesicOn (eta e) (Icc 0 (L e)) := by |
| 105 | cases e |
| 106 | · exact hbgeo |
| 107 | · exact hageo |
| 108 | have hei (e : Bool) : InjOn (eta e) (Icc 0 (L e)) := by |
| 109 | cases e |
| 110 | · exact hbi |
| 111 | · exact hai |
| 112 | have heunit (e : Bool) : ∀ t ∈ Icc 0 (L e), |
| 113 | N.metric.inner (eta e t) (deriv (eta e) t) (deriv (eta e) t) = 1 := by |
| 114 | cases e |
| 115 | · exact hbunit |
| 116 | · exact haunit |
| 117 | have hclass (p : Fin R.count × Fin 3) |
| 118 | (hp : ∀ q : Fin R.count × Fin 3, |
| 119 | faceBoundaryIndex R.face q.1 q.2 = faceBoundaryIndex R.face p.1 p.2 → q = p) : |
| 120 | ((R.face p.1).boundary p.2).map '' Icc (0 : ℝ) 1 ⊆ |
| 121 | intrinsicAnnulusBoundary 1 '' Icc a b ∨ |
| 122 | ∃ e, ((R.face p.1).boundary p.2).map '' Icc (0 : ℝ) 1 ⊆ eta e '' Icc 0 (L e) := by |
| 123 | rcases m64Intrinsic_three_arc_unpaired_side_classification R gamma alpha T hg |
| 124 | ha.continuous hbaseB hbaseA hba hU hV hUV hfront' hfV |
| 125 | v0 v1 vT hv0 hv1 (hvT.trans hmeet) p hp with hs | hs | hs |
| 126 | · exact Or.inl (hs.trans hcircle.subset) |
| 127 | · exact Or.inr ⟨false, hs⟩ |
| 128 | · exact Or.inr ⟨true, hs⟩ |
| 129 | have hturn := m64Intrinsic_region_circle_two_geodesics_turning_le N R Q |
| 130 | habound hcircleInj eta L he hegeo hei heunit hclass |
| 131 | linarith |
| 132 | |
| 133 | end PoincareMT |