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.StandardCap.Existence.Construction.Metric.TerminalMetric |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Analysis.Basic.InitialModulusContinuity |
| 3 | |
| 4 | /-! |
| 5 | # Continuous spatial jets after reversing time at the terminal slice |
| 6 | |
| 7 | Time reflection turns the terminal limit into an included initial |
| 8 | boundary. The compact terminal moduli prove joint continuity of every |
| 9 | actual spatial jet there. Only the coefficients are reflected; the |
| 10 | result is not asserted to be a forward Ricci flow. This is the endpoint |
| 11 | regularity step for Morgan-Tian Theorem 12.5, pp. 296-297. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | -- Spatial jets take values in iterated multilinear maps of bilinear forms. |
| 17 | set_option maxSynthPendingDepth 8 |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Manifold ContDiff Topology |
| 21 | |
| 22 | namespace PoincareMT.M34 |
| 23 | |
| 24 | /-- The actual Euclidean coefficients of a partial flow are jointly |
| 25 | smooth through its included initial time (Theorem 12.5, pp. 296-297). -/ |
| 26 | theorem partialFlow_contDiffOn_coefficients {g0 : StandardInitialMetric} |
| 27 | (F : PartialStandardCapFlow g0) : |
| 28 | ContDiffOn ℝ ∞ (fun p : ℝ × StandardCapSpace => |
| 29 | (F.flow.metric p.1).euclideanCoefficients p.2) (Ico 0 F.lifetime ×ˢ univ) := by |
| 30 | simpa only [RiemannianMetric.pullbackCoefficients_id] using |
| 31 | F.flow.smooth.contDiffOn_spacetime_pullbackCoefficients |
| 32 | isOpen_univ (contMDiffOn_id (I := 𝓡 3)) |
| 33 | |
| 34 | namespace PartialFlowTerminalJets |
| 35 | |
| 36 | open SpacetimeBounds |
| 37 | |
| 38 | variable {g0 : StandardInitialMetric} {F : PartialStandardCapFlow g0} {S : ℝ} |
| 39 | (L : PartialFlowTerminalJets F S) |
| 40 | |
| 41 | /-- Reverse the old coefficients at the terminal time, with the actual |
| 42 | terminal field at nonpositive reflected times (Theorem 12.5, pp. 296-297). -/ |
| 43 | noncomputable def reverseCoefficients (p : ℝ × StandardCapSpace) : MetricCoefficient 3 := |
| 44 | if 0 < p.1 then (F.flow.metric (S - p.1)).euclideanCoefficients p.2 |
| 45 | else L.coefficients p.2 |
| 46 | |
| 47 | /-- Positive reflected times are the old metric coefficients at the |
| 48 | corresponding earlier times (Theorem 12.5, pp. 296-297). -/ |
| 49 | theorem reverseCoefficients_of_pos {t : ℝ} (ht : 0 < t) (x : StandardCapSpace) : |
| 50 | L.reverseCoefficients (t, x) = (F.flow.metric (S - t)).euclideanCoefficients x := by |
| 51 | simp only [reverseCoefficients, ht, if_true] |
| 52 | |
| 53 | /-- The reflected time-zero slice is exactly the terminal field |
| 54 | (Theorem 12.5, pp. 296-297). -/ |
| 55 | theorem reverseCoefficients_zero (x : StandardCapSpace) : |
| 56 | L.reverseCoefficients (0, x) = L.coefficients x := by |
| 57 | simp only [reverseCoefficients, lt_self_iff_false, if_false] |
| 58 | |
| 59 | /-- Actual spatial derivatives of the reflected coefficient family |
| 60 | (Theorem 12.5, pp. 296-297). -/ |
| 61 | noncomputable def reverseSpatialJet (m : ℕ) (p : ℝ × StandardCapSpace) : |
| 62 | StandardCapSpace [×m]→L[ℝ] MetricCoefficient 3 := |
| 63 | iteratedFDeriv ℝ m (fun x => L.reverseCoefficients (p.1, x)) p.2 |
| 64 | |
| 65 | /-- At positive reflected times the spatial derivatives are exactly the |
| 66 | old spatial jets (Theorem 12.5, pp. 296-297). -/ |
| 67 | theorem reverseSpatialJet_of_pos (m : ℕ) {t : ℝ} (ht : 0 < t) (x : StandardCapSpace) : |
| 68 | L.reverseSpatialJet m (t, x) = |
| 69 | iteratedFDeriv ℝ m (F.flow.metric (S - t)).euclideanCoefficients x := by |
| 70 | simp only [reverseSpatialJet, L.reverseCoefficients_of_pos ht] |
| 71 | |
| 72 | /-- At reflected time zero the jets are the actual terminal spatial |
| 73 | derivatives (Theorem 12.5, pp. 296-297). -/ |
| 74 | theorem reverseSpatialJet_zero (m : ℕ) (x : StandardCapSpace) : |
| 75 | L.reverseSpatialJet m (0, x) = iteratedFDeriv ℝ m L.coefficients x := by |
| 76 | simp only [reverseSpatialJet, L.reverseCoefficients_zero] |
| 77 | |
| 78 | /-- Time reflection preserves interior joint smoothness of the old |
| 79 | coefficient family (Theorem 12.5, pp. 296-297). -/ |
| 80 | theorem contDiffOn_reverseCoefficients_interior (hSF : S ≤ F.lifetime) : |
| 81 | ContDiffOn ℝ ∞ L.reverseCoefficients (Ioo 0 S ×ˢ univ) := by |
| 82 | have hpath : ContDiff ℝ ∞ (fun p : ℝ × StandardCapSpace => (S - p.1, p.2)) := by |
| 83 | fun_prop |
| 84 | have hmaps : MapsTo (fun p : ℝ × StandardCapSpace => (S - p.1, p.2)) |
| 85 | (Ioo 0 S ×ˢ univ) (Ico 0 F.lifetime ×ˢ univ) := by |
| 86 | intro p hp |
| 87 | exact ⟨⟨sub_nonneg.mpr hp.1.2.le, (sub_lt_self S hp.1.1).trans_le hSF⟩, mem_univ _⟩ |
| 88 | apply ((partialFlow_contDiffOn_coefficients F).comp hpath.contDiffOn hmaps).congr |
| 89 | intro p hp |
| 90 | exact L.reverseCoefficients_of_pos hp.1.1 p.2 |
| 91 | |
| 92 | /-- Every reflected spatial jet is jointly smooth at interior reflected |
| 93 | times (Theorem 12.5, pp. 296-297). -/ |
| 94 | theorem contDiffOn_reverseSpatialJet_interior (hSF : S ≤ F.lifetime) (m : ℕ) : |
| 95 | ContDiffOn ℝ ∞ (L.reverseSpatialJet m) (Ioo 0 S ×ˢ univ) := |
| 96 | (L.contDiffOn_reverseCoefficients_interior hSF).iteratedFDeriv_snd_of_isOpen isOpen_univ m |
| 97 | |
| 98 | /-- All actual reflected spatial jets are jointly continuous through |
| 99 | the included terminal slice (Theorem 12.5, pp. 296-297). -/ |
| 100 | theorem continuousOn_reverseSpatialJet (P : RicciFlowCurvatureTheory.{0}) |
| 101 | (E0 : StandardCapEstimate g0) {B : ℝ} (hS : 0 < S) |
| 102 | (hSF : S ≤ F.lifetime) (hB : 0 < B) |
| 103 | (hfull : ∀ t ∈ Ico 0 S, ∀ x : StandardCapSpace, |
| 104 | (F.flow.connection t).curvatureTensorNorm x ≤ B) (m : ℕ) : |
| 105 | ContinuousOn (L.reverseSpatialJet m) (Ico 0 S ×ˢ univ) := by |
| 106 | rintro ⟨t, x⟩ ⟨ht, _hx⟩ |
| 107 | by_cases htzero : t = 0 |
| 108 | · subst t |
| 109 | obtain ⟨D, _hD, hmod⟩ := L.exists_compact_terminal_modulus P E0 hS hSF hB hfull |
| 110 | (isCompact_closedBall x 1) m |
| 111 | have hcont := (L.contDiff_coefficients P E0 hS hSF hB hfull).continuous_iteratedFDeriv |
| 112 | (m := m) (by exact_mod_cast le_top) |
| 113 | apply continuousWithinAt_zero_of_initial_norm_bound |
| 114 | (K := Metric.closedBall x 1) (C := D) (Metric.closedBall_mem_nhds x zero_lt_one) |
| 115 | hcont.continuousAt (L.reverseSpatialJet_zero m x) |
| 116 | intro r hr y hy |
| 117 | by_cases hrzero : r = 0 |
| 118 | · simp only [hrzero, L.reverseSpatialJet_zero, sub_self, norm_zero, mul_zero, le_refl] |
| 119 | · have hrpos : 0 < r := lt_of_le_of_ne hr.1 (Ne.symm hrzero) |
| 120 | rw [L.reverseSpatialJet_of_pos m hrpos, |
| 121 | ← L.jet_eq_iteratedFDeriv P E0 hS hSF hB hfull m y] |
| 122 | have h := hmod (S - r) ⟨sub_nonneg.mpr hr.2.le, sub_lt_self S hrpos⟩ y hy |
| 123 | simpa only [sub_sub_cancel] using h |
| 124 | · have htpos : t ∈ Ioo 0 S := ⟨lt_of_le_of_ne ht.1 (Ne.symm htzero), ht.2⟩ |
| 125 | exact ((L.contDiffOn_reverseSpatialJet_interior hSF m).contDiffAt |
| 126 | ((isOpen_Ioo.prod isOpen_univ).mem_nhds ⟨htpos, mem_univ x⟩)).continuousAt.continuousWithinAt |
| 127 | |
| 128 | end PartialFlowTerminalJets |
| 129 | end PoincareMT.M34 |