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.Blowup.Construction.PartialLimits.MetricConvergence |
| 2 | import PoincareLib.Geometry.Riemannian.Coordinates.CompactFamily |
| 3 | import PoincareLib.Geometry.Manifold.VectorField.Derivation |
| 4 | |
| 5 | /-! |
| 6 | # Compact quadratic comparison for partial metric limits |
| 7 | |
| 8 | The actual retained coordinate jets bound tangent quadratic forms uniformly |
| 9 | on a compact subset of the limit. The total source maps are differentiated |
| 10 | only inside their exhaustion stages. This is the local metric-comparison |
| 11 | step of Morgan--Tian Theorems 5.6 and 5.9, pp. 85-89; see the independently |
| 12 | reviewed partial-limit-compact-balls derivation. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Topology Bundle |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M30.PartialPointedMetricConvergence |
| 24 | |
| 25 | variable {n : ℕ} {M : ℕ → Type u} [∀ k, TopologicalSpace (M k)] |
| 26 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin n)) (M k)] |
| 27 | [∀ k, IsManifold (𝓡 n) ∞ (M k)] |
| 28 | {g : ∀ k, RiemannianMetric n (M k)} {p : ∀ k, M k} {A : ℝ} |
| 29 | (G : PartialPointedMetricConvergence g p A) |
| 30 | |
| 31 | /-- The closure-step exhaustion is increasing (Theorem 5.6, pp. 85-87). -/ |
| 32 | theorem exhaustion_monotone : Monotone G.exhaustion := by |
| 33 | let : TopologicalSpace G.limitCarrier.carrier := G.limitCarrier.topologicalSpace |
| 34 | exact monotone_nat_of_le_succ (fun j => subset_closure.trans (G.exhaustion_step j)) |
| 35 | |
| 36 | /-- Every compact test set lies in one fixed exhaustion stage |
| 37 | (Theorem 5.6, pp. 85-87). -/ |
| 38 | theorem exists_exhaustion_superset {K : Set G.limitCarrier.carrier} |
| 39 | (hK : @IsCompact G.limitCarrier.carrier G.limitCarrier.topologicalSpace K) : |
| 40 | ∃ j, K ⊆ G.exhaustion j := by |
| 41 | let : TopologicalSpace G.limitCarrier.carrier := G.limitCarrier.topologicalSpace |
| 42 | exact hK.elim_directed_cover G.exhaustion G.exhaustion_open |
| 43 | (by rw [G.exhaustion_covers]; exact subset_univ _) G.exhaustion_monotone.directed_le |
| 44 | |
| 45 | private theorem eventually_inner_le_near_chart (q : G.limitCarrier.carrier) : |
| 46 | letI := G.limitCarrier.topologicalSpace |
| 47 | letI := G.limitCarrier.chartedSpace |
| 48 | letI := G.limitCarrier.isManifold |
| 49 | ∃ N ∈ 𝓝 q, ∀ᶠ k in atTop, ∀ x ∈ N, x ∈ G.exhaustion k → |
| 50 | ∀ v : TangentSpace (𝓡 n) x, |
| 51 | (g (G.subsequence k)).inner (G.embedding k x) |
| 52 | (mfderiv (𝓡 n) (𝓡 n) (G.embedding k) x v) |
| 53 | (mfderiv (𝓡 n) (𝓡 n) (G.embedding k) x v) ≤ |
| 54 | 2 * G.limitMetric.inner x v v := by |
| 55 | let : TopologicalSpace G.limitCarrier.carrier := G.limitCarrier.topologicalSpace |
| 56 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) G.limitCarrier.carrier := |
| 57 | G.limitCarrier.chartedSpace |
| 58 | let : IsManifold (𝓡 n) ∞ G.limitCarrier.carrier := G.limitCarrier.isManifold |
| 59 | let E := EuclideanSpace ℝ (Fin n) |
| 60 | let : NormedAddCommGroup (E →L[ℝ] ℝ) := ContinuousLinearMap.toNormedAddCommGroup |
| 61 | let : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := |
| 62 | ContinuousLinearMap.toNormedAddCommGroup |
| 63 | let c := extChartAt (𝓡 n) q |
| 64 | have hq : q ∈ c.source := mem_extChartAt_source q |
| 65 | have hi (z : E) (hz : z ∈ c.target) : |
| 66 | (mfderiv (𝓡 n) (𝓡 n) c.symm z).IsInvertible := |
| 67 | Poincare.Manifold.VectorField.isInvertible_mfderiv_extChartAt_symm hz |
| 68 | have hc (z : E) (hz : z ∈ c.target) : ContMDiffAt (𝓡 n) (𝓡 n) ∞ c.symm z := |
| 69 | (contMDiffOn_extChartAt_symm q).contMDiffAt |
| 70 | ((isOpen_extChartAt_target (I := 𝓡 n) q).mem_nhds hz) |
| 71 | obtain ⟨r, hr, hrsub⟩ := Metric.mem_nhds_iff.mp |
| 72 | ((isOpen_extChartAt_target (I := 𝓡 n) q).mem_nhds (c.map_source hq)) |
| 73 | let C := Metric.closedBall (c q) (r / 2) |
| 74 | have hC : IsCompact C := isCompact_closedBall _ _ |
| 75 | have hCt : C ⊆ c.target := |
| 76 | (Metric.closedBall_subset_ball (by linarith)).trans hrsub |
| 77 | have hcont : ContinuousOn (G.limitMetric.pullbackCoefficients c.symm) C := by |
| 78 | intro z hz |
| 79 | exact (G.limitMetric.contDiffAt_pullbackCoefficients |
| 80 | (hc z (hCt hz))).continuousAt.continuousWithinAt |
| 81 | have hpos : ∀ z ∈ C, ∀ v : E, v ≠ 0 → |
| 82 | 0 < G.limitMetric.pullbackCoefficients c.symm z v v := by |
| 83 | intro z hz v hv |
| 84 | apply G.limitMetric.pos |
| 85 | intro hzero |
| 86 | apply hv |
| 87 | apply (hi z (hCt hz)).injective |
| 88 | rw [map_zero] |
| 89 | exact hzero |
| 90 | obtain ⟨a, ha, hlower⟩ := exists_uniform_bilinear_family_lower_bound hC hcont hpos |
| 91 | have hmetric : TendstoUniformlyOn |
| 92 | (fun k => (g (G.subsequence k)).pullbackCoefficients (G.embedding k ∘ c.symm)) |
| 93 | (G.limitMetric.pullbackCoefficients c.symm) atTop C := by |
| 94 | simpa only [Function.comp_def, iteratedFDeriv_zero_apply] using! |
| 95 | (ContinuousMultilinearMap.uniformContinuous_eval_const |
| 96 | (0 : Fin 0 → E)).comp_tendstoUniformlyOn (G.metric_jets q 0 C hC hCt) |
| 97 | have hconv := (Metric.tendstoUniformlyOn_iff |
| 98 | (α := E →L[ℝ] E →L[ℝ] ℝ)).mp hmetric a ha |
| 99 | let N := c.source ∩ c ⁻¹' Metric.ball (c q) (r / 2) |
| 100 | have hN : N ∈ 𝓝 q := inter_mem ((isOpen_extChartAt_source q).mem_nhds hq) |
| 101 | (((continuousOn_extChartAt q).continuousAt |
| 102 | ((isOpen_extChartAt_source q).mem_nhds hq)).preimage_mem_nhds |
| 103 | (Metric.ball_mem_nhds (c q) (by positivity))) |
| 104 | refine ⟨N, hN, ?_⟩ |
| 105 | filter_upwards [hconv] with k hk x hx hxstage v |
| 106 | have hxc : c x ∈ C := Metric.ball_subset_closedBall hx.2 |
| 107 | have hxi := hi (c x) (hCt hxc) |
| 108 | let w : E := (mfderiv (𝓡 n) (𝓡 n) c.symm (c x)).inverse v |
| 109 | let B := G.limitMetric.pullbackCoefficients c.symm (c x) |
| 110 | let Bk := (g (G.subsequence k)).pullbackCoefficients (G.embedding k ∘ c.symm) (c x) |
| 111 | have herr : |Bk w w - B w w| ≤ a * ‖w‖ ^ 2 := by |
| 112 | have hd : ‖Bk - B‖ ≤ a := by |
| 113 | simpa only [dist_eq_norm, norm_sub_rev] using (hk (c x) hxc).le |
| 114 | calc |
| 115 | _ ≤ ‖Bk - B‖ * ‖w‖ * ‖w‖ := by |
| 116 | simpa only [sub_apply, Real.norm_eq_abs] using (Bk - B).le_opNorm₂ w w |
| 117 | _ ≤ a * ‖w‖ ^ 2 := by |
| 118 | simpa only [pow_two, mul_assoc] using |
| 119 | mul_le_mul_of_nonneg_right hd (mul_nonneg (norm_nonneg w) (norm_nonneg w)) |
| 120 | have hbound : Bk w w ≤ 2 * B w w := by |
| 121 | have hh := (abs_le.mp herr).2 |
| 122 | have hb := hlower (c x) hxc w |
| 123 | change a * ‖w‖ ^ 2 ≤ B w w at hb |
| 124 | linarith |
| 125 | have hmap : MDifferentiableAt (𝓡 n) (𝓡 n) (G.embedding k) (c.symm (c x)) := by |
| 126 | rw [c.left_inv hx.1] |
| 127 | exact (G.embedding_smooth k ⟨x, hxstage⟩).contMDiffAt.mdifferentiableAt (by simp) |
| 128 | have hchain := mfderiv_comp (c x) hmap ((hc (c x) (hCt hxc)).mdifferentiableAt (by simp)) |
| 129 | change (g (G.subsequence k)).inner (G.embedding k (c.symm (c x))) |
| 130 | (mfderiv (𝓡 n) (𝓡 n) (G.embedding k ∘ c.symm) (c x) w) |
| 131 | (mfderiv (𝓡 n) (𝓡 n) (G.embedding k ∘ c.symm) (c x) w) ≤ |
| 132 | 2 * G.limitMetric.inner (c.symm (c x)) |
| 133 | (mfderiv (𝓡 n) (𝓡 n) c.symm (c x) w) |
| 134 | (mfderiv (𝓡 n) (𝓡 n) c.symm (c x) w) at hbound |
| 135 | have hchainw : mfderiv (𝓡 n) (𝓡 n) (G.embedding k ∘ c.symm) (c x) w = |
| 136 | mfderiv (𝓡 n) (𝓡 n) (G.embedding k) (c.symm (c x)) v := by |
| 137 | rw [hchain] |
| 138 | change mfderiv (𝓡 n) (𝓡 n) (G.embedding k) (c.symm (c x)) |
| 139 | (mfderiv (𝓡 n) (𝓡 n) c.symm (c x) |
| 140 | ((mfderiv (𝓡 n) (𝓡 n) c.symm (c x)).inverse v)) = _ |
| 141 | rw [hxi.self_apply_inverse] |
| 142 | rw [hchainw] at hbound |
| 143 | have htransport := congrArg (fun z : G.limitCarrier.carrier => |
| 144 | (g (G.subsequence k)).inner (G.embedding k z) |
| 145 | (mfderiv (𝓡 n) (𝓡 n) (G.embedding k) z v) |
| 146 | (mfderiv (𝓡 n) (𝓡 n) (G.embedding k) z v) ≤ |
| 147 | 2 * G.limitMetric.inner z v v) (c.left_inv hx.1) |
| 148 | apply htransport.mp |
| 149 | simpa only [w, hxi.self_apply_inverse] using hbound |
| 150 | |
| 151 | /-- Retained metric jets give one quadratic-form bound over each compact |
| 152 | test set, with the actual differential of each source map |
| 153 | (Theorems 5.6 and 5.9, pp. 85-89). -/ |
| 154 | theorem eventually_pullback_inner_le_twice {K : Set G.limitCarrier.carrier} |
| 155 | (hK : @IsCompact G.limitCarrier.carrier G.limitCarrier.topologicalSpace K) : |
| 156 | letI := G.limitCarrier.topologicalSpace |
| 157 | letI := G.limitCarrier.chartedSpace |
| 158 | letI := G.limitCarrier.isManifold |
| 159 | ∀ᶠ k in atTop, ∀ x ∈ K, ∀ v : TangentSpace (𝓡 n) x, |
| 160 | (g (G.subsequence k)).inner (G.embedding k x) |
| 161 | (mfderiv (𝓡 n) (𝓡 n) (G.embedding k) x v) |
| 162 | (mfderiv (𝓡 n) (𝓡 n) (G.embedding k) x v) ≤ |
| 163 | 2 * G.limitMetric.inner x v v := by |
| 164 | classical |
| 165 | let : TopologicalSpace G.limitCarrier.carrier := G.limitCarrier.topologicalSpace |
| 166 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) G.limitCarrier.carrier := |
| 167 | G.limitCarrier.chartedSpace |
| 168 | let : IsManifold (𝓡 n) ∞ G.limitCarrier.carrier := G.limitCarrier.isManifold |
| 169 | choose N hN hbound using fun q => G.eventually_inner_le_near_chart q |
| 170 | obtain ⟨s, hs⟩ := hK.elim_nhds_subcover' (fun q (_ : q ∈ K) => N q) |
| 171 | (fun q (_ : q ∈ K) => hN q) |
| 172 | have hall := (Filter.eventually_all_finite s.finite_toSet).mpr |
| 173 | (fun (q : K) (_ : q ∈ s) => hbound q) |
| 174 | obtain ⟨j, hj⟩ := G.exists_exhaustion_superset hK |
| 175 | filter_upwards [hall, eventually_ge_atTop j] with k hk hjk x hx v |
| 176 | obtain ⟨q, hq, hxq⟩ := mem_iUnion₂.mp (hs hx) |
| 177 | exact hk q hq x hxq (G.exhaustion_monotone hjk (hj hx)) v |
| 178 | |
| 179 | end PoincareMT.M30.PartialPointedMetricConvergence |