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.Basic |
| 2 | |
| 3 | /-! |
| 4 | # Global parameter-dependent horizontal sections |
| 5 | |
| 6 | Morgan-Tian Lemmas 6.4 and 6.8, pp. 107-109. Global joint smoothness |
| 7 | supplies the common spatial domain and genuine fixed-fiber parameter |
| 8 | derivatives required by the frozen horizontal pullback extension record. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.M14 |
| 18 | |
| 19 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 20 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 21 | |
| 22 | /-- Joint smoothness at a point gives a genuine two-sided derivative in |
| 23 | its fixed horizontal fiber, as required in Lemma 6.4, p. 107. -/ |
| 24 | theorem horizontal_parameter_hasDerivAt_of_contMDiffAt |
| 25 | (V : ℝ → HorizontalSection G.spacetime) |
| 26 | (s : ℝ) (p : G.Point) |
| 27 | (hV : ContMDiffAt ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 28 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 29 | (fun z : ℝ × G.Point => Bundle.TotalSpace.mk' |
| 30 | (EuclideanSpace ℝ (Fin n)) (E := G.spacetime.Horizontal) z.2 (V z.1 z.2)) |
| 31 | (s, p)) : ∃ d : G.Horizontal p, |
| 32 | HasDerivAt (fun r => V r p) d s := by |
| 33 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := |
| 34 | ⟨G.spacetime.horizontalMetric.toRiemannianMetric⟩ |
| 35 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) G.Horizontal p |
| 36 | have hp : p ∈ e.baseSet := |
| 37 | mem_baseSet_trivializationAt (EuclideanSpace ℝ (Fin n)) G.Horizontal p |
| 38 | have hf := hV.comp s (contMDiffAt_id.prodMk (contMDiffAt_const (c := p))) |
| 39 | have hc := ((e.contMDiffOn.contMDiffAt |
| 40 | (e.open_source.mem_nhds (e.mem_source.mpr hp))).comp s hf).snd |
| 41 | let y : ℝ → EuclideanSpace ℝ (Fin n) := fun r => |
| 42 | (e (Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 43 | (E := G.spacetime.Horizontal) p (V r p))).2 |
| 44 | have hy : ContDiffAt ℝ ∞ y s := hc.contDiffAt |
| 45 | have heq : (fun r => V r p) = (e.symmL ℝ p) ∘ y := by |
| 46 | funext r |
| 47 | simp only [Function.comp_apply, e.symmL_apply hp, y] |
| 48 | exact (e.symm_apply_apply_mk hp (V r p)).symm |
| 49 | rw [heq] |
| 50 | exact ⟨_, (e.symmL ℝ p).hasFDerivAt.comp_hasDerivAt s |
| 51 | (hy.differentiableAt (by simp)).hasDerivAt⟩ |
| 52 | |
| 53 | /-- Global joint smoothness gives a genuine two-sided derivative in each |
| 54 | fixed horizontal fiber, as required in Lemma 6.4, p. 107. -/ |
| 55 | theorem horizontal_parameter_hasDerivAt |
| 56 | (V : ℝ → HorizontalSection G.spacetime) |
| 57 | (hV : ContMDiff ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 58 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 59 | (fun z : ℝ × G.Point => Bundle.TotalSpace.mk' |
| 60 | (EuclideanSpace ℝ (Fin n)) (E := G.spacetime.Horizontal) z.2 (V z.1 z.2))) |
| 61 | (s : ℝ) (p : G.Point) : ∃ d : G.Horizontal p, |
| 62 | HasDerivAt (fun r => V r p) d s := |
| 63 | horizontal_parameter_hasDerivAt_of_contMDiffAt V s p (hV (s, p)) |
| 64 | |
| 65 | /-- A globally smooth horizontal section on parameter times spacetime |
| 66 | gives an extension with common spatial domain univ, Lemmas 6.4 and 6.8, |
| 67 | pp. 107-109. -/ |
| 68 | noncomputable def pullbackExtensionOfGlobalSmooth |
| 69 | {γ : ℝ → G.Point} {J : Set ℝ} {Y : ∀ s, G.Horizontal (γ s)} |
| 70 | (V : ℝ → HorizontalSection G.spacetime) |
| 71 | (hV : ContMDiff ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 72 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 73 | (fun z : ℝ × G.Point => Bundle.TotalSpace.mk' |
| 74 | (EuclideanSpace ℝ (Fin n)) (E := G.spacetime.Horizontal) z.2 (V z.1 z.2))) |
| 75 | (hY : ∀ s ∈ J, V s (γ s) = Y s) : M14PullbackExtension G γ J Y where |
| 76 | extension := V |
| 77 | domain := Set.univ |
| 78 | domain_open := isOpen_univ |
| 79 | graph_mem := fun _ _ => Set.mem_univ _ |
| 80 | spatial_smooth r := |
| 81 | (hV.comp ((contMDiff_const (c := r)).prodMk contMDiff_id)).contMDiffOn |
| 82 | joint_smooth := ⟨Set.univ, isOpen_univ, fun _ _ => Set.mem_univ _, hV.contMDiffOn⟩ |
| 83 | agrees := hY |
| 84 | parameter_derivative s _ := horizontal_parameter_hasDerivAt V hV s (γ s) |
| 85 | |
| 86 | end PoincareMT.M14 |