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.Surgery.CanonicalInduction.Terminal.Source.TerminalSourceCountableNegative |
| 2 | |
| 3 | /-! |
| 4 | # Genuine source flows at every countable index |
| 5 | |
| 6 | The selected source at max(k,j) supplies every early flow index. On |
| 7 | the good tail its full coefficients are exactly the original ones. |
| 8 | Only time restriction is used; the metric and connection are retained. |
| 9 | MT Proposition 5.14; terminal-source-countable-germs.md, A. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M47 |
| 21 | |
| 22 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 23 | local notation "V" => E →L[ℝ] E →L[ℝ] ℝ |
| 24 | |
| 25 | /-- Every index selects one genuine source from the original good-index family. -/ |
| 26 | def terminalSourceCountableSourceIndex (j k : ℕ) : {m : ℕ // j ≤ m} := |
| 27 | ⟨max k j, le_max_right k j⟩ |
| 28 | |
| 29 | /-- Available indices retain the literal original source index. -/ |
| 30 | theorem terminalSourceCountableSourceIndex_good {j k : ℕ} (hjk : j ≤ k) : |
| 31 | terminalSourceCountableSourceIndex j k = ⟨k, hjk⟩ := by |
| 32 | apply Subtype.ext |
| 33 | exact max_eq_left hjk |
| 34 | |
| 35 | variable (j : ℕ) (M : {k : ℕ // j ≤ k} → Type u) |
| 36 | [∀ a, TopologicalSpace (M a)] [∀ a, ChartedSpace E (M a)] |
| 37 | [∀ a, IsManifold (𝓡 3) ∞ (M a)] |
| 38 | {tau R : ℝ} (htau : 0 < tau) |
| 39 | (F : ∀ a, RicciFlow 3 (M a) (Icc (-tau) 0)) |
| 40 | |
| 41 | /-- The actual selected source flow restricted to its buffered included interval. -/ |
| 42 | noncomputable def terminalSourceCountableSourceFlow (k : ℕ) : |
| 43 | RicciFlow 3 (M (terminalSourceCountableSourceIndex j k)) (Icc (-(tau / 4)) 0) where |
| 44 | metric := (F (terminalSourceCountableSourceIndex j k)).metric |
| 45 | connection := (F (terminalSourceCountableSourceIndex j k)).connection |
| 46 | interval := ordConnected_Icc |
| 47 | nontrivial := ⟨-(tau / 4), ⟨le_rfl, by linarith⟩, 0, |
| 48 | ⟨by linarith, le_rfl⟩, by linarith⟩ |
| 49 | smooth := (F (terminalSourceCountableSourceIndex j k)).smooth.mono |
| 50 | (prod_mono (fun _ hs => ⟨by linarith [hs.1], hs.2⟩) (Subset.refl _)) |
| 51 | equation := fun t ht x v w => |
| 52 | ((F (terminalSourceCountableSourceIndex j k)).equation t |
| 53 | ⟨by linarith [ht.1], ht.2⟩ x v w).mono |
| 54 | (fun _ hs => ⟨by linarith [hs.1], hs.2⟩) |
| 55 | |
| 56 | /-- The restriction retains the full actual metric representative. -/ |
| 57 | theorem terminalSourceCountableSourceFlow_metric (k : ℕ) : |
| 58 | (terminalSourceCountableSourceFlow j M htau F k).metric = |
| 59 | (F (terminalSourceCountableSourceIndex j k)).metric := rfl |
| 60 | |
| 61 | variable (C : ∀ a, TerminalSourceChart ((F a).metric 0) R) |
| 62 | |
| 63 | /-- On a good index the patched flow has the full original coefficient function. -/ |
| 64 | theorem terminalSourceCountableSourceFlow_coefficients_good |
| 65 | (f0 : ℕ → E → V) {k : ℕ} (hjk : j ≤ k) : |
| 66 | (fun z : ℝ × E => |
| 67 | ((terminalSourceCountableSourceFlow j M htau F k).metric z.1).pullbackCoefficients |
| 68 | (C (terminalSourceCountableSourceIndex j k)).chart z.2) = |
| 69 | terminalSourceCountableNegative j M F C f0 k := by |
| 70 | rw [terminalSourceCountableNegative_good j M F C f0 hjk] |
| 71 | change (fun z : ℝ × E => |
| 72 | ((F (terminalSourceCountableSourceIndex j k)).metric z.1).pullbackCoefficients |
| 73 | (C (terminalSourceCountableSourceIndex j k)).chart z.2) = _ |
| 74 | rw [terminalSourceCountableSourceIndex_good hjk] |
| 75 | |
| 76 | /-- Every further strict subsequence retains these same full coefficient functions. -/ |
| 77 | theorem terminalSourceCountableSourceFlow_eventually_coefficients |
| 78 | (f0 : ℕ → E → V) {sigma : ℕ → ℕ} (hsigma : StrictMono sigma) : |
| 79 | ∀ᶠ k in atTop, |
| 80 | (fun z : ℝ × E => |
| 81 | ((terminalSourceCountableSourceFlow j M htau F (sigma k)).metric z.1).pullbackCoefficients |
| 82 | (C (terminalSourceCountableSourceIndex j (sigma k))).chart z.2) = |
| 83 | terminalSourceCountableNegative j M F C f0 (sigma k) := by |
| 84 | filter_upwards [hsigma.tendsto_atTop.eventually (eventually_ge_atTop j)] with k hk |
| 85 | exact terminalSourceCountableSourceFlow_coefficients_good j M htau F C f0 hk |
| 86 | |
| 87 | end PoincareMT.M47 |