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.Basic.TerminalReversal |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Geometry.Flow.InitialEvolutionBootstrap |
| 3 | |
| 4 | /-! |
| 5 | # Smoothness and the evolution equation at the terminal boundary |
| 6 | |
| 7 | The reflected family satisfies the negative Ricci coefficient operator. |
| 8 | Its continuous actual spatial jets and positive terminal metric allow |
| 9 | the initial-boundary bootstrap to prove all joint regularity and the |
| 10 | within-time equation at the included terminal slice. This is the |
| 11 | endpoint 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 | -- The operator domain is a dependent finite product of spatial jet spaces. |
| 17 | set_option maxSynthPendingDepth 8 |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Manifold ContDiff Topology |
| 21 | |
| 22 | namespace PoincareMT.M34 |
| 23 | |
| 24 | open SpacetimeBounds SpacetimeBounds.Bootstrap |
| 25 | |
| 26 | set_option synthInstance.maxHeartbeats 100000 in |
| 27 | -- The genuine coefficient equation is expressed on the dependent two-jet. |
| 28 | /-- At interior times the actual coefficient derivative is the finite-jet |
| 29 | Ricci operator (Theorem 12.5, pp. 296-297). -/ |
| 30 | theorem partialFlow_hasDerivAt_coefficients {g0 : StandardInitialMetric} |
| 31 | (F : PartialStandardCapFlow g0) {t : ℝ} (ht : t ∈ Ioo 0 F.lifetime) |
| 32 | (x : StandardCapSpace) : |
| 33 | HasDerivAt (fun s => (F.flow.metric s).euclideanCoefficients x) |
| 34 | (jetRicciFlowOperator 3 (spatialJet 2 |
| 35 | (fun p : ℝ × StandardCapSpace => (F.flow.metric p.1).euclideanCoefficients p.2) |
| 36 | (t, x))) t := by |
| 37 | have hne : (Ioo 0 F.lifetime).Nontrivial := by |
| 38 | refine ⟨F.lifetime / 3, ⟨?_, ?_⟩, 2 * F.lifetime / 3, ⟨?_, ?_⟩, ?_⟩ <;> |
| 39 | linarith [F.lifetime_pos] |
| 40 | let H := Poincare.Geometry.RicciFlow.Harnack.restrictFlow F.flow |
| 41 | Ioo_subset_Ico_self ordConnected_Ioo hne |
| 42 | have hinv (y : StandardCapSpace) (_hy : y ∈ (univ : Set StandardCapSpace)) : |
| 43 | (mfderiv (𝓡 3) (𝓡 3) id y).IsInvertible := by |
| 44 | rw [mfderiv_id] |
| 45 | exact ⟨ContinuousLinearEquiv.refl ℝ _, rfl⟩ |
| 46 | have heq := deriv_pullbackCoefficients_eq_ricciFlowOperator H isOpen_Ioo isOpen_univ |
| 47 | contMDiffOn_id hinv ht (mem_univ x) |
| 48 | simp only [RiemannianMetric.pullbackCoefficients_id] at heq |
| 49 | have hreg := (partialFlow_contDiffOn_coefficients F).mono |
| 50 | (prod_mono Ioo_subset_Ico_self (Subset.refl univ)) |
| 51 | have hpoint := hreg.contDiffAt (x := (t, x)) |
| 52 | ((isOpen_Ioo.prod isOpen_univ).mem_nhds ⟨ht, mem_univ x⟩) |
| 53 | have hd := (hpoint.comp t (contDiffAt_id.prodMk contDiffAt_const)).differentiableAt |
| 54 | (by simp) |
| 55 | have hder := hd.hasDerivAt |
| 56 | rw [jetRicciFlowOperator, Function.comp_apply, twoJetProjection_spatialJet] |
| 57 | convert! hder using 1 |
| 58 | exact heq.symm |
| 59 | |
| 60 | namespace PartialFlowTerminalJets |
| 61 | |
| 62 | variable {g0 : StandardInitialMetric} {F : PartialStandardCapFlow g0} {S : ℝ} |
| 63 | (L : PartialFlowTerminalJets F S) |
| 64 | |
| 65 | set_option synthInstance.maxHeartbeats 100000 in |
| 66 | -- Equality of finite jets is pointwise in the dependent order index. |
| 67 | /-- Positive reflected finite jets are the old jets with time reversed |
| 68 | (Theorem 12.5, pp. 296-297). -/ |
| 69 | theorem reverseFiniteSpatialJet_of_pos (m : ℕ) {t : ℝ} (ht : 0 < t) |
| 70 | (x : StandardCapSpace) : |
| 71 | spatialJet m L.reverseCoefficients (t, x) = spatialJet m |
| 72 | (fun p : ℝ × StandardCapSpace => (F.flow.metric p.1).euclideanCoefficients p.2) |
| 73 | (S - t, x) := by |
| 74 | funext j |
| 75 | exact L.reverseSpatialJet_of_pos j ht x |
| 76 | |
| 77 | set_option synthInstance.maxHeartbeats 100000 in |
| 78 | -- The domain tests precisely the invertibility of the zeroth coefficient. |
| 79 | /-- Every reflected two-jet lies in the actual Ricci operator domain, |
| 80 | including the terminal slice (Theorem 12.5, pp. 296-297). -/ |
| 81 | theorem reverseSpatialJet_mem_domain (P : RicciFlowCurvatureTheory.{0}) |
| 82 | (E0 : StandardCapEstimate g0) {B : ℝ} (hS : 0 < S) |
| 83 | (hSF : S ≤ F.lifetime) (hB : 0 < B) |
| 84 | (hfull : ∀ t ∈ Ico 0 S, ∀ x : StandardCapSpace, |
| 85 | (F.flow.connection t).curvatureTensorNorm x ≤ B) |
| 86 | (t : ℝ) (x : StandardCapSpace) : |
| 87 | spatialJet 2 L.reverseCoefficients (t, x) ∈ jetRicciFlowDomain 3 := by |
| 88 | change ((twoJetProjection 3 (spatialJet 2 L.reverseCoefficients (t, x))).1).IsInvertible |
| 89 | rw [twoJetProjection_spatialJet] |
| 90 | change (L.reverseCoefficients (t, x)).IsInvertible |
| 91 | by_cases ht : 0 < t |
| 92 | · rw [L.reverseCoefficients_of_pos ht] |
| 93 | convert! (F.flow.metric (S - t)).inner_isInvertible x |
| 94 | · simp only [reverseCoefficients, ht, if_false] |
| 95 | convert! (L.metric P E0 hS hSF hB hfull).inner_isInvertible x |
| 96 | |
| 97 | set_option synthInstance.maxHeartbeats 100000 in |
| 98 | -- Reflection changes the time derivative sign and preserves spatial jets. |
| 99 | /-- The reflected family solves the negative of the genuine Ricci |
| 100 | coefficient equation in its interior (Theorem 12.5, pp. 296-297). -/ |
| 101 | theorem deriv_reverseCoefficients_eq_neg_operator (hSF : S ≤ F.lifetime) |
| 102 | {t : ℝ} (ht : t ∈ Ioo 0 S) (x : StandardCapSpace) : |
| 103 | deriv (fun r => L.reverseCoefficients (r, x)) t = |
| 104 | -jetRicciFlowOperator 3 (spatialJet 2 L.reverseCoefficients (t, x)) := by |
| 105 | have htime : S - t ∈ Ioo 0 F.lifetime := |
| 106 | ⟨sub_pos.mpr ht.2, (sub_lt_self S ht.1).trans_le hSF⟩ |
| 107 | have hd := partialFlow_hasDerivAt_coefficients F htime x |
| 108 | have hr : HasDerivAt (fun r : ℝ => S - r) (-1) t := by |
| 109 | convert! (hasDerivAt_id t).const_sub S using 1 |
| 110 | have hcomp := hd.scomp t hr |
| 111 | have heq : (fun r => L.reverseCoefficients (r, x)) =ᶠ[𝓝 t] |
| 112 | (fun r => (F.flow.metric (S - r)).euclideanCoefficients x) := by |
| 113 | filter_upwards [isOpen_Ioi.mem_nhds ht.1] with r hr |
| 114 | exact L.reverseCoefficients_of_pos hr x |
| 115 | rw [heq.deriv_eq, L.reverseFiniteSpatialJet_of_pos 2 ht.1] |
| 116 | have h := hcomp.deriv |
| 117 | simp only [neg_smul, one_smul] at h |
| 118 | convert! h using 1 |
| 119 | |
| 120 | variable (P : RicciFlowCurvatureTheory.{0}) (E0 : StandardCapEstimate g0) |
| 121 | {B : ℝ} (hS : 0 < S) (hSF : S ≤ F.lifetime) (hB : 0 < B) |
| 122 | (hfull : ∀ t ∈ Ico 0 S, ∀ x : StandardCapSpace, |
| 123 | (F.flow.connection t).curvatureTensorNorm x ≤ B) |
| 124 | |
| 125 | include P E0 hS hSF hB hfull |
| 126 | |
| 127 | set_option synthInstance.maxHeartbeats 100000 in |
| 128 | -- The bootstrap handles all dependent spatial orders simultaneously. |
| 129 | /-- Every reflected spatial jet is jointly smooth through the included |
| 130 | terminal boundary (Theorem 12.5, pp. 296-297). -/ |
| 131 | theorem contDiffOn_reverseSpatialJet (m : ℕ) : |
| 132 | ContDiffOn ℝ ∞ (L.reverseSpatialJet m) (Ico 0 S ×ˢ univ) := |
| 133 | contDiffOn_spatialJets_of_initial_evolution |
| 134 | (isOpen_jetRicciFlowDomain 3) (contDiffOn_jetRicciFlowOperator 3).neg |
| 135 | (L.contDiffOn_reverseCoefficients_interior hSF) |
| 136 | (L.continuousOn_reverseSpatialJet P E0 hS hSF hB hfull) |
| 137 | (fun p _ => L.reverseSpatialJet_mem_domain P E0 hS hSF hB hfull p.1 p.2) |
| 138 | (fun p hp => L.deriv_reverseCoefficients_eq_neg_operator hSF hp.1 p.2) m |
| 139 | |
| 140 | set_option synthInstance.maxHeartbeats 100000 in |
| 141 | -- The base coefficient field is the zeroth spatial jet. |
| 142 | /-- The actual reflected coefficients are jointly smooth through the |
| 143 | terminal slice (Theorem 12.5, pp. 296-297). -/ |
| 144 | theorem contDiffOn_reverseCoefficients : |
| 145 | ContDiffOn ℝ ∞ L.reverseCoefficients (Ico 0 S ×ˢ univ) := |
| 146 | contDiffOn_of_initial_spatial_jet_evolution |
| 147 | (isOpen_jetRicciFlowDomain 3) (contDiffOn_jetRicciFlowOperator 3).neg |
| 148 | (L.contDiffOn_reverseCoefficients_interior hSF) |
| 149 | (L.continuousOn_reverseSpatialJet P E0 hS hSF hB hfull) |
| 150 | (fun p _ => L.reverseSpatialJet_mem_domain P E0 hS hSF hB hfull p.1 p.2) |
| 151 | (fun p hp => L.deriv_reverseCoefficients_eq_neg_operator hSF hp.1 p.2) |
| 152 | |
| 153 | set_option synthInstance.maxHeartbeats 100000 in |
| 154 | -- Included-time derivatives use the same finite-jet operator at the boundary. |
| 155 | /-- The negative Ricci coefficient equation holds as an actual within |
| 156 | derivative also at reflected time zero (Theorem 12.5, pp. 296-297). -/ |
| 157 | theorem hasDerivWithinAt_reverseCoefficients {t : ℝ} (ht : t ∈ Ico 0 S) |
| 158 | (x : StandardCapSpace) : |
| 159 | HasDerivWithinAt (fun r => L.reverseCoefficients (r, x)) |
| 160 | (-jetRicciFlowOperator 3 (spatialJet 2 L.reverseCoefficients (t, x))) (Ico 0 S) t := |
| 161 | hasDerivWithinAt_of_initial_spatial_jet_evolution (p := (t, x)) |
| 162 | (isOpen_jetRicciFlowDomain 3) (contDiffOn_jetRicciFlowOperator 3).neg |
| 163 | (L.contDiffOn_reverseCoefficients_interior hSF) |
| 164 | (L.continuousOn_reverseSpatialJet P E0 hS hSF hB hfull) |
| 165 | (fun p _ => L.reverseSpatialJet_mem_domain P E0 hS hSF hB hfull p.1 p.2) |
| 166 | (fun p hp => L.deriv_reverseCoefficients_eq_neg_operator hSF hp.1 p.2) ⟨ht, mem_univ x⟩ |
| 167 | |
| 168 | end PartialFlowTerminalJets |
| 169 | end PoincareMT.M34 |