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.ReducedGeometry.LGeometry.Path.PathCongruence |
| 2 | |
| 3 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/Endpoints.lean` at |
| 4 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 5 | |
| 6 | |
| 7 | /-! |
| 8 | # Fixed endpoint contributions to L-variation |
| 9 | |
| 10 | Fixing an endpoint throughout the variation parameter interval makes both |
| 11 | its first variation field and its actual pullback acceleration vanish. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.LGeometry |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 24 | [IsManifold (𝓡 n) ∞ M] |
| 25 | |
| 26 | /-- The square-root representative of a fixed initial endpoint is constant in the parameter. -/ |
| 27 | theorem squareFamily_left_eq {J : Set ℝ} {F : RicciFlow n M J} |
| 28 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 29 | (V : InitialFixedLVariation F T τ₁ τ₂ p) {u : ℝ} |
| 30 | (hu : u ∈ V.toLVariation.parameterDomain) : |
| 31 | V.squareFamily (Real.sqrt τ₁) u = p.curve τ₁ := by |
| 32 | rw [V.square_agrees (Real.sqrt τ₁) |
| 33 | ⟨le_rfl, Real.sqrt_le_sqrt p.ordered.le⟩ u hu, Real.sq_sqrt p.nonnegative] |
| 34 | exact V.fixed_left u hu |
| 35 | |
| 36 | /-- The square-root representative of a fixed terminal endpoint is constant in the parameter. -/ |
| 37 | theorem squareFamily_right_eq {J : Set ℝ} {F : RicciFlow n M J} |
| 38 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 39 | (V : FixedEndpointLVariation F T τ₁ τ₂ p) {u : ℝ} |
| 40 | (hu : u ∈ V.toLVariation.parameterDomain) : |
| 41 | V.squareFamily (Real.sqrt τ₂) u = p.curve τ₂ := by |
| 42 | rw [V.square_agrees (Real.sqrt τ₂) |
| 43 | ⟨Real.sqrt_le_sqrt p.ordered.le, le_rfl⟩ u hu, |
| 44 | Real.sq_sqrt (p.nonnegative.trans p.ordered.le)] |
| 45 | exact V.fixed_right u hu |
| 46 | |
| 47 | /-- A square-family curve constant throughout the parameter neighborhood has zero field. -/ |
| 48 | theorem squareVariationField_eq_zero_of_constant {J : Set ℝ} {F : RicciFlow n M J} |
| 49 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 50 | (V : LVariation F T τ₁ τ₂ p) (s : ℝ) (x : M) |
| 51 | (hfixed : ∀ u ∈ V.parameterDomain, V.squareFamily s u = x) : |
| 52 | squareVariationField V s = 0 := by |
| 53 | exact curveVelocity_eq_zero_of_eventually_constant |
| 54 | (Filter.eventually_of_mem |
| 55 | (isOpen_Ioo.mem_nhds ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩) hfixed) |
| 56 | |
| 57 | /-- A fixed square-family curve has zero endpoint acceleration for every derivative witness. -/ |
| 58 | theorem variationEndpointAcceleration_eq_zero_of_constant |
| 59 | {J : Set ℝ} {F : RicciFlow n M J} |
| 60 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 61 | (V : LVariation F T τ₁ τ₂ p) (D : LVariationDerivativeData V) |
| 62 | (s : ℝ) (hs : s ∈ sqrtParameterInterval τ₁ τ₂) (x : M) |
| 63 | (hfixed : ∀ u ∈ V.parameterDomain, V.squareFamily s u = x) : |
| 64 | variationEndpointAcceleration V D s hs = 0 := by |
| 65 | let E := D.endpoint_extension s hs |
| 66 | have hzero : (0 : ℝ) ∈ V.parameterDomain := |
| 67 | ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩ |
| 68 | have hvelocity (u : ℝ) (hu : u ∈ V.parameterDomain) : |
| 69 | curveVelocityWithin (n := n) (V.squareFamily s) V.parameterDomain u = 0 := |
| 70 | curveVelocityWithin_eq_zero_of_constant hfixed hu |
| 71 | have hagrees (u : ℝ) (hu : u ∈ V.parameterDomain) : |
| 72 | E.extension u (V.squareFamily s 0) = 0 := by |
| 73 | have hbase : V.squareFamily s u = V.squareFamily s 0 := |
| 74 | (hfixed u hu).trans (hfixed 0 hzero).symm |
| 75 | rw [← hbase] |
| 76 | exact (E.agrees u hu).trans (hvelocity u hu) |
| 77 | have hnear : (fun u ↦ E.extension u (V.squareFamily s 0)) =ᶠ[𝓝 (0 : ℝ)] |
| 78 | fun _ ↦ 0 := |
| 79 | Filter.eventually_of_mem (isOpen_Ioo.mem_nhds hzero) hagrees |
| 80 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 81 | ⟨(F.metric (T - s ^ 2)).toRiemannianMetric⟩ |
| 82 | have hderiv : deriv (fun u ↦ E.extension u (V.squareFamily s 0)) 0 = 0 := by |
| 83 | rw [hnear.deriv_eq] |
| 84 | simp |
| 85 | change deriv (fun u ↦ E.extension u (V.squareFamily s 0)) 0 + |
| 86 | (F.connection (T - s ^ 2)).connection (E.extension 0) (V.squareFamily s 0) |
| 87 | (curveVelocityWithin (n := n) (V.squareFamily s) V.parameterDomain 0) = 0 |
| 88 | rw [hderiv, hvelocity 0 hzero] |
| 89 | simp |
| 90 | |
| 91 | /-- Both first-variation boundary terms vanish when the endpoint curves are fixed. -/ |
| 92 | theorem firstVariationBoundaryTerm_eq_zero {J : Set ℝ} {F : RicciFlow n M J} |
| 93 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 94 | (V : FixedEndpointLVariation F T τ₁ τ₂ p) : |
| 95 | firstVariationBoundaryTerm V.toLVariation = 0 := by |
| 96 | have hleft := squareVariationField_eq_zero_of_constant V.toLVariation |
| 97 | (Real.sqrt τ₁) (p.curve τ₁) |
| 98 | (fun _ hu ↦ squareFamily_left_eq V.toInitialFixedLVariation hu) |
| 99 | have hright := squareVariationField_eq_zero_of_constant V.toLVariation |
| 100 | (Real.sqrt τ₂) (p.curve τ₂) (fun _ hu ↦ squareFamily_right_eq V hu) |
| 101 | simp only [firstVariationBoundaryTerm, hleft, hright, map_zero, sub_self] |
| 102 | |
| 103 | /-- Both second-variation acceleration terms vanish when the endpoint curves are fixed. -/ |
| 104 | theorem secondVariationBoundaryTerm_eq_zero {J : Set ℝ} {F : RicciFlow n M J} |
| 105 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 106 | (V : FixedEndpointLVariation F T τ₁ τ₂ p) |
| 107 | (D : LVariationDerivativeData V.toLVariation) : |
| 108 | secondVariationBoundaryTerm V.toLVariation D = 0 := by |
| 109 | have hleft := variationEndpointAcceleration_eq_zero_of_constant V.toLVariation D |
| 110 | (Real.sqrt τ₁) ⟨le_rfl, Real.sqrt_le_sqrt p.ordered.le⟩ (p.curve τ₁) |
| 111 | (fun _ hu ↦ squareFamily_left_eq V.toInitialFixedLVariation hu) |
| 112 | have hright := variationEndpointAcceleration_eq_zero_of_constant V.toLVariation D |
| 113 | (Real.sqrt τ₂) ⟨Real.sqrt_le_sqrt p.ordered.le, le_rfl⟩ (p.curve τ₂) |
| 114 | (fun _ hu ↦ squareFamily_right_eq V hu) |
| 115 | simp only [secondVariationBoundaryTerm, hleft, hright, map_zero, sub_self] |
| 116 | |
| 117 | end PoincareMT.LGeometry |