Outward flux of a vector field through the boundary of a box in
DefinitionGaussMagnetism_box_fluxLet be a vector field and let with for . The outward flux of through the boundary of the box is the surface integral
where points along the outward unit normal. The boundary consists of six rectangular faces; on the face the outward normal is and on the face it is . Hence
Box boundaries are the closed surfaces used in this mission to state the integral form of Gauss's law for magnetism (the net magnetic flux through a closed surface is zero).
Formalization Note Space is Larmor.Vec EuclideanSpace ℝ (Fin 3) from the published definition Larmor_vec3. The integrals are Lean interval integrals; if an integrand is not integrable Lean returns , so the value is meaningful for continuous (all theorems using it assume is at least ). The formula is only used with .
import Definitions.Def_TongEM_wave_ops
/-!
# Outward flux of a vector field through the boundary of a box
Support file for the mission on Gauss's law for magnetism (Wikipedia,
"Gauss's law for magnetism", section "Integral form"; Wikipedia, "Maxwell's
equations", section "Flux and divergence").
Space is `Larmor.Vec = EuclideanSpace ℝ (Fin 3)`; the divergence `Larmor.divg`
and curl `Larmor.curl` come from `Def_Larmor_vec3`, and the gradient
`TongEM.grad` and smoothness predicate `TongEM.SmoothV` from
`Def_TongEM_wave_ops`. This file adds the closed surfaces used for the integral
form of the law: boundaries of axis-parallel boxes.
-/
namespace GaussMagnetism
open Larmor
/-- The outward flux `∯_{∂Ω} F · dS` of a vector field `F` through the boundary of
the axis-parallel box `Ω = [a₀, b₀] × [a₁, b₁] × [a₂, b₂]`. The boundary consists
of six rectangular faces; on the face `xᵢ = bᵢ` the outward unit normal is `+eᵢ`
and on the face `xᵢ = aᵢ` it is `-eᵢ`, so the flux through that pair of faces is
the integral over the face of `Fᵢ(…, bᵢ, …) - Fᵢ(…, aᵢ, …)`. The value is only
meaningful when `aᵢ < bᵢ` for every `i`. -/
noncomputable def boxFlux (F : Vec → Vec) (a b : Vec) : ℝ :=
(∫ y in a 1..b 1, ∫ z in a 2..b 2, (F !₂[b 0, y, z] 0 - F !₂[a 0, y, z] 0)) +
(∫ x in a 0..b 0, ∫ z in a 2..b 2, (F !₂[x, b 1, z] 1 - F !₂[x, a 1, z] 1)) +
(∫ x in a 0..b 0, ∫ y in a 1..b 1, (F !₂[x, y, b 2] 2 - F !₂[x, y, a 2] 2))
end GaussMagnetism
Read-back
What the Lean code literally says, in plain math · Aristotle (Harmonic) — same agent as the drafter; non-blind
Non-blind read-back. This read-back was written by the same agent that drafted these Lean statements (Aristotle, by Harmonic), at the explicit request of the proposal owner. It was not produced by an independent auditor who saw only the Lean code, so it is not independent testimony and must not be treated as such. Compare it with the Lean code directly.
This file defines, for a vector field (where is Euclidean space indexed by coordinates ) and two points , a real number equal to the sum of three iterated one-dimensional interval integrals:
Here is the -th component of . The definition places no restriction on or : interval integrals are oriented, so if some the corresponding integrals change sign, and if they vanish; if an integrand is not integrable on the relevant interval, the integral is assigned the value . No hypothesis such as continuity of is built into the definition. The file imports (and does not modify) the previously published definitions of , divergence, curl, gradient and smoothness predicates; it defines nothing else.