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.Convergence.Volume.SourceBalls |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.SourceMetric |
| 3 | |
| 4 | /-! |
| 5 | # Uniform ball transfer from a complete pointed limit |
| 6 | |
| 7 | Compactness of the closure of a limit ball makes the metric distortion and |
| 8 | embedding-domain thresholds uniform over that ball. Compact subsets therefore |
| 9 | map into one fixed source ball along the actual stored subsequence and maps. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 17 | |
| 18 | namespace PoincareMT.PointedGeometricConvergence |
| 19 | |
| 20 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.chartedSpace |
| 21 | FlowCarrier.isManifold FlowCarrier.t3Space |
| 22 | |
| 23 | variable {n : ℕ} {T' T : ℝ} {S : PointedFlowSequence n T' T} |
| 24 | |
| 25 | /-- One eventual threshold transfers the entire limit ball to the enlarged |
| 26 | source ball through the embeddings stored in geometric convergence. -/ |
| 27 | theorem eventually_image_ballAt_subset_ballAt |
| 28 | (G : PointedGeometricConvergence S) (hT : T' < 0 ∧ 0 < T) |
| 29 | {t r C : ℝ} (ht : t ∈ Ioo T' T) |
| 30 | (hcomplete : G.limitCarrier.metricComplete (G.limitFlow.metricAt t)) |
| 31 | (hC : 1 < C) : |
| 32 | ∀ᶠ k : ℕ in atTop, |
| 33 | (fun x => ((G.embedding k).toFun (t, x)).2) '' G.limitFlow.ballAt t r ⊆ |
| 34 | (S.flow (G.subsequence k)).ballAt t (C * r) := by |
| 35 | let g := G.limitFlow.metricAt t |
| 36 | have hcompact : IsCompact (closure (g.ball G.limitFlow.base r)) := |
| 37 | g.isCompact_closure_ball_of_metricComplete hcomplete G.limitFlow.base r |
| 38 | obtain ⟨j, hj⟩ := G.exists_exhaustion_superset hcompact |
| 39 | filter_upwards [G.eventually_pullback_tangentNorm_bounds hcompact ht hC, |
| 40 | eventually_ge_atTop j] with k hk hjk |
| 41 | let h := (S.flow (G.subsequence k)).metricAt t |
| 42 | let e := (G.embedding k).spatialHomeomorph (G.exhaustion_open k) ht |
| 43 | have hsource : g.ball G.limitFlow.base r ⊆ e.source := |
| 44 | subset_closure.trans (hj.trans (G.exhaustion_monotone hjk)) |
| 45 | have he : ∀ x ∈ e.source, ContMDiffAt (𝓡 n) (𝓡 n) 1 e x := |
| 46 | fun x hx => ((G.embedding k).spatialMap_contMDiffAt |
| 47 | (G.exhaustion_open k) ht hx).of_le (by simp) |
| 48 | have hbound : ∀ x ∈ g.ball G.limitFlow.base r, ∀ v : TangentSpace (𝓡 n) x, |
| 49 | h.tangentNorm (e x) (mfderiv (𝓡 n) (𝓡 n) e x v) ≤ C * g.tangentNorm x v := |
| 50 | fun x hx v => (hk x (subset_closure hx) v).1 |
| 51 | have hbase : e G.limitFlow.base = (S.flow (G.subsequence k)).base := |
| 52 | congrArg Prod.snd (G.base_preserving_at_time hT k ht) |
| 53 | have himage := g.image_ball_subset_ball_of_tangentNorm_le h e G.limitFlow.base |
| 54 | (zero_lt_one.trans hC) hsource he hbound |
| 55 | rw [hbase] at himage |
| 56 | exact himage |
| 57 | |
| 58 | /-- A compact subset of a complete pointed limit eventually lies in one |
| 59 | uniformly bounded source ball under every stored comparison map. -/ |
| 60 | theorem exists_pos_eventually_image_subset_ballAt |
| 61 | (G : PointedGeometricConvergence S) (hT : T' < 0 ∧ 0 < T) |
| 62 | {t : ℝ} (ht : t ∈ Ioo T' T) |
| 63 | (hcomplete : G.limitCarrier.metricComplete (G.limitFlow.metricAt t)) |
| 64 | {K : Set G.limitCarrier.carrier} (hK : IsCompact K) : |
| 65 | ∃ R : ℝ, 0 < R ∧ ∀ᶠ k : ℕ in atTop, |
| 66 | (fun x => ((G.embedding k).toFun (t, x)).2) '' K ⊆ |
| 67 | (S.flow (G.subsequence k)).ballAt t R := by |
| 68 | let g := G.limitFlow.metricAt t |
| 69 | let : MetricSpace G.limitCarrier.carrier := G.limitCarrier.metricSpaceOf g |
| 70 | obtain ⟨r, hr, hKr⟩ := hK.isBounded.subset_ball_lt 0 G.limitFlow.base |
| 71 | have hball : K ⊆ G.limitFlow.ballAt t r := by |
| 72 | change K ⊆ G.limitCarrier.metricBall g G.limitFlow.base r |
| 73 | simpa only [G.limitCarrier.metricBall_eq_metricBallOf g] using hKr |
| 74 | refine ⟨2 * r, mul_pos (by norm_num) hr, ?_⟩ |
| 75 | filter_upwards [G.eventually_image_ballAt_subset_ballAt hT ht hcomplete |
| 76 | (r := r) (C := 2) (by norm_num)] with k hk |
| 77 | exact (image_mono hball).trans hk |
| 78 | |
| 79 | end PoincareMT.PointedGeometricConvergence |