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.Curvature.Evolution.Connection.ConnectionVariation |
| 2 | |
| 3 | /-! Adapted from Mapher06/Poincare-MorganTian, `PoincareMT/Proofs/M04/ConnectionVariationVector.lean`, |
| 4 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. See the curvature import record under |
| 5 | `references/ricci-flow/mapher/curvature/`. -/ |
| 6 | |
| 7 | /-! |
| 8 | # Vector variation of the supplied connection |
| 9 | |
| 10 | The fixed-metric pairing variation is reconstructed in the orthonormal basis |
| 11 | at the evaluation point. See Topping, Proposition 2.3.1 and Remarks 2.3.2-2.3.3. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | open Set Topology Filter |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.RicciFlowAnalysis |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | {J : Set ℝ} |
| 26 | |
| 27 | theorem hasDerivAt_connection_vector (F : RicciFlow n M J) |
| 28 | {U : Set M} {X Y : (y : M) → TangentSpace (𝓡 n) y} |
| 29 | {t : ℝ} {x : M} |
| 30 | (hU : IsOpen U) |
| 31 | (hX : ContMDiffOn (𝓡 n) |
| 32 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% X) U) |
| 33 | (hY : ContMDiffOn (𝓡 n) |
| 34 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% Y) U) |
| 35 | (ht : t ∈ interior J) (hx : x ∈ U) : |
| 36 | letI : Bundle.RiemannianBundle |
| 37 | (TangentSpace (𝓡 n) : M → Type _) := |
| 38 | ⟨(F.metric t).toRiemannianMetric⟩ |
| 39 | let D := F.connection t |
| 40 | let b := (F.metric t).orthonormalBasis x |
| 41 | HasDerivAt |
| 42 | (fun s ↦ (F.connection s).connection Y x (X x)) |
| 43 | (∑ i, |
| 44 | (-D.covariantTensorDerivative D.ricciEvaluation |
| 45 | x ![X x, Y x, b i] - |
| 46 | D.covariantTensorDerivative D.ricciEvaluation |
| 47 | x ![Y x, X x, b i] + |
| 48 | D.covariantTensorDerivative D.ricciEvaluation |
| 49 | x ![b i, X x, Y x]) • b i) t := by |
| 50 | classical |
| 51 | let : Bundle.RiemannianBundle |
| 52 | (TangentSpace (𝓡 n) : M → Type _) := |
| 53 | ⟨(F.metric t).toRiemannianMetric⟩ |
| 54 | let D := F.connection t |
| 55 | let b := (F.metric t).orthonormalBasis x |
| 56 | let a (i : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x))) := |
| 57 | -D.covariantTensorDerivative D.ricciEvaluation x ![X x, Y x, b i] - |
| 58 | D.covariantTensorDerivative D.ricciEvaluation x ![Y x, X x, b i] + |
| 59 | D.covariantTensorDerivative D.ricciEvaluation x ![b i, X x, Y x] |
| 60 | change HasDerivAt (fun s ↦ (F.connection s).connection Y x (X x)) |
| 61 | (∑ i, a i • b i) t |
| 62 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 63 | (TangentSpace (𝓡 n) : M → Type _) x |
| 64 | have hxe : x ∈ U ∩ e.baseSet := |
| 65 | ⟨hx, FiberBundle.mem_baseSet_trivializationAt' x⟩ |
| 66 | have hc (i : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x))) : |
| 67 | HasDerivAt |
| 68 | (fun s ↦ (F.metric t).inner x ((F.connection s).connection Y x (X x)) (b i)) |
| 69 | (a i) t := by |
| 70 | have h := hasDerivAt_connection_pairing F (hU.inter e.open_baseSet) |
| 71 | (hX.mono inter_subset_left) (hY.mono inter_subset_left) |
| 72 | ((contMDiffOn_extend_baseSet (n := n) (M := M) (x := x) (b i)).mono |
| 73 | inter_subset_right) ht hxe |
| 74 | simpa only [FiberBundle.extend_apply_self] using h |
| 75 | have hs := HasDerivAt.fun_sum (u := Finset.univ) |
| 76 | (fun i _ ↦ (hc i).smul_const (b i)) |
| 77 | have heq (s : ℝ) : |
| 78 | (∑ i, (F.metric t).inner x ((F.connection s).connection Y x (X x)) (b i) • b i) = |
| 79 | (F.connection s).connection Y x (X x) := by |
| 80 | change (∑ i, inner ℝ ((F.connection s).connection Y x (X x)) (b i) • b i) = _ |
| 81 | simpa only [real_inner_comm] using |
| 82 | b.sum_repr' ((F.connection s).connection Y x (X x)) |
| 83 | exact hs.congr_of_eventuallyEq (Eventually.of_forall fun s ↦ (heq s).symm) |
| 84 | |
| 85 | end PoincareMT.RicciFlowAnalysis |