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.SpatialEmbedding |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Noncompact.AncientVolume.ScalarRatio.Annular.ChartFlow |
| 3 | import PoincareLib.Geometry.RicciFlow.Compactness.Embedding.BallTransfer |
| 4 | |
| 5 | /-! |
| 6 | # Actual source flows on retained coordinate domains |
| 7 | |
| 8 | A compact coordinate buffer fits inside one retained exhaustion stage. |
| 9 | The stored spatial inverses then give actual partial diffeomorphisms and |
| 10 | pullback flows on the same open coordinate domain. Replacing only a finite |
| 11 | initial prefix retains every later source index and comparison map. |
| 12 | |
| 13 | Reference: Morgan--Tian Proposition 5.14 and Theorem 11.8, pp. 90-91 and |
| 14 | 272-279. This constructs source chart flows, without extracting a limit |
| 15 | or assuming an evolution equation for a formal coefficient field. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set Filter TopologicalSpace |
| 22 | open scoped Manifold ContDiff Bundle Topology |
| 23 | |
| 24 | namespace PoincareMT.M30 |
| 25 | |
| 26 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.chartedSpace |
| 27 | FlowCarrier.isManifold FlowCarrier.t2Space |
| 28 | |
| 29 | /-- Actual source flows pull back through the retained M07 maps after a |
| 30 | finite-prefix repair, preserving every total-time metric coefficient |
| 31 | (Proposition 5.14 and Theorem 11.8, pp. 90-91 and 272-279). -/ |
| 32 | theorem exists_source_flows_on_retained_chart |
| 33 | {n : ℕ} {a b : ℝ} {S : PointedFlowSequence n a b} |
| 34 | (G : PointedGeometricConvergence S) (hzero : a < 0 ∧ 0 < b) |
| 35 | {J : Set ℝ} (F : ∀ k, RicciFlow n (S.carrier k).carrier J) |
| 36 | (q : G.limitCarrier.carrier) |
| 37 | (U : Opens (EuclideanSpace ℝ (Fin n))) |
| 38 | (K : Set (EuclideanSpace ℝ (Fin n))) (hK : IsCompact K) |
| 39 | (hUK : (U : Set (EuclideanSpace ℝ (Fin n))) ⊆ K) |
| 40 | (hKchart : K ⊆ (extChartAt (𝓡 n) q).target) : |
| 41 | ∃ N : ℕ, ∃ Fchart : ℕ → RicciFlow n U J, |
| 42 | ∀ k (t : ℝ) (x : U) (v w : TangentSpace (𝓡 n) x), |
| 43 | ((Fchart k).metric t).inner x v w = |
| 44 | ((F (G.subsequence (max N k))).metric t).pullbackCoefficients |
| 45 | ((fun y => ((G.embedding (max N k)).toFun (0, y)).2) ∘ |
| 46 | (extChartAt (𝓡 n) q).symm) x v w := by |
| 47 | classical |
| 48 | have hcont : ContinuousOn (extChartAt (𝓡 n) q).symm K := |
| 49 | (contMDiffOn_extChartAt_symm (n := ∞) q).continuousOn.mono hKchart |
| 50 | obtain ⟨N, hN⟩ := G.exists_exhaustion_superset (hK.image_of_continuousOn hcont) |
| 51 | let e (i : ℕ) := |
| 52 | (G.embedding i).spatialHomeomorph (G.exhaustion_open i) hzero |
| 53 | let d (i : ℕ) : PartialDiffeomorph (𝓡 n) (𝓡 n) G.limitCarrier.carrier |
| 54 | (S.carrier (G.subsequence i)).carrier ∞ := { |
| 55 | toPartialEquiv := (e i).toPartialEquiv |
| 56 | open_source := (e i).open_source |
| 57 | open_target := (e i).open_target |
| 58 | contMDiffOn_toFun := fun x hx => |
| 59 | ((G.embedding i).spatialMap_contMDiffAt (G.exhaustion_open i) hzero hx).contMDiffWithinAt |
| 60 | contMDiffOn_invFun := by |
| 61 | rintro _ ⟨x, hx, rfl⟩ |
| 62 | exact ((G.embedding i).spatialInverse_contMDiffAt |
| 63 | (G.exhaustion_open i) hzero hx).contMDiffWithinAt } |
| 64 | let c : PartialDiffeomorph (𝓡 n) (𝓡 n) G.limitCarrier.carrier |
| 65 | (EuclideanSpace ℝ (Fin n)) ∞ := { |
| 66 | toPartialEquiv := (chartAt (EuclideanSpace ℝ (Fin n)) q).toPartialEquiv |
| 67 | open_source := (chartAt (EuclideanSpace ℝ (Fin n)) q).open_source |
| 68 | open_target := (chartAt (EuclideanSpace ℝ (Fin n)) q).open_target |
| 69 | contMDiffOn_toFun := contMDiffOn_chart |
| 70 | contMDiffOn_invFun := contMDiffOn_chart_symm } |
| 71 | have hcmap : (c.symm : EuclideanSpace ℝ (Fin n) → G.limitCarrier.carrier) = |
| 72 | (extChartAt (𝓡 n) q).symm := by |
| 73 | rw [extChartAt_coe_symm] |
| 74 | rfl |
| 75 | have hctarget : c.target = (extChartAt (𝓡 n) q).target := by |
| 76 | simp only [extChartAt_target, modelWithCornersSelf_coe, |
| 77 | modelWithCornersSelf_coe_symm, preimage_id, range_id, inter_univ] |
| 78 | rfl |
| 79 | let Φ (i : ℕ) := c.symm.trans (d i) |
| 80 | have hΦmap (i : ℕ) : |
| 81 | (Φ i : EuclideanSpace ℝ (Fin n) → (S.carrier (G.subsequence i)).carrier) = |
| 82 | (fun y => ((G.embedding i).toFun (0, y)).2) ∘ (extChartAt (𝓡 n) q).symm := by |
| 83 | change (fun y => ((G.embedding i).toFun (0, y)).2) ∘ |
| 84 | (c.symm : EuclideanSpace ℝ (Fin n) → G.limitCarrier.carrier) = _ |
| 85 | rw [hcmap] |
| 86 | have hΦsource (i : ℕ) : (Φ i).source = |
| 87 | (extChartAt (𝓡 n) q).target ∩ (extChartAt (𝓡 n) q).symm ⁻¹' G.exhaustion i := by |
| 88 | change c.target ∩ (c.symm : EuclideanSpace ℝ (Fin n) → G.limitCarrier.carrier) ⁻¹' |
| 89 | G.exhaustion i = _ |
| 90 | rw [hctarget, hcmap] |
| 91 | have hU (k : ℕ) : (U : Set (EuclideanSpace ℝ (Fin n))) ⊆ (Φ (max N k)).source := by |
| 92 | rw [hΦsource] |
| 93 | intro x hx |
| 94 | exact ⟨hKchart (hUK hx), G.exhaustion_monotone (le_max_left N k) |
| 95 | (hN (mem_image_of_mem _ (hUK hx)))⟩ |
| 96 | let Fchart (k : ℕ) := |
| 97 | (F (G.subsequence (max N k))).pullbackToPartialChart (Φ (max N k)) U (hU k) |
| 98 | refine ⟨N, Fchart, ?_⟩ |
| 99 | intro k t x v w |
| 100 | change (((F (G.subsequence (max N k))).pullbackToPartialChart |
| 101 | (Φ (max N k)) U (hU k)).metric t).inner x v w = _ |
| 102 | rw [RicciFlow.pullbackToPartialChart_inner, hΦmap] |
| 103 | |
| 104 | end PoincareMT.M30 |