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.RicciFlow.Compactness.Subsequence |
| 2 | import PoincareLib.Geometry.RicciFlow.Completeness |
| 3 | import PoincareLib.Topology.MetricSpace.Completeness |
| 4 | |
| 5 | /-! |
| 6 | # Producer interfaces for pointed compactness |
| 7 | |
| 8 | The compactness theorem has two independent geometric outputs: a smooth |
| 9 | exhaustion limit and completeness of its interior time slices. These |
| 10 | interfaces make that split explicit and provide a checked assembly into the |
| 11 | frozen M07 conclusion. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle ENNReal NNReal Topology |
| 17 | |
| 18 | namespace PoincareMT |
| 19 | |
| 20 | /-- Certificate for the smooth pointed exhaustion limit. -/ |
| 21 | structure PointedRicciFlowGeometricProducer |
| 22 | {n : ℕ} {T' T : ℝ} |
| 23 | (H : PointedRicciFlowCompactnessHypotheses n T' T) where |
| 24 | geometric_limit : PointedGeometricConvergence H.sequence |
| 25 | |
| 26 | /-- Certificate for completeness at every interior time of a produced limit. -/ |
| 27 | structure PointedRicciFlowCompletenessProducer |
| 28 | {n : ℕ} {T' T : ℝ} |
| 29 | (H : PointedRicciFlowCompactnessHypotheses n T' T) |
| 30 | (G : PointedGeometricConvergence H.sequence) where |
| 31 | complete_interior : ∀ t ∈ Set.Ioo T' T, |
| 32 | FlowCarrier.metricComplete G.limitCarrier (G.limitFlow.metricAt t) |
| 33 | |
| 34 | /-- Curvature control on the constructed limit supplies its completeness |
| 35 | producer. Zero-time completeness and curvature transfer remain obligations of |
| 36 | the geometric limit construction. -/ |
| 37 | theorem PointedRicciFlowCompletenessProducer.of_curvature_bound |
| 38 | {n : ℕ} {T' T : ℝ} |
| 39 | {H : PointedRicciFlowCompactnessHypotheses n T' T} |
| 40 | (G : PointedGeometricConvergence H.sequence) |
| 41 | (hcomplete : G.limitCarrier.metricComplete (G.limitFlow.metricAt 0)) |
| 42 | (hcurv : ∀ A : ℝ, 0 < A → ∃ K : ℝ, 0 ≤ K ∧ |
| 43 | letI : TopologicalSpace G.limitCarrier.carrier := G.limitCarrier.topologicalSpace |
| 44 | letI : ChartedSpace (EuclideanSpace ℝ (Fin n)) G.limitCarrier.carrier := |
| 45 | G.limitCarrier.chartedSpace |
| 46 | letI : IsManifold (𝓡 n) ∞ G.limitCarrier.carrier := G.limitCarrier.isManifold |
| 47 | ∀ s ∈ Set.Ioo T' T, ∀ t ∈ Set.Ioo T' T, |
| 48 | ∀ x ∈ G.limitFlow.ballAt s A, |
| 49 | (G.limitFlow.flow.connection t).curvatureTensorNorm x ≤ K) : |
| 50 | PointedRicciFlowCompletenessProducer H G where |
| 51 | complete_interior := G.limitFlow.complete_interior_of_two_time_curvature_bound |
| 52 | H.time_bounds hcomplete hcurv |
| 53 | |
| 54 | /-! The following input is the exact metric boundary left by the geometric |
| 55 | compactness construction. Its reference completeness must come from the |
| 56 | construction of the limit: an arbitrary `PointedGeometricConvergence` can |
| 57 | restrict a flat Euclidean limit to an incomplete open ball. The comparison |
| 58 | fields still require curvature transfer and curve-length estimates using |
| 59 | the all-time curvature hypothesis. -/ |
| 60 | |
| 61 | /-- Metric data sufficient to transfer zero-time completeness to every |
| 62 | interior slice of a pointed geometric limit. -/ |
| 63 | structure PointedRicciFlowInteriorCompletenessInput |
| 64 | {n : ℕ} {T' T : ℝ} |
| 65 | {H : PointedRicciFlowCompactnessHypotheses n T' T} |
| 66 | (G : PointedGeometricConvergence H.sequence) where |
| 67 | reference_complete : |
| 68 | @CompleteSpace G.limitCarrier.carrier |
| 69 | (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 70 | (G.limitFlow.metricAt 0)).toUniformSpace |
| 71 | ball_containment : ∀ t : Set.Ioo T' T, ∀ R : ℝ≥0, ∃ S : ℝ≥0, |
| 72 | ∀ x : G.limitCarrier.carrier, |
| 73 | (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 74 | (G.limitFlow.metricAt t.1)).edist x G.limitFlow.base ≤ R → |
| 75 | (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 76 | (G.limitFlow.metricAt 0)).edist x G.limitFlow.base ≤ S |
| 77 | metric_comparison : ∀ t : Set.Ioo T' T, ∀ R : ℝ≥0, ∃ C : ℝ≥0, |
| 78 | ∀ x y : G.limitCarrier.carrier, |
| 79 | (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 80 | (G.limitFlow.metricAt 0)).edist x G.limitFlow.base ≤ R → |
| 81 | (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 82 | (G.limitFlow.metricAt 0)).edist y G.limitFlow.base ≤ R → |
| 83 | (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 84 | (G.limitFlow.metricAt t.1)).edist x y ≤ |
| 85 | C * (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 86 | (G.limitFlow.metricAt 0)).edist x y ∧ |
| 87 | (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 88 | (G.limitFlow.metricAt 0)).edist x y ≤ |
| 89 | C * (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 90 | (G.limitFlow.metricAt t.1)).edist x y |
| 91 | |
| 92 | /-- Apply the checked local metric-comparison transfer to the actual Riemannian |
| 93 | metrics of a pointed flow. -/ |
| 94 | theorem PointedRicciFlowInteriorCompletenessInput.toProducer |
| 95 | {n : ℕ} {T' T : ℝ} |
| 96 | {H : PointedRicciFlowCompactnessHypotheses n T' T} |
| 97 | {G : PointedGeometricConvergence H.sequence} |
| 98 | (P : PointedRicciFlowInteriorCompletenessInput G) : |
| 99 | PointedRicciFlowCompletenessProducer H G := by |
| 100 | let d₀ : PseudoEMetricSpace G.limitCarrier.carrier := |
| 101 | (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 102 | (G.limitFlow.metricAt 0)).toPseudoEMetricSpace |
| 103 | let d₁ : Set.Ioo T' T → PseudoEMetricSpace G.limitCarrier.carrier := |
| 104 | fun t ↦ (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 105 | (G.limitFlow.metricAt t.1)).toPseudoEMetricSpace |
| 106 | have hfamily : ∀ t : Set.Ioo T' T, |
| 107 | @CompleteSpace G.limitCarrier.carrier (d₁ t).toUniformSpace := by |
| 108 | apply Poincare.completeSpace_family_of_preconnected_local_emetric_comparison |
| 109 | d₀ d₁ G.limitFlow.base P.reference_complete |
| 110 | · intro t |
| 111 | exact FlowCarrier.preconnected_metricEMetricSpace G.limitCarrier |
| 112 | (G.limitFlow.metricAt t.1) |
| 113 | · exact P.ball_containment |
| 114 | · exact P.metric_comparison |
| 115 | refine { complete_interior := ?_ } |
| 116 | intro t ht |
| 117 | have h := hfamily ⟨t, ht⟩ |
| 118 | change @CompleteSpace G.limitCarrier.carrier |
| 119 | (FlowCarrier.metricEMetricSpace G.limitCarrier |
| 120 | (G.limitFlow.metricAt t)).toUniformSpace |
| 121 | simpa [d₁] using h |
| 122 | |
| 123 | /-- Reindex a geometric producer along a strictly increasing subsequence. -/ |
| 124 | def PointedRicciFlowGeometricProducer.ofSubsequence |
| 125 | {n : ℕ} {T' T : ℝ} |
| 126 | {H : PointedRicciFlowCompactnessHypotheses n T' T} |
| 127 | {φ : ℕ → ℕ} (hφ : StrictMono φ) |
| 128 | (P : PointedRicciFlowGeometricProducer (H.subsequence φ hφ)) : |
| 129 | PointedRicciFlowGeometricProducer H where |
| 130 | geometric_limit := P.geometric_limit.ofSubsequence hφ |
| 131 | |
| 132 | /-- Reindex a completeness producer along the same subsequence. -/ |
| 133 | theorem PointedRicciFlowCompletenessProducer.ofSubsequence |
| 134 | {n : ℕ} {T' T : ℝ} |
| 135 | {H : PointedRicciFlowCompactnessHypotheses n T' T} |
| 136 | {φ : ℕ → ℕ} (hφ : StrictMono φ) |
| 137 | {P : PointedRicciFlowGeometricProducer (H.subsequence φ hφ)} |
| 138 | (C : PointedRicciFlowCompletenessProducer (H.subsequence φ hφ) P.geometric_limit) : |
| 139 | PointedRicciFlowCompletenessProducer H (P.geometric_limit.ofSubsequence hφ) where |
| 140 | complete_interior := C.complete_interior |
| 141 | |
| 142 | /-- Assemble the frozen M07 conclusion from its two producer certificates. -/ |
| 143 | def PointedRicciFlowGeometricProducer.assemble |
| 144 | {n : ℕ} {T' T : ℝ} |
| 145 | {H : PointedRicciFlowCompactnessHypotheses n T' T} |
| 146 | (P : PointedRicciFlowGeometricProducer H) |
| 147 | (C : PointedRicciFlowCompletenessProducer H P.geometric_limit) : |
| 148 | PointedRicciFlowCompactnessConclusion H where |
| 149 | geometric_limit := P.geometric_limit |
| 150 | complete_interior := C.complete_interior |
| 151 | |
| 152 | /-- Nonemptiness form of the producer assembly. -/ |
| 153 | theorem pointedRicciFlowCompactness_of_producers |
| 154 | {n : ℕ} {T' T : ℝ} |
| 155 | (H : PointedRicciFlowCompactnessHypotheses n T' T) |
| 156 | (P : PointedRicciFlowGeometricProducer H) |
| 157 | (C : PointedRicciFlowCompletenessProducer H P.geometric_limit) : |
| 158 | Nonempty (PointedRicciFlowCompactnessConclusion H) := |
| 159 | ⟨P.assemble C⟩ |
| 160 | |
| 161 | end PoincareMT |