import PoincareLib.Geometry.RicciFlow.CurveShortening.Connection.Regularity /-! # Moving-connection pullback commutation The actual parameter derivatives commute by spatial curvature and the actual connection variation. This supplies the interchange in the spatial calculation of MT2015Correction Lemma 0.2, pp. 4-6. See `references/ricci-flow/mapher/curve-evolution/derivations/2026-09-20-moving-pullback.md`. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Bundle Manifold Set Topology Filter open scoped Manifold ContDiff Bundle noncomputable section namespace PoincareMT.M62 variable {n : β„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] {J : Set ℝ} set_option maxHeartbeats 5000000 in -- Expanding the two parameter derivatives and moving Christoffel pairings needs this budget. /-- The actual moving pullback commutator, tested in the fixed metric; MT2015Correction Lemma 0.2, pp. 4-6. -/ theorem flow_pullback_curvature_pair [T2Space M] (F : RicciFlow n M J) (c : ℝ β†’ ℝ β†’ M) (Y : (z : ℝ Γ— ℝ) β†’ TangentSpace (𝓑 n) (c z.1 z.2)) {Omega : Set (ℝ Γ— ℝ)} (hOmega : IsOpen Omega) (hTime : βˆ€ z ∈ Omega, z.2 ∈ interior J) (hc : ContMDiffOn π“˜(ℝ, ℝ Γ— ℝ) (𝓑 n) ∞ (fun z : ℝ Γ— ℝ => c z.1 z.2) Omega) (hY : ContMDiffOn π“˜(ℝ, ℝ Γ— ℝ) (𝓑 n).tangent ∞ (fun z => (⟨c z.1 z.2, Y z⟩ : TangentBundle (𝓑 n) M)) Omega) {x t : ℝ} (hxt : (x, t) ∈ Omega) (Z : TangentSpace (𝓑 n) (c x t)) : (F.metric t).inner (c x t) (rampHorizontalCovariantDerivative (F.connection t) (fun r => c x r) (fun r => rampHorizontalCovariantDerivative (F.connection r) (fun s => c s r) (fun s => Y (s, r)) x) t - rampHorizontalCovariantDerivative (F.connection t) (fun s => c s t) (fun s => rampHorizontalCovariantDerivative (F.connection t) (fun r => c s r) (fun r => Y (s, r)) t) x) Z = (let X := curveVelocity (n := n) (fun s => c s t) x; let U := curveVelocity (n := n) (fun r => c x r) t; let V := Y (x, t); let D := F.connection t; (F.metric t).inner (c x t) (D.curvature (c x t) U X V) Z - D.covariantTensorDerivative D.ricciEvaluation (c x t) ![X, V, Z] - D.covariantTensorDerivative D.ricciEvaluation (c x t) ![V, X, Z] + D.covariantTensorDerivative D.ricciEvaluation (c x t) ![Z, X, V]) := by let E := EuclideanSpace ℝ (Fin n) let : NormedAddCommGroup (E β†’L[ℝ] E) := ContinuousLinearMap.toNormedAddCommGroup let : NormedSpace ℝ (E β†’L[ℝ] E) := ContinuousLinearMap.toNormedSpace let : NormedAddCommGroup (E β†’L[ℝ] E β†’L[ℝ] E) := ContinuousLinearMap.toNormedAddCommGroup let : NormedSpace ℝ (E β†’L[ℝ] E β†’L[ℝ] E) := ContinuousLinearMap.toNormedSpace let cc : ℝ β†’ ℝ β†’ M := fun r s => c s r let YY : (z : ℝ Γ— ℝ) β†’ TangentSpace (𝓑 n) (cc z.1 z.2) := fun z => Y (z.2, z.1) let O := Prod.swap ⁻¹' Omega have hO : IsOpen O := hOmega.preimage continuous_swap have hcc : ContMDiffOn π“˜(ℝ, ℝ Γ— ℝ) (𝓑 n) ∞ (fun z : ℝ Γ— ℝ => cc z.1 z.2) O := hc.comp (contDiff_snd.prodMk contDiff_fst).contMDiff.contMDiffOn (fun z hz => hz) have hYY : ContMDiffOn π“˜(ℝ, ℝ Γ— ℝ) (𝓑 n).tangent ∞ (fun z => (⟨cc z.1 z.2, YY z⟩ : TangentBundle (𝓑 n) M)) O := hY.comp (contDiff_snd.prodMk contDiff_fst).contMDiff.contMDiffOn (fun z hz => hz) let p := c x t let e := chartAt E p let U := O ∩ (fun z : ℝ Γ— ℝ => cc z.1 z.2) ⁻¹' e.source have hU : IsOpen U := hcc.continuousOn.isOpen_inter_preimage hO e.open_source have hbase : p ∈ e.source := mem_chart_source E p have hz : (t, x) ∈ U := ⟨hxt, hbase⟩ have he : ContMDiffOn (𝓑 n) (𝓑 n) ∞ e e.source := contMDiffOn_chart have hi : ContMDiffOn (𝓑 n) (𝓑 n) ∞ e.symm e.target := contMDiffOn_chart_symm let q : ℝ Γ— ℝ β†’ E := fun z => e (cc z.1 z.2) let W : ℝ Γ— ℝ β†’ E := fun z => mfderiv (𝓑 n) (𝓑 n) e (cc z.1 z.2) (YY z) let Gamma : ℝ Γ— E β†’ E β†’L[ℝ] E β†’L[ℝ] E := fun z => RicciFlowAnalysis.shiChartChristoffel (F.connection z.1) e z.2 have hq : ContDiffOn ℝ ∞ q U := (he.comp (hcc.mono inter_subset_left) (fun z hz => hz.2)).contDiffOn have hW : ContDiffOn ℝ ∞ W U := by have h := (PoincareMT.ReducedLengthMinimum.Variation.Geometry.tangentChartPhase_contMDiffOn p).comp (hYY.mono inter_subset_left) (fun z hz => hz.2) exact h.contDiffOn.snd have hGamma : ContDiffOn ℝ ∞ Gamma (J Γ—Λ’ e.target) := flow_chartChristoffel_smooth F p have hmap : MapsTo (fun z : ℝ Γ— ℝ => (z.1, q z)) U (J Γ—Λ’ e.target) := fun z hz => ⟨interior_subset (hTime (z.2, z.1) hz.1), e.map_source hz.2⟩ have hcAt (z : ℝ Γ— ℝ) (hz : z ∈ U) : MDifferentiableAt π“˜(ℝ, ℝ Γ— ℝ) (𝓑 n) (fun z : ℝ Γ— ℝ => cc z.1 z.2) z := (hcc.contMDiffAt (hO.mem_nhds hz.1)).mdifferentiableAt (by simp) have hfst (z : ℝ Γ— ℝ) : MDifferentiableAt π“˜(ℝ, ℝ) π“˜(ℝ, ℝ Γ— ℝ) (fun r : ℝ => (r, z.2)) z.1 := (differentiableAt_id.prodMk (differentiableAt_const z.2)).mdifferentiableAt have hsnd (z : ℝ Γ— ℝ) : MDifferentiableAt π“˜(ℝ, ℝ) π“˜(ℝ, ℝ Γ— ℝ) (fun s : ℝ => (z.1, s)) z.2 := ((differentiableAt_const z.1).prodMk differentiableAt_id).mdifferentiableAt have hT (z : ℝ Γ— ℝ) (hz : z ∈ U) : PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (ReducedLengthMinimum.Variation.Geometry.coordinatePartialS q z) (cc z.1 z.2) = curveVelocity (fun r => cc r z.2) z.1 := PoincareMT.ReducedLength.chartVectorField_coordinate_velocity p (fun r => cc r z.2) z.1 (ReducedLengthMinimum.Variation.Geometry.coordinatePartialS q z) hz.2 (by simpa only [Function.comp_def] using (hcAt z hz).comp z.1 (hfst z)) (ReducedLengthMinimum.Variation.Geometry.coordinateSlice_fst_hasDerivAt q ((hq.contDiffAt (hU.mem_nhds hz)).differentiableAt (by simp))) have hX (z : ℝ Γ— ℝ) (hz : z ∈ U) : PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q z) (cc z.1 z.2) = curveVelocity (fun s => cc z.1 s) z.2 := PoincareMT.ReducedLength.chartVectorField_coordinate_velocity p (fun s => cc z.1 s) z.2 (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q z) hz.2 (by simpa only [Function.comp_def] using (hcAt z hz).comp z.2 (hsnd z)) (ReducedLengthMinimum.Variation.Geometry.coordinateSlice_snd_hasDerivAt q ((hq.contDiffAt (hU.mem_nhds hz)).differentiableAt (by simp))) have hWvalue (z : ℝ Γ— ℝ) (hz : z ∈ U) : PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (W z) (cc z.1 z.2) = YY z := PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField_differential p _ _ hz.2 have htime (A : (z : ℝ Γ— ℝ) β†’ TangentSpace (𝓑 n) (cc z.1 z.2)) (V : ℝ Γ— ℝ β†’ E) (hV : ContDiffOn ℝ ∞ V U) (hvalue : βˆ€ z ∈ U, PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (V z) (cc z.1 z.2) = A z) (z : ℝ Γ— ℝ) (hz : z ∈ U) : mfderiv (𝓑 n) (𝓑 n) e (cc z.1 z.2) (rampHorizontalCovariantDerivative (F.connection z.1) (fun r => cc r z.2) (fun r => A (r, z.2)) z.1) = ReducedLengthMinimum.Variation.Geometry.coordinateCovariantS Gamma q V z := by let B := (fun r : ℝ => (r, z.2)) ⁻¹' U have hB : IsOpen B := hU.preimage (continuous_id.prodMk continuous_const) have hcongr := pullback_congr (F.connection z.1) (Ξ³ := fun r => cc r z.2) (Y := fun r => A (r, z.2)) (Z := fun r => PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (V (r, z.2)) (cc r z.2)) (x := z.1) (by filter_upwards [hB.mem_nhds hz] with r hr exact (hvalue (r, z.2) hr).symm) rw [hcongr, pullback_chart_field_coordinates (F.connection z.1) p (gamma := fun r => cc r z.2) (x := z.1) (by simpa only [Function.comp_def] using (hcAt z hz).comp z.1 (hfst z)) hz.2 hB hz (fun r => V (r, z.2)) (hV.comp (contDiffOn_id.prodMk contDiffOn_const) (fun r hr => hr))] rw [(ReducedLengthMinimum.Variation.Geometry.coordinateSlice_fst_hasDerivAt V ((hV.contDiffAt (hU.mem_nhds hz)).differentiableAt (by simp))).deriv] rw [← hT z hz] erw [RicciFlowAnalysis.shiChartField_duality he hi hz.2] rfl have hspace (A : (z : ℝ Γ— ℝ) β†’ TangentSpace (𝓑 n) (cc z.1 z.2)) (V : ℝ Γ— ℝ β†’ E) (hV : ContDiffOn ℝ ∞ V U) (hvalue : βˆ€ z ∈ U, PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (V z) (cc z.1 z.2) = A z) (z : ℝ Γ— ℝ) (hz : z ∈ U) : mfderiv (𝓑 n) (𝓑 n) e (cc z.1 z.2) (rampHorizontalCovariantDerivative (F.connection z.1) (fun s => cc z.1 s) (fun s => A (z.1, s)) z.2) = ReducedLengthMinimum.Variation.Geometry.coordinateCovariantU Gamma q V z := by let B := (fun s : ℝ => (z.1, s)) ⁻¹' U have hB : IsOpen B := hU.preimage (continuous_const.prodMk continuous_id) have hcongr := pullback_congr (F.connection z.1) (Ξ³ := fun s => cc z.1 s) (Y := fun s => A (z.1, s)) (Z := fun s => PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (V (z.1, s)) (cc z.1 s)) (x := z.2) (by filter_upwards [hB.mem_nhds hz] with s hs exact (hvalue (z.1, s) hs).symm) rw [hcongr, pullback_chart_field_coordinates (F.connection z.1) p (gamma := fun s => cc z.1 s) (x := z.2) (by simpa only [Function.comp_def] using (hcAt z hz).comp z.2 (hsnd z)) hz.2 hB hz (fun s => V (z.1, s)) (hV.comp (contDiffOn_const.prodMk contDiffOn_id) (fun s hs => hs))] rw [(ReducedLengthMinimum.Variation.Geometry.coordinateSlice_snd_hasDerivAt V ((hV.contDiffAt (hU.mem_nhds hz)).differentiableAt (by simp))).deriv] rw [← hX z hz] erw [RicciFlowAnalysis.shiChartField_duality he hi hz.2] rfl let Yx := fun z : ℝ Γ— ℝ => rampHorizontalCovariantDerivative (F.connection z.1) (fun s => cc z.1 s) (fun s => YY (z.1, s)) z.2 let Yt := fun z : ℝ Γ— ℝ => rampHorizontalCovariantDerivative (F.connection z.1) (fun r => cc r z.2) (fun r => YY (r, z.2)) z.1 have hWx := ReducedLengthMinimum.Variation.Geometry.coordinateCovariantU_contDiffOn hU Gamma q W hGamma hq hW hmap have hWt := ReducedLengthMinimum.Variation.Geometry.coordinateCovariantS_contDiffOn hU Gamma q W hGamma hq hW hmap have hYx (z : ℝ Γ— ℝ) (hz : z ∈ U) : PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (ReducedLengthMinimum.Variation.Geometry.coordinateCovariantU Gamma q W z) (cc z.1 z.2) = Yx z := by rw [← hspace YY W hW hWvalue z hz] exact PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField_differential p _ _ hz.2 have hYt (z : ℝ Γ— ℝ) (hz : z ∈ U) : PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (ReducedLengthMinimum.Variation.Geometry.coordinateCovariantS Gamma q W z) (cc z.1 z.2) = Yt z := by rw [← htime YY W hW hWvalue z hz] exact PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField_differential p _ _ hz.2 have hGammaAt : DifferentiableAt ℝ Gamma (t, q (t, x)) := (hGamma.contDiffAt (prod_mem_nhds_iff.mpr ⟨mem_interior_iff_mem_nhds.mp (hTime (x, t) hxt), e.open_target.mem_nhds (e.map_source hbase)⟩)).differentiableAt (by simp) have hGammaSpace : HasFDerivAt (RicciFlowAnalysis.shiChartChristoffel (F.connection t) e) ((fderiv ℝ Gamma (t, q (t, x))).comp ((0 : E β†’L[ℝ] ℝ).prod (ContinuousLinearMap.id ℝ E))) (q (t, x)) := by exact hGammaAt.hasFDerivAt.comp (q (t, x)) ((hasFDerivAt_const t (q (t, x))).prodMk (hasFDerivAt_id (q (t, x)))) have hGammaDer (v : E) : fderiv ℝ (RicciFlowAnalysis.shiChartChristoffel (F.connection t) e) (q (t, x)) v = fderiv ℝ Gamma (t, q (t, x)) (0, v) := by rw [hGammaSpace.fderiv] rfl have hcomm := ReducedLengthMinimum.Variation.Geometry.coordinateCovariant_commutator Gamma q W (hq.contDiffAt (hU.mem_nhds hz)) (hW.contDiffAt (hU.mem_nhds hz)) hGammaAt have hR := RicciFlowAnalysis.shiChart_curvature_formula (F.connection t) he hi (e.map_source hbase) (ReducedLengthMinimum.Variation.Geometry.coordinatePartialS q (t, x)) (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q (t, x)) (W (t, x)) rw [← RicciFlowAnalysis.shiChartField_at_inverse he hi (e.map_source hbase), ← RicciFlowAnalysis.shiChartField_at_inverse he hi (e.map_source hbase), ← RicciFlowAnalysis.shiChartField_at_inverse he hi (e.map_source hbase), e.left_inv hbase] at hR change mfderiv (𝓑 n) (𝓑 n) e p ((F.connection t).curvature p (PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (ReducedLengthMinimum.Variation.Geometry.coordinatePartialS q (t, x)) p) (PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q (t, x)) p) (PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField p (W (t, x)) p)) = _ at hR rw [hT (t, x) hz, hX (t, x) hz, hWvalue (t, x) hz, hGammaDer, hGammaDer] at hR let Ccoord : E := mfderiv (𝓑 n) (𝓑 n) e p ((F.connection t).curvature p (curveVelocity (fun r => cc r x) t) (curveVelocity (fun s => cc t s) x) (YY (t, x))) let B := fderiv ℝ Gamma (t, q (t, x)) (1, 0) (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q (t, x)) (W (t, x)) have hRcoord : Ccoord = (((fderiv ℝ Gamma (t, q (t, x))) (0, ReducedLengthMinimum.Variation.Geometry.coordinatePartialS q (t, x))) (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q (t, x))) (W (t, x)) - (((fderiv ℝ Gamma (t, q (t, x))) (0, ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q (t, x))) (ReducedLengthMinimum.Variation.Geometry.coordinatePartialS q (t, x))) (W (t, x)) + ((Gamma (t, q (t, x))) (ReducedLengthMinimum.Variation.Geometry.coordinatePartialS q (t, x))) (((Gamma (t, q (t, x))) (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q (t, x))) (W (t, x))) - ((Gamma (t, q (t, x))) (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q (t, x))) (((Gamma (t, q (t, x))) (ReducedLengthMinimum.Variation.Geometry.coordinatePartialS q (t, x))) (W (t, x))) := by simpa only [Ccoord, Gamma, q, p, cc] using hR have hcoord : ReducedLengthMinimum.Variation.Geometry.coordinateCovariantS Gamma q (ReducedLengthMinimum.Variation.Geometry.coordinateCovariantU Gamma q W) (t, x) - ReducedLengthMinimum.Variation.Geometry.coordinateCovariantU Gamma q (ReducedLengthMinimum.Variation.Geometry.coordinateCovariantS Gamma q W) (t, x) = Ccoord + B := by calc _ = -(ReducedLengthMinimum.Variation.Geometry.coordinateCovariantU Gamma q (ReducedLengthMinimum.Variation.Geometry.coordinateCovariantS Gamma q W) (t, x) - ReducedLengthMinimum.Variation.Geometry.coordinateCovariantS Gamma q (ReducedLengthMinimum.Variation.Geometry.coordinateCovariantU Gamma q W) (t, x)) := by simp only [sub_eq_add_neg, neg_add] abel _ = _ := by rw [hcomm, hRcoord] dsimp only [B, Gamma, q, p, cc] abel let L : E β†’L[ℝ] ℝ := ((F.metric t).inner p Z).comp (mfderiv (𝓑 n) (𝓑 n) e p).inverse have hL (V : TangentSpace (𝓑 n) p) : L (mfderiv (𝓑 n) (𝓑 n) e p V) = (F.metric t).inner p V Z := by change (F.metric t).inner p Z ((mfderiv (𝓑 n) (𝓑 n) e p).inverse (mfderiv (𝓑 n) (𝓑 n) e p V)) = _ rw [(RicciFlowAnalysis.shiChart_mfderiv_isInvertible he hi hbase).inverse_apply_self] exact (F.metric t).symm p Z V have hGt : HasDerivAt (fun r => Gamma (r, q (t, x))) (fderiv ℝ Gamma (t, q (t, x)) (1, 0)) t := by change HasDerivAt (Gamma ∘ fun r : ℝ => (r, q (t, x))) (fderiv ℝ Gamma (t, q (t, x)) (1, 0)) t simpa only [id_eq] using hGammaAt.hasFDerivAt.comp_hasDerivAt t ((hasDerivAt_id t).prodMk (hasDerivAt_const t (q (t, x)))) have hGB : HasDerivAt (fun r => Gamma (r, q (t, x)) (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q (t, x)) (W (t, x))) B t := by simpa only [map_zero, zero_add, add_zero] using (hGt.clm_apply (hasDerivAt_const t (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q (t, x)))).clm_apply (hasDerivAt_const t (W (t, x))) have hpaired := L.hasFDerivAt.comp_hasDerivAt t hGB have hvariation := hasDerivAt_flow_chartChristoffel_pair F p (hTime (x, t) hxt) hbase (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q (t, x)) (W (t, x)) (mfderiv (𝓑 n) (𝓑 n) e p Z) rw [PoincareMT.ReducedLengthMinimum.Variation.Geometry.chartVectorField_differential p p Z hbase] at hvariation have hvariation' : HasDerivAt (fun r => L (Gamma (r, q (t, x)) (ReducedLengthMinimum.Variation.Geometry.coordinatePartialU q (t, x)) (W (t, x)))) _ t := hvariation.congr_of_eventuallyEq (Eventually.of_forall fun r => (F.metric t).symm p Z _) have hB := hpaired.unique hvariation' dsimp only at hB rw [hX (t, x) hz, hWvalue (t, x) hz] at hB have hfinal := congrArg L hcoord rw [map_sub, map_add, hL, hB] at hfinal rw [← htime Yx _ hWx hYx (t, x) hz, ← hspace Yt _ hWt hYt (t, x) hz, hL, hL] at hfinal change (F.metric t).inner p (_ - _) Z = _ rw [map_sub, sub_apply] convert hfinal using 1 all_goals dsimp only [cc, YY, Yx, Yt, p] ring end PoincareMT.M62