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.LocalTestField |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Euler.EulerResidual |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.IndexForm.IndexPositivity |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Local.IntervalTestFunctions |
| 5 | |
| 6 | /-! |
| 7 | # Interior Euler equation for a smooth minimizing square path |
| 8 | |
| 9 | Morgan-Tian Lemma 6.4 and Definition 6.7, pp. 107-108. Actual supported |
| 10 | gauge variations and scalar test functions force the frozen paired Euler |
| 11 | residual to vanish against every horizontal vector in the interior. |
| 12 | The argument assumes the supplied smooth square-root representative; |
| 13 | regularity of a general minimizing path is a separate step. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | -- The compared variation fields have the same actual horizontal base fiber. |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set Filter MeasureTheory |
| 21 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.M14 |
| 26 | |
| 27 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 28 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 29 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 30 | {R : M14SquareRootPath G p} |
| 31 | |
| 32 | /-- A minimizing path annihilates the continuous residual representative |
| 33 | of each supported gauge test field, the fundamental-lemma step after |
| 34 | Lemma 6.4, pp. 107-108. -/ |
| 35 | theorem variationEulerDensity_supportedGauge_eq_zero |
| 36 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 37 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (hmin : M14IsMinimizing p) |
| 38 | (b : G.gaugeCover.index) |
| 39 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 40 | G.gaugeCover.spatial b) (η : ℝ → EuclideanSpace ℝ (Fin n)) |
| 41 | {U : Set G.Point} (hU : IsOpen U) |
| 42 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 43 | (hright : ∀ q ∈ U, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) |
| 44 | (hη : ContDiff ℝ ∞ η) |
| 45 | (hsupport : tsupport η ⊆ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) |
| 46 | (hsrc : ∀ s ∈ tsupport η, R.curve s ∈ U) (V : M14LVariationData G p R) |
| 47 | (hV : ∀ s v, V.squareFamily s v = supportedGaugeFamily R b lift η (s, v)) : |
| 48 | ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, variationEulerDensity V s = 0 := by |
| 49 | have hab := Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt |
| 50 | have hcont := (variationEulerDensity_contDiffOn hM12 V).continuousOn |
| 51 | apply hcont.eq_zero_of_intervalIntegral_contDiff_smul hab |
| 52 | intro ψ hψ _ _ |
| 53 | let ξ := fun s => ψ s • η s |
| 54 | have hξ : ContDiff ℝ ∞ ξ := hψ.smul hη |
| 55 | have hξη : tsupport ξ ⊆ tsupport η := tsupport_smul_subset_right ψ η |
| 56 | obtain ⟨Vξ, hfixξ, hVξ⟩ := exists_supportedGauge_variation R b lift ξ hM12 hU hlift |
| 57 | hright hξ (hξη.trans hsupport) (fun s hs => hsrc s (hξη hs)) |
| 58 | obtain ⟨Dξ⟩ := exists_variationDerivativeData Vξ |
| 59 | have hfield (s : ℝ) (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) : |
| 60 | M14VariationField Vξ s = ψ s • M14VariationField V s := by |
| 61 | apply Subtype.ext |
| 62 | have hξval := variationField_supportedGauge_val R b lift ξ Vξ hVξ |
| 63 | (fun t ht => hright _ (hsrc t (hξη ht))) hs |
| 64 | have hηval := variationField_supportedGauge_val R b lift η V hV |
| 65 | (fun t ht => hright _ (hsrc t ht)) hs |
| 66 | have hlinear := congrArg Subtype.val (((G.gaugeCover.metric b).spatialTangentEquiv |
| 67 | (lift (R.curve s)).1 (lift (R.curve s)).2).map_smul (ψ s) (η s)) |
| 68 | exact hξval.trans (hlinear.trans |
| 69 | (congrArg (fun w : SpacetimeModelVector n => ψ s • w) hηval.symm)) |
| 70 | have hz := firstVariationResidualIntegral_eq_zero hCoordinates hM12 Vξ Dξ hmin hfixξ |
| 71 | change (∫ s in Real.sqrt τ₁..Real.sqrt τ₂, |
| 72 | -M14SquareRootEulerResidual G R Dξ.base_extension s (M14VariationField Vξ s)) = 0 at hz |
| 73 | rw [intervalIntegral.integral_neg, neg_eq_zero] at hz |
| 74 | rw [← hz] |
| 75 | apply intervalIntegral.integral_congr_Ioo_of_le hab.le |
| 76 | intro s hs |
| 77 | change ψ s • variationEulerDensity V s = |
| 78 | M14SquareRootEulerResidual G R Dξ.base_extension s (M14VariationField Vξ s) |
| 79 | rw [variationEulerDensity_eq_residual hCoordinates hM12 V Dξ.base_extension hs, |
| 80 | hfield s (Ioo_subset_Icc_self hs), squareRootEulerResidual_smul hM12, smul_eq_mul] |
| 81 | |
| 82 | /-- A supplied smooth square-root representative of a minimizing path |
| 83 | satisfies the actual paired Euler equation at every interior time, |
| 84 | Definition 6.7, p. 108. -/ |
| 85 | theorem squareRootEulerResidual_eq_zero_of_minimizing_interior |
| 86 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 87 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (hmin : M14IsMinimizing p) |
| 88 | (E : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 89 | R.horizontal_velocity) {s : ℝ} |
| 90 | (hs : s ∈ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) (W : G.Horizontal (R.curve s)) : |
| 91 | M14SquareRootEulerResidual G R E s W = 0 := by |
| 92 | obtain ⟨b, U, lift, hU, hlift, hright, η, hη, hsupport, hsrc, hvalue⟩ := |
| 93 | exists_supportedGaugeTest_at R hs W |
| 94 | obtain ⟨V, _, hV⟩ := exists_supportedGauge_variation R b lift η hM12 hU hlift hright hη |
| 95 | hsupport hsrc |
| 96 | have hz := variationEulerDensity_supportedGauge_eq_zero hCoordinates hM12 hmin b lift η |
| 97 | hU hlift hright hη hsupport hsrc V hV s (Ioo_subset_Icc_self hs) |
| 98 | rw [variationEulerDensity_eq_residual hCoordinates hM12 V E hs] at hz |
| 99 | have hfield : M14VariationField V s = W := Subtype.ext |
| 100 | ((variationField_supportedGauge_val R b lift η V hV |
| 101 | (fun t ht => hright _ (hsrc t ht)) (Ioo_subset_Icc_self hs)).trans hvalue) |
| 102 | rwa [hfield] at hz |
| 103 | |
| 104 | end PoincareMT.M14 |