Imports
/- Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Nikolai Kashcheev, Joseph Tooby-Smith -/ module public import Physlib.Relativity.Tensors.RealTensor.Vector.Basic public import Physlib.SpaceAndTime.Space.Module public import Physlib.SpaceAndTime.Time.Basic public import Mathlib.Analysis.Calculus.Deriv.Inv public import Mathlib.Analysis.InnerProductSpace.Calculus

Time Derivatives

i. Overview

In this module we define and prove basic lemmas about derivatives of functions on Time.

ii. Key results

    deriv : The derivative of a function Time → M at a given time.

    manifoldDeriv : The derivative of a function from Time to a manifold.

iii. Table of contents

    A. The definition of the derivative

      A.1. Derivatives of functions into vector spaces

      A.2. Derivatives of functions into manifolds

    B. Linearlity properties of the derivative

    C. Derivative of constant functions

    D. Smoothness properties

    E. Derivatives of components

iv. References

@[expose] public section

A. The definition of the derivative

A.1. Derivatives of functions into vector spaces

@[inherit_doc deriv] scoped notation "∂ₜ" => derivlemma deriv_eq [AddCommGroup M] [Module M] [TopologicalSpace M] (f : Time M) (t : Time) : Time.deriv f t = fderiv f t 1 := rfl

A.2. Derivatives of functions into manifolds

B. Linearlity properties of the derivative

d:t:Timef:Time EuclideanSpace (Fin d)k:hf:Differentiable f(k fderiv f t) 1 = k ∂ₜ (fun t => f t) td:t:Timef:Time EuclideanSpace (Fin d)k:hf:Differentiable fDifferentiableAt f t d:t:Timef:Time EuclideanSpace (Fin d)k:hf:Differentiable fDifferentiableAt f t All goals completed! 🐙M:Typet:Timeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mf:Time M(-fderiv f t) 1 = -∂ₜ f t All goals completed! 🐙All goals completed! 🐙All goals completed! 🐙All goals completed! 🐙

Quotient rule for Time.deriv on real-valued functions: if c and g are differentiable at t and g t ≠ 0, then ∂ₜ (c / g) t = (∂ₜ c t * g t - c t * ∂ₜ g t) / (g t)^2.

t:Timec:Time g:Time hc:DifferentiableAt c thg:DifferentiableAt g thgz:g t 0(fderiv (fun s => c s / g s) t) 1 = ((fderiv c t) 1 * g t - c t * (fderiv g t) 1) / g t ^ 2 t:Timec:Time g:Time hc:DifferentiableAt c thg:DifferentiableAt g thgz:g t 0(fderiv (fun s => c s * (g s)⁻¹) t) 1 = (fderiv c t) 1 * g t * (g t)⁻¹ ^ 2 - c t * (fderiv g t) 1 * (g t)⁻¹ ^ 2 t:Timec:Time g:Time hc:DifferentiableAt c thg:DifferentiableAt g thgz:g t 0-(c t * ((fderiv g t) 1 * (g t ^ 2)⁻¹)) + (g t)⁻¹ * (fderiv c t) 1 = (fderiv c t) 1 * g t * (g t ^ 2)⁻¹ - c t * (fderiv g t) 1 * (g t ^ 2)⁻¹ t:Timec:Time g:Time hc:DifferentiableAt c thg:DifferentiableAt g thgz:g t 0-(c t * (fderiv g t) 1) + g t * (fderiv c t) 1 = g t * (fderiv c t) 1 - c t * (fderiv g t) 1 All goals completed! 🐙

C. Derivative of constant functions

M:Typet:Timeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mm:M(fderiv (fun x => m) t) 1 = 0 All goals completed! 🐙

D. Smoothness properties

@[fun_prop] lemma val_contDiff {n : WithTop ℕ∞} : ContDiff n Time.val := n:ℕ∞ωContDiff n val n:ℕ∞ωContDiff n toRealCLM All goals completed! 🐙M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mf:Time Mhf:Differentiable f Differentiable (fderiv f) ContDiff (fderiv (fderiv f))Differentiable fun t => fderiv f t All goals completed! 🐙@[fun_prop] lemma deriv_contDiff_of_contDiff {M : Type} [NormedAddCommGroup M] [NormedSpace M] (f : Time M) (hf : ContDiff f) : ContDiff (∂ₜ f) := M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mf:Time Mhf:ContDiff fContDiff (∂ₜ f) M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mf:Time Mhf:ContDiff fContDiff fun t => (fderiv f t) 1 M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mf:Time Mhf:ContDiff fContDiff ((fun x => x 1) fun t => fderiv f t) M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mf:Time Mhf:ContDiff fContDiff fun x => x 1M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mf:Time Mhf:ContDiff fContDiff fun t => fderiv f t M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mf:Time Mhf:ContDiff fContDiff fun x => x 1M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mf:Time Mhf:ContDiff fContDiff fun t => fderiv f t All goals completed! 🐙@[fun_prop] lemma deriv_contDiff_of_space {n} {M : Type} [NormedAddCommGroup M] [NormedSpace M] (f : Time Space d M) (hf : ContDiff (n + 1) f) : ContDiff n fun (x : Space d) => (∂ₜ fun t => f t x) t := d:t:Timen:ℕ∞ωM:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mf:Time Space d Mhf:ContDiff (n + 1) fContDiff n fun x => ∂ₜ (fun t => f t x) t d:t:Timen:ℕ∞ωM:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace Mf:Time Space d Mhf:ContDiff (n + 1) fContDiff n fun x => (fderiv (fun t => f t x) t) 1 All goals completed! 🐙

E. Derivatives of components

n:f:Time EuclideanSpace (Fin n)hf: (i : Fin n), Differentiable fun t => (f t).ofLp i (i : Fin n), Differentiable fun x => (f x).ofLp i All goals completed! 🐙All goals completed! 🐙 n:μ:Fin nf:Time EuclideanSpace (Fin n)hf:Differentiable ft:TimeDifferentiableAt (⇑(EuclideanSpace.proj μ)) (f t) All goals completed! 🐙 n:μ:Fin nf:Time EuclideanSpace (Fin n)hf:Differentiable ft:TimeDifferentiableAt (fun x => f x) t All goals completed! 🐙n:μ:Fin nf:Time EuclideanSpace (Fin n)hf:Differentiable ft:Timedt:Time(fderiv (⇑(EuclideanSpace.proj μ)) (f t) ∘SL fderiv (fun x => f x) t) dt = ((fderiv (fun t => f t) t) dt).ofLp μn:μ:Fin nf:Time EuclideanSpace (Fin n)hf:Differentiable ft:Timedt:TimeDifferentiableAt (⇑(EuclideanSpace.proj μ)) (f t)n:μ:Fin nf:Time EuclideanSpace (Fin n)hf:Differentiable ft:Timedt:TimeDifferentiableAt (fun x => f x) t n:μ:Fin nf:Time EuclideanSpace (Fin n)hf:Differentiable ft:Timedt:Time(fderiv (⇑(EuclideanSpace.proj μ)) (f t) ∘SL fderiv (fun x => f x) t) dt = ((fderiv (fun t => f t) t) dt).ofLp μ All goals completed! 🐙 n:μ:Fin nf:Time EuclideanSpace (Fin n)hf:Differentiable ft:Timedt:TimeDifferentiableAt (⇑(EuclideanSpace.proj μ)) (f t) All goals completed! 🐙 n:μ:Fin nf:Time EuclideanSpace (Fin n)hf:Differentiable ft:Timedt:TimeDifferentiableAt (fun x => f x) t All goals completed! 🐙d:f:Time Lorentz.Vector dhf:Differentiable ft:Timei:Fin 1 Fin d(Lorentz.Vector.coordCLM i) (∂ₜ (fun x => f x) t) = ∂ₜ (fun x => f x) t i All goals completed! 🐙 d:f:Time Lorentz.Vector dhf:Differentiable ft:Timei:Fin 1 Fin dDifferentiableAt (⇑(Lorentz.Vector.coordCLM i)) (f t) All goals completed! 🐙 d:f:Time Lorentz.Vector dhf:Differentiable ft:Timei:Fin 1 Fin dDifferentiableAt (fun x => f x) t All goals completed! 🐙lemma deriv_space {d : } {f : Time Space d} (hf : Differentiable f) (t : Time) (i : Fin d) : deriv (fun s => f s i) t = deriv f t i := (Space.fderiv_space_components i f hf t 1).symm