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.AnnularEvolution.Sweep.Metric.Transport |
| 2 | |
| 3 | /-! |
| 4 | # Sharp multiplicative area comparison between nearby flow metrics |
| 5 | |
| 6 | Orthogonalizing one differential column in the source metric proves Gram |
| 7 | area monotonicity from a tangent-norm comparison. Degenerate columns are |
| 8 | included. The same-map annulus transport therefore has a multiplicative |
| 9 | area bound whose factor tends to one as the metric times approach. |
| 10 | |
| 11 | Morgan--Tian context: Lemma 19.15 and its annular area-to-energy construction, printed pp. |
| 12 | 447-449. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set MeasureTheory |
| 19 | open scoped Manifold ContDiff Bundle |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | |
| 28 | /-- A tangent-norm comparison by a nonnegative factor bounds the Gram determinant by its |
| 29 | fourth power. Source: MT Lemma 19.15, pp. 447-449, its weak minimum and sweep construction. -/ |
| 30 | theorem m64_gram_pair_le_of_metric_le |
| 31 | (g h : RiemannianMetric n M) (x : M) {D : ℝ} (hD : 0 ≤ D) |
| 32 | (hcompare : ∀ v : TangentSpace (𝓡 n) x, h.inner x v v ≤ D * g.inner x v v) |
| 33 | (u v : TangentSpace (𝓡 n) x) : |
| 34 | h.inner x u u * h.inner x v v - (h.inner x u v) ^ 2 ≤ |
| 35 | D ^ 2 * (g.inner x u u * g.inner x v v - (g.inner x u v) ^ 2) := by |
| 36 | by_cases hu : u = 0 |
| 37 | · subst u |
| 38 | simp |
| 39 | have hpos : 0 < g.inner x u u := g.pos x u hu |
| 40 | have hne : g.inner x u u ≠ 0 := ne_of_gt hpos |
| 41 | let q := g.inner x u v / g.inner x u u |
| 42 | let w := v - q • u |
| 43 | have hinvariant (m : RiemannianMetric n M) : |
| 44 | m.inner x u u * m.inner x v v - (m.inner x u v) ^ 2 = |
| 45 | m.inner x u u * m.inner x w w - (m.inner x u w) ^ 2 := by |
| 46 | dsimp only [w] |
| 47 | simp only [map_sub, sub_apply, map_smul, smul_apply, smul_eq_mul] |
| 48 | rw [m.symm x v u] |
| 49 | ring |
| 50 | have horth : g.inner x u w = 0 := by |
| 51 | dsimp only [w, q] |
| 52 | simp only [map_sub, map_smul, smul_eq_mul] |
| 53 | field_simp |
| 54 | ring |
| 55 | have hgu : 0 ≤ g.inner x u u := hpos.le |
| 56 | have hhw : 0 ≤ h.inner x w w := (h.toRiemannianMetric.toCore x).re_inner_nonneg _ |
| 57 | calc |
| 58 | _ = h.inner x u u * h.inner x w w - (h.inner x u w) ^ 2 := hinvariant h |
| 59 | _ ≤ h.inner x u u * h.inner x w w := sub_le_self _ (sq_nonneg _) |
| 60 | _ ≤ (D * g.inner x u u) * (D * g.inner x w w) := |
| 61 | mul_le_mul (hcompare u) (hcompare w) hhw (mul_nonneg hD hgu) |
| 62 | _ = D ^ 2 * (g.inner x u u * g.inner x w w - (g.inner x u w) ^ 2) := by |
| 63 | rw [horth] |
| 64 | ring |
| 65 | _ = _ := by rw [← hinvariant g] |
| 66 | |
| 67 | /-- A tangent-norm comparison by a nonnegative factor bounds area density by its square. |
| 68 | Source: MT Lemma 19.15, pp. 447-449, its weak minimum and sweep construction. -/ |
| 69 | theorem m64AreaDensity_le_of_tangentNorm_le |
| 70 | (g h : RiemannianMetric n M) {C : ℝ} (_hC : 0 ≤ C) |
| 71 | (hcompare : ∀ x : M, ∀ v : TangentSpace (𝓡 n) x, |
| 72 | h.tangentNorm x v ≤ C * g.tangentNorm x v) |
| 73 | (f : LoopPlane → M) (p : LoopPlane) : |
| 74 | m60AreaDensity h f p ≤ C ^ 2 * m60AreaDensity g f p := by |
| 75 | have hquadratic (x : M) (v : TangentSpace (𝓡 n) x) : |
| 76 | h.inner x v v ≤ C ^ 2 * g.inner x v v := by |
| 77 | have hsquare := pow_le_pow_left₀ (Real.sqrt_nonneg _) (hcompare x v) 2 |
| 78 | have hgp : 0 ≤ g.inner x v v := (g.toRiemannianMetric.toCore x).re_inner_nonneg v |
| 79 | have hhp : 0 ≤ h.inner x v v := (h.toRiemannianMetric.toCore x).re_inner_nonneg v |
| 80 | change (Real.sqrt (h.inner x v v)) ^ 2 ≤ |
| 81 | (C * Real.sqrt (g.inner x v v)) ^ 2 at hsquare |
| 82 | rw [mul_pow, Real.sq_sqrt hgp, Real.sq_sqrt hhp] at hsquare |
| 83 | exact hsquare |
| 84 | have hdet : Matrix.det (m60AreaGram h f p) ≤ |
| 85 | (C ^ 2) ^ 2 * Matrix.det (m60AreaGram g f p) := by |
| 86 | rw [Matrix.det_fin_two, Matrix.det_fin_two, |
| 87 | m60AreaGram_symm h f p 1 0, m60AreaGram_symm g f p 1 0] |
| 88 | simpa only [m60AreaGram, pow_two] using |
| 89 | m64_gram_pair_le_of_metric_le g h (f p) (sq_nonneg C) (hquadratic (f p)) |
| 90 | (mfderiv (𝓡 2) (𝓡 n) f p (EuclideanSpace.basisFun (Fin 2) ℝ 0)) |
| 91 | (mfderiv (𝓡 2) (𝓡 n) f p (EuclideanSpace.basisFun (Fin 2) ℝ 1)) |
| 92 | simp only [m60AreaDensity, max_eq_right (m60AreaGram_det_nonneg h f p), |
| 93 | max_eq_right (m60AreaGram_det_nonneg g f p)] |
| 94 | calc |
| 95 | _ ≤ Real.sqrt ((C ^ 2) ^ 2 * Matrix.det (m60AreaGram g f p)) := |
| 96 | Real.sqrt_le_sqrt hdet |
| 97 | _ = _ := by rw [Real.sqrt_mul (sq_nonneg _), Real.sqrt_sq (sq_nonneg C)] |
| 98 | |
| 99 | /-- Transporting an admissible annulus to a comparable metric multiplies its area by at most |
| 100 | the squared norm factor. Source: MT Lemma 19.15, pp. 447-449, its weak minimum and sweep |
| 101 | construction. -/ |
| 102 | theorem m64Annulus_transport_metric_area [T2Space M] |
| 103 | (g h : RiemannianMetric n M) {c0 c1 : ℝ → M} |
| 104 | (A : M64Annulus g c0 c1) {C : ℝ} (hC : 0 < C) |
| 105 | (hcompare : ∀ x : M, ∀ v : TangentSpace (𝓡 n) x, |
| 106 | h.tangentNorm x v ≤ C * g.tangentNorm x v) : |
| 107 | ∃ B : M64Annulus h c0 c1, B.map = A.map ∧ B.area ≤ C ^ 2 * A.area := by |
| 108 | have hdist (x y : M) : h.edist x y ≤ ENNReal.ofReal C * g.edist x y := by |
| 109 | apply RiemannianMetric.edist_le_mul_of_tangentNorm_mfderiv_le g h |
| 110 | (F := id) contMDiff_id hC |
| 111 | intro q v |
| 112 | simpa only [id_eq, mfderiv_id, ContinuousLinearMap.id_apply] using hcompare q v |
| 113 | obtain ⟨B, hmap⟩ := m64Annulus_transport_metric g h A hC.le hdist |
| 114 | refine ⟨B, hmap, ?_⟩ |
| 115 | change (∫ p in m64AnnulusDomain, m60AreaDensity h B.map p) ≤ _ |
| 116 | calc |
| 117 | _ ≤ ∫ p in m64AnnulusDomain, C ^ 2 * m60AreaDensity g A.map p := |
| 118 | integral_mono B.area_integrable (A.area_integrable.const_mul (C ^ 2)) (fun p => by |
| 119 | rw [hmap] |
| 120 | exact m64AreaDensity_le_of_tangentNorm_le g h hC.le hcompare A.map p) |
| 121 | _ = _ := integral_const_mul _ _ |
| 122 | |
| 123 | /-- Metric distortion along the compact flow gives an explicit exponential area comparison |
| 124 | for the transported annulus. Source: MT Lemma 19.15, pp. 447-449, its weak minimum and sweep |
| 125 | construction. -/ |
| 126 | theorem m64Annulus_transport_time_area [T2Space M] |
| 127 | {a b : ℝ} (F : RicciFlow n M (Icc a b)) {K : ℝ} (hK : 0 ≤ K) |
| 128 | (hcurv : ∀ t ∈ Icc a b, ∀ x : M, (F.connection t).curvatureTensorNorm x ≤ K) |
| 129 | {s t : ℝ} (hs : s ∈ Icc a b) (ht : t ∈ Icc a b) |
| 130 | {c0 c1 : ℝ → M} (A : M64Annulus (F.metric s) c0 c1) : |
| 131 | ∃ B : M64Annulus (F.metric t) c0 c1, B.map = A.map ∧ |
| 132 | B.area ≤ Real.exp ((n : ℝ) * K * |t - s|) ^ 2 * A.area := |
| 133 | m64Annulus_transport_metric_area (F.metric s) (F.metric t) A (Real.exp_pos _) |
| 134 | (m64_flow_tangentNorm_time_comparison F hK hcurv hs ht) |
| 135 | |
| 136 | end PoincareMT |