import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.Mathlib.DiffeomorphDerivative /-! Totalized derivatives under the fixed pre-carrier diffeomorphism. This calculus supports Morgan--Tian Definition 15.8, pp. 361-362, for the transport derived in `proof-work/tasks/M51/derivations/2026-09-24-event-transport.md`. -/ set_option autoImplicit false open scoped Manifold ContDiff namespace Diffeomorph variable {๐•œ : Type*} [NontriviallyNormedField ๐•œ] {Eโ‚ : Type*} [NormedAddCommGroup Eโ‚] [NormedSpace ๐•œ Eโ‚] {Eโ‚‚ : Type*} [NormedAddCommGroup Eโ‚‚] [NormedSpace ๐•œ Eโ‚‚] {Eโ‚ƒ : Type*} [NormedAddCommGroup Eโ‚ƒ] [NormedSpace ๐•œ Eโ‚ƒ] {Hโ‚ : Type*} [TopologicalSpace Hโ‚] {Hโ‚‚ : Type*} [TopologicalSpace Hโ‚‚] {Hโ‚ƒ : Type*} [TopologicalSpace Hโ‚ƒ] {Iโ‚ : ModelWithCorners ๐•œ Eโ‚ Hโ‚} {Iโ‚‚ : ModelWithCorners ๐•œ Eโ‚‚ Hโ‚‚} {Iโ‚ƒ : ModelWithCorners ๐•œ Eโ‚ƒ Hโ‚ƒ} {Mโ‚ : Type*} [TopologicalSpace Mโ‚] [ChartedSpace Hโ‚ Mโ‚] {Mโ‚‚ : Type*} [TopologicalSpace Mโ‚‚] [ChartedSpace Hโ‚‚ Mโ‚‚] {Mโ‚ƒ : Type*} [TopologicalSpace Mโ‚ƒ] [ChartedSpace Hโ‚ƒ Mโ‚ƒ] {n : โ„•โˆžฯ‰} /-- Precomposition by a diffeomorphism respects totalized derivatives. This supports the reference-map transport for Definition 15.8, pp. 361-362. -/ theorem mfderiv_precomp (e : Diffeomorph Iโ‚ Iโ‚‚ Mโ‚ Mโ‚‚ n) (hn : n โ‰  0) (f : Mโ‚‚ โ†’ Mโ‚ƒ) (x : Mโ‚) : mfderiv Iโ‚ Iโ‚ƒ (f โˆ˜ e) x = (mfderiv Iโ‚‚ Iโ‚ƒ f (e x)).comp (mfderiv Iโ‚ Iโ‚‚ e x) := by by_cases hf : MDifferentiableAt Iโ‚‚ Iโ‚ƒ f (e x) ยท exact _root_.mfderiv_comp x hf (e.contMDiff.mdifferentiable hn x) ยท have hcomp : ยฌ MDifferentiableAt Iโ‚ Iโ‚ƒ (f โˆ˜ e) x := by intro h have hback := h.comp_of_eq (e x) (e.symm.contMDiff.mdifferentiable hn _) (e.symm_apply_apply x) have heq : (f โˆ˜ e) โˆ˜ e.symm = f := funext (fun y => congrArg f (e.apply_symm_apply y)) rw [heq] at hback exact hf hback rw [mfderiv_zero_of_not_mdifferentiableAt hcomp, mfderiv_zero_of_not_mdifferentiableAt hf, ContinuousLinearMap.zero_comp] end Diffeomorph