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.TerminalSourceCountableJetBounds |
| 2 | import Mathlib.Analysis.Calculus.MeanValue |
| 3 | |
| 4 | /-! |
| 5 | # Included ellipticity and time control for the actual countable sources |
| 6 | |
| 7 | The original G4 guards supply curvature and all mixed derivatives. |
| 8 | Closed source continuity and the right-open time derivative estimate |
| 9 | control the difference from the same actual terminal coefficients. |
| 10 | MT Proposition 5.14; terminal-source-countable-germs.md, B. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | set_option maxSynthPendingDepth 12 |
| 16 | |
| 17 | open Set Filter TopologicalSpace |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M47 |
| 23 | |
| 24 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 25 | local notation "V" => E →L[ℝ] E →L[ℝ] ℝ |
| 26 | |
| 27 | private theorem time_difference_bound {tau D : ℝ} (htau : 0 < tau) |
| 28 | {U : Set E} (hU : IsOpen U) (f : ℝ × E → V) |
| 29 | (hf : ContDiffOn ℝ ∞ f (Icc (-tau) 0 ×ˢ U)) |
| 30 | (hbound : ∀ t ∈ Ioo (-(tau / 2)) 0, ∀ x ∈ U, |
| 31 | ‖iteratedFDeriv ℝ 1 f (t, x)‖ ≤ D) : |
| 32 | ∀ t ∈ Ioo (-(tau / 2)) 0, ∀ x ∈ U, |
| 33 | ‖f (t, x) - f (0, x)‖ ≤ D * |t| := by |
| 34 | intro t ht x hx |
| 35 | have hopen : ContDiffOn ℝ ∞ f (Ioo (-tau) 0 ×ˢ U) := |
| 36 | hf.mono (prod_mono Ioo_subset_Icc_self (Subset.refl _)) |
| 37 | have hcontinuous : ContinuousOn (fun s : ℝ => f (s, x)) (Icc t 0) := |
| 38 | hf.continuousOn.comp (continuous_id.prodMk continuous_const).continuousOn |
| 39 | (fun s hs => ⟨⟨by linarith [ht.1, hs.1], hs.2⟩, hx⟩) |
| 40 | have hderiv (s : ℝ) (hs : s ∈ Ico t 0) : |
| 41 | HasDerivWithinAt (fun u : ℝ => f (u, x)) |
| 42 | (fderiv ℝ f (s, x) (1, 0)) (Ici s) s := by |
| 43 | have hp : (s, x) ∈ Ioo (-tau) 0 ×ˢ U := |
| 44 | ⟨⟨by linarith [ht.1, hs.1], hs.2⟩, hx⟩ |
| 45 | have hd := (hopen.contDiffAt ((isOpen_Ioo.prod hU).mem_nhds hp)).differentiableAt |
| 46 | (by simp) |
| 47 | exact (hd.hasFDerivAt.comp_hasDerivAt s |
| 48 | ((hasDerivAt_id s).prodMk (hasDerivAt_const s x))).hasDerivWithinAt |
| 49 | have hnorm (s : ℝ) (hs : s ∈ Ico t 0) : |
| 50 | ‖fderiv ℝ f (s, x) (1, 0)‖ ≤ D := by |
| 51 | have hb : ‖fderiv ℝ f (s, x)‖ ≤ D := by |
| 52 | simpa only [norm_iteratedFDeriv_one] using |
| 53 | hbound s ⟨ht.1.trans_le hs.1, hs.2⟩ x hx |
| 54 | have hn : ‖((1 : ℝ), (0 : E))‖ = 1 := by simp |
| 55 | exact ((fderiv ℝ f (s, x)).le_opNorm (1, 0)).trans |
| 56 | (by simpa only [hn, mul_one] using hb) |
| 57 | have h := norm_image_sub_le_of_norm_deriv_right_le_segment |
| 58 | hcontinuous hderiv hnorm 0 ⟨ht.2.le, le_rfl⟩ |
| 59 | calc |
| 60 | _ = ‖f (0, x) - f (t, x)‖ := norm_sub_rev _ _ |
| 61 | _ ≤ D * (0 - t) := h |
| 62 | _ = D * |t| := by rw [zero_sub, abs_of_neg ht.2] |
| 63 | |
| 64 | /-- Original first-failure/G2 guards give included ellipticity and a |
| 65 | single spatially uniform error bound all the way to the terminal value. -/ |
| 66 | theorem terminalSourceCountable_g4_closed_bounds (j : ℕ) |
| 67 | (S : RepairedControlledSchedulesData.{u}) |
| 68 | (B : M47ComponentAnalyticBounds.{u} S.setup.C) |
| 69 | (p : SurgeryParameterPrefix S.constants) (P : M46Predecessors.{u}) |
| 70 | {tau R L eta rho : ℝ} (htau : 0 < tau) (hrho : 0 < rho) |
| 71 | (hrhoR : 2 * rho < R) |
| 72 | (hsmall : ∀ s : ℝ, |s| ≤ 2 * rho → |
| 73 | ((13 * max (4 * L / 3) 1) * s ^ 2) * |
| 74 | Real.exp (max 1 ((13 * max (4 * L / 3) 1) * s ^ 2)) ≤ 3) |
| 75 | (F0 : {k : ℕ // j ≤ k} → SurgeryFlowData.{u}) |
| 76 | (O : ∀ a, SurgeryObservation (F0 a)) |
| 77 | (W : ∀ a, M33RegularHistoryWindow (F0 a)) |
| 78 | (H : ∀ a, M33RegularHistoryData (W a)) |
| 79 | (C0 : {k : ℕ // j ≤ k} → GeneralizedSliceCarrier.{u}) |
| 80 | (base Q rNext : {k : ℕ // j ≤ k} → ℝ) |
| 81 | (U : ∀ a, Opens (C0 a).carrier) |
| 82 | (e : ∀ a, GeneralizedFlowCylinder (H a).generalized (C0 a) |
| 83 | (base a) (Q a) (Icc (-tau) 0) (U a : Set (C0 a).carrier)) |
| 84 | (F : ∀ a, RicciFlow 3 (U a) (Icc (-tau) 0)) |
| 85 | (C : ∀ a, TerminalSourceChart ((F a).metric 0) R) |
| 86 | (hGood : ∀ᶠ a in Filter.comap |
| 87 | (Subtype.val : {k : ℕ // j ≤ k} → ℕ) atTop, |
| 88 | TerminalSourceJetsG4Good S B p (O a) (H a) (U a) (e a) (F a) |
| 89 | (τ := tau) (base := base a) (Q := Q a) (rNext := rNext a) |
| 90 | (R := R) (L := L) (eta := eta) (C a)) |
| 91 | (f0 : ℕ → E → V) |
| 92 | (hread : ∀ a, EqOn (f0 a.val) |
| 93 | (((F a).metric 0).pullbackCoefficients (C a).chart) |
| 94 | (Metric.ball 0 (rho / 2))) : |
| 95 | let f := terminalSourceCountableNegative j (fun a => (U a : Type u)) F C f0 |
| 96 | (∀ᶠ k in atTop, ∀ t ∈ Icc (-tau) 0, ∀ x ∈ Metric.ball (0 : E) (rho / 2), ∀ v, |
| 97 | terminalSourceLower (13 * max (4 * L / 3) 1) tau * ‖v‖ ^ 2 ≤ f k (t, x) v v) ∧ |
| 98 | ∃ D : ℝ, 0 ≤ D ∧ ∀ᶠ k in atTop, |
| 99 | ∀ t ∈ Ioo (-(tau / 2)) 0, ∀ x ∈ Metric.ball (0 : E) (rho / 2), |
| 100 | ‖f k (t, x) - f0 k x‖ ≤ D * |t| := by |
| 101 | let f := terminalSourceCountableNegative j (fun a => (U a : Type u)) F C f0 |
| 102 | let l := Filter.comap (Subtype.val : {k : ℕ // j ≤ k} → ℕ) atTop |
| 103 | have hraw := Filter.eventually_comap.mp (terminalSourceJetsG4_eventually_raw |
| 104 | l S B p P htau F0 O W H C0 base Q rNext U e F C hGood) |
| 105 | have hcurv : 0 < 13 * max (4 * L / 3) 1 := |
| 106 | mul_pos (by norm_num) (lt_of_lt_of_le zero_lt_one (le_max_right _ _)) |
| 107 | have hball : Metric.ball (0 : E) (rho / 2) ⊆ Metric.closedBall 0 rho := |
| 108 | (Metric.ball_subset_ball (by linarith)).trans Metric.ball_subset_closedBall |
| 109 | constructor |
| 110 | · filter_upwards [hraw, eventually_ge_atTop j] with k hk hjk t ht x hx v |
| 111 | rw [terminalSourceCountableNegative_good j (fun a => (U a : Type u)) F C f0 hjk] |
| 112 | exact ((C ⟨k, hjk⟩).closed_bounds htau hcurv.le (F ⟨k, hjk⟩) |
| 113 | hrhoR hsmall (hk ⟨k, hjk⟩ rfl) ht |
| 114 | (Metric.closedBall_subset_closedBall (by linarith) (hball hx)) v).1 |
| 115 | · obtain ⟨D, hD, hbound⟩ := (terminalSourceCountable_g4_jet_bounds j S B p P |
| 116 | htau hrho hrhoR hsmall F0 O W H C0 base Q rNext U e F C hGood f0 hread).2 1 |
| 117 | refine ⟨D, hD, ?_⟩ |
| 118 | filter_upwards [hbound, eventually_ge_atTop j] with k hk hjk |
| 119 | have hsmooth : ContDiffOn ℝ ∞ (f k) |
| 120 | (Icc (-tau) 0 ×ˢ Metric.ball (0 : E) (rho / 2)) := by |
| 121 | dsimp only [f] |
| 122 | rw [terminalSourceCountableNegative_good j (fun a => (U a : Type u)) F C f0 hjk] |
| 123 | exact (M44.contDiffOn_pullbackCoefficients_within (F ⟨k, hjk⟩) |
| 124 | Metric.isOpen_ball (C ⟨k, hjk⟩).smooth).mono |
| 125 | (prod_mono (Subset.refl _) (Metric.ball_subset_ball (by linarith))) |
| 126 | have hz : ∀ x ∈ Metric.ball (0 : E) (rho / 2), f k (0, x) = f0 k x := by |
| 127 | intro x hx |
| 128 | dsimp only [f] |
| 129 | rw [terminalSourceCountableNegative_good j (fun a => (U a : Type u)) F C f0 hjk] |
| 130 | exact (hread ⟨k, hjk⟩ hx).symm |
| 131 | intro t ht x hx |
| 132 | rw [← hz x hx] |
| 133 | exact time_difference_bound htau Metric.isOpen_ball (f k) hsmooth |
| 134 | (fun s hs y hy => hk s hs y (hball hy)) t ht x hx |
| 135 | |
| 136 | end PoincareMT.M47 |