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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.Coordinates.IndexedCovering |
| 3 | |
| 4 | /-! |
| 5 | # Assembling finite static normal covers |
| 6 | |
| 7 | An ambient small-ball cover and normalized charts at its centers give the |
| 8 | actual compact-coordinate-core cover. Distance comparison, compactness and |
| 9 | the distinguished base chart are proved during assembly. This supplies the |
| 10 | static spatial normal covers for Morgan--Tian Theorem 5.6, pp. 85-87; |
| 11 | see the bounded-margin factory derivation dated 2026-09-22. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M28 |
| 23 | |
| 24 | private theorem exists_surjective_fin_with_base {α : Type*} [Fintype α] |
| 25 | (a : α) {N : ℕ} (hN : Fintype.card α ≤ N) : |
| 26 | ∃ f : Fin (N + 1) → α, f 0 = a ∧ Function.Surjective f := by |
| 27 | classical |
| 28 | let : Nonempty α := ⟨a⟩ |
| 29 | let e : α ↪ Fin N := |
| 30 | { toFun := fun x => ⟨(Fintype.equivFin α x).val, |
| 31 | (Fintype.equivFin α x).isLt.trans_le hN⟩ |
| 32 | inj' := fun x y h => (Fintype.equivFin α).injective |
| 33 | (Fin.ext (congrArg (fun z : Fin N => z.val) h)) } |
| 34 | refine ⟨Fin.cases a (Function.invFun e), rfl, ?_⟩ |
| 35 | intro x |
| 36 | exact ⟨(e x).succ, Function.leftInverse_invFun e.injective x⟩ |
| 37 | |
| 38 | /-- A finite ambient cover and locally supplied normal charts construct all |
| 39 | fields of the actual normal-cover structure. The basepoint is inserted and |
| 40 | the chart count is padded uniformly; Theorem 5.6, pp. 85-87. -/ |
| 41 | theorem exists_normalChartCover_of_normal_charts |
| 42 | {n : ℕ} {M : Type u} [TopologicalSpace M] [T3Space M] [PreconnectedSpace M] |
| 43 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 44 | (g : RiemannianMetric n M) (p : M) {r R ρ : ℝ} {N : ℕ} |
| 45 | (hr : 0 < r) (hρ : 0 < ρ) (hρR : 2 * ρ < R) |
| 46 | (hcover : ∃ C : Finset M, (↑C : Set M) ⊆ g.ball p r ∧ C.card ≤ N ∧ |
| 47 | g.ball p r ⊆ ⋃ q ∈ C, g.ball q (ρ / 4)) |
| 48 | (hcharts : ∀ q ∈ g.ball p r, |
| 49 | ∃ L : EuclideanSpace ℝ (Fin n) ≃L[ℝ] EuclideanSpace ℝ (Fin n), |
| 50 | ∃ Φ : PartialDiffeomorph (𝓡 n) (𝓡 n) (EuclideanSpace ℝ (Fin n)) M ∞, |
| 51 | Φ.source = Metric.ball 0 R ∧ Φ.target = g.ball q R ∧ Φ 0 = q ∧ |
| 52 | (∀ u w, g.pullbackCoefficients (extChartAt (𝓡 n) q).symm |
| 53 | (extChartAt (𝓡 n) q q) (L u) (L w) = inner ℝ u w) ∧ |
| 54 | HasFDerivAt (fun w => extChartAt (𝓡 n) q (Φ w)) L.toContinuousLinearMap 0 ∧ |
| 55 | (∀ w ∈ Metric.ball 0 R, |
| 56 | g.IsGeodesicOn (fun t => Φ (t • w)) {t : ℝ | t • w ∈ Metric.ball 0 R}) ∧ |
| 57 | (∀ w ∈ Metric.ball 0 R, g.edist q (Φ w) = ENNReal.ofReal ‖w‖) ∧ |
| 58 | ∀ x ∈ Metric.closedBall 0 (2 * ρ), ∀ w, |
| 59 | (1 / 4 : ℝ) * ‖w‖ ^ 2 ≤ g.pullbackCoefficients Φ x w w ∧ |
| 60 | g.pullbackCoefficients Φ x w w ≤ (9 / 4 : ℝ) * ‖w‖ ^ 2) : |
| 61 | Nonempty (NormalChartCover (fun _ => g) p (-1) 1 r R ρ (1 / 4) (9 / 4) (N + 1)) := by |
| 62 | classical |
| 63 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 64 | ⟨g.toRiemannianMetric⟩ |
| 65 | obtain ⟨C, hC, hcard, hcover⟩ := hcover |
| 66 | let S := insert p C |
| 67 | have hp : p ∈ g.ball p r := by |
| 68 | change g.edist p p < ENNReal.ofReal r |
| 69 | have hself : g.edist p p = 0 := Manifold.riemannianEDist_self |
| 70 | rw [hself] |
| 71 | exact ENNReal.ofReal_pos.mpr hr |
| 72 | have hS : (↑S : Set M) ⊆ g.ball p r := by |
| 73 | intro q hq |
| 74 | rcases Finset.mem_insert.mp hq with rfl | hq |
| 75 | · exact hp |
| 76 | · exact hC hq |
| 77 | obtain ⟨f, hfzero, hf⟩ := exists_surjective_fin_with_base |
| 78 | (⟨p, Finset.mem_insert_self _ _⟩ : S) (N := N + 1) (by |
| 79 | simpa only [Fintype.card_coe] using |
| 80 | (Finset.card_insert_le p C).trans (Nat.add_le_add_right hcard 1)) |
| 81 | choose L Φ hsource htarget hzero hL hderiv hgeo hdist hcoeff using |
| 82 | fun q : S => hcharts q (hS q.property) |
| 83 | have hcore : g.ball p r ⊆ ⋃ q : S, Φ q '' Metric.closedBall 0 (ρ / 4) := by |
| 84 | intro x hx |
| 85 | obtain ⟨q, hq, hxq⟩ := mem_iUnion₂.mp (hcover hx) |
| 86 | let q' : S := ⟨q, Finset.mem_insert_of_mem hq⟩ |
| 87 | have hxtarget : x ∈ (Φ q').target := by |
| 88 | rw [htarget] |
| 89 | exact hxq.trans_le (ENNReal.ofReal_le_ofReal (by linarith : ρ / 4 ≤ R)) |
| 90 | have hwsource : (Φ q').symm x ∈ Metric.ball 0 R := by |
| 91 | rw [← hsource] |
| 92 | exact (Φ q').map_target hxtarget |
| 93 | have heq := (Φ q').right_inv hxtarget |
| 94 | refine mem_iUnion.mpr ⟨q', (Φ q').symm x, ?_, heq⟩ |
| 95 | have hnorm := (congrArg (g.edist (q' : M)) heq).symm.trans |
| 96 | (hdist q' ((Φ q').symm x) hwsource) |
| 97 | have hsmall : ENNReal.ofReal ‖(Φ q').symm x‖ < ENNReal.ofReal (ρ / 4) := by |
| 98 | rw [← hnorm] |
| 99 | exact hxq |
| 100 | apply Metric.mem_closedBall.mpr |
| 101 | rw [dist_zero_right] |
| 102 | exact ((ENNReal.ofReal_lt_ofReal_iff (by positivity : 0 < ρ / 4)).mp hsmall).le |
| 103 | refine ⟨{ |
| 104 | centre := fun i => f i |
| 105 | chart := fun i => Φ (f i) |
| 106 | centre_zero := congrArg Subtype.val hfzero |
| 107 | centre_mem := fun i => hS (f i).property |
| 108 | source := fun i => hsource (f i) |
| 109 | target := fun i => htarget (f i) |
| 110 | map_zero := fun i => hzero (f i) |
| 111 | normalized := fun i => ⟨L (f i), hL (f i), hderiv (f i)⟩ |
| 112 | radial_geodesic := fun i => hgeo (f i) |
| 113 | radial_distance := fun i => hdist (f i) |
| 114 | coefficients := fun i _ _ => hcoeff (f i) |
| 115 | distances := ?_ |
| 116 | compact_image := ?_ |
| 117 | cover := ?_ }⟩ |
| 118 | · intro i x hx y hy |
| 119 | apply g.toReal_edist_bounds_of_normal_pullback_bounds (f i) (Φ (f i)) |
| 120 | (by positivity) (by linarith) (by norm_num) (by norm_num) |
| 121 | (hsource (f i)) (htarget (f i)) (hdist (f i)) |
| 122 | (fun z hz v => hcoeff (f i) z ?_ v) hx hy |
| 123 | exact Metric.closedBall_subset_closedBall (by linarith) (Metric.ball_subset_closedBall hz) |
| 124 | · intro i |
| 125 | apply (isCompact_closedBall (0 : EuclideanSpace ℝ (Fin n)) (ρ / 4)).image_of_continuousOn |
| 126 | apply (Φ (f i)).contMDiffOn.continuousOn.mono |
| 127 | rw [hsource] |
| 128 | exact Metric.closedBall_subset_ball (by linarith) |
| 129 | · intro x hx |
| 130 | obtain ⟨q, hq⟩ := mem_iUnion.mp (hcore hx) |
| 131 | obtain ⟨i, rfl⟩ := hf q |
| 132 | exact mem_iUnion.mpr ⟨i, hq⟩ |
| 133 | |
| 134 | end PoincareMT.M28 |