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.Generalized.Noncollapse.Compact.Product.OrdinaryProduct |
| 2 | import PoincareLib.Geometry.Spacetime.Interval.RealTime |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Basic |
| 4 | |
| 5 | /-! Adapted from Mapher `PoincareMT/Proofs/M15/Thm8_10_PathLift.lean` at |
| 6 | `0c5d5c4e1ecbc12703b1994e226df1b15d2e8d39`. See the source mapping in |
| 7 | `references/ricci-flow/mapher/noncollapse/import.json`. -/ |
| 8 | |
| 9 | /-! |
| 10 | # Ordinary paths lifted to the actual product spacetime |
| 11 | |
| 12 | Morgan-Tian Remark 3.37, p. 60, Definitions 6.1-6.2, pp. 105-106, |
| 13 | and Theorem 8.10, p. 177. The real-time parametrization uses the |
| 14 | selected interval atlas and only asserts derivatives at valid times. |
| 15 | See `references/ricci-flow/mapher/noncollapse/derivations/2026-09-21-ordinary-capture.md`. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | -- Derivatives retain the selected interval and product tangent instances. |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set |
| 23 | open scoped Manifold ContDiff Bundle Topology |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.Generalized.Noncollapse |
| 28 | |
| 29 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 31 | {I : SpacetimeInterval} |
| 32 | |
| 33 | /-- Every ordinary backward path has an actual admissible product lift. |
| 34 | Source: Definitions 6.1-6.2, pp. 105-106, used in Theorem 8.10, p. 177. -/ |
| 35 | theorem ordinaryProduct_backwardPath_lift |
| 36 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 37 | (F : RicciFlow n M I.domain) |
| 38 | (P : OrdinaryProductRicciGeometry F.metric I) |
| 39 | {T a b : ℝ} (q : BackwardTimePath F T a b) : |
| 40 | ∃ p : M14BackwardPath (ordinaryProductTransport F P) T a b |
| 41 | (P.product.productCylinder.toSpacetime |
| 42 | ((⟨T - a, q.time_mem a ⟨le_rfl, q.ordered.le⟩⟩, q.curve a))) |
| 43 | (P.product.productCylinder.toSpacetime |
| 44 | ((⟨T - b, q.time_mem b ⟨q.ordered.le, le_rfl⟩⟩, q.curve b))), |
| 45 | ∀ (s : ℝ) (hs : s ∈ Icc a b), |
| 46 | P.product.productCylinder.toSpacetime |
| 47 | ((⟨T - s, q.time_mem s hs⟩, q.curve s)) = p.curve s := by |
| 48 | let G := ordinaryProductTransport F P |
| 49 | let D := P.product.timeIntervals.interval I |
| 50 | let e := P.product.productCylinder |
| 51 | let g := ordinaryProductCylinderMetric F P |
| 52 | let α : ℝ → D.Point := fun s => D.realParam (T - s) |
| 53 | let L : ℝ → D.Point × M := fun s => (α s, q.curve s) |
| 54 | let γ : ℝ → G.Point := e.toSpacetime ∘ L |
| 55 | let v : ∀ s, G.Horizontal (γ s) := fun s => |
| 56 | g.spatialTangentEquiv (α s) (q.curve s) (curveVelocity (n := n) q.curve s) |
| 57 | have hαval (s : ℝ) (hs : s ∈ Icc a b) : (α s).val = T - s := |
| 58 | D.realParam_val (q.time_mem s hs) |
| 59 | have hα : ContMDiffOn 𝓘(ℝ) (𝓡∂ 1) 1 α (Icc a b) := |
| 60 | (D.realParam_smoothOn.of_le (by simp)).comp |
| 61 | (contDiff_const.sub contDiff_id).contMDiff.contMDiffOn q.time_mem |
| 62 | have hL : ContMDiffOn 𝓘(ℝ) (spacetimeModel n) 1 L (Ioo a b) := |
| 63 | (hα.mono Ioo_subset_Icc_self).prodMk q.regular |
| 64 | have hγ : ContMDiffOn 𝓘(ℝ) (spacetimeModel n) 1 γ (Ioo a b) := |
| 65 | (e.smooth.of_le (by simp)).comp_contMDiffOn hL |
| 66 | have hlift (s : ℝ) (hs : s ∈ Icc a b) : |
| 67 | e.toSpacetime ((⟨T - s, q.time_mem s hs⟩, q.curve s)) = γ s := by |
| 68 | have ht : α s = ⟨T - s, q.time_mem s hs⟩ := Subtype.ext (hαval s hs) |
| 69 | change e.toSpacetime _ = e.toSpacetime (α s, q.curve s) |
| 70 | rw [ht] |
| 71 | have hclock (s : ℝ) (hs : s ∈ Icc a b) : G.spacetime.timeFunction (γ s) = T - s := |
| 72 | (e.time_eq (L s)).trans (hαval s hs) |
| 73 | have hderiv (s : ℝ) (hs : s ∈ Ioo a b) : |
| 74 | mfderiv 𝓘(ℝ) (spacetimeModel n) γ s 1 = |
| 75 | -G.spacetime.timeVector (γ s) + (v s).val := by |
| 76 | have hnh : Ioo a b ∈ 𝓝 s := isOpen_Ioo.mem_nhds hs |
| 77 | have hu : UniqueDiffWithinAt ℝ (Ioo a b) s := isOpen_Ioo.uniqueDiffWithinAt hs |
| 78 | have ht := q.time_mem s (Ioo_subset_Icc_self hs) |
| 79 | have hsub : HasDerivAt (fun r : ℝ => T - r) (-1) s := by |
| 80 | simpa using (hasDerivAt_id s).const_sub T |
| 81 | have hsubm : MDifferentiableWithinAt 𝓘(ℝ) 𝓘(ℝ) |
| 82 | (fun r : ℝ => T - r) (Ioo a b) s := |
| 83 | hsub.differentiableAt.mdifferentiableAt.mdifferentiableWithinAt |
| 84 | have hsubD : mfderivWithin 𝓘(ℝ) 𝓘(ℝ) (fun r : ℝ => T - r) |
| 85 | (Ioo a b) s 1 = -1 := by |
| 86 | rw [mfderivWithin_eq_fderivWithin] |
| 87 | simpa using! congrArg (fun A : ℝ →L[ℝ] ℝ => A 1) |
| 88 | (hsub.hasFDerivAt.hasFDerivWithinAt.fderivWithin hu) |
| 89 | have hαd : mfderiv 𝓘(ℝ) (𝓡∂ 1) α s 1 = -D.positiveTangent (α s) := by |
| 90 | rw [← mfderivWithin_of_mem_nhds hnh] |
| 91 | change mfderivWithin 𝓘(ℝ) (𝓡∂ 1) (D.realParam ∘ (fun r => T - r)) |
| 92 | (Ioo a b) s 1 = _ |
| 93 | rw [mfderivWithin_comp s |
| 94 | ((D.realParam_smoothOn (T - s) ht).mdifferentiableWithinAt (by simp)) |
| 95 | hsubm (fun r hr => q.time_mem r (Ioo_subset_Icc_self hr)) hu.uniqueMDiffWithinAt] |
| 96 | change mfderivWithin 𝓘(ℝ) (𝓡∂ 1) D.realParam I.domain (T - s) |
| 97 | (mfderivWithin 𝓘(ℝ) 𝓘(ℝ) (fun r : ℝ => T - r) (Ioo a b) s 1) = _ |
| 98 | rw [hsubD, D.realParam_mfderivWithin ht] |
| 99 | change (D.inclusionDerivative (α s)).symm (-1) = |
| 100 | -(D.inclusionDerivative (α s)).symm 1 |
| 101 | exact map_neg _ _ |
| 102 | have hαm := ((hα.mono Ioo_subset_Icc_self s hs).mdifferentiableWithinAt |
| 103 | (by simp)).mdifferentiableAt hnh |
| 104 | have hqm := ((q.regular s hs).mdifferentiableWithinAt (by simp)).mdifferentiableAt hnh |
| 105 | have hLm := ((hL s hs).mdifferentiableWithinAt (by simp)).mdifferentiableAt hnh |
| 106 | have hLd : mfderiv 𝓘(ℝ) (spacetimeModel n) L s 1 = |
| 107 | (-D.positiveTangent (α s), curveVelocity (n := n) q.curve s) := by |
| 108 | change mfderiv 𝓘(ℝ) ((𝓡∂ 1).prod (𝓡 n)) |
| 109 | (fun r => (α r, q.curve r)) s 1 = _ |
| 110 | rw [mfderiv_prodMk hαm hqm] |
| 111 | change (mfderiv 𝓘(ℝ) (𝓡∂ 1) α s 1, |
| 112 | mfderiv 𝓘(ℝ) (𝓡 n) q.curve s 1) = _ |
| 113 | rw [hαd] |
| 114 | rfl |
| 115 | change mfderiv 𝓘(ℝ) (spacetimeModel n) (e.toSpacetime ∘ L) s 1 = _ |
| 116 | rw [mfderiv_comp_apply s (e.smooth.mdifferentiableAt (by simp)) hLm, hLd] |
| 117 | rw [mfderiv_prod_eq_add_apply (e.smooth.mdifferentiableAt (by simp)), |
| 118 | map_neg, e.worldline_derivative, ← g.spatialTangentEquiv_eq] |
| 119 | rfl |
| 120 | have hdensity (s : ℝ) (hs : s ∈ Ioo a b) : |
| 121 | M14RawLIntegrand G γ v s = backwardLIntegrand F T q.curve s := by |
| 122 | have hc := ordinaryProduct_moving_calculus hM12 F P |
| 123 | unfold M14RawLIntegrand backwardLIntegrand |
| 124 | change Real.sqrt s * (horizontalScalarCurvature G.leafwise |
| 125 | (e.toSpacetime (α s, q.curve s)) + |
| 126 | G.spacetime.horizontalMetric.inner (e.toSpacetime (α s, q.curve s)) |
| 127 | (g.spatialTangentEquiv (α s) (q.curve s) (curveVelocity (n := n) q.curve s)) |
| 128 | (g.spatialTangentEquiv (α s) (q.curve s) (curveVelocity (n := n) q.curve s))) = _ |
| 129 | erw [← hc.scalar_eq, ← g.metric_eq] |
| 130 | change Real.sqrt s * ((F.connection (α s).val).scalarCurvature (q.curve s) + |
| 131 | (F.metric (α s).val).inner (q.curve s) _ _) = _ |
| 132 | rw [hαval s (Ioo_subset_Icc_self hs)] |
| 133 | refine ⟨{ |
| 134 | tau_nonneg := q.nonnegative |
| 135 | tau_lt := q.ordered |
| 136 | base_time := e.time_eq _ |
| 137 | endpoint_time := e.time_eq _ |
| 138 | curve := γ |
| 139 | curve_start := (hlift a ⟨le_rfl, q.ordered.le⟩).symm |
| 140 | curve_end := (hlift b ⟨q.ordered.le, le_rfl⟩).symm |
| 141 | curve_time := hclock |
| 142 | curve_continuous := e.smooth.continuous.comp_continuousOn |
| 143 | (hα.continuousOn.prodMk q.continuous) |
| 144 | curve_regular := hγ |
| 145 | horizontal_velocity := v |
| 146 | derivative_eq := hderiv |
| 147 | action_integrable := ?_ |
| 148 | }, hlift⟩ |
| 149 | apply q.l_integrable.congr_uIoo |
| 150 | intro s hs |
| 151 | exact (hdensity s (by simpa only [uIoo_of_le q.ordered.le] using hs)).symm |
| 152 | |
| 153 | end PoincareMT.Generalized.Noncollapse |