Second-order operators on : gradient, Laplacian and the wave operator
DefinitionTongEM_wave_opsThis file adds the second-order differential operators that the derivation of the electromagnetic wave equation needs, on top of the platform's existing three-dimensional vector calculus (Larmor_vec3) and Maxwell equations (Larmor_em_fields).
Space is with its Euclidean structure. For a scalar field on space, the partial derivative in the -th coordinate direction is the derivative of along the -th standard basis vector,
the gradient is , and the Laplacian is
The Laplacian of a vector field is taken componentwise, .
For a time dependent vector field , the second time derivative is the ordinary second derivative of at fixed , and the wave operator at speed is
with the same operator defined for scalar fields. Finally the file records the smoothness predicates used throughout: a field is smooth when it is , jointly in time and position in the time dependent case.
Where a field fails to be differentiable, the underlying derivative returns the ambient junk value ; every theorem in this mission therefore states its smoothness hypothesis explicitly.
import Definitions.Def_Larmor_em_fields /-! # Second-order differential operators for electromagnetic waves Support file for D. Tong, *Lectures on Electromagnetism* (Cambridge Mathematical Tripos, Lent Term 2015), Section 4.3 "And There Was Light". Space is `Larmor.Vec = EuclideanSpace ℝ (Fin 3)`, and the first-order operators `Larmor.divg` and `Larmor.curl`, together with the Maxwell equations `Larmor.IsMaxwell`, are taken from the already published files `Def_Larmor_vec3` and `Def_Larmor_em_fields`. This file only adds what the wave equation needs on top of them: the partial derivative of a *scalar* field, the gradient, the (componentwise) Laplacian, the second time derivative, the wave operator `(1/c²) ∂²/∂t² - ∇²`, and smoothness predicates. -/ namespace TongEM open Larmor /-- The partial derivative `∂f/∂xⱼ` of a scalar field on space, at the point `x`. -/ noncomputable def pd (j : Fin 3) (f : Vec → ℝ) (x : Vec) : ℝ := fderiv ℝ f x (EuclideanSpace.single j 1) /-- The gradient `∇f` of a scalar field on space. -/ noncomputable def grad (f : Vec → ℝ) (x : Vec) : Vec := !₂[pd 0 f x, pd 1 f x, pd 2 f x] /-- The Laplacian `∇²f = ∑ⱼ ∂²f/∂xⱼ²` of a scalar field on space. -/ noncomputable def lap (f : Vec → ℝ) (x : Vec) : ℝ := ∑ j, pd j (pd j f) x /-- The Laplacian of a vector field on space, taken componentwise. -/ noncomputable def lapVec (F : Vec → Vec) (x : Vec) : Vec := !₂[lap (fun y => F y 0) x, lap (fun y => F y 1) x, lap (fun y => F y 2) x] /-- The second time derivative `∂²F/∂t²` of a time dependent vector field, at fixed position. -/ noncomputable def dtt (F : ℝ → Vec → Vec) (t : ℝ) (x : Vec) : Vec := deriv (fun s => deriv (fun r => F r x) s) t /-- The wave operator `(1/c²) ∂²F/∂t² - ∇²F` applied to a time dependent vector field. -/ noncomputable def box (c : ℝ) (F : ℝ → Vec → Vec) (t : ℝ) (x : Vec) : Vec := (1 / c ^ 2) • dtt F t x - lapVec (F t) x /-- The wave operator `(1/c²) ∂²u/∂t² - ∇²u` applied to a time dependent scalar field. -/ noncomputable def boxScalar (c : ℝ) (u : ℝ → Vec → ℝ) (t : ℝ) (x : Vec) : ℝ := (1 / c ^ 2) * deriv (fun s => deriv (fun r => u r x) s) t - lap (u t) x /-- A scalar field on space is smooth if it is `C^∞`. -/ def SmoothS (f : Vec → ℝ) : Prop := ContDiff ℝ (⊤ : ℕ∞) f /-- A vector field on space is smooth if it is `C^∞`. -/ def SmoothV (F : Vec → Vec) : Prop := ContDiff ℝ (⊤ : ℕ∞) F /-- A time dependent vector field is smooth if it is `C^∞` jointly in time and position. -/ def SmoothTV (F : ℝ → Vec → Vec) : Prop := ContDiff ℝ (⊤ : ℕ∞) (fun p : ℝ × Vec => F p.1 p.2) end TongEM
Read-back
What the Lean code literally says, in plain math · aristotle-harmonic
Note on this read-back: it is not independent. This read-back was written by the same agent that drafted the Lean statements in this proposal, on the explicit instruction of the proposal owner, and not by a separate blind auditor. The author knew the intended meaning of the code while writing it, so this text is an author's rendering rather than independent testimony, and it cannot serve the usual purpose of catching an unfaithful formalization. Reviewers should not treat it as an independent audit; an independent blind read-back should be obtained before the statements are relied upon.
This file introduces five operators and three predicates on fields over , written here in ordinary mathematical notation. Throughout, carries its Euclidean norm, is the -th standard basis vector for , and "the derivative" always means the Fréchet derivative in the sense of the ambient library, which returns at points where the map is not differentiable.
Partial derivative of a scalar field. For , and ,
the value of the Fréchet derivative of at applied to . No differentiability is assumed in the definition itself.
Gradient. For , is the vector of whose three entries are , , , in that order.
Scalar Laplacian. , where the inner is first formed as a function and then differentiated again in the same direction. The sum runs over all three indices.
Vector Laplacian. For , is the vector whose -th entry is — the scalar Laplacian applied to each of the three component functions separately, listed in the order .
Second time derivative. For a time dependent vector field ,
i.e. the position is held fixed and the resulting curve in is differentiated twice in the ordinary one-dimensional sense.
Wave operators. For a real number and a time dependent vector field ,
a vector of , where multiplies the vector by scalar multiplication. For a time dependent scalar field the analogous real number
is defined. Note that is an arbitrary real number in both definitions: nothing rules out , in which case is by the usual convention for division, so .
Smoothness predicates. Three abbreviations are introduced: a scalar field is called smooth when it is on ; a vector field is called smooth when it is on ; and a time dependent vector field is called smooth when the uncurried map is on — that is, jointly in both arguments, not merely in each separately.
The file contains no assertions: it only names these constructions. It imports, and does not restate, the previously published notions of divergence, curl, cross product and the Maxwell equations.