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 Mathlib.Geometry.Manifold.VectorField.LieBracket |
| 2 | |
| 3 | /-! |
| 4 | # Coordinate fields on a manifold with corners |
| 5 | |
| 6 | The commuting-frame calculation for Morgan-Tian Lemma 6.4, pp. 107-108. |
| 7 | This extends the proof pattern in M08 `ChartEulerFrame.lean` to a general |
| 8 | real model with corners. Only the chart differential is inverted; no |
| 9 | open ambient domain for the chart inverse is assumed. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- Tangent coordinate maps identify the model vector space with its tangent aliases. |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter Bundle |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | variable {E H M : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 20 | [TopologicalSpace H] (I : ModelWithCorners ℝ E H) |
| 21 | [TopologicalSpace M] [ChartedSpace H M] [IsManifold I ∞ M] |
| 22 | |
| 23 | namespace VectorField |
| 24 | |
| 25 | /-- The vector field with constant coordinates in the tangent chart at |
| 26 | a chosen point, used in Lemma 6.4, pp. 107-108. -/ |
| 27 | noncomputable def chartFrame (x : M) (v : E) (y : M) : TangentSpace I y := |
| 28 | (trivializationAt E (TangentSpace I) x).symmL ℝ y v |
| 29 | |
| 30 | /-- Coordinate frame fields are smooth on their chart source, also for |
| 31 | manifolds with boundary; Lemma 6.4, pp. 107-108. -/ |
| 32 | theorem chartFrame_contMDiffOn (x : M) (v : E) : |
| 33 | ContMDiffOn I I.tangent ∞ (T% (chartFrame I x v)) (chartAt H x).source := by |
| 34 | let e := trivializationAt E (TangentSpace I) x |
| 35 | have hmap : ContMDiffOn I (I.prod 𝓘(ℝ, E)) ∞ |
| 36 | (fun y : M => (y, v)) e.baseSet := contMDiffOn_id.prodMk contMDiffOn_const |
| 37 | apply (e.contMDiffOn_symm.comp hmap (fun y hy => e.mem_target.mpr hy)).congr |
| 38 | intro y hy |
| 39 | rw [show chartFrame I x v y = e.symm y v from Trivialization.symmL_apply e hy v] |
| 40 | exact e.mk_symm hy v |
| 41 | |
| 42 | /-- A coordinate field is the actual pullback of a constant model |
| 43 | field through the extended chart; Lemma 6.4, pp. 107-108. -/ |
| 44 | theorem chartFrame_eq_mpullback {x y : M} (hy : y ∈ (chartAt H x).source) (v : E) : |
| 45 | chartFrame I x v y = mpullback I 𝓘(ℝ, E) (extChartAt I x) (fun _ => v) y := by |
| 46 | symm |
| 47 | have hy' : y ∈ (extChartAt I x).source := by simpa only [extChartAt_source] using hy |
| 48 | apply (isInvertible_mfderiv_extChartAt (I := I) hy').inverse_apply_eq.mpr |
| 49 | rw [← TangentBundle.continuousLinearMapAt_trivializationAt hy] |
| 50 | exact ((trivializationAt E (TangentSpace I) x).continuousLinearMapAt_symmL |
| 51 | (R := ℝ) hy v).symm |
| 52 | |
| 53 | variable [CompleteSpace E] |
| 54 | |
| 55 | /-- Two coordinate fields commute on their chart source, with no |
| 56 | boundaryless assumption; Lemma 6.4, pp. 107-108. -/ |
| 57 | theorem chartFrame_mlieBracket {x y : M} (hy : y ∈ (chartAt H x).source) (v w : E) : |
| 58 | mlieBracket I (chartFrame I x v) (chartFrame I x w) y = 0 := by |
| 59 | have htwo : minSmoothness ℝ 2 ≤ (∞ : ℕ∞ω) := by |
| 60 | rw [minSmoothness_of_isRCLikeNormedField] |
| 61 | exact WithTop.coe_le_coe.mpr le_top |
| 62 | let : IsManifold I (minSmoothness ℝ 2) M := IsManifold.of_le htwo |
| 63 | have heq (z : E) : chartFrame I x z =ᶠ[𝓝 y] |
| 64 | mpullback I 𝓘(ℝ, E) (extChartAt I x) (fun _ => z) := by |
| 65 | filter_upwards [(chartAt H x).open_source.mem_nhds hy] with p hp |
| 66 | exact chartFrame_eq_mpullback I hp z |
| 67 | rw [(heq v).mlieBracket_vectorField_eq (heq w)] |
| 68 | have hconst (z : E) := |
| 69 | ((contMDiffAt_vectorSpace_iff_contDiffAt |
| 70 | (𝕜 := ℝ) (V := fun _ => z) (x := extChartAt I x y) (n := (1 : ℕ∞ω))).mpr |
| 71 | contDiffAt_const).mdifferentiableAt one_ne_zero |
| 72 | have hchart : ContMDiffAt I 𝓘(ℝ, E) ∞ (extChartAt I x) y := |
| 73 | contMDiffAt_extChartAt' (I := I) (n := ∞) hy |
| 74 | rw [← mpullback_mlieBracket (hconst v) (hconst w) hchart htwo] |
| 75 | have hzero : mlieBracket 𝓘(ℝ, E) (fun _ : E => v) (fun _ : E => w) = 0 := by |
| 76 | funext q |
| 77 | change mlieBracketWithin 𝓘(ℝ, E) (fun _ => v) (fun _ => w) univ q = 0 |
| 78 | rw [mlieBracketWithin_eq_lieBracketWithin] |
| 79 | simp [lieBracketWithin] |
| 80 | rw [hzero, mpullback_zero] |
| 81 | rfl |
| 82 | |
| 83 | omit [CompleteSpace E] in |
| 84 | /-- The inverse tangent frame reconstructs a vector from its chart |
| 85 | differential, as used in Lemma 6.4, pp. 107-108. -/ |
| 86 | theorem chartFrame_mfderiv_extChartAt {x y : M} (hy : y ∈ (chartAt H x).source) |
| 87 | (v : TangentSpace I y) : |
| 88 | chartFrame I x (mfderiv I 𝓘(ℝ, E) (extChartAt I x) y v) y = v := by |
| 89 | rw [chartFrame, ← TangentBundle.continuousLinearMapAt_trivializationAt hy] |
| 90 | exact (trivializationAt E (TangentSpace I) x).symmL_continuousLinearMapAt hy v |
| 91 | |
| 92 | omit [CompleteSpace E] in |
| 93 | /-- The coordinate derivative reconstructs the actual manifold curve |
| 94 | velocity through the frame; Lemma 6.4, pp. 107-108. -/ |
| 95 | theorem chartFrame_curve_deriv {γ : ℝ → M} {x : M} {s : ℝ} |
| 96 | (hx : γ s ∈ (chartAt H x).source) |
| 97 | (hγ : MDifferentiableAt 𝓘(ℝ) I γ s) : |
| 98 | chartFrame I x (deriv ((extChartAt I x) ∘ γ) s) (γ s) = |
| 99 | mfderiv 𝓘(ℝ) I γ s (1 : ℝ) := by |
| 100 | have hc := (contMDiffAt_extChartAt' (I := I) (n := ∞) hx).mdifferentiableAt (by simp) |
| 101 | have h := mfderiv_comp_apply s hc hγ (1 : ℝ) |
| 102 | have hderiv : mfderiv 𝓘(ℝ) 𝓘(ℝ, E) ((extChartAt I x) ∘ γ) s (1 : ℝ) = |
| 103 | deriv ((extChartAt I x) ∘ γ) s := by |
| 104 | exact (congrArg (fun L : ℝ →L[ℝ] E => L 1) |
| 105 | (mfderiv_eq_fderiv (f := (extChartAt I x) ∘ γ) (x := s))).trans |
| 106 | fderiv_apply_one_eq_deriv |
| 107 | have hd : deriv ((extChartAt I x) ∘ γ) s = |
| 108 | mfderiv I 𝓘(ℝ, E) (extChartAt I x) (γ s) (mfderiv 𝓘(ℝ) I γ s (1 : ℝ)) := by |
| 109 | exact hderiv.symm.trans h |
| 110 | rw [hd] |
| 111 | exact chartFrame_mfderiv_extChartAt I hx _ |
| 112 | |
| 113 | end VectorField |