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.Annulus |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.Family |
| 3 | |
| 4 | /-! |
| 5 | # Actual sampled polygons and raw family approximations for M64 |
| 6 | |
| 7 | Morgan--Tian Definition 19.18, Claims 19.19-19.20, Corollary 19.21 and |
| 8 | Lemma 19.17, pp. 449-453. An unsmoothed polygon retains its actual continuous |
| 9 | circle boundary. The flattened family uses the fixed M63 profile, and the |
| 10 | conversion to M63 retains the same polygons and C1 loop records. |
| 11 | |
| 12 | See reviews/contracts/M64-round1.md and |
| 13 | reviews/errata/2026-09-14-m64-annulus-comparison.md. Constant sides are allowed; |
| 14 | no C1 regularity is imposed on an unsmoothed polygon at its corners. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | /-- The fixed counterclockwise angular parametrization of the actual circle. -/ |
| 26 | noncomputable def m64LoopCircleParam (x : ℝ) : LoopCircle := |
| 27 | ⟨!₂[Real.cos x, Real.sin x], by |
| 28 | simp [EuclideanSpace.norm_eq, Fin.sum_univ_two, Real.cos_sq_add_sin_sq]⟩ |
| 29 | |
| 30 | section Polygons |
| 31 | |
| 32 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 33 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 34 | {g : RiemannianMetric n M} {D : LeviCivitaData g} {N : ℕ} |
| 35 | |
| 36 | /-- The continuous circle map of this exact periodic polygon. The angular |
| 37 | identity fixes its parametrization rather than choosing another boundary. -/ |
| 38 | structure M64PolygonBoundary (polygon : M63GeodesicPolygon g D N) where |
| 39 | map : ContinuousMap LoopCircle M |
| 40 | angular_eq : ∀ x, map (m64LoopCircleParam x) = polygon.map x |
| 41 | |
| 42 | /-- Actual derivative-integral length of the piecewise smooth polygon. |
| 43 | The M64 statement identifies it with the sum of the minimizing side lengths. -/ |
| 44 | noncomputable def m64PolygonLength (polygon : M63GeodesicPolygon g D N) : ℝ := |
| 45 | ∫ x in (0 : ℝ)..curvePeriod, |
| 46 | g.tangentNorm (polygon.map x) (curveVelocity (n := n) polygon.map x) |
| 47 | |
| 48 | end Polygons |
| 49 | |
| 50 | section Families |
| 51 | |
| 52 | variable {M : Type u} [TopologicalSpace M] |
| 53 | [ChartedSpace LoopAmbient M] [IsManifold (𝓡 3) ∞ M] |
| 54 | {g : RiemannianMetric 3 M} {D : LeviCivitaData g} {N : ℕ} |
| 55 | |
| 56 | /-- Only the vertex sampling relation; existence, minimizing sides and |
| 57 | continuity belong to the actual M63 polygon object. -/ |
| 58 | def M64SampledPolygon (gamma : C1FreeLoopSpace (M := M)) |
| 59 | (polygon : M63GeodesicPolygon g D N) : Prop := |
| 60 | ∀ j : Fin N, polygon.vertices j = periodicFreeLoop gamma (m63CellLeft N j) |
| 61 | |
| 62 | /-- Raw and flattened approximations of the displayed null-loop family. |
| 63 | All disk classes and area bounds concern the displayed maps. Regularity in |
| 64 | the sphere parameter is only continuity of values and actual angular jets. -/ |
| 65 | structure M64RawFamilyApproximation (g : RiemannianMetric 3 M) |
| 66 | (D : LeviCivitaData g) |
| 67 | (Gamma : ContinuousMap LoopTwoSphere (C1FreeLoopSpace (M := M))) |
| 68 | (zeta : ℝ) where |
| 69 | count : ℕ |
| 70 | count_positive : 0 < count |
| 71 | polygon : LoopTwoSphere → M63GeodesicPolygon g D count |
| 72 | sampled : ∀ z, M64SampledPolygon (Gamma z) (polygon z) |
| 73 | boundary : ∀ z, M64PolygonBoundary (polygon z) |
| 74 | polygon_continuous : Continuous (fun p : LoopTwoSphere × ℝ => (polygon p.1).map p.2) |
| 75 | boundary_continuous : Continuous (fun p : LoopTwoSphere × LoopCircle => (boundary p.1).map p.2) |
| 76 | polygon_length : ∀ z, m64PolygonLength (polygon z) = |
| 77 | ∑ j : Fin count, m63CellLength count * ((polygon z).side j).speed |
| 78 | raw_null : ∀ z, M64RawNullLoop (boundary z).map |
| 79 | source_filling : ∀ z, FillingAreaData g (Gamma z) |
| 80 | raw_disk_nonempty : ∀ z, Nonempty (M64RawSpanningDisk g (boundary z).map) |
| 81 | raw_area_bounded_below : ∀ z, BddBelow (m64RawDiskAreaRange g (boundary z).map) |
| 82 | raw_area_nonnegative : ∀ z, 0 ≤ m64RawFillingArea g (boundary z).map |
| 83 | raw_area_error : ∀ z, |
| 84 | |m64RawFillingArea g (boundary z).map - fillingArea g (Gamma z)| < zeta |
| 85 | annulus : ∀ z, M64Annulus g (periodicFreeLoop (Gamma z)) (polygon z).map |
| 86 | annulus_piecewise : ∀ z, M64PiecewiseC1Annulus (annulus z) |
| 87 | annulus_geodesic : ∀ z, M64GeodesicAnnulus D (annulus z) |
| 88 | annulus_area : ∀ z, 0 ≤ (annulus z).area ∧ (annulus z).area < zeta |
| 89 | family : ContinuousMap LoopTwoSphere (C1FreeLoopSpace (M := M)) |
| 90 | null_family : M61NullFamily family |
| 91 | homotopic : Gamma.Homotopic family |
| 92 | angular_eq : ∀ z x, |
| 93 | periodicFreeLoop (family z) x = m63FlattenedPolygon (polygon z) x |
| 94 | angular_smooth : ∀ z, |
| 95 | ContMDiff 𝓘(ℝ, ℝ) (𝓡 3) ∞ (periodicFreeLoop (family z)) |
| 96 | first_jet_continuous : Continuous (fun p : LoopTwoSphere × ℝ => |
| 97 | m63AngularFirstJet (n := 3) (periodicFreeLoop (family p.1)) p.2) |
| 98 | second_jet_continuous : Continuous (fun p : LoopTwoSphere × ℝ => |
| 99 | m63AngularSecondJet D (periodicFreeLoop (family p.1)) p.2) |
| 100 | flattened_length : ∀ z, freeLoopLength g (family z) = m64PolygonLength (polygon z) |
| 101 | family_filling : ∀ z, FillingAreaData g (family z) |
| 102 | flattening_area_range : ∀ z, |
| 103 | m64RawDiskAreaRange g (boundary z).map = |
| 104 | Set.range (fun disk : LipschitzSpanningDisk g (family z) => disk.area) |
| 105 | length_loss : ∀ z, |
| 106 | 0 ≤ freeLoopLength g (Gamma z) - freeLoopLength g (family z) ∧ |
| 107 | freeLoopLength g (Gamma z) - freeLoopLength g (family z) < zeta |
| 108 | area_error : ∀ z, |fillingArea g (family z) - fillingArea g (Gamma z)| < zeta |
| 109 | |
| 110 | /-- Forget the extra raw-boundary witnesses, retaining every M63 object |
| 111 | literally. This construction uses no theorem about approximation or flow. -/ |
| 112 | def M64RawFamilyApproximation.toM63 {a b : ℝ} |
| 113 | {F : RicciFlow 3 M (Set.Icc a b)} |
| 114 | {Gamma : ContinuousMap LoopTwoSphere (C1FreeLoopSpace (M := M))} |
| 115 | {zeta : ℝ} |
| 116 | (A : M64RawFamilyApproximation (F.metric a) (F.connection a) Gamma zeta) : |
| 117 | M63RawApproximation F Gamma zeta where |
| 118 | count := A.count |
| 119 | count_positive := A.count_positive |
| 120 | polygon := A.polygon |
| 121 | sample_eq := A.sampled |
| 122 | family := A.family |
| 123 | null_family := A.null_family |
| 124 | homotopic := A.homotopic |
| 125 | angular_eq := A.angular_eq |
| 126 | angular_smooth := A.angular_smooth |
| 127 | first_jet_continuous := A.first_jet_continuous |
| 128 | second_jet_continuous := A.second_jet_continuous |
| 129 | length_loss := A.length_loss |
| 130 | area_error := A.area_error |
| 131 | |
| 132 | end Families |
| 133 | |
| 134 | end PoincareMT |