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.Pullback.PullbackReparametrization |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Pullback.PullbackCongruence |
| 3 | |
| 4 | /-! |
| 5 | # Affine combinations of actual horizontal pullback fields |
| 6 | |
| 7 | Morgan-Tian Proposition 6.13 and Corollary 6.16, pp. 110-112. |
| 8 | Affine combinations of actual extensions retain common open spatial |
| 9 | and joint domains. M12's raw connection laws and genuine parameter |
| 10 | derivatives give the affine derivative formula at closed endpoints. |
| 11 | This adapts M08 PullbackLinearity to the actual horizontal bundle. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | -- Pullback section fibers are the actual 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 : Set ℝ} {Y Z H : ∀ s, G.Horizontal (γ s)} |
| 28 | |
| 29 | /-- The actual affine extension uses the same two supplied sections |
| 30 | on their common domains, Proposition 6.13 and Corollary 6.16, |
| 31 | pp. 110-112. -/ |
| 32 | noncomputable def affinePullbackExtension (EY : M14PullbackExtension G γ J Y) |
| 33 | (EZ : M14PullbackExtension G γ J Z) (c : ℝ) : |
| 34 | M14PullbackExtension G γ J (fun s => Y s + c • Z s) := by |
| 35 | let W : ℝ → HorizontalSection G.spacetime := fun s q => |
| 36 | EY.extension s q + c • EZ.extension s q |
| 37 | let U := EY.joint_smooth.choose ∩ EZ.joint_smooth.choose |
| 38 | have hU : IsOpen U := EY.joint_smooth.choose_spec.1.inter EZ.joint_smooth.choose_spec.1 |
| 39 | have hgraph (s : ℝ) (hs : s ∈ J) : (s, γ s) ∈ U := |
| 40 | ⟨EY.joint_smooth.choose_spec.2.1 s hs, EZ.joint_smooth.choose_spec.2.1 s hs⟩ |
| 41 | let base : ContMDiffMap ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 42 | (spacetimeModel n) (ℝ × G.Point) G.Point ∞ := ⟨Prod.snd, contMDiff_snd⟩ |
| 43 | let : ∀ z, AddCommGroup (((base : ℝ × G.Point → G.Point) *ᵖ G.Horizontal) z) := |
| 44 | fun z => inferInstanceAs (AddCommGroup (G.Horizontal (base z))) |
| 45 | let : ∀ z, Module ℝ (((base : ℝ × G.Point → G.Point) *ᵖ G.Horizontal) z) := |
| 46 | fun z => inferInstanceAs (Module ℝ (G.Horizontal (base z))) |
| 47 | let A : ∀ z, ((base : ℝ × G.Point → G.Point) *ᵖ G.Horizontal) z := |
| 48 | fun z => EY.extension z.1 z.2 |
| 49 | let B : ∀ z, ((base : ℝ × G.Point → G.Point) *ᵖ G.Horizontal) z := |
| 50 | fun z => EZ.extension z.1 z.2 |
| 51 | have hA : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 52 | (((𝓘(ℝ, ℝ)).prod (spacetimeModel n)).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 53 | (fun z => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) z (A z)) U := by |
| 54 | intro z hz |
| 55 | exact (Bundle.contMDiffWithinAt_pullback_section_iff base A U z).mpr |
| 56 | ((EY.joint_smooth.choose_spec.2.2 z hz.1).mono inter_subset_left) |
| 57 | have hB : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 58 | (((𝓘(ℝ, ℝ)).prod (spacetimeModel n)).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 59 | (fun z => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) z (B z)) U := by |
| 60 | intro z hz |
| 61 | exact (Bundle.contMDiffWithinAt_pullback_section_iff base B U z).mpr |
| 62 | ((EZ.joint_smooth.choose_spec.2.2 z hz.2).mono inter_subset_right) |
| 63 | have hsum := hA.add_section (hB.const_smul_section (a := c)) |
| 64 | have hW : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 65 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 66 | (fun z : ℝ × G.Point => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 67 | (E := G.Horizontal) z.2 (W z.1 z.2)) U := by |
| 68 | intro z hz |
| 69 | exact (Bundle.contMDiffWithinAt_pullback_section_iff base |
| 70 | (fun z => A z + c • B z) U z).mp (hsum z hz) |
| 71 | refine { |
| 72 | extension := W |
| 73 | domain := EY.domain ∩ EZ.domain |
| 74 | domain_open := EY.domain_open.inter EZ.domain_open |
| 75 | graph_mem := fun s hs => ⟨EY.graph_mem s hs, EZ.graph_mem s hs⟩ |
| 76 | spatial_smooth := ?_ |
| 77 | joint_smooth := ⟨U, hU, hgraph, hW⟩ |
| 78 | agrees := ?_ |
| 79 | parameter_derivative := ?_ } |
| 80 | · intro s |
| 81 | exact ((EY.spatial_smooth s).mono inter_subset_left).add_section |
| 82 | (((EZ.spatial_smooth s).mono inter_subset_right).const_smul_section) |
| 83 | · intro s hs |
| 84 | dsimp only [W] |
| 85 | rw [EY.agrees s hs, EZ.agrees s hs] |
| 86 | · intro s hs |
| 87 | exact horizontal_parameter_hasDerivAt_of_contMDiffAt W s (γ s) |
| 88 | ((hW _ (hgraph s hs)).contMDiffAt (hU.mem_nhds (hgraph s hs))) |
| 89 | |
| 90 | /-- The actual pullback derivative of an affine extension is the |
| 91 | same affine combination of actual derivatives, even at closed |
| 92 | parameter endpoints, Proposition 6.13, pp. 110-112. -/ |
| 93 | theorem horizontalCovariantDerivative_affine |
| 94 | (EY : M14PullbackExtension G γ J Y) (EZ : M14PullbackExtension G γ J Z) (c : ℝ) |
| 95 | {s : ℝ} (hs : s ∈ J) : |
| 96 | M14HorizontalCovariantDerivative G γ J (fun r => Y r + c • Z r) |
| 97 | (affinePullbackExtension EY EZ c) s = |
| 98 | M14HorizontalCovariantDerivative G γ J Y EY s + |
| 99 | c • M14HorizontalCovariantDerivative G γ J Z EZ s := by |
| 100 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 101 | let : NormedAddCommGroup (G.Horizontal (γ s)) := |
| 102 | (metric.toCore (γ s)).toNormedAddCommGroupOfTopology |
| 103 | (metric.continuousAt (γ s)) (metric.isVonNBounded (γ s)) |
| 104 | let : InnerProductSpace ℝ (G.Horizontal (γ s)) := |
| 105 | .ofCoreOfTopology (metric.toCore (γ s)) |
| 106 | (metric.continuousAt (γ s)) (metric.isVonNBounded (γ s)) |
| 107 | obtain ⟨dY, hdY⟩ := EY.parameter_derivative s hs |
| 108 | obtain ⟨dZ, hdZ⟩ := EZ.parameter_derivative s hs |
| 109 | have hd := (hdY.differentiableAt.hasDerivAt.add |
| 110 | (hdZ.differentiableAt.hasDerivAt.const_smul c)).deriv |
| 111 | change deriv (fun r => EY.extension r (γ s) + c • EZ.extension r (γ s)) s = |
| 112 | deriv (fun r => EY.extension r (γ s)) s + c • deriv (fun r => EZ.extension r (γ s)) s at hd |
| 113 | have hY := ((EY.spatial_smooth s _ (EY.graph_mem s hs)).contMDiffAt |
| 114 | (EY.domain_open.mem_nhds (EY.graph_mem s hs))).mdifferentiableAt (by simp) |
| 115 | have hZ := ((EZ.spatial_smooth s _ (EZ.graph_mem s hs)).contMDiffAt |
| 116 | (EZ.domain_open.mem_nhds (EZ.graph_mem s hs))).mdifferentiableAt (by simp) |
| 117 | have hD := rawHorizontalCovariantDerivative_isCovariantDerivative G.leafwise |
| 118 | have hadd := hD.add hY ((mdifferentiableAt_const (c := c)).smul_section hZ) |
| 119 | have hsmul := hD.smul_const c hZ |
| 120 | change rawHorizontalCovariantDerivative G.leafwise (EY.extension s + c • EZ.extension s) |
| 121 | (γ s) = rawHorizontalCovariantDerivative G.leafwise (EY.extension s) (γ s) + |
| 122 | rawHorizontalCovariantDerivative G.leafwise (c • EZ.extension s) (γ s) at hadd |
| 123 | rw [hsmul] at hadd |
| 124 | change deriv (fun r => EY.extension r (γ s) + c • EZ.extension r (γ s)) s + |
| 125 | rawHorizontalCovariantDerivative G.leafwise (EY.extension s + c • EZ.extension s) (γ s) |
| 126 | (mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) γ J s (1 : ℝ)) = _ |
| 127 | rw [hd, hadd] |
| 128 | simp only [M14HorizontalCovariantDerivative, add_apply, smul_apply, smul_add] |
| 129 | abel |
| 130 | |
| 131 | /-- Any supplied extension of the actual affine field has the affine |
| 132 | derivative, wherever within derivatives are unique, Proposition 6.13, |
| 133 | pp. 110-112. -/ |
| 134 | theorem horizontalCovariantDerivative_affine_congr |
| 135 | (EY : M14PullbackExtension G γ J Y) (EZ : M14PullbackExtension G γ J Z) |
| 136 | (EH : M14PullbackExtension G γ J H) (c : ℝ) |
| 137 | (hH : ∀ s ∈ J, H s = Y s + c • Z s) {s : ℝ} (hs : s ∈ J) |
| 138 | (hJ : UniqueDiffWithinAt ℝ J s) |
| 139 | (hγ : MDifferentiableWithinAt (𝓘(ℝ, ℝ)) (spacetimeModel n) γ J s) : |
| 140 | M14HorizontalCovariantDerivative G γ J H EH s = |
| 141 | M14HorizontalCovariantDerivative G γ J Y EY s + |
| 142 | c • M14HorizontalCovariantDerivative G γ J Z EZ s := by |
| 143 | let EA := pullbackExtensionCongrOn EH (fun _ _ => rfl) (fun r hr => heq_of_eq (hH r hr)) |
| 144 | have h := eq_of_heq |
| 145 | (horizontalCovariantDerivative_congrOn EH (fun _ _ => rfl) |
| 146 | (fun r hr => heq_of_eq (hH r hr)) hs) |
| 147 | exact h.trans ((horizontalCovariantDerivative_extension_independent EA |
| 148 | (affinePullbackExtension EY EZ c) hs hJ hγ).trans |
| 149 | (horizontalCovariantDerivative_affine EY EZ c hs)) |
| 150 | |
| 151 | end PoincareMT.M14 |