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.Variation.Extension.ProductExtension |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Differential.PullbackSectionSmooth |
| 3 | import Mathlib.Geometry.Manifold.VectorBundle.ContMDiffSection |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Pullback.PullbackMetric |
| 5 | |
| 6 | /-! |
| 7 | # Reparameterizing actual horizontal pullback extensions |
| 8 | |
| 9 | Morgan-Tian equation (6.2) and Lemma 6.8, pp. 106, 108-109. A smooth |
| 10 | scalar multiple and smooth parameter substitution retain the actual |
| 11 | extension's common spatial domain and its genuine parameter derivatives. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | -- The pullback bundle fibers are the supplied horizontal fibers over the spatial projection. |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M14 |
| 24 | |
| 25 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 26 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 27 | {γ : ℝ → G.Point} {J K : Set ℝ} {Y : ∀ s, G.Horizontal (γ s)} |
| 28 | |
| 29 | /-- A globally smooth parameter substitution and scalar factor give |
| 30 | an actual pullback extension on the new parameter set, retaining the |
| 31 | common spatial domain required in Lemma 6.8, pp. 108-109. -/ |
| 32 | noncomputable def pullbackExtensionSmulComp (E : M14PullbackExtension G γ J Y) |
| 33 | (f c : ℝ → ℝ) (hf : ContDiff ℝ ∞ f) (hc : ContDiff ℝ ∞ c) (hmap : MapsTo f K J) : |
| 34 | M14PullbackExtension G (γ ∘ f) K (fun s => c s • Y (f s)) := by |
| 35 | let W : ℝ → HorizontalSection G.spacetime := fun s q => c s • E.extension (f s) q |
| 36 | let U := E.joint_smooth.choose |
| 37 | have hU := E.joint_smooth.choose_spec.1 |
| 38 | have hgraph := E.joint_smooth.choose_spec.2.1 |
| 39 | have hE := E.joint_smooth.choose_spec.2.2 |
| 40 | let k := fun z : ℝ × G.Point => (f z.1, z.2) |
| 41 | let N := k ⁻¹' U |
| 42 | have hk : ContMDiff ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 43 | ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) ∞ k := |
| 44 | (hf.contMDiff.comp contMDiff_fst).prodMk contMDiff_snd |
| 45 | have hN : IsOpen N := hU.preimage hk.continuous |
| 46 | have hfield := hE.comp hk.contMDiffOn (fun _ hz => hz) |
| 47 | let base : ContMDiffMap ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 48 | (spacetimeModel n) (ℝ × G.Point) G.Point ∞ := ⟨Prod.snd, contMDiff_snd⟩ |
| 49 | let : ∀ z, AddCommGroup (((base : ℝ × G.Point → G.Point) *ᵖ G.Horizontal) z) := |
| 50 | fun z => inferInstanceAs (AddCommGroup (G.Horizontal (base z))) |
| 51 | let : ∀ z, Module ℝ (((base : ℝ × G.Point → G.Point) *ᵖ G.Horizontal) z) := |
| 52 | fun z => inferInstanceAs (Module ℝ (G.Horizontal (base z))) |
| 53 | let V : ∀ z, ((base : ℝ × G.Point → G.Point) *ᵖ G.Horizontal) z := |
| 54 | fun z => E.extension (f z.1) z.2 |
| 55 | have hV : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 56 | (((𝓘(ℝ, ℝ)).prod (spacetimeModel n)).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 57 | (fun z => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) z (V z)) N := by |
| 58 | intro z hz |
| 59 | exact (Bundle.contMDiffWithinAt_pullback_section_iff base V N z).mpr (hfield z hz) |
| 60 | have hscalar : ContMDiff ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) (𝓘(ℝ, ℝ)) ∞ |
| 61 | (fun z : ℝ × G.Point => c z.1) := hc.contMDiff.comp contMDiff_fst |
| 62 | have hscaled := hscalar.contMDiffOn.smul_section hV |
| 63 | have hW : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 64 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 65 | (fun z : ℝ × G.Point => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 66 | (E := G.Horizontal) z.2 (W z.1 z.2)) N := by |
| 67 | intro z hz |
| 68 | exact (Bundle.contMDiffWithinAt_pullback_section_iff base |
| 69 | (fun z => c z.1 • V z) N z).mp (hscaled z hz) |
| 70 | refine { |
| 71 | extension := W |
| 72 | domain := E.domain |
| 73 | domain_open := E.domain_open |
| 74 | graph_mem := fun s hs => E.graph_mem (f s) (hmap hs) |
| 75 | spatial_smooth := ?_ |
| 76 | joint_smooth := ⟨N, hN, fun s hs => hgraph (f s) (hmap hs), hW⟩ |
| 77 | agrees := ?_ |
| 78 | parameter_derivative := ?_ } |
| 79 | · intro s |
| 80 | exact (E.spatial_smooth (f s)).const_smul_section |
| 81 | · intro s hs |
| 82 | exact congrArg (fun v : G.Horizontal (γ (f s)) => c s • v) (E.agrees (f s) (hmap hs)) |
| 83 | · intro s hs |
| 84 | exact horizontal_parameter_hasDerivAt_of_contMDiffAt W s (γ (f s)) |
| 85 | ((hW _ (hgraph (f s) (hmap hs))).contMDiffAt (hN.mem_nhds (hgraph (f s) (hmap hs)))) |
| 86 | |
| 87 | /-- The actual covariant derivative obeys the scalar product and |
| 88 | parameter chain rules at interior points, equation (6.2) and Lemma 6.8, |
| 89 | pp. 106, 108-109. No nonzero scalar or parameter derivative is required. -/ |
| 90 | theorem horizontalCovariantDerivative_smul_comp |
| 91 | (E : M14PullbackExtension G γ J Y) (f c : ℝ → ℝ) |
| 92 | (hf : ContDiff ℝ ∞ f) (hc : ContDiff ℝ ∞ c) (hmap : MapsTo f K J) |
| 93 | {s : ℝ} (hs : s ∈ K) (hK : K ∈ 𝓝 s) (hJ : J ∈ 𝓝 (f s)) |
| 94 | (hγ : MDifferentiableAt (𝓘(ℝ, ℝ)) (spacetimeModel n) γ (f s)) : |
| 95 | M14HorizontalCovariantDerivative G (γ ∘ f) K (fun r => c r • Y (f r)) |
| 96 | (pullbackExtensionSmulComp E f c hf hc hmap) s = |
| 97 | deriv c s • Y (f s) + (c s * deriv f s) • |
| 98 | M14HorizontalCovariantDerivative G γ J Y E (f s) := by |
| 99 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 100 | let : NormedAddCommGroup (G.Horizontal (γ (f s))) := |
| 101 | (metric.toCore (γ (f s))).toNormedAddCommGroupOfTopology |
| 102 | (metric.continuousAt (γ (f s))) (metric.isVonNBounded (γ (f s))) |
| 103 | let : InnerProductSpace ℝ (G.Horizontal (γ (f s))) := |
| 104 | .ofCoreOfTopology (metric.toCore (γ (f s))) |
| 105 | (metric.continuousAt (γ (f s))) (metric.isVonNBounded (γ (f s))) |
| 106 | have hf' := (hf.differentiable (by simp) s).hasDerivAt |
| 107 | have hc' := (hc.differentiable (by simp) s).hasDerivAt |
| 108 | obtain ⟨d, hd⟩ := E.parameter_derivative (f s) (hmap hs) |
| 109 | have ht := (hc'.smul (hd.differentiableAt.hasDerivAt.scomp s hf')).deriv |
| 110 | have hparam : deriv (fun r => c r • E.extension (f r) (γ (f s))) s = |
| 111 | c s • (deriv f s • deriv (fun r => E.extension r (γ (f s))) (f s)) + |
| 112 | deriv c s • Y (f s) := by |
| 113 | simpa only [Pi.smul_def', Function.comp_def, E.agrees (f s) (hmap hs)] using ht |
| 114 | have hspace := ((E.spatial_smooth (f s) (γ (f s)) |
| 115 | (E.graph_mem (f s) (hmap hs))).contMDiffAt |
| 116 | (E.domain_open.mem_nhds (E.graph_mem (f s) (hmap hs)))).mdifferentiableAt (by simp) |
| 117 | have hcov := (rawHorizontalCovariantDerivative_isCovariantDerivative G.leafwise).smul_const |
| 118 | (c s) hspace |
| 119 | have hfderiv : mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) f s (1 : ℝ) = |
| 120 | deriv f s • (1 : TangentSpace (𝓘(ℝ, ℝ)) (f s)) := by |
| 121 | have hv := congrArg (fun L : TangentSpace (𝓘(ℝ, ℝ)) s →L[ℝ] |
| 122 | TangentSpace (𝓘(ℝ, ℝ)) (f s) => L 1) hf'.hasFDerivAt.hasMFDerivAt.mfderiv |
| 123 | change mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) f s (1 : ℝ) = |
| 124 | (ContinuousLinearMap.toSpanSingleton ℝ (deriv f s)) (1 : ℝ) at hv |
| 125 | simpa only [ContinuousLinearMap.toSpanSingleton_apply, one_smul, smul_eq_mul, |
| 126 | mul_one, one_mul] using hv |
| 127 | have hchain := mfderiv_comp_apply s hγ hf'.differentiableAt.mdifferentiableAt (1 : ℝ) |
| 128 | rw [hfderiv, map_smul] at hchain |
| 129 | change deriv (fun r => c r • E.extension (f r) (γ (f s))) s + |
| 130 | rawHorizontalCovariantDerivative G.leafwise (c s • E.extension (f s)) (γ (f s)) |
| 131 | (mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) (γ ∘ f) K s (1 : ℝ)) = _ |
| 132 | rw [mfderivWithin_of_mem_nhds hK, hchain, hcov] |
| 133 | rw [hparam] |
| 134 | simp only [M14HorizontalCovariantDerivative, mfderivWithin_of_mem_nhds hJ, |
| 135 | smul_apply, map_smul, smul_smul, smul_add, mul_comm (deriv f s) (c s)] |
| 136 | abel |
| 137 | |
| 138 | end PoincareMT.M14 |