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.Calculus.Differential.RectanglePartialTangent |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.OpenFieldExtension |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareRootVelocityExtension |
| 4 | |
| 5 | /-! |
| 6 | # Actual derivative extensions for a square-root variation |
| 7 | |
| 8 | Morgan-Tian Lemma 6.4 and Proposition 6.33, pp. 107-108, 121-122. |
| 9 | The actual partial tangent field is smooth on the supplied closed-by-open |
| 10 | rectangle. Horizontal projection and the closed/open extension theorems |
| 11 | give all three frozen variation extension records. The variation identities |
| 12 | are separate obligations. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle |
| 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 | {R : M14SquareRootPath G p} |
| 27 | |
| 28 | private theorem parameterDomain_isOpen (V : M14LVariationData G p R) : |
| 29 | IsOpen V.parameterDomain := by |
| 30 | rw [V.parameterDomain_eq] |
| 31 | exact isOpen_Ioo |
| 32 | |
| 33 | private theorem zero_mem_parameterDomain (V : M14LVariationData G p R) : |
| 34 | (0 : ℝ) ∈ V.parameterDomain := by |
| 35 | rw [V.parameterDomain_eq] |
| 36 | exact ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩ |
| 37 | |
| 38 | /-- The actual horizontal endpoint variation field is smooth on the |
| 39 | closed-by-open square rectangle, Lemma 6.4, pp. 107-108. -/ |
| 40 | theorem variation_endpoint_field_smooth (V : M14LVariationData G p R) : |
| 41 | ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) |
| 42 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 43 | (fun z : ℝ × ℝ => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 44 | (E := G.Horizontal) (V.squareFamily z.1 z.2) |
| 45 | (M14EndpointVariationField V z.1 z.2)) |
| 46 | (M14SqrtParameterInterval τ₁ τ₂ ×ˢ V.parameterDomain) := by |
| 47 | have hI : UniqueDiffOn ℝ (M14SqrtParameterInterval τ₁ τ₂) := |
| 48 | uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt) |
| 49 | have hrect := V.square_smooth.mono V.square_contains |
| 50 | have htan := hrect.contMDiffOn_partialTangent_snd_prod hI (parameterDomain_isOpen V) (1 : ℝ) |
| 51 | (k := ∞) (by simp) |
| 52 | have hproj : ContMDiff (spacetimeModel n).tangent |
| 53 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 54 | (fun v : TangentBundle (spacetimeModel n) G.Point => |
| 55 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 56 | (E := G.Horizontal) v.proj |
| 57 | (G.spacetime.horizontalProjection v.proj v.2)) := |
| 58 | G.spacetime.horizontalProjection_smooth |
| 59 | exact hproj.comp_contMDiffOn htan |
| 60 | |
| 61 | /-- The frozen variation field is smooth on the full closed square-root |
| 62 | interval, including endpoints, Lemma 6.4, pp. 107-108. -/ |
| 63 | theorem variation_field_smooth (V : M14LVariationData G p R) : |
| 64 | ContMDiffOn (𝓘(ℝ, ℝ)) |
| 65 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 66 | (fun s => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 67 | (E := G.Horizontal) (R.curve s) (M14VariationField V s)) |
| 68 | (M14SqrtParameterInterval τ₁ τ₂) := by |
| 69 | have hv := (variation_endpoint_field_smooth V).comp |
| 70 | (contMDiff_id.prodMk (contMDiff_const (c := (0 : ℝ)))).contMDiffOn |
| 71 | (fun _ hs => ⟨hs, zero_mem_parameterDomain V⟩) |
| 72 | apply hv.congr |
| 73 | intro s _ |
| 74 | apply Bundle.TotalSpace.ext (V.square_base s).symm |
| 75 | simp only [M14VariationField, M14EndpointVariationField, Function.comp_apply, id_eq] |
| 76 | have htransport {q r : G.Point} (h : q = r) (v : G.Horizontal q) : |
| 77 | HEq (h.symm ▸ v : G.Horizontal r) v := by |
| 78 | cases h |
| 79 | rfl |
| 80 | exact htransport (V.square_base s) _ |
| 81 | |
| 82 | /-- The actual variation field has a closed-interval horizontal extension, |
| 83 | the derivative-data step of Lemma 6.4, pp. 107-108. -/ |
| 84 | theorem exists_variation_field_extension (V : M14LVariationData G p R) : |
| 85 | Nonempty (M14PullbackExtension G R.curve |
| 86 | (M14SqrtParameterInterval τ₁ τ₂) (M14VariationField V)) := |
| 87 | exists_pullbackExtension_Icc (Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt) |
| 88 | (variation_field_smooth V) |
| 89 | |
| 90 | /-- Each endpoint variation has its actual horizontal extension over the |
| 91 | whole open variation-parameter interval, Proposition 6.33, pp. 121-122. -/ |
| 92 | theorem exists_endpoint_variation_extension (V : M14LVariationData G p R) |
| 93 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) : |
| 94 | Nonempty (M14PullbackExtension G (fun u => V.squareFamily s u) |
| 95 | V.parameterDomain (M14EndpointVariationField V s)) := by |
| 96 | apply exists_pullbackExtension_of_isOpen (parameterDomain_isOpen V) |
| 97 | exact (variation_endpoint_field_smooth V).comp |
| 98 | ((contMDiff_const (c := s)).prodMk contMDiff_id).contMDiffOn |
| 99 | (fun _ hu => ⟨hs, hu⟩) |
| 100 | |
| 101 | /-- All actual horizontal extension records required by the first and |
| 102 | second variation formulas exist, Lemma 6.4 and Proposition 6.33, |
| 103 | pp. 107-108, 121-122. -/ |
| 104 | theorem exists_variationDerivativeData (V : M14LVariationData G p R) : |
| 105 | Nonempty (M14VariationDerivativeData V) := by |
| 106 | classical |
| 107 | obtain ⟨Ebase⟩ := exists_squareRoot_velocity_extension R |
| 108 | obtain ⟨Evar⟩ := exists_variation_field_extension V |
| 109 | exact ⟨{ |
| 110 | base_extension := Ebase |
| 111 | variation_extension := Evar |
| 112 | endpoint_extension := fun _ hs => Classical.choice (exists_endpoint_variation_extension V hs) |
| 113 | }⟩ |
| 114 | |
| 115 | end PoincareMT.M14 |