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.ReducedGeometry.Exponential.Domain.MaximalSmooth |
| 2 | |
| 3 | /-! |
| 4 | # The actual horizontal initial-vector differential |
| 5 | |
| 6 | Morgan-Tian Lemma 6.18, pp. 113-114. The constant clock of an |
| 7 | initial-vector slice makes its actual manifold differential |
| 8 | horizontal. At zero the slice is the constant basepoint map. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set Filter |
| 14 | open scoped Manifold ContDiff Topology Bundle |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.M14 |
| 19 | |
| 20 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 21 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 22 | {T : ℝ} {x : G.Point} |
| 23 | |
| 24 | private theorem horizontal_t2Space : T2Space (G.Horizontal x) := |
| 25 | FiberBundle.t2Space (EuclideanSpace ℝ (Fin n)) G.Horizontal x |
| 26 | |
| 27 | attribute [local instance] horizontal_t2Space |
| 28 | |
| 29 | /-- Horizontal projection of precisely the frozen actual initial-vector |
| 30 | differential, used in Lemma 6.18, pp. 113-114. Geometric assertions are |
| 31 | made only on the actual survival domain. -/ |
| 32 | noncomputable def initialValueDifferential |
| 33 | (G : GeneralizedLGeometryTransport n X time I) (T : ℝ) (x : G.Point) |
| 34 | (Z : G.Horizontal x) (s : ℝ) : |
| 35 | G.Horizontal x →L[ℝ] G.Horizontal (initialValueCurve G T x Z s) := |
| 36 | letI : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := |
| 37 | ⟨G.spacetime.horizontalMetric.toRiemannianMetric⟩ |
| 38 | (G.spacetime.horizontalProjection (initialValueCurve G T x Z s)).comp |
| 39 | (M14InitialVectorDerivative G (initialValueCurve G T x) s Z) |
| 40 | |
| 41 | /-- At square time zero the actual initial-vector differential vanishes, |
| 42 | since every initial vector has the same basepoint, Definition 6.17, |
| 43 | p. 113. -/ |
| 44 | theorem initialValueCurve_initialVectorDerivative_zero (Z : G.Horizontal x) : |
| 45 | M14InitialVectorDerivative G (initialValueCurve G T x) 0 Z = 0 := by |
| 46 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 47 | let : NormedAddCommGroup (G.Horizontal x) := |
| 48 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 49 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 50 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 51 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 52 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := ⟨metric⟩ |
| 53 | unfold M14InitialVectorDerivative |
| 54 | have hcurve : (fun V => initialValueCurve G T x V 0) = fun _ => x := |
| 55 | funext initialValueCurve_zero |
| 56 | rw [hcurve] |
| 57 | exact mfderiv_const |
| 58 | |
| 59 | /-- The actual initial-vector differential has zero clock component |
| 60 | throughout survival, including zero and physical time endpoints, |
| 61 | Lemma 6.18, pp. 113-114. -/ |
| 62 | theorem initialValueCurve_initialVectorDerivative_clock |
| 63 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 64 | (hbase : G.spacetime.timeFunction x = T) {Z : G.Horizontal x} {s : ℝ} |
| 65 | (hs : (Z, s) ∈ initialValueDomain G T x) (W : G.Horizontal x) : |
| 66 | (show ℝ from mfderiv (spacetimeModel n) 𝓘(ℝ) G.spacetime.timeFunction |
| 67 | (initialValueCurve G T x Z s) |
| 68 | (M14InitialVectorDerivative G (initialValueCurve G T x) s Z W)) = 0 := by |
| 69 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 70 | let : NormedAddCommGroup (G.Horizontal x) := |
| 71 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 72 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 73 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 74 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 75 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := ⟨metric⟩ |
| 76 | rcases eq_or_lt_of_le (initialValueDomain_nonneg hs) with hs0 | hs0 |
| 77 | · subst s |
| 78 | rw [initialValueCurve_initialVectorDerivative_zero] |
| 79 | simp only [zero_apply, map_zero] |
| 80 | rfl |
| 81 | obtain ⟨U, hU, hZU, htube, hsm⟩ := |
| 82 | initialValueCurve_smooth_prefix hM04 hM12 hbase hs0 hs |
| 83 | have hslice : ContMDiffOn (𝓘(ℝ, G.Horizontal x)) (spacetimeModel n) ∞ |
| 84 | (fun V => initialValueCurve G T x V s) U := |
| 85 | hsm.comp (contMDiff_id.prodMk (contMDiff_const (c := s))).contMDiffOn |
| 86 | (fun _ hV => ⟨hV, hs0.le, le_rfl⟩) |
| 87 | have hdiff := ((hslice Z hZU).contMDiffAt (hU.mem_nhds hZU)).mdifferentiableAt |
| 88 | (by simp) |
| 89 | have htime : ContMDiff (spacetimeModel n) 𝓘(ℝ) ∞ G.spacetime.timeFunction := |
| 90 | G.spacetime.time_smooth |
| 91 | have ht := (htime.mdifferentiable (by simp) |
| 92 | (initialValueCurve G T x Z s)).hasMFDerivAt.comp Z hdiff.hasMFDerivAt |
| 93 | have hc : HasFDerivAt (fun V => G.spacetime.timeFunction (initialValueCurve G T x V s)) |
| 94 | (0 : G.Horizontal x →L[ℝ] ℝ) Z := by |
| 95 | apply (hasFDerivAt_const (T - s ^ 2) Z).congr_of_eventuallyEq |
| 96 | filter_upwards [hU.mem_nhds hZU] with V hV |
| 97 | exact initialValueCurve_clock hbase (htube ⟨hV, hs0.le, le_rfl⟩) |
| 98 | set_option backward.isDefEq.respectTransparency false in |
| 99 | exact DFunLike.congr_fun (ht.hasFDerivAt.unique hc) W |
| 100 | |
| 101 | -- The scalar tangent fiber of the time function is definitionally the reals. |
| 102 | set_option backward.isDefEq.respectTransparency false in |
| 103 | /-- The projected differential retains exactly the underlying actual |
| 104 | initial-vector tangent on the maximal survival domain, the ambient |
| 105 | differential clause of Lemma 6.18, pp. 113-114. -/ |
| 106 | theorem initialValueDifferential_val |
| 107 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 108 | (hbase : G.spacetime.timeFunction x = T) {Z : G.Horizontal x} {s : ℝ} |
| 109 | (hs : (Z, s) ∈ initialValueDomain G T x) (W : G.Horizontal x) : |
| 110 | (initialValueDifferential G T x Z s W).val = |
| 111 | M14InitialVectorDerivative G (initialValueCurve G T x) s Z W := by |
| 112 | let v : TangentSpace (spacetimeModel n) (initialValueCurve G T x Z s) := |
| 113 | M14InitialVectorDerivative G (initialValueCurve G T x) s Z W |
| 114 | change (G.spacetime.horizontalProjection _ v).val = v |
| 115 | rw [G.spacetime.horizontalProjection_eq] |
| 116 | change v - (show ℝ from mfderiv (spacetimeModel n) 𝓘(ℝ) G.spacetime.timeFunction |
| 117 | (initialValueCurve G T x Z s) v) • |
| 118 | G.spacetime.timeVector (initialValueCurve G T x Z s) = v |
| 119 | rw [initialValueCurve_initialVectorDerivative_clock hM04 hM12 hbase hs W, |
| 120 | zero_smul, sub_zero] |
| 121 | |
| 122 | end PoincareMT.M14 |