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.Surgery.CanonicalInduction.Terminal.Germs.TerminalGermsAtlas |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Terminal.Germs.TerminalGermsCompleteness |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Terminal.Germs.TerminalGermsMetricComparison |
| 4 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.Stages.SourceEmbedding.PointedExhaustion |
| 5 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.Stages.SourceEmbedding.MetricExhaustion |
| 6 | |
| 7 | set_option synthInstance.maxHeartbeats 200000 |
| 8 | /-! |
| 9 | # The complete terminal geometry from the original source charts |
| 10 | |
| 11 | The actual source distances, terminal jets and finite source-ball covers |
| 12 | construct one connected complete quotient with its based embeddings. |
| 13 | The further strict subsequence remains explicit for all earlier time jets. |
| 14 | Source: MT Theorems 5.9-5.11, pp. 88-90; |
| 15 | derivations/terminal-germs-completeness.md, Stage A4b. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set Filter Metric Poincare.Gluing Poincare.Analysis.Calculus |
| 22 | open scoped Manifold ContDiff Topology NNReal ENNReal |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.M47 |
| 27 | |
| 28 | open ChartDistance |
| 29 | |
| 30 | private def ClosedNested {X : Type*} [TopologicalSpace X] (E : ℕ → Set X) : Prop := |
| 31 | ∀ j, closure (E j) ⊆ E (j + 1) |
| 32 | |
| 33 | private def Covers {X : Type*} (E : ℕ → Set X) : Prop := (⋃ j, E j) = univ |
| 34 | |
| 35 | private theorem pointwise_chart_distance |
| 36 | {U : ℕ → Set (EuclideanSpace ℝ (Fin 3))} |
| 37 | {M : ℕ → Type u} [∀ k, MetricSpace (M k)] |
| 38 | {e : ∀ k i, Piece U i → M k} |
| 39 | {D : ∀ i j, C(Piece U i × Piece U j, ℝ)} |
| 40 | (hD : ∀ i j, TendstoLocallyUniformly |
| 41 | (fun k (p : Piece U i × Piece U j) => dist (e k i p.1) (e k j p.2)) (D i j) atTop) : |
| 42 | ∀ (i j : ℕ) (x : Piece U i) (y : Piece U j), |
| 43 | Tendsto (fun k => dist (e k i x) (e k j y)) atTop (𝓝 (D i j (x, y))) := by |
| 44 | intro i j x y |
| 45 | exact (hD i j).tendstoLocallyUniformlyOn.tendsto_at (mem_univ (x, y)) |
| 46 | |
| 47 | /-- Actual chart controls and finite source-ball covers construct the |
| 48 | same complete terminal metric and a further shared source subsequence. |
| 49 | The local time intervals and their jets remain available by reindexing. -/ |
| 50 | theorem terminalGerms_complete_terminal_geometry |
| 51 | (U : ℕ → Set (EuclideanSpace ℝ (Fin 3))) (hU : ∀ i, IsOpen (U i)) |
| 52 | [∀ i, Nonempty (Piece U i)] |
| 53 | {M : ℕ → Type u} [∀ k, MetricSpace (M k)] |
| 54 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin 3)) (M k)] |
| 55 | [∀ k, IsManifold (𝓡 3) ∞ (M k)] |
| 56 | (g : ∀ k, RiemannianMetric 3 (M k)) |
| 57 | (hactual : ∀ (k : ℕ) (x y : M k), edist x y = (g k).edist x y) |
| 58 | {e : ∀ k i, Piece U i → M k} |
| 59 | {D : ∀ i j, C(Piece U i × Piece U j, ℝ)} |
| 60 | (hD : ∀ i j, TendstoLocallyUniformly |
| 61 | (fun k (p : Piece U i × Piece U j) => dist (e k i p.1) (e k j p.2)) (D i j) atTop) |
| 62 | (L : ℕ → ℝ≥0) (he : ∀ k i, LipschitzWith (L i) (e k i)) |
| 63 | (c : ℕ → ℝ) (hc : ∀ i, 0 < c i) |
| 64 | (hlower : ∀ k i x y, c i * dist x y ≤ dist (e k i x) (e k i y)) |
| 65 | (hopen : ∀ k i, Topology.IsOpenEmbedding (e k i)) |
| 66 | (hconn : ∀ k (p : M k) r, IsPreconnected (ball p r)) |
| 67 | (hsmooth : letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin 3)) (Piece U i) := |
| 68 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 69 | ∀ k i, IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ (e k i)) |
| 70 | (hjets : ∀ i, LocallyEventuallyBoundedDerivatives (U i) |
| 71 | (fun k => (g k).pullbackCoefficients (chartParametrization U hU (e k i)))) |
| 72 | (helliptic : ∀ i K, IsCompact K → K ⊆ U i → |
| 73 | ∃ a : ℝ, 0 < a ∧ ∀ᶠ k in atTop, ∀ x ∈ K, ∀ v, |
| 74 | a * ‖v‖ ^ 2 ≤ |
| 75 | (g k).pullbackCoefficients (chartParametrization U hU (e k i)) x v v) |
| 76 | {i₀ : ℕ} (p : Piece U i₀) |
| 77 | (hcover : ∀ R : ℝ, 0 < R → ∃ s : Finset ℕ, ∃ K : ∀ i, Set (Piece U i), |
| 78 | (∀ i ∈ s, IsCompact (K i)) ∧ |
| 79 | ∀ᶠ k in atTop, ball (e k i₀ p) R ⊆ ⋃ i ∈ s, e k i '' K i) |
| 80 | (B : ℕ → EuclideanSpace ℝ (Fin 3) → |
| 81 | EuclideanSpace ℝ (Fin 3) →L[ℝ] EuclideanSpace ℝ (Fin 3) →L[ℝ] ℝ) |
| 82 | (hBsmooth : ∀ i, ContDiffOn ℝ ∞ (B i) (U i)) |
| 83 | (hBjets : ∀ i m K, IsCompact K → K ⊆ U i → TendstoUniformlyOn |
| 84 | (fun k => iteratedFDeriv ℝ m |
| 85 | ((g k).pullbackCoefficients (chartParametrization U hU (e k i)))) |
| 86 | (iteratedFDeriv ℝ m (B i)) atTop K) : |
| 87 | letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin 3)) (Piece U i) := |
| 88 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 89 | letI : ∀ i, IsManifold (𝓡 3) ∞ (Piece U i) := |
| 90 | fun i => (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 91 | letI : ∀ i, LocallyCompactSpace (Piece U i) := fun i => (hU i).locallyCompactSpace |
| 92 | let hpoint := pointwise_chart_distance hD |
| 93 | let O := overlapSystem hpoint L he c hc hlower hopen hconn |
| 94 | ∃ hO : SmoothOverlap U hU O, |
| 95 | ConnectedSpace (Quotient O.setoid) ∧ |
| 96 | letI : T2Space (Quotient O.setoid) := |
| 97 | O.quotient_t2Space (overlapSystem_closed hpoint L he c hc hlower hopen hconn) |
| 98 | letI := quotientChartedSpace U hU O |
| 99 | letI := quotient_isManifold U hU O hO |
| 100 | letI : LocallyCompactSpace (Quotient O.setoid) := |
| 101 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin 3)) _ |
| 102 | ∃ gQ : RiemannianMetric 3 (Quotient O.setoid), MetricComplete gQ ∧ |
| 103 | (∀ i (x : Piece U i) (v w : TangentSpace (𝓡 3) x), |
| 104 | B i x v w = gQ.inner (O.include i x) |
| 105 | (mfderiv (𝓡 3) (𝓡 3) (O.include i) x v) |
| 106 | (mfderiv (𝓡 3) (𝓡 3) (O.include i) x w)) ∧ |
| 107 | ∃ E : ℕ → Set (Quotient O.setoid), |
| 108 | (∀ j, IsOpen (E j)) ∧ (∀ j, IsConnected (E j)) ∧ |
| 109 | (∀ j, O.include i₀ p ∈ E j) ∧ (∀ j, IsCompact (closure (E j))) ∧ |
| 110 | ClosedNested E ∧ Covers E ∧ |
| 111 | ∃ sigma : ℕ → ℕ, StrictMono sigma ∧ |
| 112 | ∃ f : ∀ k, Quotient O.setoid → M (sigma k), |
| 113 | (∀ k, Topology.IsOpenEmbedding (fun x : E k => f k x) ∧ |
| 114 | IsLocalDiffeomorphOn (𝓡 3) (𝓡 3) ∞ (f k) (E k) ∧ |
| 115 | f k (O.include i₀ p) = e (sigma k) i₀ p) ∧ |
| 116 | (∀ (i : ℕ) (K : Set (Piece U i)), IsCompact K → TendstoUniformlyOn |
| 117 | (fun (k : ℕ) (x : Piece U i) => |
| 118 | dist (f k (O.include i x)) (e (sigma k) i x)) (fun _ => 0) atTop K) ∧ |
| 119 | (∀ (i m : ℕ) (K : Set (EuclideanSpace ℝ (Fin 3))), |
| 120 | IsCompact K → K ⊆ U i → TendstoUniformlyOn |
| 121 | (fun k => iteratedFDeriv ℝ m |
| 122 | ((g (sigma k)).pullbackCoefficients |
| 123 | (chartParametrization U hU (f k ∘ O.include i)))) |
| 124 | (iteratedFDeriv ℝ m (B i)) atTop K) ∧ |
| 125 | ∀ A : ℝ, 0 < A → ∃ j, ∀ᶠ k in atTop, |
| 126 | ∀ x ∈ frontier (E j), ENNReal.ofReal A ≤ |
| 127 | (g (sigma k)).edist (f k (O.include i₀ p)) (f k x) := by |
| 128 | classical |
| 129 | let : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin 3)) (Piece U i) := |
| 130 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 131 | let : ∀ i, IsManifold (𝓡 3) ∞ (Piece U i) := |
| 132 | fun i => (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 133 | let : ∀ i, LocallyCompactSpace (Piece U i) := fun i => (hU i).locallyCompactSpace |
| 134 | let hp := pointwise_chart_distance hD |
| 135 | let O := overlapSystem hp L he c hc hlower hopen hconn |
| 136 | have hBlocal (i : ℕ) := |
| 137 | CoordinateTransition.locallyUniformly_of_tendsto_zeroJet (hU i) (hBjets i 0) |
| 138 | obtain ⟨hT2, hSecond, hO, gLimit, hcompat, hcoeff, hmetric⟩ := |
| 139 | terminalGerms_terminal_atlas U hU hp L he c hc hlower hopen hconn hsmooth g |
| 140 | hjets helliptic B hBlocal hBsmooth |
| 141 | let : T2Space (Quotient O.setoid) := hT2 |
| 142 | let : SecondCountableTopology (Quotient O.setoid) := hSecond |
| 143 | let := quotientChartedSpace U hU O |
| 144 | let := quotient_isManifold U hU O hO |
| 145 | let : LocallyCompactSpace (Quotient O.setoid) := |
| 146 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin 3)) _ |
| 147 | have htransition := fun i j => locallyEventuallyBoundedDerivatives_source_transition |
| 148 | U hU hp L he c hc hlower hopen hconn hsmooth g hjets helliptic i j |
| 149 | obtain ⟨hconnected, E, hE, hEc, hEp, hEK, hEstep, hEcover, sigma, hsigma, |
| 150 | f, hf, happrox, hreadout, hescape⟩ := |
| 151 | exists_pointed_source_exhaustion_with_boundary_escape U hU hD L he c hc hlower |
| 152 | hopen hconn hsmooth htransition p hcover |
| 153 | let : ConnectedSpace (Quotient O.setoid) := hconnected |
| 154 | have hEmono : Monotone E := monotone_nat_of_le_succ fun j => |
| 155 | subset_closure.trans (hEstep j) |
| 156 | have hsourceJets := source_exhaustion_pullbackCoefficients_tendsto_jets U hU O hO |
| 157 | hE hEmono hEcover f (fun k => (hf k).2.1) |
| 158 | L (fun k => he (sigma k)) c hc (fun k => hlower (sigma k)) |
| 159 | (fun k => hopen (sigma k)) (fun k => hconn (sigma k)) |
| 160 | (fun k => hsmooth (sigma k)) happrox hreadout (fun k => g (sigma k)) B hBsmooth |
| 161 | (fun i m K hK hKU V hV => hsigma.tendsto_atTop.eventually (hBjets i m K hK hKU V hV)) |
| 162 | have hsourceZero : ∀ i K, IsCompact K → K ⊆ U i → TendstoUniformlyOn |
| 163 | (fun k => (g (sigma k)).pullbackCoefficients |
| 164 | (chartParametrization U hU (f k ∘ O.include i))) (B i) atTop K := by |
| 165 | intro i K hK hKU |
| 166 | simpa only [Function.comp_def, iteratedFDeriv_zero_apply] using |
| 167 | (ContinuousMultilinearMap.uniformContinuous_eval_const |
| 168 | (0 : Fin 0 → EuclideanSpace ℝ (Fin 3))).comp_tendstoUniformlyOn |
| 169 | (hsourceJets i 0 K hK hKU) |
| 170 | have hquad := terminalGerms_source_quadratic_bound U hU O hO E hE hEmono hEcover f |
| 171 | (fun k => (hf k).2.1) (fun k => g (sigma k)) gLimit hcompat B |
| 172 | (fun i => (hBsmooth i).continuousOn) hcoeff hsourceZero |
| 173 | have hescapeActual : ∀ A : ℝ, 0 < A → ∃ j, ∀ᶠ k in atTop, |
| 174 | ∀ x ∈ frontier (E j), ENNReal.ofReal A ≤ |
| 175 | (g (sigma k)).edist (f k (O.include i₀ p)) (f k x) := by |
| 176 | intro A hA |
| 177 | obtain ⟨j, hj⟩ := hescape A hA |
| 178 | refine ⟨j, hj.mono fun k hk x hx => ?_⟩ |
| 179 | rw [(hf k).2.2, ← hactual (sigma k)] |
| 180 | exact hk x hx |
| 181 | let gQ := quotientMetric U hU O hO gLimit hcompat |
| 182 | have hcomplete : MetricComplete gQ := terminalGerms_metricComplete_of_boundary_escape |
| 183 | gQ (fun k => g (sigma k)) E hE hEK hEstep hEmono hEcover (O.include i₀ p) hEp |
| 184 | f (fun k => (hf k).1) (fun k => (hf k).2.1) hquad hescapeActual |
| 185 | exact ⟨hO, hconnected, gQ, hcomplete, hmetric, |
| 186 | E, hE, hEc, hEp, hEK, hEstep, hEcover, sigma, hsigma, f, hf, |
| 187 | happrox, hsourceJets, hescapeActual⟩ |
| 188 | |
| 189 | end PoincareMT.M47 |