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.Regularity.Formulas.RegularSpatialDerivative |
| 2 | |
| 3 | /-! |
| 4 | # Actual initial-vector variations on regular branches |
| 5 | |
| 6 | The field at every prefix time is the actual exponential differential. |
| 7 | Stable-set openness makes the branch action and normalized raw reduced |
| 8 | length equal as parameter germs. Morgan-Tian Lemma 6.22, pp. 115-116, |
| 9 | Proposition 6.28, p. 117, and Lemma 6.49, p. 131. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- The source self-model tangent retains the metric-normed horizontal fiber. |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 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 : G.Point} |
| 26 | |
| 27 | private theorem horizontal_t2Space : T2Space (G.Horizontal x) := |
| 28 | FiberBundle.t2Space (EuclideanSpace ℝ (Fin n)) G.Horizontal x |
| 29 | |
| 30 | attribute [local instance] horizontal_t2Space |
| 31 | |
| 32 | private theorem horizontal_transport_val {q r : G.Point} (h : q = r) |
| 33 | (v : G.Horizontal q) : (h.symm ▸ v : G.Horizontal r).val = v.val := by |
| 34 | cases h |
| 35 | rfl |
| 36 | |
| 37 | private theorem horizontal_heq_of_val_eq {q r : G.Point} (h : q = r) |
| 38 | {v : G.Horizontal q} {w : G.Horizontal r} (hv : v.val = w.val) : HEq v w := by |
| 39 | cases h |
| 40 | exact heq_of_eq (Subtype.ext hv) |
| 41 | |
| 42 | /-- Every prefix field of the affine initial-vector variation is the |
| 43 | actual exponential differential, Lemma 6.22, pp. 115-116. -/ |
| 44 | theorem initialVectorVariation_field_at (E : M14ExponentialFamily G T x) |
| 45 | (Z W : G.Horizontal x) {s r : ℝ} (hs : (Z, s) ∈ E.domain) (hpos : 0 < s) |
| 46 | (V : M14LVariationData G (E.path Z s hs hpos) (E.square_path Z s hs hpos)) |
| 47 | (hV : ∀ t ∈ M14SqrtParameterInterval 0 (s ^ 2), ∀ u, |
| 48 | V.squareFamily t u = E.gamma (Z + u • W) t) |
| 49 | (hr : r ∈ M14SqrtParameterInterval 0 (s ^ 2)) (hrsurv : (Z, r) ∈ E.domain) : |
| 50 | HEq (M14VariationField V r) (E.differential Z r hrsurv W) := by |
| 51 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 52 | let : NormedAddCommGroup (G.Horizontal x) := |
| 53 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 54 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 55 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 56 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 57 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := ⟨metric⟩ |
| 58 | have hzero : (0 : ℝ) ∈ V.parameterDomain := by |
| 59 | rw [V.parameterDomain_eq] |
| 60 | exact ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 61 | have hval : (M14VariationField V r).val = |
| 62 | mfderiv (𝓘(ℝ, ℝ)) (spacetimeModel n) (fun u => V.squareFamily r u) 0 (1 : ℝ) := by |
| 63 | exact (horizontal_transport_val (V.square_base r) (M14EndpointVariationField V r 0)).trans |
| 64 | (endpointVariationField_val_eq_tangent V hr hzero) |
| 65 | have hline : HasDerivAt (fun u : ℝ => Z + u • W) W 0 := by |
| 66 | simpa only [id_eq, one_smul] using ((hasDerivAt_id (0 : ℝ)).smul_const W).const_add Z |
| 67 | have hlineM : mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, G.Horizontal x)) |
| 68 | (fun u : ℝ => Z + u • W) 0 (1 : ℝ) = W := by |
| 69 | rw [mfderiv_eq_fderiv, hline.hasFDerivAt.fderiv] |
| 70 | change (1 : ℝ) • W = W |
| 71 | exact one_smul ℝ W |
| 72 | have hchain := mfderiv_comp_apply_of_eq (x := (0 : ℝ)) |
| 73 | ((exponentialFamily_gamma_slice_contMDiffAt E hrsurv).mdifferentiableAt (by simp)) |
| 74 | hline.differentiableAt.mdifferentiableAt (by simp only [zero_smul, add_zero]) (1 : ℝ) |
| 75 | rw [hlineM] at hchain |
| 76 | have heq : (fun u => V.squareFamily r u) = (fun u => E.gamma (Z + u • W) r) := |
| 77 | funext (hV r hr) |
| 78 | rw [heq] at hval |
| 79 | apply horizontal_heq_of_val_eq (exponential_square_curve_eq E Z hs hpos hr) |
| 80 | exact hval.trans (hchain.trans (E.differential_pointwise_mfderiv Z r hrsurv W).symm) |
| 81 | |
| 82 | /-- The affine initial-vector variation fixes the actual initial |
| 83 | endpoint, Lemma 6.22, pp. 115-116. -/ |
| 84 | theorem initialVectorVariation_initialFixed (E : M14ExponentialFamily G T x) |
| 85 | (Z W : G.Horizontal x) {s : ℝ} (hs : (Z, s) ∈ E.domain) (hpos : 0 < s) |
| 86 | (V : M14LVariationData G (E.path Z s hs hpos) (E.square_path Z s hs hpos)) |
| 87 | (hV : ∀ r ∈ M14SqrtParameterInterval 0 (s ^ 2), ∀ u, |
| 88 | V.squareFamily r u = E.gamma (Z + u • W) r) : V.left_endpoint_fixed := by |
| 89 | apply V.left_endpoint_fixed_spec.mpr |
| 90 | intro u hu |
| 91 | have hzero : (0 : ℝ) ∈ M14SqrtParameterInterval 0 (s ^ 2) := |
| 92 | ⟨by simp, Real.sqrt_nonneg _⟩ |
| 93 | have h := V.square_agrees 0 hzero u hu |
| 94 | simpa only [zero_pow (by decide : 2 ≠ 0), hV 0 hzero u, E.gamma_at_zero, |
| 95 | (E.path Z s hs hpos).curve_start] using h.symm |
| 96 | |
| 97 | /-- At a joint endpoint, nearby affine branches are minimizing, so |
| 98 | their action equals normalized raw reduced length as a germ, |
| 99 | Proposition 6.28 and Lemma 6.49, pp. 117, 131. -/ |
| 100 | theorem initialVectorVariation_action_germ (E : M14ExponentialFamily G T x) |
| 101 | (Z W : G.Horizontal x) {s : ℝ} (hs : (Z, s) ∈ E.domain) (hpos : 0 < s) |
| 102 | (hz : (Z, s) ∈ M14JointDomain G E) |
| 103 | (V : M14LVariationData G (E.path Z s hs hpos) (E.square_path Z s hs hpos)) |
| 104 | (hmem : ∀ u ∈ V.parameterDomain, (Z + u • W, s) ∈ E.domain) |
| 105 | (hV : ∀ r ∈ M14SqrtParameterInterval 0 (s ^ 2), ∀ u, |
| 106 | V.squareFamily r u = E.gamma (Z + u • W) r) : |
| 107 | M14VariationAction V =ᶠ[𝓝 0] |
| 108 | (fun u => (2 * s) * M14ReducedLengthAt G T 0 x (V.squareFamily s u)) := by |
| 109 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 110 | let : NormedAddCommGroup (G.Horizontal x) := |
| 111 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 112 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 113 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 114 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 115 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := ⟨metric⟩ |
| 116 | obtain ⟨H, hZH⟩ := jointDomain_stableSet E hz |
| 117 | have hline : ContinuousAt (fun u : ℝ => Z + u • W) 0 := by fun_prop |
| 118 | have hU : H.carrier ∈ 𝓝 (Z + (0 : ℝ) • W) := by |
| 119 | simpa only [zero_smul, add_zero] using H.carrier_open.mem_nhds hZH |
| 120 | have hP : V.parameterDomain ∈ 𝓝 (0 : ℝ) := by |
| 121 | rw [V.parameterDomain_eq] |
| 122 | exact isOpen_Ioo.mem_nhds ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 123 | have hsC : s ∈ M14SqrtParameterInterval 0 (s ^ 2) := by |
| 124 | simpa only [M14SqrtParameterInterval, Real.sqrt_zero, Real.sqrt_sq hpos.le] using |
| 125 | (show s ∈ Icc 0 s from ⟨hpos.le, le_rfl⟩) |
| 126 | filter_upwards [hline.preimage_mem_nhds hU, hP] with u hu huP |
| 127 | have hbranch := stableInitialVector_unique_branch E ((H.carrier_exact _).mp hu) |
| 128 | rw [initialVectorVariation_action E Z W hs hpos V hmem hV huP, hV s hsC u, |
| 129 | reducedLengthAt_eq_normalized_action E (hmem u huP) hpos |
| 130 | (exponentialPath_minimizing_of_uniqueBranch E hpos (hmem u huP) hbranch)] |
| 131 | exact (mul_div_cancel₀ _ (mul_pos zero_lt_two hpos).ne').symm |
| 132 | |
| 133 | end PoincareMT.M14 |