Imports
/- Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhi Kai Pong, Joseph Tooby-Smith, Lode Vermeulen -/ module public import Physlib.SpaceAndTime.Space.Derivatives.Grad public import Physlib.SpaceAndTime.Space.DistOfFunction

Divergence on Space

i. Overview

In this module we define the divergence operator on functions and distributions from Space d to EuclideanSpace ℝ (Fin d), and prove various basic properties about it.

ii. Key results

    div : The divergence operator on functions from Space d to EuclideanSpace ℝ (Fin d).

    distDiv : The divergence operator on distributions from Space d to EuclideanSpace ℝ (Fin d).

    distDiv_ofFunction : The divergence of a distribution from a bounded function.

iii. Table of contents

    A. The divergence on functions

      A.1. The divergence on the zero function

      A.2. The divergence on a constant function

      A.3. The divergence distributes over addition

      A.4. The divergence distributes over scalar multiplication

      A.5. The divergence of a linear map is a linear map

    B. Divergence of distributions

      B.1. Basic equalities

      B.2. Divergence on distributions from bounded functions

iv. References

@[expose] public section

A. The divergence on functions

@[inherit_doc div] macro (name := divNotation) "∇" "⬝" f:term:100 : term => `(div $f)d:f:Space d EuclideanSpace (Fin d)hf:Differentiable fx:Space di:Fin d(deriv i (fun x => f x) x).ofLp i = ((fderiv f x) (basis i)).ofLp id:f:Space d EuclideanSpace (Fin d)hf:Differentiable fx:Space di:Fin dDifferentiable f d:f:Space d EuclideanSpace (Fin d)hf:Differentiable fx:Space di:Fin dDifferentiable f All goals completed! 🐙

A.1. The divergence on the zero function

@[simp] lemma div_zero : (0 : Space d EuclideanSpace (Fin d)) = 0 := d:div 0 = 0 d:(fun x => (Multiset.map (fun i => (fderiv (fun x => (0 x).ofLp i) x) (basis i)) Finset.univ.val).sum) = 0 d:(fun x => 0) = 0 All goals completed! 🐙

A.2. The divergence on a constant function

@[simp] lemma div_const : (fun _ : Space d => v) = 0 := d:v:EuclideanSpace (Fin d)(div fun x => v) = 0 d:v:EuclideanSpace (Fin d)(fun x => (Multiset.map (fun i => (fderiv (fun x => ((fun x => v) x).ofLp i) x) (basis i)) Finset.univ.val).sum) = 0 d:v:EuclideanSpace (Fin d)(fun x => 0) = 0 All goals completed! 🐙

A.3. The divergence distributes over addition

d:f1:Space d EuclideanSpace (Fin d)f2:Space d EuclideanSpace (Fin d)hf1:Differentiable f1hf2:Differentiable f2x:Space di:Fin d(fderiv (fun x => (f1 x).ofLp i) x + fderiv (fun x => (f2 x).ofLp i) x) (basis i) = (fderiv (fun x => (f1 x).ofLp i) x) (basis i) + (fderiv (fun x => (f2 x).ofLp i) x) (basis i)d:f1:Space d EuclideanSpace (Fin d)f2:Space d EuclideanSpace (Fin d)hf1:Differentiable f1hf2:Differentiable f2x:Space di:Fin dDifferentiableAt (fun x => (f1 x).ofLp i) xd:f1:Space d EuclideanSpace (Fin d)f2:Space d EuclideanSpace (Fin d)hf1:Differentiable f1hf2:Differentiable f2x:Space di:Fin dDifferentiableAt (fun x => (f2 x).ofLp i) x d:f1:Space d EuclideanSpace (Fin d)f2:Space d EuclideanSpace (Fin d)hf1:Differentiable f1hf2:Differentiable f2x:Space di:Fin dDifferentiableAt (fun x => (f1 x).ofLp i) xd:f1:Space d EuclideanSpace (Fin d)f2:Space d EuclideanSpace (Fin d)hf1:Differentiable f1hf2:Differentiable f2x:Space di:Fin dDifferentiableAt (fun x => (f2 x).ofLp i) x d:f1:Space d EuclideanSpace (Fin d)f2:Space d EuclideanSpace (Fin d)hf1:Differentiable f1hf2:Differentiable f2x:Space di:Fin dDifferentiableAt (fun x => (f1 x).ofLp i) x All goals completed! 🐙 d:f1:Space d EuclideanSpace (Fin d)f2:Space d EuclideanSpace (Fin d)hf1:Differentiable f1hf2:Differentiable f2x:Space di:Fin dDifferentiableAt (fun x => (f2 x).ofLp i) x All goals completed! 🐙

A.4. The divergence distributes over scalar multiplication

d:f:Space d EuclideanSpace (Fin d)k:hf:Differentiable fx:Space di:Fin d(k fderiv (fun x => (f x).ofLp i) x) (basis i) = k * (fderiv (fun x => (f x).ofLp i) x) (basis i)d:f:Space d EuclideanSpace (Fin d)k:hf:Differentiable fx:Space di:Fin dDifferentiableAt (fun x => (f x).ofLp i) x d:f:Space d EuclideanSpace (Fin d)k:hf:Differentiable fx:Space di:Fin dDifferentiableAt (fun x => (f x).ofLp i) x d:f:Space d EuclideanSpace (Fin d)k:hf:Differentiable fx:Space di:Fin dDifferentiableAt (fun x => (f x).ofLp i) x All goals completed! 🐙

A.5. The divergence of a linear map is a linear map

W:Type u_1inst✝¹:NormedAddCommGroup Winst✝:NormedSpace Wf:W Space EuclideanSpace (Fin 3)hf: (w : W), Differentiable (f w)hf':IsLinearMap fk:w:WDifferentiable (f w) All goals completed! 🐙

B. Divergence of distributions

@[inherit_doc distDiv] macro (name := distDivNotation) "∇ᵈ" "⬝" f:term:100 : term => `(distDiv $f)

B.1. Basic equalities

lemma distDiv_apply_eq_sum_fderivD {d} (f : (Space d) →d[] EuclideanSpace (Fin d)) (η : 𝓢(Space d, )) : (∇ᵈ f) η = i, fderivD f η (basis i) i := d:f:(Space d)→d[] EuclideanSpace (Fin d)η:𝓢(Space d, )(distDiv f) η = i, ((((fderivD ) f) η) (basis i)).ofLp i All goals completed! 🐙d:f:(Space d)→d[] EuclideanSpace (Fin d)η:𝓢(Space d, ) i, ((((fderivD ) f) η) (basis i)).ofLp i = i, (((distDeriv i) f) η).ofLp i All goals completed! 🐙

B.2. Divergence on distributions from bounded functions

The divergence of a distribution from a bounded function.

All goals completed! 🐙