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.Minimum.Variation.Geometry.ChartFrame |
| 2 | import Mathlib.Geometry.Manifold.MFDeriv.Atlas |
| 3 | import Mathlib.Geometry.Manifold.VectorField.LieBracket |
| 4 | |
| 5 | /-! |
| 6 | # Commuting vector fields from a fixed spatial chart |
| 7 | |
| 8 | This is the local chart-vector-field layer used by the compact-field |
| 9 | variation producer. The retained `chartFrame` supplies the inverse-chart |
| 10 | differential and its smoothness; this file gives it the API needed by the |
| 11 | weighted perturbation construction. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option maxHeartbeats 800000 |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedLengthMinimum.Variation.Geometry |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 25 | [IsManifold (𝓡 n) ∞ M] |
| 26 | |
| 27 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 28 | |
| 29 | noncomputable def chartVectorField (p : M) (v : E) : |
| 30 | (x : M) → TangentSpace (𝓡 n) x := |
| 31 | VectorField.mpullback (𝓡 n) (𝓡 n) (chartAt E p) (fun _ ↦ v) |
| 32 | |
| 33 | theorem chartVectorField_smooth (p : M) (v : E) : |
| 34 | ContMDiffOn (𝓡 n) ((𝓡 n).prod (𝓡 n)) ∞ (T% (chartVectorField p v)) |
| 35 | (chartAt E p).source := by |
| 36 | have hV : ContMDiff (𝓡 n) ((𝓡 n).prod (𝓡 n)) ∞ |
| 37 | (fun y : E ↦ (⟨y, v⟩ : TangentBundle (𝓡 n) E)) := |
| 38 | (contMDiff_vectorSpace_iff_contDiff (V := fun _ : E ↦ v)).mpr contDiff_const |
| 39 | intro x hx |
| 40 | have hc : ContMDiffAt (𝓡 n) (𝓡 n) ∞ (chartAt E p) x := |
| 41 | contMDiffOn_chart.contMDiffAt ((chartAt E p).open_source.mem_nhds hx) |
| 42 | have hi : (mfderiv (𝓡 n) (𝓡 n) (chartAt E p) x).IsInvertible := |
| 43 | ⟨(mdifferentiable_chart (I := 𝓡 n) p).mfderiv hx, rfl⟩ |
| 44 | exact ((hV _).mpullback_vectorField_preimage hc hi (by simp)).contMDiffWithinAt |
| 45 | |
| 46 | theorem chartVectorField_at_inverse (p : M) (v : E) (y : E) |
| 47 | (hy : y ∈ (chartAt E p).target) : |
| 48 | chartVectorField p v ((chartAt E p).symm y) = |
| 49 | mfderiv (𝓡 n) (𝓡 n) (chartAt E p).symm y v := by |
| 50 | let e := chartAt E p |
| 51 | have hi : (mfderiv (𝓡 n) (𝓡 n) e (e.symm y)).IsInvertible := |
| 52 | ⟨(mdifferentiable_chart (I := 𝓡 n) p).mfderiv (e.map_target hy), rfl⟩ |
| 53 | have hcomp := congrArg (fun L : E →L[ℝ] E ↦ L v) |
| 54 | ((mdifferentiable_chart (I := 𝓡 n) p).comp_symm_deriv hy) |
| 55 | change (mfderiv (𝓡 n) (𝓡 n) e (e.symm y)).inverse v = _ |
| 56 | change (mfderiv (𝓡 n) (𝓡 n) e (e.symm y)) |
| 57 | ((mfderiv (𝓡 n) (𝓡 n) e.symm y) v) = v at hcomp |
| 58 | calc |
| 59 | _ = (mfderiv (𝓡 n) (𝓡 n) e (e.symm y)).inverse |
| 60 | ((mfderiv (𝓡 n) (𝓡 n) e (e.symm y)) |
| 61 | ((mfderiv (𝓡 n) (𝓡 n) e.symm y) v)) := congrArg _ hcomp.symm |
| 62 | _ = _ := hi.inverse_apply_self _ |
| 63 | |
| 64 | set_option backward.isDefEq.respectTransparency false in |
| 65 | theorem chartVectorField_bracket (p : M) (v w : E) (x : M) |
| 66 | (hx : x ∈ (chartAt E p).source) : |
| 67 | VectorField.mlieBracket (𝓡 n) (chartVectorField p v) (chartVectorField p w) x = 0 := by |
| 68 | have horder : minSmoothness ℝ 2 ≤ (∞ : ℕ∞ω) := by |
| 69 | rw [minSmoothness_of_isRCLikeNormedField] |
| 70 | exact ENat.natCast_le_of_coe_top_le_withTop le_rfl 2 |
| 71 | letI : IsManifold (𝓡 n) (minSmoothness ℝ 2) M := |
| 72 | IsManifold.of_le (n := ∞) horder |
| 73 | have hV (a : E) : ContMDiff (𝓡 n) ((𝓡 n).prod (𝓡 n)) ∞ |
| 74 | (fun y : E ↦ (⟨y, a⟩ : TangentBundle (𝓡 n) E)) := |
| 75 | (contMDiff_vectorSpace_iff_contDiff (V := fun _ : E ↦ a)).mpr contDiff_const |
| 76 | have hc : ContMDiffAt (𝓡 n) (𝓡 n) ∞ (chartAt E p) x := |
| 77 | contMDiffOn_chart.contMDiffAt ((chartAt E p).open_source.mem_nhds hx) |
| 78 | have h := VectorField.mpullback_mlieBracket |
| 79 | ((hV v _).mdifferentiableAt (by simp)) ((hV w _).mdifferentiableAt (by simp)) |
| 80 | hc horder |
| 81 | have hz : VectorField.mlieBracket (𝓡 n) (fun _ : E ↦ v) (fun _ : E ↦ w) = 0 := by |
| 82 | change VectorField.mlieBracketWithin (𝓘(ℝ, E)) (fun _ : E ↦ v) |
| 83 | (fun _ : E ↦ w) Set.univ = 0 |
| 84 | rw [VectorField.mlieBracketWithin_eq_lieBracketWithin] |
| 85 | ext y |
| 86 | simp [VectorField.lieBracketWithin] |
| 87 | change VectorField.mlieBracket (𝓡 n) |
| 88 | (VectorField.mpullback (𝓡 n) (𝓡 n) (chartAt E p) (fun _ ↦ v)) |
| 89 | (VectorField.mpullback (𝓡 n) (𝓡 n) (chartAt E p) (fun _ ↦ w)) x = 0 |
| 90 | rw [← h, hz, VectorField.mpullback_zero] |
| 91 | rfl |
| 92 | |
| 93 | theorem mvfderiv_chartVectorField (p : M) (f : M → ℝ) (y v : E) |
| 94 | (hy : y ∈ (chartAt E p).target) |
| 95 | (hf : MDifferentiableAt (𝓡 n) (𝓘(ℝ, ℝ)) f ((chartAt E p).symm y)) : |
| 96 | mvfderiv (𝓡 n) f ((chartAt E p).symm y) |
| 97 | (chartVectorField p v ((chartAt E p).symm y)) = |
| 98 | fderiv ℝ (fun z ↦ f ((chartAt E p).symm z)) y v := by |
| 99 | rw [chartVectorField_at_inverse p v y hy] |
| 100 | have h := mfderiv_comp y hf |
| 101 | ((mdifferentiable_chart (I := 𝓡 n) p).mdifferentiableAt_symm hy) |
| 102 | rw [mfderiv_eq_fderiv] at h |
| 103 | exact (congrArg (fun L ↦ L v) h).symm |
| 104 | |
| 105 | theorem chartVectorField_differential (p x : M) (v : TangentSpace (𝓡 n) x) |
| 106 | (hx : x ∈ (chartAt E p).source) : |
| 107 | chartVectorField p (mfderiv (𝓡 n) (𝓡 n) (chartAt E p) x v) x = v := by |
| 108 | have hi : (mfderiv (𝓡 n) (𝓡 n) (chartAt E p) x).IsInvertible := |
| 109 | ⟨(mdifferentiable_chart (I := 𝓡 n) p).mfderiv hx, rfl⟩ |
| 110 | exact hi.inverse_apply_self v |
| 111 | |
| 112 | end PoincareMT.ReducedLengthMinimum.Variation.Geometry |