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 ℝ f⊢ DifferentiableAt ℝ f t d:ℕt:Timef:Time → EuclideanSpace ℝ (Fin d)k:ℝhf:Differentiable ℝ f⊢ DifferentiableAt ℝ 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 ℝ ∞ f⊢ ContDiff ℝ ∞ (∂ₜ f) M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace ℝ Mf:Time → Mhf:ContDiff ℝ ∞ f⊢ ContDiff ℝ ∞ fun t => (fderiv ℝ f t) 1 M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace ℝ Mf:Time → Mhf:ContDiff ℝ ∞ f⊢ ContDiff ℝ ∞ ((fun x => x 1) ∘ fun t => fderiv ℝ f t) M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace ℝ Mf:Time → Mhf:ContDiff ℝ ∞ f⊢ ContDiff ℝ ∞ fun x => x 1M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace ℝ Mf:Time → Mhf:ContDiff ℝ ∞ f⊢ ContDiff ℝ ∞ fun t => fderiv ℝ f t M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace ℝ Mf:Time → Mhf:ContDiff ℝ ∞ f⊢ ContDiff ℝ ∞ fun x => x 1M:Typeinst✝¹:NormedAddCommGroup Minst✝:NormedSpace ℝ Mf:Time → Mhf:ContDiff ℝ ∞ f⊢ ContDiff ℝ ∞ 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) ↿f⊢ ContDiff ℝ 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) ↿f⊢ ContDiff ℝ 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:Time⊢ DifferentiableAt ℝ (⇑(EuclideanSpace.proj μ)) (f t) All goals completed! 🐙 n:ℕμ:Fin nf:Time → EuclideanSpace ℝ (Fin n)hf:Differentiable ℝ ft:Time⊢ DifferentiableAt ℝ (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:Time⊢ DifferentiableAt ℝ (⇑(EuclideanSpace.proj μ)) (f t)n:ℕμ:Fin nf:Time → EuclideanSpace ℝ (Fin n)hf:Differentiable ℝ ft:Timedt:Time⊢ DifferentiableAt ℝ (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:Time⊢ DifferentiableAt ℝ (⇑(EuclideanSpace.proj μ)) (f t) All goals completed! 🐙 n:ℕμ:Fin nf:Time → EuclideanSpace ℝ (Fin n)hf:Differentiable ℝ ft:Timedt:Time⊢ DifferentiableAt ℝ (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 d⊢ DifferentiableAt ℝ (⇑(Lorentz.Vector.coordCLM i)) (f t) All goals completed! 🐙 d:ℕf:Time → Lorentz.Vector dhf:Differentiable ℝ ft:Timei:Fin 1 ⊕ Fin d⊢ DifferentiableAt ℝ (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