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.GeometricLimit.Stages.SourceEmbedding.UniformMetric |
| 2 | |
| 3 | /-! |
| 4 | # Actual terminal coefficient limits give compact metric comparison |
| 5 | |
| 6 | The tensor convergence theorem is applied on a singleton index set; |
| 7 | no Ricci flow or time extension is asserted. Source: MT Theorem 5.9, |
| 8 | pp. 88-89; derivations/terminal-germs-completeness.md, Stage A4. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option backward.isDefEq.respectTransparency false |
| 13 | |
| 14 | open Set Filter Poincare.Gluing |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | universe u v |
| 18 | |
| 19 | namespace PoincareMT.M47 |
| 20 | |
| 21 | /-- Unit-vector error rescales to a quadratic upper bound for every |
| 22 | tangent vector, without a packaged pointed-flow convergence object. -/ |
| 23 | theorem terminalGerms_quadratic_of_unit_error |
| 24 | {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 26 | {N : Type v} [TopologicalSpace N] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) N] [IsManifold (𝓡 3) ∞ N] |
| 28 | (g : RiemannianMetric 3 M) (h : RiemannianMetric 3 N) (f : M → N) (x : M) |
| 29 | (hclose : ∀ v w : TangentSpace (𝓡 3) x, |
| 30 | g.tangentNorm x v ≤ 1 → g.tangentNorm x w ≤ 1 → |
| 31 | |h.inner (f x) (mfderiv (𝓡 3) (𝓡 3) f x v) |
| 32 | (mfderiv (𝓡 3) (𝓡 3) f x w) - g.inner x v w| < 1) |
| 33 | (v : TangentSpace (𝓡 3) x) : |
| 34 | h.inner (f x) (mfderiv (𝓡 3) (𝓡 3) f x v) |
| 35 | (mfderiv (𝓡 3) (𝓡 3) f x v) ≤ 4 * g.inner x v v := by |
| 36 | by_cases hv : v = 0 |
| 37 | · subst v |
| 38 | simp |
| 39 | let a := g.tangentNorm x v |
| 40 | have ha : 0 < a := Real.sqrt_pos.mpr (g.pos x v hv) |
| 41 | have ha2 : a ^ 2 = g.inner x v v := Real.sq_sqrt (g.pos x v hv).le |
| 42 | let w : TangentSpace (𝓡 3) x := a⁻¹ • v |
| 43 | have hw : g.tangentNorm x w = 1 := by |
| 44 | dsimp [w, RiemannianMetric.tangentNorm] |
| 45 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 46 | rw [show a⁻¹ * (a⁻¹ * g.inner x v v) = a⁻¹ ^ 2 * a ^ 2 by rw [ha2]; ring] |
| 47 | rw [show a⁻¹ ^ 2 * a ^ 2 = 1 by field_simp, Real.sqrt_one] |
| 48 | have hbound := (le_abs_self _).trans_lt (hclose w w hw.le hw.le) |
| 49 | simp only [w, map_smul, smul_apply, smul_eq_mul] at hbound |
| 50 | have hainv : a⁻¹ ^ 2 * a ^ 2 = 1 := by field_simp |
| 51 | have hpos : 0 < a⁻¹ ^ 2 := sq_pos_of_pos (inv_pos.mpr ha) |
| 52 | nlinarith [g.pos x v hv] |
| 53 | |
| 54 | open ChartDistance |
| 55 | |
| 56 | /-- The actual coordinate convergence of the source embeddings supplies |
| 57 | the compact quadratic bound used by the static completeness argument. -/ |
| 58 | theorem terminalGerms_source_quadratic_bound |
| 59 | (U : ℕ → Set (EuclideanSpace ℝ (Fin 3))) (hU : ∀ i, IsOpen (U i)) |
| 60 | [∀ i, Nonempty (Piece U i)] |
| 61 | (O : OverlapSystem (fun i => Piece U i)) (hO : SmoothOverlap U hU O) |
| 62 | [T2Space (Quotient O.setoid)] |
| 63 | (E : ℕ → Set (Quotient O.setoid)) (hE : ∀ k, IsOpen (E k)) |
| 64 | (hmono : Monotone E) (hcover : (⋃ k, E k) = univ) |
| 65 | {N : ℕ → Type u} [∀ k, TopologicalSpace (N k)] |
| 66 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin 3)) (N k)] |
| 67 | [∀ k, IsManifold (𝓡 3) ∞ (N k)] |
| 68 | (f : ∀ k, Quotient O.setoid → N k) |
| 69 | (hf : letI := quotientChartedSpace U hU O |
| 70 | ∀ k, IsLocalDiffeomorphOn (𝓡 3) (𝓡 3) ∞ (f k) (E k)) |
| 71 | (h : ∀ k, RiemannianMetric 3 (N k)) |
| 72 | (g : ∀ i, CanonicalMetric U hU i) (hg : CompatibleMetrics U hU O g) |
| 73 | (B : ℕ → EuclideanSpace ℝ (Fin 3) → |
| 74 | EuclideanSpace ℝ (Fin 3) →L[ℝ] EuclideanSpace ℝ (Fin 3) →L[ℝ] ℝ) |
| 75 | (hB : ∀ i, ContinuousOn (B i) (U i)) |
| 76 | (hcoeff : letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin 3)) (Piece U i) := |
| 77 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 78 | letI : ∀ i, IsManifold (𝓡 3) ∞ (Piece U i) := |
| 79 | fun i => (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 80 | ∀ i (x : Piece U i) v w, (g i).inner x v w = B i x v w) |
| 81 | (hconv : ∀ i K, IsCompact K → K ⊆ U i → TendstoUniformlyOn |
| 82 | (fun k => (h k).pullbackCoefficients (chartParametrization U hU (f k ∘ O.include i))) |
| 83 | (B i) atTop K) : |
| 84 | letI := quotientChartedSpace U hU O |
| 85 | letI := quotient_isManifold U hU O hO |
| 86 | ∀ K : Set (Quotient O.setoid), IsCompact K → ∀ᶠ k in atTop, |
| 87 | ∀ x ∈ K, ∀ v : TangentSpace (𝓡 3) x, |
| 88 | (h k).inner (f k x) (mfderiv (𝓡 3) (𝓡 3) (f k) x v) |
| 89 | (mfderiv (𝓡 3) (𝓡 3) (f k) x v) ≤ |
| 90 | 4 * (quotientMetric U hU O hO g hg).inner x v v := by |
| 91 | let := quotientChartedSpace U hU O |
| 92 | let := quotient_isManifold U hU O hO |
| 93 | have herror := source_exhaustion_uniform_metric_error U hU O hO hE hmono hcover f hf |
| 94 | (fun k _ => h k) (fun i _ => g i) (fun _ => hg) |
| 95 | (J := {0}) (fun i p => B i p.2) |
| 96 | (fun i => (hB i).comp continuous_snd.continuousOn (fun _ hp => hp.2)) |
| 97 | (fun i _ _ x => hcoeff i x) (by |
| 98 | intro i K hK hKU |
| 99 | have hsub : Prod.snd '' K ⊆ U i := by |
| 100 | rintro _ ⟨p, hp, rfl⟩ |
| 101 | exact (hKU hp).2 |
| 102 | exact ((hconv i (Prod.snd '' K) (hK.image continuous_snd) hsub).comp Prod.snd).mono |
| 103 | (subset_preimage_image Prod.snd K)) |
| 104 | intro K hK |
| 105 | filter_upwards [herror K {0} hK isCompact_singleton Subset.rfl 1 zero_lt_one] with k hk |
| 106 | intro x hx v |
| 107 | exact terminalGerms_quadratic_of_unit_error (quotientMetric U hU O hO g hg) (h k) |
| 108 | (f k) x (hk 0 (mem_singleton 0) x hx) v |
| 109 | |
| 110 | end PoincareMT.M47 |