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 | /- Adapted from Mapher `PoincareMT/Proofs/M03/Existence/ConjugatorPullbackDerivativeNative.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.RicciFlow.Local.Gauge.Flow.ConjugatorChartLie |
| 6 | import PoincareLib.Geometry.RicciFlow.Local.Gauge.Flow.ConjugatorWithinDerivative |
| 7 | import Mathlib.Geometry.Manifold.Diffeomorph |
| 8 | |
| 9 | /-! |
| 10 | # The actual fixed-metric pullback derivative |
| 11 | |
| 12 | Local coordinates turn the manifold orbit equation into the Euclidean one. |
| 13 | The within-product variational equation and the intrinsic chart Lie identity |
| 14 | then compute the pullback derivative, including time zero. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option maxHeartbeats 2400000 |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open scoped Manifold ContDiff Bundle Topology |
| 22 | |
| 23 | noncomputable section |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.ConjugatorLieDerivativeNative |
| 28 | |
| 29 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 31 | |
| 32 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 33 | |
| 34 | theorem chartMap_spatial_derivative |
| 35 | (Φ : Diffeomorph (𝓡 n) (𝓡 n) M M ∞) (p q : M) {x : M} |
| 36 | (hp : x ∈ (chartAt E p).source) (hq : Φ x ∈ (chartAt E q).source) |
| 37 | (u : TangentSpace (𝓡 n) x) : |
| 38 | fderiv ℝ (fun z => chartAt E q (Φ ((chartAt E p).symm z))) |
| 39 | (chartAt E p x) (mfderiv (𝓡 n) 𝓘(ℝ, E) (chartAt E p) x u) = |
| 40 | mfderiv (𝓡 n) 𝓘(ℝ, E) (chartAt E q) (Φ x) |
| 41 | (mfderiv (𝓡 n) (𝓡 n) Φ x u) := by |
| 42 | have hback := (chartAt E p).left_inv hp |
| 43 | have hi := (mdifferentiable_chart (I := 𝓡 n) p).mdifferentiableAt_symm |
| 44 | ((chartAt E p).map_source hp) |
| 45 | have hPhi := Φ.mdifferentiable (by simp) x |
| 46 | have hiPhi : MDifferentiableAt 𝓘(ℝ, E) (𝓡 n) |
| 47 | (Φ ∘ (chartAt E p).symm) (chartAt E p x) := by |
| 48 | exact hPhi.comp_of_eq (chartAt E p x) hi hback |
| 49 | have houter := mfderiv_comp_apply_of_eq (chartAt E p x) |
| 50 | ((mdifferentiable_chart (I := 𝓡 n) q).mdifferentiableAt hq) hiPhi |
| 51 | (show (Φ ∘ (chartAt E p).symm) (chartAt E p x) = Φ x by simp only [Function.comp_apply, hback]) |
| 52 | (mfderiv (𝓡 n) 𝓘(ℝ, E) (chartAt E p) x u) |
| 53 | have hinner := mfderiv_comp_apply_of_eq (chartAt E p x) hPhi hi hback |
| 54 | (mfderiv (𝓡 n) 𝓘(ℝ, E) (chartAt E p) x u) |
| 55 | have hinv := congrArg (fun L : TangentSpace (𝓡 n) x →L[ℝ] TangentSpace (𝓡 n) x => L u) |
| 56 | ((mdifferentiable_chart (I := 𝓡 n) p).symm_comp_deriv hp) |
| 57 | have hinv' : |
| 58 | mfderiv 𝓘(ℝ, E) (𝓡 n) (chartAt E p).symm (chartAt E p x) |
| 59 | (mfderiv (𝓡 n) 𝓘(ℝ, E) (chartAt E p) x u) = u := hinv |
| 60 | rw [hinv'] at hinner |
| 61 | rw [hinner, mfderiv_eq_fderiv] at houter |
| 62 | exact houter |
| 63 | |
| 64 | theorem chartMetricForm_chartMap |
| 65 | (g : RiemannianMetric n M) (Φ : Diffeomorph (𝓡 n) (𝓡 n) M M ∞) |
| 66 | (p q : M) {x : M} (hp : x ∈ (chartAt E p).source) |
| 67 | (hq : Φ x ∈ (chartAt E q).source) (u v : TangentSpace (𝓡 n) x) : |
| 68 | chartMetricForm g q (chartAt E q (Φ x)) |
| 69 | (fderiv ℝ (fun z => chartAt E q (Φ ((chartAt E p).symm z))) |
| 70 | (chartAt E p x) (mfderiv (𝓡 n) 𝓘(ℝ, E) (chartAt E p) x u)) |
| 71 | (fderiv ℝ (fun z => chartAt E q (Φ ((chartAt E p).symm z))) |
| 72 | (chartAt E p x) (mfderiv (𝓡 n) 𝓘(ℝ, E) (chartAt E p) x v)) = |
| 73 | g.inner (Φ x) (mfderiv (𝓡 n) (𝓡 n) Φ x u) (mfderiv (𝓡 n) (𝓡 n) Φ x v) := by |
| 74 | rw [chartMetricForm_apply, (chartAt E q).left_inv hq, |
| 75 | chartMap_spatial_derivative Φ p q hp hq u, |
| 76 | chartMap_spatial_derivative Φ p q hp hq v] |
| 77 | have hinv := (mdifferentiable_chart (I := 𝓡 n) q).symm_comp_deriv hq |
| 78 | have hu := congrArg (fun L : TangentSpace (𝓡 n) (Φ x) →L[ℝ] |
| 79 | TangentSpace (𝓡 n) (Φ x) => L (mfderiv (𝓡 n) (𝓡 n) Φ x u)) hinv |
| 80 | have hv := congrArg (fun L : TangentSpace (𝓡 n) (Φ x) →L[ℝ] |
| 81 | TangentSpace (𝓡 n) (Φ x) => L (mfderiv (𝓡 n) (𝓡 n) Φ x v)) hinv |
| 82 | exact congrArg₂ (fun a b => g.inner (Φ x) a b) hu hv |
| 83 | |
| 84 | theorem hasDerivWithinAt_fixedMetric_pullback_neg |
| 85 | {T t : ℝ} (hT : 0 < T) (ht : t ∈ Set.Ico 0 T) |
| 86 | {g : RiemannianMetric n M} (D : LeviCivitaData g) |
| 87 | (Φ : ℝ → Diffeomorph (𝓡 n) (𝓡 n) M M ∞) |
| 88 | (W : (y : M) → TangentSpace (𝓡 n) y) |
| 89 | (hΦ : ContMDiffOn (𝓘(ℝ, ℝ).prod (𝓡 n)) (𝓡 n) ∞ |
| 90 | (fun q : ℝ × M => Φ q.1 q.2) (Set.Ico 0 T ×ˢ Set.univ)) |
| 91 | (hW : ∀ y, ContMDiffAt (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ (T% W) y) |
| 92 | (hgen : ∀ y : M, HasMFDerivWithinAt 𝓘(ℝ, ℝ) (𝓡 n) |
| 93 | (fun s => Φ s y) (Set.Ico 0 T) t |
| 94 | ((1 : ℝ →L[ℝ] ℝ).smulRight (-W (Φ t y)))) |
| 95 | (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 96 | HasDerivWithinAt |
| 97 | (fun s => g.inner (Φ s x) |
| 98 | (mfderiv (𝓡 n) (𝓡 n) (Φ s) x u) |
| 99 | (mfderiv (𝓡 n) (𝓡 n) (Φ s) x v)) |
| 100 | (-DeTurckNative.metricLieDerivative D W (Φ t x) |
| 101 | (mfderiv (𝓡 n) (𝓡 n) (Φ t) x u) |
| 102 | (mfderiv (𝓡 n) (𝓡 n) (Φ t) x v)) (Set.Ico 0 T) t := by |
| 103 | let p := x |
| 104 | let q := Φ t x |
| 105 | let z₀ := chartAt E p x |
| 106 | let F : ℝ × E → E := fun a => chartAt E q (Φ a.1 ((chartAt E p).symm a.2)) |
| 107 | let U := (chartAt E p).target |
| 108 | let J := Set.Ico 0 T |
| 109 | let V : E → E := fun z => -chartVector q W z |
| 110 | have hp : x ∈ (chartAt E p).source := mem_chart_source E x |
| 111 | have hq : Φ t x ∈ (chartAt E q).source := mem_chart_source E (Φ t x) |
| 112 | have hz₀ : z₀ ∈ U := (chartAt E p).map_source hp |
| 113 | have hback : (chartAt E p).symm z₀ = x := (chartAt E p).left_inv hp |
| 114 | have hFval : F (t, z₀) = chartAt E q (Φ t x) := by simp only [F, hback] |
| 115 | have hFtgt : F (t, z₀) ∈ (chartAt E q).target := by |
| 116 | rw [hFval] |
| 117 | exact (chartAt E q).map_source hq |
| 118 | have hFback : (chartAt E q).symm (F (t, z₀)) = Φ t x := by |
| 119 | rw [hFval, (chartAt E q).left_inv hq] |
| 120 | have hcoord : ContDiffWithinAt ℝ 2 F (J ×ˢ U) (t, z₀) := by |
| 121 | have hinverse : ContMDiffWithinAt 𝓘(ℝ, E) (𝓡 n) ∞ |
| 122 | (chartAt E p).symm U z₀ := contMDiffOn_chart_symm (I := 𝓡 n) (x := p) z₀ hz₀ |
| 123 | have hparam : ContMDiffWithinAt (𝓘(ℝ, ℝ).prod 𝓘(ℝ, E)) |
| 124 | (𝓘(ℝ, ℝ).prod (𝓡 n)) ∞ |
| 125 | (fun a : ℝ × E => (a.1, (chartAt E p).symm a.2)) (J ×ˢ U) (t, z₀) := by |
| 126 | exact contMDiffWithinAt_fst.prodMk |
| 127 | (hinverse.comp (t, z₀) contMDiffWithinAt_snd (fun _ ha => ha.2)) |
| 128 | have hflow := (hΦ (t, x) ⟨ht, Set.mem_univ x⟩).comp_of_eq hparam |
| 129 | (fun _ ha => ⟨ha.1, Set.mem_univ _⟩) (by simp only [hback]) |
| 130 | have hchart : ContMDiffAt (𝓡 n) 𝓘(ℝ, E) ∞ (chartAt E q) (Φ t x) := |
| 131 | (contMDiffOn_chart (I := 𝓡 n) (x := q) (Φ t x) hq).contMDiffAt |
| 132 | ((chartAt E q).open_source.mem_nhds hq) |
| 133 | have hc := hchart.comp_contMDiffWithinAt_of_eq hflow |
| 134 | (by simp only [Function.comp_apply, hback]) |
| 135 | rw [← modelWithCornersSelf_prod, chartedSpaceSelf_prod] at hc |
| 136 | exact hc.contDiffWithinAt.of_le |
| 137 | (WithTop.coe_le_coe.mpr (le_top : (2 : ℕ∞) ≤ ⊤)) |
| 138 | have hV : DifferentiableAt ℝ V (F (t, z₀)) := by |
| 139 | have h := (chartVector_contDiffAt q hFtgt (by rw [hFback]; exact hW _)).differentiableAt (by simp) |
| 140 | exact h.neg |
| 141 | have hG : DifferentiableAt ℝ (chartMetricForm g q) (F (t, z₀)) := |
| 142 | ((chartMetricForm_contDiffOn g q).contDiffAt |
| 143 | ((chartAt E q).open_target.mem_nhds hFtgt)).differentiableAt (by simp) |
| 144 | have htarget : ∀ᶠ z in 𝓝 z₀, |
| 145 | Φ t ((chartAt E p).symm z) ∈ (chartAt E q).source := by |
| 146 | have hc : ContinuousAt (fun z => Φ t ((chartAt E p).symm z)) z₀ := |
| 147 | (Φ t).continuous.continuousAt.comp |
| 148 | ((chartAt E p).continuousOn_symm.continuousAt ((chartAt E p).open_target.mem_nhds hz₀)) |
| 149 | exact hc (by simpa only [hback] using (chartAt E q).open_source.mem_nhds hq) |
| 150 | have horbit : ∀ᶠ z in 𝓝 z₀, |
| 151 | HasDerivWithinAt (fun s => F (s, z)) (V (F (t, z))) J t := by |
| 152 | filter_upwards [htarget] with z hz |
| 153 | have hc := HasMFDerivAt.comp_hasMFDerivWithinAt t |
| 154 | (f := fun s => Φ s ((chartAt E p).symm z)) |
| 155 | ((mdifferentiable_chart (I := 𝓡 n) q).mdifferentiableAt hz).hasMFDerivAt |
| 156 | (hgen ((chartAt E p).symm z)) |
| 157 | have hd := hc.hasFDerivWithinAt.hasDerivWithinAt |
| 158 | have hv : V (F (t, z)) = |
| 159 | -mfderiv (𝓡 n) 𝓘(ℝ, E) (chartAt E q) (Φ t ((chartAt E p).symm z)) |
| 160 | (W (Φ t ((chartAt E p).symm z))) := by |
| 161 | dsimp only [V, F] |
| 162 | rw [chartVector_chart q W hz] |
| 163 | rw [hv] |
| 164 | have hraw : HasDerivWithinAt (fun s => F (s, z)) |
| 165 | (mfderiv (𝓡 n) 𝓘(ℝ, E) (chartAt E q) (Φ t ((chartAt E p).symm z)) |
| 166 | ((1 : ℝ) • (-W (Φ t ((chartAt E p).symm z))))) J t := hd |
| 167 | simpa only [one_smul, map_neg] using hraw |
| 168 | let cu := mfderiv (𝓡 n) 𝓘(ℝ, E) (chartAt E p) x u |
| 169 | let cv := mfderiv (𝓡 n) 𝓘(ℝ, E) (chartAt E p) x v |
| 170 | have hcalc := hasDerivWithinAt_pullback_coefficient_of_contDiffWithinAt |
| 171 | (chartAt E p).open_target (uniqueDiffOn_Ico 0 T) ht hz₀ |
| 172 | (mem_closure_interior_Ico_prod (chartAt E p).open_target hT ht hz₀) |
| 173 | hcoord hV hG horbit cu cv |
| 174 | have htimeTarget : ∀ᶠ s in 𝓝[J] t, Φ s x ∈ (chartAt E q).source := by |
| 175 | exact (hgen x).continuousWithinAt ((chartAt E q).open_source.mem_nhds hq) |
| 176 | have heq : |
| 177 | (fun s => g.inner (Φ s x) |
| 178 | (mfderiv (𝓡 n) (𝓡 n) (Φ s) x u) |
| 179 | (mfderiv (𝓡 n) (𝓡 n) (Φ s) x v)) =ᶠ[𝓝[J] t] |
| 180 | (fun s => chartMetricForm g q (F (s, z₀)) |
| 181 | (fderiv ℝ (fun z => F (s, z)) z₀ cu) |
| 182 | (fderiv ℝ (fun z => F (s, z)) z₀ cv)) := by |
| 183 | filter_upwards [htimeTarget] with s hs |
| 184 | simpa only [F, hback] using (chartMetricForm_chartMap g (Φ s) p q hp hs u v).symm |
| 185 | have htransport := hcalc.congr_of_eventuallyEq_of_mem heq ht |
| 186 | apply htransport.congr_deriv |
| 187 | rw [coordinateLieMetric_neg] |
| 188 | congr 1 |
| 189 | rw [coordinateLieMetric_chart_eq D q hFtgt (by rw [hFback]; exact hW _), hFback] |
| 190 | have hu := chartMap_spatial_derivative (Φ t) p q hp hq u |
| 191 | have hv := chartMap_spatial_derivative (Φ t) p q hp hq v |
| 192 | change fderiv ℝ (fun z => F (t, z)) z₀ cu = _ at hu |
| 193 | change fderiv ℝ (fun z => F (t, z)) z₀ cv = _ at hv |
| 194 | rw [hu, hv, hFval] |
| 195 | have hinv := (mdifferentiable_chart (I := 𝓡 n) q).symm_comp_deriv hq |
| 196 | exact congrArg₂ (fun a b => DeTurckNative.metricLieDerivative D W (Φ t x) a b) |
| 197 | (congrArg (fun L : TangentSpace (𝓡 n) (Φ t x) →L[ℝ] |
| 198 | TangentSpace (𝓡 n) (Φ t x) => L (mfderiv (𝓡 n) (𝓡 n) (Φ t) x u)) hinv) |
| 199 | (congrArg (fun L : TangentSpace (𝓡 n) (Φ t x) →L[ℝ] |
| 200 | TangentSpace (𝓡 n) (Φ t x) => L (mfderiv (𝓡 n) (𝓡 n) (Φ t) x v)) hinv) |
| 201 | |
| 202 | end PoincareMT.ConjugatorLieDerivativeNative |
| 203 | |
| 204 | end |