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.ReducedLength.Variation.Fields.ChartFieldDerivative |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.VelocityRestriction |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Exponential.FamilySquareVelocity |
| 4 | |
| 5 | /-! |
| 6 | # Actual endpoint accelerations in initial-fixed variations |
| 7 | |
| 8 | The initial constant germ removes its acceleration contribution for every |
| 9 | derivative-data witness. The terminal contribution is retained exactly. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | open Filter |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.ReducedLength |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 24 | [IsManifold (𝓡 n) ∞ M] |
| 25 | {J : Set ℝ} {F : RicciFlow n M J} {T b τmax : ℝ} |
| 26 | |
| 27 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 28 | |
| 29 | set_option backward.isDefEq.respectTransparency false in |
| 30 | theorem initialFixedVariation_acceleration_zero {P : BackwardTimePath F T 0 b} |
| 31 | (V : InitialFixedLVariation F T 0 b P) (D : LVariationDerivativeData V.toLVariation) |
| 32 | (h0 : (0 : ℝ) ∈ sqrtParameterInterval 0 b) : |
| 33 | variationEndpointAcceleration V.toLVariation D 0 h0 = 0 := by |
| 34 | let I := V.toLVariation.parameterDomain |
| 35 | let η := V.squareFamily 0 |
| 36 | have hI : IsOpen I := isOpen_Ioo |
| 37 | have hz : (0 : ℝ) ∈ I := ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 38 | have hc (r : ℝ) (hr : r ∈ I) : η r = P.curve 0 := by |
| 39 | have h := V.square_agrees 0 h0 r hr |
| 40 | simpa only [zero_pow two_ne_zero, V.fixed_left r hr] using h |
| 41 | have hη : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ η I := |
| 42 | V.square_smooth.comp (contMDiff_const.prodMk contMDiff_id).contMDiffOn |
| 43 | (fun _ hr ↦ V.square_contains ⟨h0, hr⟩) |
| 44 | have hd (r : ℝ) (hr : r ∈ I) : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) η r := |
| 45 | (hη.contMDiffAt (hI.mem_nhds hr)).mdifferentiableAt (by simp) |
| 46 | have hv (r : ℝ) (hr : r ∈ I) : curveVelocityWithin (n := n) η I r = 0 := by |
| 47 | have heq : η =ᶠ[𝓝 r] fun _ ↦ P.curve 0 := by |
| 48 | filter_upwards [hI.mem_nhds hr] with t ht |
| 49 | exact hc t ht |
| 50 | rw [curveVelocityWithin_eq_curveVelocity η I r (hI.uniqueDiffOn r hr) (hd r hr)] |
| 51 | have h := curveVelocity_congr_of_eventuallyEq (n := n) heq |
| 52 | simpa only [curveVelocity, mfderiv_const, zero_apply] using h |
| 53 | have hchart (r : ℝ) (hr : r ∈ I ∩ I) : |
| 54 | η r ∈ (chartAt E (P.curve 0)).source := by |
| 55 | rw [hc r hr.1] |
| 56 | exact mem_chart_source E (P.curve 0) |
| 57 | have hrep (r : ℝ) (hr : r ∈ I ∩ I) : |
| 58 | chartVectorField (P.curve 0) 0 (η r) = curveVelocityWithin (n := n) η I r := by |
| 59 | rw [hv r hr.1] |
| 60 | exact (mfderiv (𝓡 n) (𝓡 n) (chartAt E (P.curve 0)) (η r)).inverse.map_zero |
| 61 | have h := pullbackCovariantDerivative_chart_field_zero F (fun _ ↦ T) (P.curve 0) |
| 62 | η (curveVelocityWithin (n := n) η I) I I (D.endpoint_extension 0 h0) |
| 63 | 0 hz hI hz (hI.uniqueDiffOn 0 hz) (hd 0 hz) (fun _ ↦ (0 : E)) contDiffOn_const |
| 64 | hchart hrep 0 (hasDerivAt_const 0 (0 : E)) rfl |
| 65 | simpa only [variationEndpointAcceleration, zero_pow two_ne_zero, sub_zero, |
| 66 | chartVectorField, VectorField.mpullback, map_zero] using h |
| 67 | |
| 68 | set_option backward.isDefEq.respectTransparency false in |
| 69 | theorem initialFixedVariation_secondBoundary {P : BackwardTimePath F T 0 b} |
| 70 | (hb : 0 < b) (V : InitialFixedLVariation F T 0 b P) |
| 71 | (D : LVariationDerivativeData V.toLVariation) : |
| 72 | secondVariationBoundaryTerm V.toLVariation D = |
| 73 | (F.metric (T - b)).inner (V.toLVariation.baseSquareCurve (Real.sqrt b)) |
| 74 | (curveVelocityWithin V.toLVariation.baseSquareCurve (sqrtParameterInterval 0 b) |
| 75 | (Real.sqrt b)) |
| 76 | (variationEndpointAcceleration V.toLVariation D (Real.sqrt b) |
| 77 | ⟨Real.sqrt_le_sqrt hb.le, le_rfl⟩) := by |
| 78 | have hzero (s : ℝ) (hs : s ∈ sqrtParameterInterval 0 b) (heq : s = 0) : |
| 79 | variationEndpointAcceleration V.toLVariation D s hs = 0 := by |
| 80 | subst s |
| 81 | exact initialFixedVariation_acceleration_zero V D hs |
| 82 | unfold secondVariationBoundaryTerm |
| 83 | dsimp only |
| 84 | rw [hzero (Real.sqrt 0) _ Real.sqrt_zero, map_zero, sub_zero, Real.sq_sqrt hb.le] |
| 85 | |
| 86 | set_option backward.isDefEq.respectTransparency false in |
| 87 | theorem lExponentialFamily_initialFixedVariation_secondBoundary {p : M} |
| 88 | (A : LExponentialFamily F T τmax p) (Z : TangentSpace (𝓡 n) p) |
| 89 | (b : ℝ) (hb : 0 < b) (hmax : b < τmax) |
| 90 | (V : InitialFixedLVariation F T 0 b (A.path Z b hb hmax)) |
| 91 | (D : LVariationDerivativeData V.toLVariation) |
| 92 | (hbase : V.toLVariation.baseSquareCurve = A.squareFamily Z) : |
| 93 | secondVariationBoundaryTerm V.toLVariation D = |
| 94 | (2 * Real.sqrt b) * (F.metric (T - b)).inner (A.gamma Z b) |
| 95 | (curveVelocity (A.gamma Z) b) |
| 96 | (variationEndpointAcceleration V.toLVariation D (Real.sqrt b) |
| 97 | ⟨Real.sqrt_le_sqrt hb.le, le_rfl⟩) := by |
| 98 | let c := Real.sqrt b |
| 99 | have hc : 0 < c := Real.sqrt_pos.mpr hb |
| 100 | have hsmax : c < Real.sqrt τmax := Real.sqrt_lt_sqrt hb.le hmax |
| 101 | have hKd : UniqueDiffOn ℝ (sqrtParameterInterval 0 b) := by |
| 102 | simpa only [sqrtParameterInterval, Real.sqrt_zero] using uniqueDiffOn_Icc hc |
| 103 | have hcK : c ∈ sqrtParameterInterval 0 b := ⟨Real.sqrt_le_sqrt hb.le, le_rfl⟩ |
| 104 | have hβd := (lExponentialFamily_squareSlice_contMDiffAt A Z c |
| 105 | ⟨hc.le, hsmax⟩).mdifferentiableAt (by simp) |
| 106 | have hv : (curveVelocityWithin (n := n) V.toLVariation.baseSquareCurve |
| 107 | (sqrtParameterInterval 0 b) c : E) = (2 * c) • curveVelocity (A.gamma Z) b := by |
| 108 | rw [hbase, curveVelocityWithin_eq_curveVelocity (A.squareFamily Z) |
| 109 | (sqrtParameterInterval 0 b) c (hKd c hcK) hβd, |
| 110 | lExponentialFamily_square_velocity_eq A Z c ⟨hc, hsmax⟩] |
| 111 | rw [show c ^ 2 = b from Real.sq_sqrt hb.le] |
| 112 | have hp : V.toLVariation.baseSquareCurve c = A.gamma Z b := by |
| 113 | rw [hbase, A.square_agrees Z c ⟨hc.le, hsmax⟩, show c ^ 2 = b from Real.sq_sqrt hb.le] |
| 114 | rw [initialFixedVariation_secondBoundary hb V D] |
| 115 | change (F.metric (T - b)).inner (V.toLVariation.baseSquareCurve c) _ _ = _ |
| 116 | rw [hv, hp, map_smul, ContinuousLinearMap.smul_apply, smul_eq_mul] |
| 117 | |
| 118 | end PoincareMT.ReducedLength |