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.SupportedBackwardGaugeFamily |
| 2 | |
| 3 | /-! |
| 4 | # Smooth supported gauge surfaces in original time |
| 5 | |
| 6 | Morgan-Tian Lemma 6.4, pp. 107-108. Once the actual path is smooth |
| 7 | on its original strict interval, the supported affine perturbation is |
| 8 | jointly smooth there. Its actual parameter tangent is the prescribed |
| 9 | cylinder spatial tangent applied to the test field. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- The cylinder's product and actual spatial tangent models retain their frozen instances. |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | {T τ₁ τ₂ : ℝ} {x y : G.Point} (p : M14BackwardPath G T τ₁ τ₂ x y) |
| 26 | (b : G.gaugeCover.index) |
| 27 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 28 | G.gaugeCover.spatial b) (η : ℝ → EuclideanSpace ℝ (Fin n)) |
| 29 | |
| 30 | /-- The unpatched gauge family is jointly smooth at an admissible |
| 31 | interior point of a smooth path, Lemma 6.4, pp. 107-108. -/ |
| 32 | theorem backwardGaugeFamily_joint_contMDiffAt |
| 33 | (hp : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ p.curve (Ioo τ₁ τ₂)) |
| 34 | {U : Set G.Point} (hU : IsOpen U) |
| 35 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 36 | (hη : ContDiff ℝ ∞ η) {z : ℝ × ℝ} (ht : z.1 ∈ Ioo τ₁ τ₂) |
| 37 | (hsrc : p.curve z.1 ∈ U) |
| 38 | (hshift : (lift (p.curve z.1)).2.val + z.2 • η z.1 ∈ G.gaugeCover.spatial b) : |
| 39 | ContMDiffAt ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ |
| 40 | (fun w : ℝ × ℝ => backwardGaugeFamily p b lift η w.2 w.1) z := by |
| 41 | have hbase : ContMDiffAt ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ |
| 42 | (fun w : ℝ × ℝ => p.curve w.1) z := |
| 43 | ((hp _ ht).contMDiffAt (isOpen_Ioo.mem_nhds ht)).comp z contMDiffAt_fst |
| 44 | have hL := ((hlift _ hsrc).contMDiffAt (hU.mem_nhds hsrc)).comp z hbase |
| 45 | have hv : ContMDiffAt ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (𝓡 n) ∞ |
| 46 | (fun w : ℝ × ℝ => w.2 • η w.1) z := |
| 47 | contMDiffAt_snd.smul (hη.contMDiff.contMDiffAt.comp z contMDiffAt_fst) |
| 48 | have hS := (((G.gaugeCover.spatial b).affineShift_contMDiffOn _ hshift).contMDiffAt |
| 49 | ((G.gaugeCover.spatial b).affineShift_domain_isOpen.mem_nhds hshift)).comp z |
| 50 | (hL.snd.prodMk hv) |
| 51 | exact (G.gaugeCover.cylinder b).smooth.contMDiffAt.comp z (hL.fst.prodMk hS) |
| 52 | |
| 53 | /-- The supported family is jointly smooth on the original open |
| 54 | parameter rectangle, including the test-support edges, Lemma 6.4, |
| 55 | pp. 107-108. -/ |
| 56 | theorem supportedBackwardGaugeFamily_joint_contMDiffOn |
| 57 | (hp : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ p.curve (Ioo τ₁ τ₂)) |
| 58 | {U : Set G.Point} (hU : IsOpen U) |
| 59 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 60 | (hright : ∀ q ∈ U, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) |
| 61 | (hη : ContDiff ℝ ∞ η) (hsrc : ∀ t ∈ tsupport η, p.curve t ∈ U) {P : Set ℝ} |
| 62 | (hshift : ∀ t ∈ tsupport η, ∀ v ∈ P, |
| 63 | (lift (p.curve t)).2.val + v • η t ∈ G.gaugeCover.spatial b) : |
| 64 | ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ |
| 65 | (fun z : ℝ × ℝ => supportedBackwardGaugeFamily p b lift η z.2 z.1) (Ioo τ₁ τ₂ ×ˢ P) := by |
| 66 | have hbase : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ |
| 67 | (fun z : ℝ × ℝ => p.curve z.1) (Ioo τ₁ τ₂ ×ˢ P) := |
| 68 | hp.comp contMDiffOn_fst (fun _ hz => hz.1) |
| 69 | intro z hz |
| 70 | by_cases hs : z.1 ∈ tsupport η |
| 71 | · have hpathSmooth : ContMDiffAt ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ |
| 72 | (fun w : ℝ × ℝ => p.curve w.1) z := |
| 73 | ((hp _ hz.1).contMDiffAt (isOpen_Ioo.mem_nhds hz.1)).comp z contMDiffAt_fst |
| 74 | have hpath := hpathSmooth.continuousAt |
| 75 | have heq : (fun w : ℝ × ℝ => supportedBackwardGaugeFamily p b lift η w.2 w.1) =ᶠ[𝓝 z] |
| 76 | (fun w : ℝ × ℝ => backwardGaugeFamily p b lift η w.2 w.1) := by |
| 77 | filter_upwards [hpath.preimage_mem_nhds (hU.mem_nhds (hsrc _ hs))] with w hw |
| 78 | exact supportedBackwardGaugeFamily_eq_gauge p b lift η (hright _ hw) w.2 |
| 79 | exact ((backwardGaugeFamily_joint_contMDiffAt p b lift η hp hU hlift hη hz.1 |
| 80 | (hsrc _ hs) (hshift _ hs _ hz.2)).congr_of_eventuallyEq heq).contMDiffWithinAt |
| 81 | · have heq : (fun w : ℝ × ℝ => supportedBackwardGaugeFamily p b lift η w.2 w.1) =ᶠ[𝓝 z] |
| 82 | (fun w => p.curve w.1) := by |
| 83 | filter_upwards [((isClosed_tsupport η).isOpen_compl.preimage continuous_fst).mem_nhds hs] |
| 84 | with w hw |
| 85 | exact supportedBackwardGaugeFamily_eq_of_not_tsupport p b lift η hw w.2 |
| 86 | exact (hbase z hz).congr_of_eventuallyEq |
| 87 | (heq.filter_mono nhdsWithin_le_nhds) heq.eq_of_nhds |
| 88 | |
| 89 | /-- The actual parameter tangent of the unpatched gauge family is |
| 90 | the cylinder's spatial tangent applied to the test field, Lemma 6.4, |
| 91 | pp. 107-108. -/ |
| 92 | theorem backwardGaugeFamily_parameter_mfderiv (s : ℝ) : |
| 93 | mfderiv (𝓘(ℝ, ℝ)) (spacetimeModel n) (fun v => backwardGaugeFamily p b lift η v s) 0 1 = |
| 94 | ((G.gaugeCover.metric b).spatialTangentEquiv |
| 95 | (lift (p.curve s)).1 (lift (p.curve s)).2 (η s)).val := by |
| 96 | let c := (lift (p.curve s)).2 |
| 97 | let t := (lift (p.curve s)).1 |
| 98 | let f := fun q : G.gaugeCover.spatial b => (G.gaugeCover.cylinder b).toSpacetime (t, q) |
| 99 | have hf : ContMDiff (𝓡 n) (spacetimeModel n) ∞ f := |
| 100 | (G.gaugeCover.cylinder b).smooth.comp (contMDiff_const.prodMk contMDiff_id) |
| 101 | have hshift := (G.gaugeCover.spatial b).affineShift_parameter_contMDiffAt c (η s) |
| 102 | have hd := mfderiv_comp_apply_of_eq (x := (0 : ℝ)) |
| 103 | (hf.mdifferentiable (by simp) c) (hshift.mdifferentiableAt (by simp)) |
| 104 | (show (G.gaugeCover.spatial b).affineShift c ((0 : ℝ) • η s) = c by |
| 105 | rw [zero_smul, TopologicalSpace.Opens.affineShift_zero]) (1 : ℝ) |
| 106 | rw [TopologicalSpace.Opens.affineShift_parameter_mfderiv] at hd |
| 107 | simpa only [f, c, t, Function.comp_def, backwardGaugeFamily, zero_smul, |
| 108 | TopologicalSpace.Opens.affineShift_zero, (G.gaugeCover.metric b).spatialTangentEquiv_eq] |
| 109 | using hd |
| 110 | |
| 111 | /-- Patching outside the test support preserves the actual parameter |
| 112 | tangent formula at every original parameter, Lemma 6.4, pp. 107-108. -/ |
| 113 | theorem supportedBackwardGaugeFamily_parameter_mfderiv |
| 114 | (hright : ∀ s ∈ tsupport η, |
| 115 | (G.gaugeCover.cylinder b).toSpacetime (lift (p.curve s)) = p.curve s) (s : ℝ) : |
| 116 | mfderiv (𝓘(ℝ, ℝ)) (spacetimeModel n) |
| 117 | (fun v => supportedBackwardGaugeFamily p b lift η v s) 0 1 = |
| 118 | ((G.gaugeCover.metric b).spatialTangentEquiv |
| 119 | (lift (p.curve s)).1 (lift (p.curve s)).2 (η s)).val := by |
| 120 | by_cases hs : s ∈ tsupport η |
| 121 | · have heq : (fun v => supportedBackwardGaugeFamily p b lift η v s) = |
| 122 | (fun v => backwardGaugeFamily p b lift η v s) := |
| 123 | funext (fun v => supportedBackwardGaugeFamily_eq_gauge p b lift η (hright s hs) v) |
| 124 | rw [heq] |
| 125 | exact backwardGaugeFamily_parameter_mfderiv p b lift η s |
| 126 | · have heq : (fun v => supportedBackwardGaugeFamily p b lift η v s) = |
| 127 | (fun _ : ℝ => p.curve s) := |
| 128 | funext (fun v => supportedBackwardGaugeFamily_eq_of_not_tsupport p b lift η hs v) |
| 129 | rw [heq, image_eq_zero_of_notMem_tsupport hs, map_zero] |
| 130 | simp only [mfderiv_const, zero_apply, Submodule.coe_zero] |
| 131 | |
| 132 | end PoincareMT.M14 |