Merge pull request #422 from HEPLean/Tensors

chore: Lint & remove TODO
This commit is contained in:
Joseph Tooby-Smith 2025-03-24 05:46:36 -04:00 committed by GitHub
commit 34c300ccc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 12 deletions

View file

@ -15,15 +15,22 @@ namespace Electromagnetism
/-- An electromagnetic system consists of charge density, a current density,
the speed ofl light and the electric permittivity. -/
structure EMSystem where
/-- The charge density. -/
ρ : SpaceTime →
/-- The current density. -/
J : SpaceTime → EuclideanSpace (Fin 3)
/-- The speed of light. -/
c :
/-- The permittivity. -/
ε₀ :
TODO "Charge density and current desnity should be generalized to signed measures, in such a way
that they are still easy to work with and can be integrated with with tensor notation.
See here:
https://leanprover.zulipchat.com/#narrow/channel/479953-PhysLean/topic/Maxwell's.20Equations"
/-- The charge density. -/
abbrev ChargeDensity := SpaceTime →
/-- Current density. -/
abbrev CurrentDensity := SpaceTime → EuclideanSpace (Fin 3)
namespace EMSystem
variable (𝓔 : EMSystem)
open SpaceTime
@ -34,10 +41,13 @@ noncomputable def μ₀ : := 1/(𝓔.c^2 * 𝓔.ε₀)
/-- Coulomb's constant. -/
noncomputable def coulombConstant : := 1/(4 * Real.pi * 𝓔.ε₀)
end EMSystem
variable (𝓔 : EMSystem) (ρ : ChargeDensity) (J : CurrentDensity)
open SpaceTime
local notation "ε₀" => 𝓔.ε₀
local notation "μ₀" => 𝓔.μ₀
local notation "J" => 𝓔.J
local notation "ρ" => 𝓔.ρ
/-- Gauss's law for the Electric field. -/
def GaussLawElectric (E : ElectricField) : Prop :=
@ -57,11 +67,10 @@ def FaradayLaw (E : ElectricField) (B : MagneticField) : Prop :=
/-- Maxwell's equations. -/
def MaxwellEquations (E : ElectricField) (B : MagneticField) : Prop :=
𝓔.GaussLawElectric E ∧ GaussLawMagnetic B ∧
FaradayLaw E B ∧ 𝓔.AmpereLaw E B
GaussLawElectric 𝓔 ρ E ∧ GaussLawMagnetic B ∧
FaradayLaw E B ∧ AmpereLaw 𝓔 J E B
TODO "Show that if the charge density is spherically symmetric,
then the electric field is also spherically symmetric."
end EMSystem
end Electromagnetism

View file

@ -12,8 +12,6 @@ import PhysLean.Meta.TODO.Basic
open System
TODO "Make this definition more functional in style. In other words, remove the for loop."
/-- The recursive function underlying `allFilePaths`. -/
partial def allFilePaths.go (prev : Array FilePath)
(root : String) (path : FilePath) : IO (Array FilePath) := do

View file

@ -77,7 +77,7 @@ unsafe def processFileArray (files : Array FilePath) : IO Unit := do
if files.toList.length = 0 then
return ()
if files.toList.length = 1 then
let path? := files.get? 0
let path? := files[0]?
match path? with
| some path =>
transverseTactics path visitTacticInfo