Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
439e3fb
refactor(CKMMatrix): golf row normalization/orthogonality proofs
Vilin97 Jun 25, 2026
535375d
refactor(CKMMatrix): golf rows_linearly_independent dispatch
Vilin97 Jun 25, 2026
a44257e
refactor(CKMMatrix): golf phaseShiftApply entry lemmas via shared lemma
Vilin97 Jun 25, 2026
d572bef
refactor(CKMMatrix): golf shift_*_phase_zero proofs via phase-cancel …
Vilin97 Jun 25, 2026
df68617
refactor(Units): golf npow projection lemmas via shared lemma
Vilin97 Jun 25, 2026
9468761
refactor(Units): golf div projection lemmas via shared lemma
Vilin97 Jun 25, 2026
c477e0d
refactor(Weyl): golf *ToMatrix_symm_expand_tmul proofs via shared lemma
Vilin97 Jun 25, 2026
440722a
refactor(SU5): golf chiral-index no-exotics proofs
Vilin97 Jun 25, 2026
43eaf88
style(CKMMatrix): wrap over-long line in cexp_phase_mul_eq_norm
Vilin97 Jun 25, 2026
4b06eb8
refactor(Tensors): golf *ToMatrix(Re)_symm_expand_tmul proofs via sha…
Vilin97 Jun 25, 2026
2c4b4ca
refactor(SU5): golf chiralIndicesOf*_subset_sum_le_three proofs
Vilin97 Jun 25, 2026
3182ad2
refactor(SU5): golf ofPotentialTerm'_*_finset proofs
Vilin97 Jun 25, 2026
90a325f
refactor(Fluxes): golf numChiral_eq_sum_sub proofs via shared lemma
Vilin97 Jun 25, 2026
0d9f780
refactor(UnitDependent): golf isDimensionallyCorrect_fun_* proofs
Vilin97 Jun 25, 2026
3331cdf
refactor(DimSevenPlane): golf B₀–B₆_cubic simp lists
Vilin97 Jun 25, 2026
f958c9d
refactor(LorentzGroup): golf boost proofs and boost_zero_* cluster
Vilin97 Jun 25, 2026
63b6879
refactor(LorentzGroup): golf ofSpecialOrthogonal via shared lemma
Vilin97 Jun 25, 2026
4257c7c
refactor(Space.Derivatives): golf inner_apply differentiability lemmas
Vilin97 Jun 25, 2026
91c8129
refactor(Space.Norm): golf radial-integral and tendsTo proofs via hel…
Vilin97 Jun 25, 2026
b33b35b
refactor(Space.IsDistBounded): share integrability reduction helper
Vilin97 Jun 25, 2026
56da21f
refactor: collapse `apply X; · fun_prop; · fun_prop` to `apply X <;> …
Vilin97 Jun 25, 2026
b57fb56
refactor(HarmonicOscillator.Completeness): golf orthogonal_exp proof
Vilin97 Jun 25, 2026
ff82d83
refactor(WickAlgebra.SuperCommute): collapse rfl dispatch to `<;> rfl`
Vilin97 Jun 25, 2026
7ddfc34
refactor: collapse two-goal `· simp; · simp` dispatch to `<;> simp`
Vilin97 Jun 25, 2026
51dfdbd
refactor(IsLocalizedfunctionTransform): golf via shared locality helpers
Vilin97 Jun 25, 2026
7164c8a
refactor(HasVarAdjoint): golf adjFDeriv_apply and unique
Vilin97 Jun 25, 2026
0bc211d
refactor(VariationalCalculus.Basic): golf fundamental_theorem proof
Vilin97 Jun 25, 2026
2fb0d74
refactor(ComplexTensor.Matrix.Pre): golf *ToMatrix_ρ cluster via helper
Vilin97 Jun 25, 2026
4ee4ed2
refactor(RealTensor.Matrix.Pre): golf *ToMatrixRe_ρ cluster via helper
Vilin97 Jun 25, 2026
259f30f
refactor(SU5.AllowsTerm): golf allowsTermForm dispatch proofs
Vilin97 Jun 25, 2026
cb59e5e
refactor(SU5.PhenoClosed): share q5/q10 filter-empty helper
Vilin97 Jun 25, 2026
08f7e2e
refactor(IdealGas): golf partitionZ_eq and measurable_H via helpers
Vilin97 Jun 25, 2026
963ad5b
refactor(Fin.Involutions): golf involutionCons and involutionNoFixedS…
Vilin97 Jun 25, 2026
5e1681f
refactor(EMPotential): golf spaceTime_deriv_action_eq_sum and dedup e…
Vilin97 Jun 25, 2026
46ceeb0
refactor(Weyl.Two): golf *ToMatrix_ρ cluster via helper (−203 lines)
Vilin97 Jun 25, 2026
0a34093
refactor(Tensors): golf *ToMatrix_ρ_symm clusters via map_symm_of_ρ h…
Vilin97 Jun 25, 2026
348b2c0
refactor(InnerProductSpace.Basic): golf inner_top_equiv_norm and bound
Vilin97 Jun 25, 2026
ec570b0
refactor(TwoHDM.Potential): golf stabilityCounterExample proof
Vilin97 Jun 25, 2026
bf00544
refactor(KineticTerm): share HasVarGradientAt construction via helper
Vilin97 Jun 25, 2026
5a5ee57
refactor(IsExtrema): dedup differentiability side-conditions
Vilin97 Jun 25, 2026
1e6c58d
refactor(Rotations): collapse one_mem' to `constructor <;> simp`
Vilin97 Jun 25, 2026
cff85ae
refactor(SU5.MinimalSuperSet): golf exists_minimalSuperSet
Vilin97 Jun 25, 2026
06d283d
refactor(SU5.Completions): golf exist_completions_subset_of_complete
Vilin97 Jun 25, 2026
0b4a91d
refactor(SU5.Map): golf map_ofPotentialTerm_toFinset via structural h…
Vilin97 Jun 25, 2026
ffa638d
refactor(SL2C.SelfAdjoint): golf detA_one in toSelfAdjointMap_det_one'
Vilin97 Jun 25, 2026
454ccb1
refactor(PauliMatrices.AsTensor): golf asConsTensor isIntertwining calc
Vilin97 Jun 25, 2026
6c507e9
refactor(HarmonicOscillator.Solution): golf trajectories_unique, retu…
Vilin97 Jun 25, 2026
8a3540e
refactor(DampedHarmonicOscillator.Solution): golf base velocity/accel…
Vilin97 Jun 25, 2026
14394fb
refactor(ConstantTimeDist): dedup integrability/seminorm bounds via h…
Vilin97 Jun 25, 2026
f16a792
refactor(HasVarAdjDeriv): golf via deriv_sum_smul_const helper (−101)
Vilin97 Jun 25, 2026
390b901
refactor(LaplaceRungeLenzVector): golf positionDotMomentum_commutatio…
Vilin97 Jun 25, 2026
dfd9e18
refactor(List.InsertionSort): golf via rel_of_not_rel/val_succAbove h…
Vilin97 Jun 25, 2026
6142d92
refactor(PolyBddSchwartzSubmodule): golf dense_top/dense_zero_top (−3)
Vilin97 Jun 25, 2026
91b8825
refactor(RealTensor.ToComplex): golf toComplex_repr, prodT/contrT_toC…
Vilin97 Jun 25, 2026
e07dcee
refactor(Operators.Multiplication): golf mulOperator_adjoint_domain_l…
Vilin97 Jun 25, 2026
d13cbc4
refactor(ConstantSliceDist): dedup slice-integral bounds via helpers …
Vilin97 Jun 25, 2026
2352a55
refactor(CanonicalEnsemble.Lemmas): golf 14 thermodynamic proofs (−324)
Vilin97 Jun 25, 2026
c54fb04
refactor(TightBindingChain.Basic): golf quantaWaveNumber/energyEigens…
Vilin97 Jun 25, 2026
855494d
refactor(Space.Derivatives.Curl): golf homotopyOperatorIntegrand_cont…
Vilin97 Jun 25, 2026
a47e5f8
refactor(Mathematics.Fin): golf succAbove_succAbove_predAboveI via Ma…
Vilin97 Jun 25, 2026
44645b3
refactor(MinimallyAllowsTerm.OfFinset): golf mem_toMultisets/eq_allow…
Vilin97 Jun 25, 2026
be82147
refactor(Operators.Position): golf radiusPowLM_apply_memHS via linteg…
Vilin97 Jun 25, 2026
8d528a4
refactor(SpectralTheory.Basic): golf numericalRange/defectNumber proo…
Vilin97 Jun 25, 2026
e31fc9c
refactor(Norm.IteratedLaplacian): golf oddNormIteratedLaplacianCoeff_…
Vilin97 Jun 25, 2026
12e2428
refactor(Causality.LightLike): golf lightlike_spatial_parallel proofs…
Vilin97 Jun 25, 2026
94e3904
refactor(StandardParameters): golf eq_standParam proofs via helper (−…
Vilin97 Jun 25, 2026
f345626
refactor(Vacuum.HarmonicWave): golf magneticFieldMatrix derivs via he…
Vilin97 Jun 25, 2026
55f4ab5
refactor(TwoHDM.GramMatrix): golf gramMatrix proofs (−69)
Vilin97 Jun 25, 2026
1c4cea7
refactor(PhysHermite): golf physHermite_orthogonal_cons via helper (−64)
Vilin97 Jun 25, 2026
cb2cb95
refactor(Mathematics.List): golf via mono_tail helper (−45)
Vilin97 Jun 25, 2026
0a54446
refactor(Quanta.FiveQuanta): golf 9 proofs via reduce helpers (−81)
Vilin97 Jun 25, 2026
09f6111
refactor(Distributional.KineticTerm): golf gradKineticTerm_eq_distTen…
Vilin97 Jun 25, 2026
3deb187
refactor(HamiltonsEquations): golf hamiltons_equations_varGradient (−30)
Vilin97 Jun 25, 2026
19df161
refactor(CanonicalEnsemble.Finite): golf deriv_meanEnergyBetaReal via…
Vilin97 Jun 26, 2026
bd539ea
refactor(Vacuum.IsPlaneWave): dedup field derivs via propagator helpe…
Vilin97 Jun 26, 2026
c3a9e12
refactor(Integrals.RadialAngularMeasure): golf integrable_neg_pow_on_…
Vilin97 Jun 26, 2026
2e0d8df
refactor(SL2C.Basic): golf toSelfAdjointMap proofs (−29)
Vilin97 Jun 26, 2026
3f426e3
refactor(Kinematics.ElectricField): golf electricField_eq_fieldStreng…
Vilin97 Jun 26, 2026
d318b6a
refactor(RealTensor.Metrics.Pre): golf contr/coContract_apply_metric …
Vilin97 Jun 26, 2026
f1229c6
refactor(Tensors.Constructors): golf fromSingleT/fromPairT_contr proo…
Vilin97 Jun 26, 2026
dbe3e3c
refactor(Boosts.Generalized): golf generalizedBoost_inv (−77)
Vilin97 Jun 26, 2026
243d263
refactor(OneDimension.Operators.Momentum): golf isSelfAdjoint via hel…
Vilin97 Jun 26, 2026
96667dd
refactor(Temperature.Basic): golf tendsto_const_inv_mul_atTop (−145)
Vilin97 Jun 26, 2026
7561368
refactor(Tensors.Contraction.Basic): golf contrT_comm (−61)
Vilin97 Jun 26, 2026
4ddf648
refactor(HarmonicOscillator.TISE): golf deriv_deriv_eigenfunction (−65)
Vilin97 Jun 26, 2026
462200c
refactor(Kinematics.MagneticField): golf time_deriv_magneticFieldMatr…
Vilin97 Jun 26, 2026
9f28b56
refactor(NavierStokes.Momentum): golf momentumEquation_iff_convective…
Vilin97 Jun 26, 2026
554da5d
refactor(Quanta.TenQuanta): golf reduce/chiral proofs via helpers (−92)
Vilin97 Jun 26, 2026
f87a2fd
refactor(SU5.ChargeSpectrum.Basic): golf min_exists_inductive + 11 pr…
Vilin97 Jun 26, 2026
1db5f15
refactor(Lagrangian.TotalDerivativeEquivalence): golf isTotalTimeDeri…
Vilin97 Jun 26, 2026
d907d69
refactor(Tensors.Contraction.Basis): golf contrT_basis_repr_apply (−21)
Vilin97 Jun 26, 2026
dba514f
refactor(Distributional.IsExtrema): golf isExtrema_iff_space_time via…
Vilin97 Jun 26, 2026
c92f838
refactor(Current.InfiniteWire): golf infiniteWire_isExterma (−22)
Vilin97 Jun 26, 2026
ab75e8e
refactor(HiggsBoson.Potential): golf neg_/isBounded_ proofs (−70)
Vilin97 Jun 26, 2026
a7eef04
refactor(Tensors.Dual): golf toDualMap_fromDualMap (−13)
Vilin97 Jun 26, 2026
3a213df
refactor(SpectralTheory.Symmetric): golf regularityDomain_isConnected…
Vilin97 Jun 26, 2026
282bce7
refactor(FourTree.UniqueMap): golf map_mem_uniqueMap proofs (−75)
Vilin97 Jun 26, 2026
7c29c86
refactor(FourTree.Basic): golf mem_iff_mem_toMultiset via mem_iff hel…
Vilin97 Jun 26, 2026
617a1f9
refactor(RealTensor.Vector.MinkowskiProduct): golf minkowskiProductMa…
Vilin97 Jun 26, 2026
27e46ab
refactor(Calculus.ParametricIntegration): golf hasFDerivAt_parametric…
Vilin97 Jun 26, 2026
fed0252
refactor(Dynamics.Hamiltonian): golf canonicalMomentum_eq (−31)
Vilin97 Jun 26, 2026
b597f53
refactor(IdealGas.Basic): golf adiabatic_relation_UaUbVaVb (−27)
Vilin97 Jun 26, 2026
4c3b0c2
refactor(Distribution.PowMul): golf norm_iteratedFDeriv_ofRealCLM (−26)
Vilin97 Jun 26, 2026
b164281
refactor(OrthogY3B3.PlaneWithY3B3): golf planeY (−27)
Vilin97 Jun 26, 2026
fc60f17
refactor(PauliMatrices.ToTensor): golf pauliCoDown/pauliContrDown_ofR…
Vilin97 Jun 26, 2026
0e3768d
refactor(Tensors.Contraction.Products): golf prodT_contrT_snd (−4)
Vilin97 Jun 26, 2026
f74a236
refactor(SpaceTime.Derivatives): golf distDeriv_comp_lorentz_action v…
Vilin97 Jun 26, 2026
b6b131f
refactor(Tensors.Product): golf prodT_assoc/prodT_assoc' (−97)
Vilin97 Jun 26, 2026
6b1d957
refactor(Orthochronous.Basic): golf isOrthochronous_mul_iff via coe h…
Vilin97 Jun 26, 2026
7225766
refactor(TimeAndSpace.Basic): golf fderiv_time_commute_fderiv_space v…
Vilin97 Jun 26, 2026
4cdcfaa
refactor(RealTensor.Metrics.Basic): golf metric_repr proofs via helpe…
Vilin97 Jun 26, 2026
6baca09
refactor(RealTensor.Vector.Tensorial): golf smul_eq_sum (−38)
Vilin97 Jun 26, 2026
1696fd3
refactor(SpaceTime.Boosts): golf boost_zero/boost_x cluster (−31)
Vilin97 Jun 26, 2026
d0275e0
refactor(RealTensor.CoVector.Tensorial): golf smul_eq_sum (−31)
Vilin97 Jun 26, 2026
e882c44
refactor(Units.Examples): golf energyMass_isDimensionallyCorrect (−31)
Vilin97 Jun 26, 2026
43e8f9b
refactor(StandardParameterization.Basic): golf cross_product_t (−28)
Vilin97 Jun 26, 2026
ab3e742
refactor(HiggsBoson.Basic): golf gaugeGroupI_smul_phase_snd (−24)
Vilin97 Jun 26, 2026
26df544
refactor(QED.LineInPlaneCond): golf linesInPlane_four via linear_comb…
Vilin97 Jun 26, 2026
9ae8e9c
refactor(Dynamics.Lagrangian): golf gradLagrangian_eq_electricField_m…
Vilin97 Jun 26, 2026
63ec05c
refactor(Space.Derivatives.Iterated): golf iteratedDerivList via help…
Vilin97 Jun 26, 2026
69d277c
refactor(MinimallyAllowsTerm.FinsetTerms): golf mem_minTopBottom via …
Vilin97 Jun 26, 2026
d760445
refactor(ClassicalMechanics.EulerLagrange): golf euler_lagrange_varGr…
Vilin97 Jun 26, 2026
fe43ad9
Merge remote-tracking branch 'origin/master' into claude/golf-proofs
Vilin97 Jun 26, 2026
6ec0e99
refactor: remove all added helper declarations, keep golf via proof-o…
Vilin97 Jun 26, 2026
db4fba6
Merge remote-tracking branch 'origin/master' into claude/golf-proofs
Vilin97 Jun 26, 2026
8d9bb5d
Merge remote-tracking branch 'origin/master' into claude/golf-proofs
Vilin97 Jun 26, 2026
2af269a
Address review comments from jstoobysmith (#1263)
Vilin97 Jun 26, 2026
d355614
style: wrap over-length lines from the have-key renames (ERR_LIN)
Vilin97 Jun 28, 2026
6d6bc33
Merge remote-tracking branch 'origin/master' into claude/golf-proofs
Vilin97 Jun 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
257 changes: 79 additions & 178 deletions Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean

Large diffs are not rendered by default.

25 changes: 8 additions & 17 deletions Physlib/ClassicalMechanics/EulerLagrange.lean
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ theorem euler_lagrange_varGradient
(L : Time → X → X → ℝ) (q : Time → X)
(hq : ContDiff ℝ ∞ q) (hL : ContDiff ℝ ∞ ↿L) :
(δ (q':=q), ∫ t, L t (q' t) (fderiv ℝ q' t 1)) = eulerLagrangeOp L q := by
rw [eulerLagrangeOp_eq]
simp only [Time.deriv_eq]
simp only [eulerLagrangeOp_eq, Time.deriv_eq]
apply HasVarGradientAt.varGradient
apply HasVarGradientAt.intro _
· apply HasVarAdjDerivAt.comp
Expand All @@ -57,25 +56,17 @@ theorem euler_lagrange_varGradient
· fun_prop
intro x u
apply DifferentiableAt.hasAdjFDerivAt
apply Differentiable.differentiableAt
apply ContDiff.differentiable
fun_prop
simp
apply ContDiff.differentiable (n := ∞) (by fun_prop) (by simp)
· apply HasVarAdjDerivAt.prod (F:=fun φ => φ)
· apply HasVarAdjDerivAt.id _ hq
· apply HasVarAdjDerivAt.fderiv
· exact hq
· apply HasVarAdjDerivAt.fderiv (hu := hq)
case hgrad =>
funext t
simp (disch:=fun_prop) only
simp[sub_eq_add_neg]
simp (disch := fun_prop) [sub_eq_add_neg]
congr
rw [gradient_eq_adjFDeriv, adjFDeriv_uncurry]
apply ContDiff.differentiable (n := ∞) (by fun_prop) (by simp)
apply ContDiff.differentiable (n := ∞) (by fun_prop) (by simp)
funext t
rw [gradient_eq_adjFDeriv, adjFDeriv_uncurry]
apply ContDiff.differentiable (n := ∞) (by fun_prop) (by simp)
apply ContDiff.differentiable (n := ∞) (by fun_prop) (by simp)
all_goals
try funext t
rw [gradient_eq_adjFDeriv, adjFDeriv_uncurry] <;>
apply ContDiff.differentiable (n := ∞) (by fun_prop) (by simp)

end ClassicalMechanics
66 changes: 12 additions & 54 deletions Physlib/ClassicalMechanics/HamiltonsEquations.lean
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,7 @@ lemma hamiltonEqOp_eq_zero_iff_hamiltons_equations (H : Time → X → X → ℝ
hamiltonEqOp H p q = 0 ↔
(∀ t, ∂ₜ q t = gradient (fun x => H t x (q t)) (p t)) ∧
(∀ t, ∂ₜ p t = -gradient (fun x => H t (p t) x) (q t)) := by
simp [hamiltonEqOp_eq]
simp_all only [Time.deriv_eq]
rw [funext_iff]
simp_all only [Pi.zero_apply, Prod.mk_eq_zero]
apply Iff.intro
· intro h1
apply And.intro
· intro t
conv_rhs =>
rw [← add_zero (gradient (fun x => H t x (q t)) (p t)), ← (h1 t).1]
simp
· intro t
conv_lhs =>
rw [← add_zero (fderiv ℝ p t 1), ← (h1 t).2]
simp
· intro a x
simp_all only [add_neg_cancel, neg_neg, and_self]
simp [hamiltonEqOp_eq, funext_iff, Prod.mk_eq_zero, forall_and, add_eq_zero_iff_neg_eq]

theorem hamiltons_equations_varGradient
(H : Time → X → X → ℝ) (pq : Time → X × X) (hp : ContDiff ℝ ∞ pq)
Expand All @@ -81,42 +65,21 @@ theorem hamiltons_equations_varGradient
apply HasVarAdjDerivAt.comp
(F := fun (φ : Time → X × X) t => i t (φ t))
(G := fun (φ : Time → X × X) t => ((φ t).1, fderiv ℝ (Prod.snd ∘ φ) t 1))
· apply HasVarAdjDerivAt.fmap
· fun_prop
· fun_prop
intro t x
apply DifferentiableAt.hasAdjFDerivAt
fun_prop
· exact HasVarAdjDerivAt.fmap _ _ (by fun_prop) (by fun_prop)
fun x _ => (by fun_prop : DifferentiableAt ℝ _ _).hasAdjFDerivAt
· apply HasVarAdjDerivAt.prod
· apply HasVarAdjDerivAt.fst
apply HasVarAdjDerivAt.id
fun_prop
· exact HasVarAdjDerivAt.fst (HasVarAdjDerivAt.id _ (by fun_prop))
· apply HasVarAdjDerivAt.fderiv' (F := fun (φ : Time → X × X) t => (φ t).2)
apply HasVarAdjDerivAt.fmap
· fun_prop
· fun_prop
intro t x
apply DifferentiableAt.hasAdjFDerivAt
fun_prop
exact HasVarAdjDerivAt.fmap _ _ (by fun_prop) (by fun_prop)
fun x _ => (by fun_prop : DifferentiableAt ℝ _ _).hasAdjFDerivAt
· apply HasVarAdjDerivAt.neg
let H' := fun t => ↿(H t)
change HasVarAdjDerivAt (fun φ x => H' x (φ x)) _ pq
apply HasVarAdjDerivAt.fmap
· fun_prop
· fun_prop
intro x u
apply DifferentiableAt.hasAdjFDerivAt
apply Differentiable.differentiableAt
apply ContDiff.differentiable
fun_prop
simp
exact HasVarAdjDerivAt.fmap (fun t => ↿(H t)) _ (by fun_prop) (by fun_prop)
fun x _ => (((by fun_prop : ContDiff ℝ ∞ _).differentiable
(by simp)).differentiableAt).hasAdjFDerivAt
· simp only [adjFDeriv_prod_snd, Prod.mk_add_mk, add_zero, zero_add]
funext x
rw [adjFDeriv_uncurry]
swap
· apply ContDiff.differentiable
fun_prop
simp
rw [adjFDeriv_uncurry
((by fun_prop : ContDiff ℝ ∞ _).differentiable (by simp)).differentiableAt]
simp only [Prod.neg_mk, Prod.mk_add_mk]
rw [adjFDeriv_inner]
simp only [one_smul]
Expand All @@ -126,11 +89,6 @@ theorem hamiltons_equations_varGradient
simp
rw [← gradient_eq_adjFDeriv, ← gradient_eq_adjFDeriv]
rfl
· apply ContDiff.differentiable
fun_prop
simp
· apply ContDiff.differentiable
fun_prop
simp
all_goals exact ((by fun_prop : ContDiff ℝ ∞ _).differentiable (by simp)).differentiableAt

end ClassicalMechanics
4 changes: 1 addition & 3 deletions Physlib/ClassicalMechanics/WaveEquation/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ lemma planeWave_differentiable_time {d f₀ c x} {s : Direction d}
(h' : Differentiable ℝ f₀) :
Differentiable ℝ (fun t => planeWave f₀ c s t x) := by
simp only [planeWave_eq]
apply Differentiable.comp
· fun_prop
· fun_prop
apply Differentiable.comp <;> fun_prop

@[fun_prop]
lemma planeWave_differentiable_space {d f₀ c t} {s : Direction d}
Expand Down
44 changes: 11 additions & 33 deletions Physlib/Electromagnetism/Current/InfiniteWire.lean
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,7 @@ lemma infiniteWire_vectorPotential (𝓕 : FreeSpace) (I : ℝ) :
ext η i
simp [vectorPotential, infiniteWire, constantTime_apply,
constantSliceDist_apply, Lorentz.Vector.spatialCLM, distOfFunction_vector_eval,
distOfFunction_eculid_eval]
left
congr
funext x
congr 1
exact Eq.propIntro (fun a => id (Eq.symm a)) fun a => id (Eq.symm a)
distOfFunction_eculid_eval, eq_comm]

lemma infiniteWire_vectorPotential_fst (𝓕 : FreeSpace) (I : ℝ)(η : 𝓢(Time × Space 3, ℝ)) :
(infiniteWire 𝓕 I).vectorPotential 𝓕.c η 0 =
Expand Down Expand Up @@ -192,18 +187,14 @@ lemma infiniteWire_vectorPotential_distTimeDeriv (𝓕 : FreeSpace) (I : ℝ) :
distTimeDeriv ((infiniteWire 𝓕 I).vectorPotential 𝓕.c) = 0 := by
ext1 η
ext i
simp only [_root_.zero_apply, PiLp.zero_apply]
rw [infiniteWire_vectorPotential _ I, constantTime_distTimeDeriv]
simp

@[simp]
lemma infiniteWire_vectorPotential_distSpaceDeriv_0 (𝓕 : FreeSpace) (I : ℝ) :
distSpaceDeriv 0 ((infiniteWire 𝓕 I).vectorPotential 𝓕.c) = 0 := by
ext1 η
simp [infiniteWire_vectorPotential _ I]
right
rw [constantTime_distSpaceDeriv, distDeriv_constantSliceDist_same]
simp
simp [infiniteWire_vectorPotential _ I, constantTime_distSpaceDeriv,
distDeriv_constantSliceDist_same]

/-!

Expand Down Expand Up @@ -233,7 +224,6 @@ lemma infiniteWire_isExterma {𝓕 : FreeSpace} {I : ℝ} :
_root_.zero_apply, one_div, wireCurrentDensity_chargeDesnity, mul_zero,
implies_true, PiLp.zero_apply, zero_sub, true_and]
intro ε i
field_simp
rw [neg_add_eq_zero]
fin_cases i
· simp [Fin.sum_univ_three]
Expand All @@ -257,27 +247,15 @@ lemma infiniteWire_isExterma {𝓕 : FreeSpace} {I : ℝ} :
· ext ε
simp [distDiv_apply_eq_sum_distDeriv]
rw [add_comm]
congr
· rw [distDeriv_apply, fderivD_apply]
conv_rhs => rw [distDeriv_apply, fderivD_apply]
simp [distGrad_apply]
· rw [distDeriv_apply, fderivD_apply]
conv_rhs => rw [distDeriv_apply, fderivD_apply]
simp [distGrad_apply]
congr 1 <;>
simp [distDeriv_apply, fderivD_apply, distGrad_apply]
rw [distGrad_distOfFunction_log_norm]
have h1 := distDiv_inv_pow_eq_dim (d := 2)
simp at h1
simp [h1]
· simp only [Fin.mk_one, Fin.isValue, neg_sub, Finset.sum_sub_distrib, Fin.sum_univ_three,
infiniteWire_vectorPotential_distSpaceDeriv_0, map_zero, _root_.zero_apply,
PiLp.zero_apply, zero_add, wireCurrentDensity_currentDensity_snd, mul_zero]
ring_nf
rw [distSpaceDeriv_commute]
simp [distSpaceDeriv_apply']
· simp only [Fin.reduceFinMk, Fin.isValue, neg_sub, Finset.sum_sub_distrib, Fin.sum_univ_three,
infiniteWire_vectorPotential_distSpaceDeriv_0, map_zero, _root_.zero_apply,
PiLp.zero_apply, zero_add, add_sub_add_right_eq_sub, wireCurrentDensity_currentDensity_thrd,
mul_zero]
simpa using distDiv_inv_pow_eq_dim (d := 2)
all_goals
simp only [Fin.mk_one, Fin.reduceFinMk, Fin.isValue, neg_sub, Finset.sum_sub_distrib,
Fin.sum_univ_three, infiniteWire_vectorPotential_distSpaceDeriv_0, map_zero,
_root_.zero_apply, PiLp.zero_apply, zero_add, add_sub_add_right_eq_sub,
wireCurrentDensity_currentDensity_snd, wireCurrentDensity_currentDensity_thrd, mul_zero]
ring_nf
rw [distSpaceDeriv_commute]
simp [distSpaceDeriv_apply']
Expand Down
90 changes: 36 additions & 54 deletions Physlib/Electromagnetism/Distributional/Dynamics/IsExtrema.lean
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,13 @@ lemma isExtrema_iff_components {𝓕 : FreeSpace}
(J : DistLorentzCurrentDensity d) :
IsExtrema 𝓕 A J ↔ (∀ ε, A.gradLagrangian 𝓕 J ε (Sum.inl 0) = 0)
∧ (∀ ε i, A.gradLagrangian 𝓕 J ε (Sum.inr i) = 0) := by
apply Iff.intro
· intro h
rw [isExtrema_iff_gradLagrangian] at h
simp [h]
· intro h
rw [isExtrema_iff_gradLagrangian]
ext1 ε
funext i
match i with
| Sum.inl 0 => exact h.1 ε
| Sum.inr j => exact h.2 ε j
rw [isExtrema_iff_gradLagrangian]
refine ⟨fun h => by simp [h], fun h => ?_⟩
ext1 ε
funext i
match i with
| Sum.inl 0 => exact h.1 ε
| Sum.inr j => exact h.2 ε j
/-!

### A.1. IsExtrema and Gauss's law and Ampère's law
Expand All @@ -103,51 +99,37 @@ lemma isExtrema_iff_space_time {𝓕 : FreeSpace}
((Space.distSpaceDeriv j (A.magneticFieldMatrix 𝓕.c)) ε) (j, i) +
𝓕.μ₀ * J.currentDensity 𝓕.c ε i = 0) := by
rw [isExtrema_iff_components]
refine and_congr ?_ ?_
· simp [gradLagrangian_sum_inl_0]
field_simp
simp [𝓕.c_sq]
field_simp
simp [sub_eq_zero]
apply Iff.intro
· intro h ε
convert h (SchwartzMap.compCLMOfContinuousLinearEquiv (F := ℝ) ℝ
(SpaceTime.toTimeAndSpace 𝓕.c (d := d)) ε) using 1
· simp [SpaceTime.distTimeSlice_symm_apply]
ring_nf
congr
ext x
simp
· simp [SpaceTime.distTimeSlice_symm_apply]
congr
ext x
simp
· intro h ε
convert! h (SchwartzMap.compCLMOfContinuousLinearEquiv (F := ℝ) ℝ
(SpaceTime.toTimeAndSpace 𝓕.c (d := d)).symm ε) using 1
· simp [SpaceTime.distTimeSlice_symm_apply]
ring_nf
· apply Iff.intro
· intro h ε i
specialize h (SchwartzMap.compCLMOfContinuousLinearEquiv (F := ℝ) ℝ
(SpaceTime.toTimeAndSpace 𝓕.c (d := d)) ε) i
linear_combination (norm := field_simp) (𝓕.μ₀) * h
simp [gradLagrangian_sum_inr_i, SpaceTime.distTimeSlice_symm_apply]
have hx : (SchwartzMap.compCLMOfContinuousLinearEquiv ℝ (SpaceTime.toTimeAndSpace 𝓕.c).symm)
((SchwartzMap.compCLMOfContinuousLinearEquiv ℝ (SpaceTime.toTimeAndSpace 𝓕.c)) ε)
= ε := by
ext i
simp
simp [hx, 𝓕.c_sq]
have hsurj : Function.Surjective (SchwartzMap.compCLMOfContinuousLinearEquiv (F := ℝ) ℝ
(SpaceTime.toTimeAndSpace 𝓕.c (d := d)).symm) := by
intro f
refine ⟨SchwartzMap.compCLMOfContinuousLinearEquiv ℝ
(SpaceTime.toTimeAndSpace 𝓕.c (d := d)).symm.symm f, ?_⟩
ext x
simp
have hgauss : ∀ a b : ℝ,
1 / (𝓕.μ₀ * 𝓕.c.val) * a - 𝓕.c.val * b = 0 ↔ a = 1 / 𝓕.ε₀ * b := by
intro a b
have c_sq_mul_eq : 𝓕.c.val * b * (𝓕.μ₀ * 𝓕.c.val) = 1 / 𝓕.ε₀ * b := by
have hcb : 𝓕.c.val * b * (𝓕.μ₀ * 𝓕.c.val) = 𝓕.μ₀ * 𝓕.c.val ^ 2 * b := by ring
rw [hcb, 𝓕.c_sq]
field_simp
ring
· intro h ε i
specialize h (SchwartzMap.compCLMOfContinuousLinearEquiv (F := ℝ) ℝ
(SpaceTime.toTimeAndSpace 𝓕.c (d := d)).symm ε) i
linear_combination (norm := field_simp) (𝓕.μ₀⁻¹) * h
simp [gradLagrangian_sum_inr_i, SpaceTime.distTimeSlice_symm_apply, 𝓕.c_sq]
rw [sub_eq_zero, div_mul_eq_mul_div, one_mul,
div_eq_iff (mul_ne_zero 𝓕.μ₀_ne_zero 𝓕.c.val_ne_zero), c_sq_mul_eq]
have hampere : ∀ T S C : ℝ, 𝓕.μ₀⁻¹ * (1 / 𝓕.c.val ^ 2 * T - S) + C = 0 ↔
𝓕.μ₀ * 𝓕.ε₀ * T - S + 𝓕.μ₀ * C = 0 := by
intro T S C
have mu0_factor_eq : 𝓕.μ₀ * 𝓕.ε₀ * T - S + 𝓕.μ₀ * C
= 𝓕.μ₀ * (𝓕.μ₀⁻¹ * (1 / 𝓕.c.val ^ 2 * T - S) + C) := by
rw [𝓕.c_sq]
field_simp
ring
rw [mu0_factor_eq, mul_eq_zero, or_iff_right 𝓕.μ₀_ne_zero]
refine and_congr ?_ ?_
· simp only [gradLagrangian_sum_inl_0, SpaceTime.distTimeSlice_symm_apply]
rw [hsurj.forall]
exact forall_congr' fun ε => hgauss _ _
· simp only [gradLagrangian_sum_inr_i, SpaceTime.distTimeSlice_symm_apply]
rw [hsurj.forall]
exact forall_congr' fun ε => forall_congr' fun i => hampere _ _ _

/-!

Expand Down
Loading
Loading