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.Coordinates.GaugeEndpointFamily |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.LocalTestField |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.IndexForm.FixedEndpointBoundary |
| 4 | |
| 5 | /-! |
| 6 | # Actual fields of independently moving endpoints |
| 7 | |
| 8 | Morgan-Tian Lemma 6.22 and Proposition 6.30, pp. 115-116, 118-119. |
| 9 | An actual endpoint germ in one gauge identifies the frozen variation |
| 10 | field with its prescribed spatial direction. The independent endpoint |
| 11 | family therefore removes the initial-vector component of that field. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | -- Transported horizontal vectors retain their common underlying tangent model. |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M14 |
| 24 | |
| 25 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 26 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 27 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 28 | {R : M14SquareRootPath G p} |
| 29 | |
| 30 | private theorem horizontal_transport_val {q r : G.Point} (h : q = r) |
| 31 | (v : G.Horizontal q) : (h.symm ▸ v : G.Horizontal r).val = v.val := by |
| 32 | cases h |
| 33 | rfl |
| 34 | |
| 35 | /-- An actual affine spatial endpoint germ gives the frozen |
| 36 | variation field through the genuine gauge tangent map, |
| 37 | Lemma 6.22, pp. 115-116. -/ |
| 38 | theorem variationField_gauge_germ (V : M14LVariationData G p R) {s : ℝ} |
| 39 | (hs : s ∈ M14SqrtParameterInterval a b) (j : G.gaugeCover.index) |
| 40 | (t : (G.timeIntervals.interval (G.gaugeCover.interval j)).Point) |
| 41 | (q : G.gaugeCover.spatial j) (w : EuclideanSpace ℝ (Fin n)) |
| 42 | (h : (fun u => V.squareFamily s u) =ᶠ[𝓝 0] fun u => |
| 43 | (G.gaugeCover.cylinder j).toSpacetime (t, (G.gaugeCover.spatial j).affineShift q (u • w))) : |
| 44 | (M14VariationField V s).val = ((G.gaugeCover.metric j).spatialTangentEquiv t q w).val := by |
| 45 | have h0 : (0 : ℝ) ∈ V.parameterDomain := by |
| 46 | rw [V.parameterDomain_eq] |
| 47 | exact ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 48 | have hv := (horizontal_transport_val (V.square_base s) (M14EndpointVariationField V s 0)).trans |
| 49 | (endpointVariationField_val_eq_tangent V hs h0) |
| 50 | rw [h.mfderiv_eq (I := 𝓘(ℝ, ℝ)) (I' := spacetimeModel n)] at hv |
| 51 | exact hv.trans (gaugeShiftFamily_parameter_mfderiv R j (fun _ => (t, q)) (fun _ => w) s) |
| 52 | |
| 53 | namespace GaugeEndpointFamily |
| 54 | |
| 55 | variable {f : ℝ × ℝ → G.Point} {U : Set ℝ} {B c : ℝ} |
| 56 | {j : G.gaugeCover.index} |
| 57 | {lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval j)).Point × |
| 58 | G.gaugeCover.spatial j} |
| 59 | (D : GaugeEndpointFamily f U T 0 B c 0 j lift) |
| 60 | |
| 61 | /-- Only the independent spatial component of a parameter line |
| 62 | moves the marked endpoint. The resulting actual field is the gauge |
| 63 | tangent of that component, Proposition 6.30, pp. 118-119. -/ |
| 64 | theorem variationField_line_marked (V : M14LVariationData G p R) |
| 65 | (hc : c ∈ M14SqrtParameterInterval a b) |
| 66 | (z d : ℝ × EuclideanSpace ℝ (Fin n)) (hz : z ∈ D.parameters) |
| 67 | (hparam : ∀ u ∈ V.parameterDomain, z + u • d ∈ D.parameters) |
| 68 | (hV : ∀ u, V.squareFamily c u = D.family (c, z + u • d)) : |
| 69 | ∃ hy : z.2 ∈ G.gaugeCover.spatial j, |
| 70 | (M14VariationField V c).val = ((G.gaugeCover.metric j).spatialTangentEquiv |
| 71 | (lift (f (c, 0))).1 ⟨z.2, hy⟩ d.2).val := by |
| 72 | obtain ⟨hy, _⟩ := D.marked z hz |
| 73 | refine ⟨hy, variationField_gauge_germ V hc j (lift (f (c, 0))).1 ⟨z.2, hy⟩ d.2 ?_⟩ |
| 74 | have h0 : (0 : ℝ) ∈ V.parameterDomain := by |
| 75 | rw [V.parameterDomain_eq] |
| 76 | exact ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 77 | have hP : IsOpen V.parameterDomain := V.parameterDomain_eq ▸ isOpen_Ioo |
| 78 | filter_upwards [hP.mem_nhds h0] with u hu |
| 79 | obtain ⟨hyu, hmark⟩ := D.marked _ (hparam u hu) |
| 80 | have hshift : (⟨(z + u • d).2, hyu⟩ : G.gaugeCover.spatial j) = |
| 81 | (G.gaugeCover.spatial j).affineShift ⟨z.2, hy⟩ (u • d.2) := |
| 82 | Subtype.ext ((G.gaugeCover.spatial j).affineShift_val |
| 83 | (x := ⟨z.2, hy⟩) (v := u • d.2) hyu).symm |
| 84 | exact (hV u).trans (hmark.trans |
| 85 | (congrArg (fun q => (G.gaugeCover.cylinder j).toSpacetime ((lift (f (c, 0))).1, q)) hshift)) |
| 86 | |
| 87 | /-- A fixed original initial endpoint gives zero initial field for |
| 88 | every realized endpoint-family parameter line, Lemma 6.22, pp. 115-116. -/ |
| 89 | theorem variationField_line_initial_zero (V : M14LVariationData G p R) |
| 90 | (z d : ℝ × EuclideanSpace ℝ (Fin n)) |
| 91 | (hparam : ∀ u ∈ V.parameterDomain, z + u • d ∈ D.parameters) |
| 92 | (hV : ∀ u, V.squareFamily 0 u = D.family (0, z + u • d)) |
| 93 | (hleft : ∀ r ∈ U, f (0, r) = x) : M14VariationField V 0 = 0 := by |
| 94 | have hfixed (u : ℝ) (hu : u ∈ V.parameterDomain) : V.squareFamily 0 u = x := |
| 95 | (hV u).trans ((D.initial _ (hparam u hu)).trans |
| 96 | (hleft _ (D.parameter_subset _ (hparam u hu)))) |
| 97 | have h0 : (0 : ℝ) ∈ V.parameterDomain := by |
| 98 | rw [V.parameterDomain_eq] |
| 99 | exact ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 100 | apply variationField_eq_zero_of_constant V |
| 101 | intro u hu |
| 102 | exact (hfixed u hu).trans (hfixed 0 h0).symm |
| 103 | |
| 104 | end GaugeEndpointFamily |
| 105 | |
| 106 | end PoincareMT.M14 |