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.Paths.SquareRoot.Action.SquareCurve |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Differential.RectanglePartialTangent |
| 3 | |
| 4 | /-! |
| 5 | # Smooth square densities of closed-time families |
| 6 | |
| 7 | Morgan-Tian equation (6.2) and Lemma 6.22, pp. 106, 115-116. |
| 8 | The actual within time tangent and its horizontal projection are |
| 9 | jointly smooth through closed endpoints. Applying the metric and |
| 10 | scalar curvature gives the actual jointly smooth action density. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | -- Product self-models and their charted-space instances are transported together. |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle |
| 19 | |
| 20 | universe u v |
| 21 | |
| 22 | namespace PoincareMT.M14 |
| 23 | |
| 24 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 25 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 26 | {E : Type v} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 27 | {C : Set ℝ} {U : Set E} {γ : ℝ × E → G.Point} |
| 28 | |
| 29 | /-- The projected actual within time velocity of a smooth family is |
| 30 | jointly smooth on a closed-by-open rectangle, the velocity regularity |
| 31 | used in Lemma 6.22, pp. 115-116. -/ |
| 32 | theorem squareFamilyVelocity_contMDiffOn (hC : UniqueDiffOn ℝ C) (hU : IsOpen U) |
| 33 | (hγ : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, E))) (spacetimeModel n) ∞ γ (C ×ˢ U)) : |
| 34 | ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, E))) |
| 35 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 36 | (fun z : ℝ × E => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 37 | (E := G.Horizontal) (γ z) |
| 38 | (projectedCurveVelocityWithin G (fun r => γ (r, z.2)) C z.1)) (C ×ˢ U) := by |
| 39 | have htan := hγ.contMDiffOn_partialTangentWithin_fst_prod |
| 40 | hC hU.uniqueDiffOn (1 : ℝ) (k := ∞) (by simp) |
| 41 | have hproj : ContMDiff (spacetimeModel n).tangent |
| 42 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 43 | (fun v : TangentBundle (spacetimeModel n) G.Point => |
| 44 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 45 | (E := G.Horizontal) v.proj (G.spacetime.horizontalProjection v.proj v.2)) := |
| 46 | G.spacetime.horizontalProjection_smooth |
| 47 | exact hproj.comp_contMDiffOn htan |
| 48 | |
| 49 | set_option maxHeartbeats 1000000 in |
| 50 | -- Smooth metric application elaborates two dependent actual velocity fields. |
| 51 | /-- The actual square density of a jointly smooth closed-time family |
| 52 | is jointly smooth, including its closed time endpoints, equation |
| 53 | (6.2) and Lemma 6.22, pp. 106, 115-116. -/ |
| 54 | theorem squareFamilyDensity_contDiffOn (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 55 | (hC : UniqueDiffOn ℝ C) (hU : IsOpen U) |
| 56 | (hγ : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, E))) (spacetimeModel n) ∞ γ (C ×ˢ U)) : |
| 57 | ContDiffOn ℝ ∞ (fun z : ℝ × E => |
| 58 | squareCurveDensity G (fun r => γ (r, z.2)) C z.1) (C ×ˢ U) := by |
| 59 | have hα : ContMDiffOn (𝓘(ℝ, ℝ × E)) (spacetimeModel n) ∞ γ (C ×ˢ U) := by |
| 60 | rw [modelWithCornersSelf_prod, ← chartedSpaceSelf_prod] |
| 61 | exact hγ |
| 62 | have hA : ContMDiffOn (𝓘(ℝ, ℝ × E)) |
| 63 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 64 | (fun z : ℝ × E => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 65 | (E := G.Horizontal) (γ z) |
| 66 | (projectedCurveVelocityWithin G (fun r => γ (r, z.2)) C z.1)) (C ×ˢ U) := by |
| 67 | rw [modelWithCornersSelf_prod, ← chartedSpaceSelf_prod] |
| 68 | exact squareFamilyVelocity_contMDiffOn hC hU hγ |
| 69 | have hmetric := G.spacetime.horizontalMetric.contMDiff.comp_contMDiffOn hα |
| 70 | have hpair := hmetric.clm_bundle_apply₂ (F₃ := ℝ) (E₃ := Bundle.Trivial G.Point ℝ) hA hA |
| 71 | have hg : ContMDiffOn (𝓘(ℝ, ℝ × E)) (𝓘(ℝ, ℝ)) ∞ |
| 72 | (fun z => G.spacetime.horizontalMetric.inner (γ z) |
| 73 | (projectedCurveVelocityWithin G (fun r => γ (r, z.2)) C z.1) |
| 74 | (projectedCurveVelocityWithin G (fun r => γ (r, z.2)) C z.1)) (C ×ˢ U) := by |
| 75 | intro z hz |
| 76 | simpa only [Bundle.Trivial.fiberBundle_trivializationAt', Bundle.Trivial.trivialization_apply] |
| 77 | using (Bundle.contMDiffWithinAt_totalSpace.mp (hpair z hz)).2 |
| 78 | have H := (hM12.leafwise_calculus X time I G.spacetime G.slices |
| 79 | G.timeIntervals G.gaugeCover).2 G.leafwise |
| 80 | have hscalar := (H.scalar_smooth.comp_contMDiffOn hα).contDiffOn |
| 81 | exact ((contDiffOn_const.mul (contDiffOn_fst.pow 2)).mul hscalar).add |
| 82 | (contDiffOn_const.mul hg.contDiffOn) |
| 83 | |
| 84 | end PoincareMT.M14 |