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.Ancient.Pointed |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.Ancient.Window |
| 3 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.Stages.SpacetimeEmbedding |
| 4 | |
| 5 | /-! |
| 6 | # Subsequences and finite windows of one ancient pointed limit |
| 7 | |
| 8 | Reindexing preserves the constructed ancient flow and all its convergence |
| 9 | maps. On any finite time window a source tail gives the frozen M07 convergence |
| 10 | record, with exactly the same limit metric and connection. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | namespace PoincareMT.AncientPointedGeometricConvergence |
| 20 | |
| 21 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.chartedSpace |
| 22 | FlowCarrier.isManifold |
| 23 | |
| 24 | /-- Restore the original source index while retaining one ancient limit. -/ |
| 25 | def ofSubsequence {n : ℕ} {C : ℕ → FlowCarrier.{0} n} |
| 26 | {g : ∀ k, ℝ → (C k).metric} {p : ∀ k, (C k).carrier} {T : ℝ} |
| 27 | {σ : ℕ → ℕ} (hσ : StrictMono σ) |
| 28 | (G : AncientPointedGeometricConvergence (fun k => C (σ k)) |
| 29 | (fun k => g (σ k)) (fun k => p (σ k)) T) : |
| 30 | AncientPointedGeometricConvergence C g p T where |
| 31 | limitCarrier := G.limitCarrier |
| 32 | limitFlow := G.limitFlow |
| 33 | base := G.base |
| 34 | subsequence := σ ∘ G.subsequence |
| 35 | subsequence_strictMono := hσ.comp G.subsequence_strictMono |
| 36 | exhaustion := G.exhaustion |
| 37 | exhaustion_open := G.exhaustion_open |
| 38 | exhaustion_connected := G.exhaustion_connected |
| 39 | exhaustion_compactClosure := G.exhaustion_compactClosure |
| 40 | exhaustion_increasing := G.exhaustion_increasing |
| 41 | exhaustion_covers := G.exhaustion_covers |
| 42 | embedding := G.embedding |
| 43 | embedding_open := G.embedding_open |
| 44 | embedding_smooth := G.embedding_smooth |
| 45 | base_in_exhaustion := G.base_in_exhaustion |
| 46 | base_preserving := G.base_preserving |
| 47 | pullback_metric_converges := G.pullback_metric_converges |
| 48 | pullback_metric_CInfinity := G.pullback_metric_CInfinity |
| 49 | |
| 50 | /-- The fixed ancient limit and fixed spatial maps give finite-window |
| 51 | convergence of a tail, without making another compactness selection. -/ |
| 52 | noncomputable def window {n : ℕ} {C : ℕ → FlowCarrier.{0} n} |
| 53 | {J : ℕ → Set ℝ} (F : ∀ k, RicciFlow n (C k).carrier (J k)) |
| 54 | {p : ∀ k, (C k).carrier} {T a b : ℝ} |
| 55 | (G : AncientPointedGeometricConvergence C (fun k => (F k).metric) p T) |
| 56 | (hab : a < b) (hb : b ≤ T) (N : ℕ) |
| 57 | (hsub : ∀ k, Ioo a b ⊆ J (G.subsequence (k + N))) : |
| 58 | PointedGeometricConvergence |
| 59 | (sourceWindowSequence (fun k => C (G.subsequence k)) |
| 60 | (fun k => F (G.subsequence k)) (fun k => p (G.subsequence k)) N hsub hab) := by |
| 61 | let L := G.limitCarrier |
| 62 | let B := L.basedWindow G.limitFlow G.base (fun _ ht => ht.2.trans_le hb) hab |
| 63 | let S := sourceWindowSequence (fun k => C (G.subsequence k)) |
| 64 | (fun k => F (G.subsequence k)) (fun k => p (G.subsequence k)) N hsub hab |
| 65 | have hmono : Monotone G.exhaustion := |
| 66 | monotone_nat_of_le_succ G.exhaustion_increasing |
| 67 | have hopen (k : ℕ) : Topology.IsOpenEmbedding |
| 68 | (fun x : G.exhaustion k => G.embedding (k + N) x) := |
| 69 | (G.embedding_open (k + N)).comp (Topology.IsOpenEmbedding.inclusion |
| 70 | (hmono (by omega : k ≤ k + N)) |
| 71 | ((G.exhaustion_open k).preimage continuous_subtype_val)) |
| 72 | have hsmooth (k : ℕ) : IsLocalDiffeomorphOn (𝓡 n) (𝓡 n) ∞ |
| 73 | (G.embedding (k + N)) (G.exhaustion k) := |
| 74 | fun x => G.embedding_smooth (k + N) |
| 75 | ⟨x, hmono (by omega : k ≤ k + N) x.property⟩ |
| 76 | refine { |
| 77 | limitCarrier := L |
| 78 | limitFlow := B |
| 79 | subsequence := id |
| 80 | subsequence_strictMono := strictMono_id |
| 81 | exhaustion := G.exhaustion |
| 82 | exhaustion_open := G.exhaustion_open |
| 83 | exhaustion_connected := G.exhaustion_connected |
| 84 | exhaustion_compactClosure := G.exhaustion_compactClosure |
| 85 | exhaustion_increasing := G.exhaustion_increasing |
| 86 | exhaustion_covers := G.exhaustion_covers |
| 87 | embedding := fun k => SmoothSpacetimeEmbedding.of_spatial B (S.flow k) |
| 88 | (G.exhaustion_open k) (G.embedding (k + N)) (hopen k) (hsmooth k) (Ioo a b) |
| 89 | base_in_exhaustion := G.base_in_exhaustion |
| 90 | base_preserving := fun k => congrArg (fun x => (0, x)) (G.base_preserving (k + N)) |
| 91 | pullback_metric_converges := ?_ |
| 92 | pullback_metric_CInfinity := ?_ } |
| 93 | · intro j K I hK hKE hI hIT ε hε |
| 94 | obtain ⟨M, hjM, hM⟩ := G.pullback_metric_converges j K I hK hKE hI |
| 95 | (fun t ht => (hIT ht).2.trans_le hb) ε hε |
| 96 | refine ⟨M, hjM, fun k hk => ?_⟩ |
| 97 | exact hM (k + N) (by omega) |
| 98 | · intro q j r K hK hKE ε hε |
| 99 | obtain ⟨M, hjM, hM⟩ := G.pullback_metric_CInfinity q j r K hK |
| 100 | (fun z hz => ⟨(hKE hz).1.2.trans_le hb, (hKE hz).2⟩) ε hε |
| 101 | refine ⟨M, hjM, fun k hk => ?_⟩ |
| 102 | exact hM (k + N) (by omega) |
| 103 | |
| 104 | end PoincareMT.AncientPointedGeometricConvergence |