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.Cylinder.CylinderFlow |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.Noncollapse.Calculus.InverseOnRange |
| 3 | import PoincareLib.Geometry.RicciFlow.MetricComparison.LocalCurvature |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.SliceMap |
| 5 | |
| 6 | /-! Adapted from Mapher `PoincareMT/Proofs/M15/Lemma8_8_SliceTransfer.lean` at |
| 7 | `0c5d5c4e1ecbc12703b1994e226df1b15d2e8d39`. See the source mapping in |
| 8 | `references/ricci-flow/mapher/noncollapse/import.json`. -/ |
| 9 | |
| 10 | /-! |
| 11 | # Terminal-to-earlier slice transfer on the actual ball |
| 12 | |
| 13 | Morgan-Tian Claim 8.8, pp. 174-175. The inverse of the based source map |
| 14 | gives a smooth transfer on the actual terminal ball, and M04 compares |
| 15 | the two slice metrics on its actual differential. |
| 16 | See `references/ricci-flow/mapher/noncollapse/derivations/2026-09-21-slice-transfer.md`. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open Set |
| 22 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.Generalized.Noncollapse |
| 27 | |
| 28 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 29 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 30 | {T r : ℝ} {x : (G.slices T).Point} {K : SpacetimeInterval} |
| 31 | {C : Type u} [TopologicalSpace C] |
| 32 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 33 | [T2Space C] [SecondCountableTopology C] |
| 34 | |
| 35 | /-- The actual ball admits a smooth terminal-to-earlier slice transfer |
| 36 | with the backward metric bound from RicciFlowAnalysis. Source: Claim 8.8, pp. 174-175. |
| 37 | No identification of global intrinsic distances is used. -/ |
| 38 | theorem actualBallCylinder_exists_slice_transfer |
| 39 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 40 | (B : M15ActualBallCylinder G T x r K C) |
| 41 | (t : (G.timeIntervals.interval K).Point) : |
| 42 | ∃ f : (G.slices T).Point → (G.slices t.val).Point, |
| 43 | ContMDiffOn (𝓡 n) (𝓡 n) ∞ f ((G.slices T).metricOnPoints.ball x r) ∧ |
| 44 | (∀ c : C, f (B.source_map c) = |
| 45 | movingGaugeSliceMap B.embedding.toMovingSpacetimeGauge G.slices t c) ∧ |
| 46 | ∀ z ∈ (G.slices T).metricOnPoints.ball x r, |
| 47 | ∀ v : TangentSpace (𝓡 n) z, |
| 48 | (G.slices t.val).metricOnPoints.tangentNorm (f z) |
| 49 | (mfderiv (𝓡 n) (𝓡 n) f z v) ≤ |
| 50 | Real.exp ((n : ℝ) * (r⁻¹) ^ 2 * (T - t.val)) * |
| 51 | (G.slices T).metricOnPoints.tangentNorm z v := by |
| 52 | have hx : x ∈ (G.slices T).metricOnPoints.ball x r := by |
| 53 | let : Bundle.RiemannianBundle |
| 54 | (TangentSpace (𝓡 n) : (G.slices T).Point → Type _) := |
| 55 | ⟨(G.slices T).metricOnPoints.toRiemannianMetric⟩ |
| 56 | change Manifold.riemannianEDist (𝓡 n) x x < ENNReal.ofReal r |
| 57 | rw [Manifold.riemannianEDist_self, ENNReal.ofReal_pos] |
| 58 | exact B.radius_pos |
| 59 | obtain ⟨c0, _⟩ := B.source_map_range.symm ▸ hx |
| 60 | let : Nonempty C := ⟨c0⟩ |
| 61 | have hlocal : IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ B.source_map := by |
| 62 | rw [← actualBallCylinder_terminal_sliceMap_eq B] |
| 63 | exact movingGaugeSliceMap_localDiffeomorph B.embedding.toMovingSpacetimeGauge |
| 64 | G.slices B.metric.toMovingSpacetimeGaugeGeometry ⟨T, B.base_mem⟩ |
| 65 | have hU : IsOpen ((G.slices T).metricOnPoints.ball x r) := by |
| 66 | rw [← B.source_map_range] |
| 67 | exact hlocal.isOpen_range |
| 68 | have hinv := hlocal.contMDiffOn_invFun_of_injective B.source_map_embedding.injective |
| 69 | rw [B.source_map_range] at hinv |
| 70 | let m := movingGaugeSliceMap B.embedding.toMovingSpacetimeGauge G.slices t |
| 71 | have hm : ContMDiff (𝓡 n) (𝓡 n) ∞ m := |
| 72 | (movingGaugeSliceMap_localDiffeomorph B.embedding.toMovingSpacetimeGauge |
| 73 | G.slices B.metric.toMovingSpacetimeGaugeGeometry t).contMDiff |
| 74 | let f := m ∘ Function.invFun B.source_map |
| 75 | have hf : ContMDiffOn (𝓡 n) (𝓡 n) ∞ f ((G.slices T).metricOnPoints.ball x r) := |
| 76 | hm.comp_contMDiffOn hinv |
| 77 | have hrecover (c : C) : f (B.source_map c) = m c := by |
| 78 | dsimp only [f, Function.comp_apply] |
| 79 | rw [Function.leftInverse_invFun B.source_map_embedding.injective c] |
| 80 | refine ⟨f, hf, hrecover, ?_⟩ |
| 81 | intro z hz v |
| 82 | obtain ⟨c, rfl⟩ := B.source_map_range.symm ▸ hz |
| 83 | obtain ⟨w, hw⟩ := ((hlocal c).mfderivToContinuousLinearEquiv (by simp)).surjective v |
| 84 | change mfderiv (𝓡 n) (𝓡 n) B.source_map c w = v at hw |
| 85 | have hcomp : f ∘ B.source_map = m := funext hrecover |
| 86 | have hchain := congrArg (fun A => A w) |
| 87 | (mfderiv_comp c ((hf.contMDiffAt (hU.mem_nhds hz)).mdifferentiableAt (by simp)) |
| 88 | ((hlocal c).mdifferentiableAt (by simp))) |
| 89 | rw [hcomp] at hchain |
| 90 | change mfderiv (𝓡 n) (𝓡 n) m c w = |
| 91 | mfderiv (𝓡 n) (𝓡 n) f (B.source_map c) |
| 92 | (mfderiv (𝓡 n) (𝓡 n) B.source_map c w) at hchain |
| 93 | have H := hM12.gauges X time I G.spacetime G.slices G.timeIntervals G.gaugeCover G.leafwise |
| 94 | obtain ⟨D⟩ := H.moving_connections C K B.embedding.toMovingSpacetimeGauge |
| 95 | B.metric.toMovingSpacetimeGaugeGeometry |
| 96 | have hcalc := H.moving_calculus C K B.embedding.toMovingSpacetimeGauge |
| 97 | B.metric.toMovingSpacetimeGaugeGeometry D |
| 98 | have hnorm : (G.slices t.val).metricOnPoints.tangentNorm (f (B.source_map c)) |
| 99 | (mfderiv (𝓡 n) (𝓡 n) f (B.source_map c) v) = |
| 100 | (B.metric.metric t.val).tangentNorm c w := by |
| 101 | rw [← hw, ← hchain, hrecover c] |
| 102 | exact congrArg Real.sqrt (hcalc.slice_metric_eq t c w w) |
| 103 | have hterminal : (G.slices T).metricOnPoints.tangentNorm (B.source_map c) v = |
| 104 | (B.metric.metric T).tangentNorm c w := by |
| 105 | rw [← hw] |
| 106 | exact congrArg Real.sqrt (actualBallCylinder_terminal_metric_pullback hM12 B c w w) |
| 107 | obtain ⟨F, hmetric, hRm, _⟩ := actualBallCylinder_exists_flow hM12 B |
| 108 | have htT : t.val ≤ T := by |
| 109 | have ht : t.val ∈ K.domain := t.property |
| 110 | rw [B.interval_domain] at ht |
| 111 | exact ht.2 |
| 112 | have hcurv : ∀ s ∈ Icc t.val T, (F.connection s).curvatureTensorNorm c ≤ (r⁻¹) ^ 2 := by |
| 113 | intro s hs |
| 114 | have hsK := F.interval.out t.property B.base_mem hs |
| 115 | rw [hRm ⟨s, hsK⟩ c] |
| 116 | exact B.curvature_bound ⟨s, hsK⟩ c |
| 117 | have hcompare := (RicciFlowAnalysis.tangentNorm_comparison_at_of_curvature_bound F t.property B.base_mem |
| 118 | htT (sq_nonneg r⁻¹) c hcurv w).1 |
| 119 | have h := mul_le_mul_of_nonneg_left hcompare |
| 120 | (Real.exp_pos ((n : ℝ) * (r⁻¹) ^ 2 * (T - t.val))).le |
| 121 | have hexp : Real.exp ((n : ℝ) * (r⁻¹) ^ 2 * (T - t.val)) * |
| 122 | Real.exp (-(n : ℝ) * (r⁻¹) ^ 2 * (T - t.val)) = 1 := by |
| 123 | rw [← Real.exp_add] |
| 124 | convert Real.exp_zero using 1 |
| 125 | congr 1 |
| 126 | ring |
| 127 | rw [← mul_assoc, hexp, one_mul, hmetric] at h |
| 128 | rw [hnorm, hterminal] |
| 129 | exact h |
| 130 | |
| 131 | end PoincareMT.Generalized.Noncollapse |