statement stringlengths 1 1.98k | proof stringlengths 0 15.3k | type stringclasses 10
values | symbolic_name stringlengths 1 117 | library stringclasses 156
values | filename stringclasses 526
values | imports listlengths 0 7 | deps listlengths 0 64 | docstring stringlengths 0 2.13k | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
lagrangian_eq : lagrangian S = fun t x v =>
1 / (2 : ℝ) * S.m * ⟪v, v⟫_ℝ - 1 / (2 : ℝ) * S.k * ⟪x, x⟫_ℝ | by
ext t x v
simp [lagrangian, potentialEnergy]
ring | lemma | ClassicalMechanics.HarmonicOscillator.lagrangian_eq | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
lagrangian_eq_kineticEnergy_sub_potentialEnergy (t : Time)
(xₜ : Time → EuclideanSpace ℝ (Fin 1)) :
lagrangian S t (xₜ t) (∂ₜ xₜ t) = kineticEnergy S xₜ t - potentialEnergy S (xₜ t) | by
rw [lagrangian_eq, kineticEnergy, potentialEnergy]
simp only [one_div, smul_eq_mul, sub_right_inj]
ring | lemma | ClassicalMechanics.HarmonicOscillator.lagrangian_eq_kineticEnergy_sub_potentialEnergy | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
contDiff_lagrangian (n : WithTop ℕ∞) : ContDiff ℝ n ↿S.lagrangian | by
rw [lagrangian_eq]
apply ContDiff.sub
· apply ContDiff.mul
· apply ContDiff.mul
· exact contDiff_const
· exact contDiff_const
· exact ContDiff.inner (𝕜 := ℝ) (contDiff_snd.comp contDiff_snd)
(contDiff_snd.comp contDiff_snd)
· apply ContDiff.mul
· apply ContDiff.mul
· ex... | lemma | ClassicalMechanics.HarmonicOscillator.contDiff_lagrangian | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
toDual_symm_innerSL (x : EuclideanSpace ℝ (Fin 1)) :
(InnerProductSpace.toDual ℝ (EuclideanSpace ℝ (Fin 1))).symm (innerSL ℝ x) = x | by
apply (innerSL_inj (𝕜:=ℝ) (E:=EuclideanSpace ℝ (Fin 1))).1
ext y
simp [InnerProductSpace.toDual_symm_apply] | lemma | ClassicalMechanics.HarmonicOscillator.toDual_symm_innerSL | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
gradient_inner_self (x : EuclideanSpace ℝ (Fin 1)) :
gradient (fun y : EuclideanSpace ℝ (Fin 1) => ⟪y, y⟫_ℝ) x = (2 : ℝ) • x | by
refine ext_inner_right (𝕜 := ℝ) fun y => ?_
unfold gradient
rw [InnerProductSpace.toDual_symm_apply]
have hid : DifferentiableAt ℝ (fun y : EuclideanSpace ℝ (Fin 1) => y) x := differentiableAt_id
rw [show (fun y : EuclideanSpace ℝ (Fin 1) => ⟪y, y⟫_ℝ) =
fun y => ⟪(fun y => y) y, (fun y => y) y⟫_ℝ fr... | lemma | ClassicalMechanics.HarmonicOscillator.gradient_inner_self | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"inner_smul_left'"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
gradient_const_mul_inner_self (c : ℝ) (x : EuclideanSpace ℝ (Fin 1)) :
gradient (fun y : EuclideanSpace ℝ (Fin 1) => c * ⟪y, y⟫_ℝ) x = (2 * c) • x | by
calc
gradient (fun y : EuclideanSpace ℝ (Fin 1) => c * ⟪y, y⟫_ℝ) x
= (InnerProductSpace.toDual ℝ (EuclideanSpace ℝ (Fin 1))).symm
(fderiv ℝ (fun y : EuclideanSpace ℝ (Fin 1) => c * ⟪y, y⟫_ℝ) x) := rfl
_ = (InnerProductSpace.toDual ℝ (EuclideanSpace ℝ (Fin 1))).symm
(c • fder... | lemma | ClassicalMechanics.HarmonicOscillator.gradient_const_mul_inner_self | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
gradient_add_const' {f : EuclideanSpace ℝ (Fin 1) → ℝ} {c : ℝ}
(x : EuclideanSpace ℝ (Fin 1)) :
gradient (fun y => f y + c) x = gradient f x | by
unfold gradient
rw [fderiv_add_const] | lemma | ClassicalMechanics.HarmonicOscillator.gradient_add_const' | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
gradient_lagrangian_position_eq (t : Time) (x : EuclideanSpace ℝ (Fin 1))
(v : EuclideanSpace ℝ (Fin 1)) :
gradient (fun x => lagrangian S t x v) x = - S.k • x | by
have h_eq : (fun y : EuclideanSpace ℝ (Fin 1) => lagrangian S t y v) =
fun y => (-(1 / (2 : ℝ)) * S.k) * ⟪y, y⟫_ℝ + (1 / (2 : ℝ) * S.m * ⟪v, v⟫_ℝ) := by
funext y; unfold lagrangian potentialEnergy; simp only [smul_eq_mul]; ring
rw [h_eq, gradient_add_const', gradient_const_mul_inner_self]
ext; simp | lemma | ClassicalMechanics.HarmonicOscillator.gradient_lagrangian_position_eq | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
gradient_lagrangian_velocity_eq (t : Time) (x : EuclideanSpace ℝ (Fin 1))
(v : EuclideanSpace ℝ (Fin 1)) :
gradient (lagrangian S t x) v = S.m • v | by
have h_eq : (fun y : EuclideanSpace ℝ (Fin 1) => lagrangian S t x y) =
fun y => ((1 / (2 : ℝ)) * S.m) * ⟪y, y⟫_ℝ + (-(1 / (2 : ℝ)) * S.k * ⟪x, x⟫_ℝ) := by
funext y; unfold lagrangian potentialEnergy; simp only [smul_eq_mul]; ring
change gradient (fun y : EuclideanSpace ℝ (Fin 1) => lagrangian S t x y) ... | lemma | ClassicalMechanics.HarmonicOscillator.gradient_lagrangian_velocity_eq | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
gradLagrangian (xₜ : Time → EuclideanSpace ℝ (Fin 1)) :
Time → EuclideanSpace ℝ (Fin 1) | (δ (q':=xₜ), ∫ t, lagrangian S t (q' t) (fderiv ℝ q' t 1)) | def | ClassicalMechanics.HarmonicOscillator.gradLagrangian | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | The Euler-Lagrange operator for the classical harmonic oscillator. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
gradLagrangian_eq_eulerLagrangeOp (xₜ : Time → EuclideanSpace ℝ (Fin 1))
(hq : ContDiff ℝ ∞ xₜ) :
gradLagrangian S xₜ = eulerLagrangeOp S.lagrangian xₜ | by
rw [gradLagrangian,
ClassicalMechanics.euler_lagrange_varGradient _ _ hq (S.contDiff_lagrangian _)] | lemma | ClassicalMechanics.HarmonicOscillator.gradLagrangian_eq_eulerLagrangeOp | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"ClassicalMechanics.euler_lagrange_varGradient",
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
EquationOfMotion (xₜ : Time → EuclideanSpace ℝ (Fin 1)) : Prop | S.gradLagrangian xₜ = 0 | def | ClassicalMechanics.HarmonicOscillator.EquationOfMotion | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | The equation of motion for the Harmonic oscillator. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
equationOfMotion_iff_gradLagrangian_zero (xₜ : Time → EuclideanSpace ℝ (Fin 1)) :
S.EquationOfMotion xₜ ↔ S.gradLagrangian xₜ = 0 | by rfl | lemma | ClassicalMechanics.HarmonicOscillator.equationOfMotion_iff_gradLagrangian_zero | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
force (S : HarmonicOscillator) (x : EuclideanSpace ℝ (Fin 1)) :
EuclideanSpace ℝ (Fin 1) | - gradient (potentialEnergy S) x | def | ClassicalMechanics.HarmonicOscillator.force | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [] | The force of the classical harmonic oscillator defined as `- dU(x)/dx` where `U(x)`
is the potential energy. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
force_eq_linear (x : EuclideanSpace ℝ (Fin 1)) : force S x = - S.k • x | by
unfold force potentialEnergy
have hpot : (fun y : EuclideanSpace ℝ (Fin 1) => (1 / (2 : ℝ)) • S.k • ⟪y, y⟫_ℝ) =
fun y => ((1 / (2 : ℝ)) * S.k) * ⟪y, y⟫_ℝ := by
funext y
simp [smul_eq_mul, mul_assoc]
rw [hpot]
have hgrad : gradient (fun y : EuclideanSpace ℝ (Fin 1) => ((1 / (2 : ℝ)) * S.k) * ⟪y,... | lemma | ClassicalMechanics.HarmonicOscillator.force_eq_linear | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [] | The force on the classical harmonic oscillator is `- k x`. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
gradLagrangian_eq_force (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (hx : ContDiff ℝ ∞ xₜ) :
S.gradLagrangian xₜ = fun t => force S (xₜ t) - S.m • ∂ₜ (∂ₜ xₜ) t | by
funext t
rw [gradLagrangian_eq_eulerLagrangeOp S xₜ hx, eulerLagrangeOp]
congr
· simp [gradient_lagrangian_position_eq, force_eq_linear]
· conv_lhs =>
arg 1
ext t'
rw [gradient_lagrangian_velocity_eq]
show ∂ₜ (fun t' => S.m • ∂ₜ xₜ t') t = S.m • ∂ₜ (∂ₜ xₜ) t
have hd : Differentiab... | lemma | ClassicalMechanics.HarmonicOscillator.gradLagrangian_eq_force | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | The Euler lagrange operator corresponds to Newton's second law. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
equationOfMotion_iff_newtons_2nd_law (xₜ : Time → EuclideanSpace ℝ (Fin 1))
(hx : ContDiff ℝ ∞ xₜ) :
S.EquationOfMotion xₜ ↔
(∀ t, S.m • ∂ₜ (∂ₜ xₜ) t = force S (xₜ t)) | by
rw [EquationOfMotion, gradLagrangian_eq_force S xₜ hx, funext_iff]
simp only [Pi.zero_apply]
conv_lhs =>
enter [x]
rw [sub_eq_zero, eq_comm] | lemma | ClassicalMechanics.HarmonicOscillator.equationOfMotion_iff_newtons_2nd_law | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
energy_conservation_of_equationOfMotion (xₜ : Time → EuclideanSpace ℝ (Fin 1))
(hx : ContDiff ℝ ∞ xₜ)
(h : S.EquationOfMotion xₜ) : ∂ₜ (S.energy xₜ) = 0 | by
rw [energy_deriv _ _ hx]
rw [equationOfMotion_iff_newtons_2nd_law _ _ hx] at h
funext x
simp only [Pi.zero_apply]
rw [h]
simp [force_eq_linear] | lemma | ClassicalMechanics.HarmonicOscillator.energy_conservation_of_equationOfMotion | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
energy_conservation_of_equationOfMotion' (xₜ : Time → EuclideanSpace ℝ (Fin 1))
(hx : ContDiff ℝ ∞ xₜ)
(h : S.EquationOfMotion xₜ) (t : Time) : S.energy xₜ t = S.energy xₜ 0 | by
have h1 := S.energy_conservation_of_equationOfMotion xₜ hx h
unfold Time.deriv at h1
apply is_const_of_fderiv_eq_zero (𝕜 := ℝ)
· exact energy_differentiable S xₜ hx
intro t
ext p
simp only [ContinuousLinearMap.zero_apply]
have hp : p = p.val • 1 := by ext; simp
rw [hp]
simp only [map_smul, smul_... | lemma | ClassicalMechanics.HarmonicOscillator.energy_conservation_of_equationOfMotion' | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time",
"Time.deriv"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
toCanonicalMomentum (t : Time) (x : EuclideanSpace ℝ (Fin 1)) :
EuclideanSpace ℝ (Fin 1) ≃ₗ[ℝ] EuclideanSpace ℝ (Fin 1) | where
toFun v := gradient (S.lagrangian t x ·) v
invFun p := (1 / S.m) • p
left_inv v := by
simp [gradient_lagrangian_velocity_eq]
right_inv p := by
simp [gradient_lagrangian_velocity_eq]
map_add' v1 v2 := by
simp [gradient_lagrangian_velocity_eq]
map_smul' c v := by
simp [gradient_lagrangia... | def | ClassicalMechanics.HarmonicOscillator.toCanonicalMomentum | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | The equivalence between velocity and canonical momentum. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
toCanonicalMomentum_eq (t : Time) (x : EuclideanSpace ℝ (Fin 1))
(v : EuclideanSpace ℝ (Fin 1)) :
toCanonicalMomentum S t x v = S.m • v | by
simp [toCanonicalMomentum, gradient_lagrangian_velocity_eq] | lemma | ClassicalMechanics.HarmonicOscillator.toCanonicalMomentum_eq | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
hamiltonian (t : Time) (p : EuclideanSpace ℝ (Fin 1))
(x : EuclideanSpace ℝ (Fin 1)) : ℝ | ⟪p, (toCanonicalMomentum S t x).symm p⟫_ℝ - S.lagrangian t x ((toCanonicalMomentum S t x).symm p) | def | ClassicalMechanics.HarmonicOscillator.hamiltonian | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | The hamiltonian as a function of time, momentum and position. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
hamiltonian_eq :
hamiltonian S = fun _ p x => (1 / (2 : ℝ)) * (1 / S.m) * ⟪p, p⟫_ℝ +
(1 / (2 : ℝ)) * S.k * ⟪x, x⟫_ℝ | by
funext t x p
simp only [hamiltonian, toCanonicalMomentum, lagrangian_eq, one_div, LinearEquiv.coe_symm_mk',
inner_smul_right, inner_smul_left, map_inv₀, ringHom_apply]
have hm : S.m ≠ 0 := by exact m_ne_zero S
field_simp
ring | lemma | ClassicalMechanics.HarmonicOscillator.hamiltonian_eq | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
hamiltonian_contDiff (n : WithTop ℕ∞) : ContDiff ℝ n ↿S.hamiltonian | by
rw [hamiltonian_eq]
apply ContDiff.add
· apply ContDiff.mul
· apply ContDiff.mul
· exact contDiff_const
· exact contDiff_const
· exact ContDiff.inner (𝕜 := ℝ) (contDiff_fst.comp contDiff_snd)
(contDiff_fst.comp contDiff_snd)
· apply ContDiff.mul
· apply ContDiff.mul
· e... | lemma | ClassicalMechanics.HarmonicOscillator.hamiltonian_contDiff | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
gradient_hamiltonian_position_eq (t : Time) (x : EuclideanSpace ℝ (Fin 1))
(p : EuclideanSpace ℝ (Fin 1)) :
gradient (hamiltonian S t p) x = S.k • x | by
have h_eq : (fun y : EuclideanSpace ℝ (Fin 1) => hamiltonian S t p y) =
fun y => ((1 / (2 : ℝ)) * S.k) * ⟪y, y⟫_ℝ +
((1 / (2 : ℝ)) * (1 / S.m) * ⟪p, p⟫_ℝ) := by
funext y; unfold hamiltonian; simp only [toCanonicalMomentum, lagrangian, one_div,
inner_self_eq_norm_sq_to_K, ringHom_apply, pote... | lemma | ClassicalMechanics.HarmonicOscillator.gradient_hamiltonian_position_eq | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
gradient_hamiltonian_momentum_eq (t : Time) (x : EuclideanSpace ℝ (Fin 1))
(p : EuclideanSpace ℝ (Fin 1)) :
gradient (hamiltonian S t · x) p = (1 / S.m) • p | by
have h_eq : (fun y : EuclideanSpace ℝ (Fin 1) => hamiltonian S t y x) =
fun y => ((1 / (2 : ℝ)) * (1 / S.m)) * ⟪y, y⟫_ℝ +
((1 / (2 : ℝ)) * S.k * ⟪x, x⟫_ℝ) := by
funext y; unfold hamiltonian; simp only [toCanonicalMomentum, lagrangian, one_div,
inner_self_eq_norm_sq_to_K, ringHom_apply, pote... | lemma | ClassicalMechanics.HarmonicOscillator.gradient_hamiltonian_momentum_eq | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
hamiltonian_eq_energy (xₜ : Time → EuclideanSpace ℝ (Fin 1)) :
(fun t => hamiltonian S t (toCanonicalMomentum S t (xₜ t) (∂ₜ xₜ t)) (xₜ t)) = energy S xₜ | by
funext t
have hsymm :
(toCanonicalMomentum S t (xₜ t)).symm (S.m • ∂ₜ xₜ t) = ∂ₜ xₜ t := by
rw [← toCanonicalMomentum_eq (S := S) (t := t) (x := xₜ t) (v := ∂ₜ xₜ t)]
exact LinearEquiv.symm_apply_apply (toCanonicalMomentum S t (xₜ t)) (∂ₜ xₜ t)
unfold hamiltonian lagrangian energy kineticEnergy p... | lemma | ClassicalMechanics.HarmonicOscillator.hamiltonian_eq_energy | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
hamiltonEqOp (p : Time → EuclideanSpace ℝ (Fin 1))
(q : Time → EuclideanSpace ℝ (Fin 1)) | ClassicalMechanics.hamiltonEqOp (hamiltonian S) p q | def | ClassicalMechanics.HarmonicOscillator.hamiltonEqOp | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"ClassicalMechanics.hamiltonEqOp",
"Time"
] | The operator on the momentum-position phase-space whose vanishing is equivalent to the
hamilton's equations between the momentum and position. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
equationOfMotion_iff_hamiltonEqOp_eq_zero (xₜ : Time → EuclideanSpace ℝ (Fin 1))
(hx : ContDiff ℝ ∞ xₜ) : S.EquationOfMotion xₜ ↔
hamiltonEqOp S (fun t => S.toCanonicalMomentum t (xₜ t) (∂ₜ xₜ t)) xₜ = 0 | by
rw [hamiltonEqOp, hamiltonEqOp_eq_zero_iff_hamiltons_equations]
simp [toCanonicalMomentum_eq, gradient_hamiltonian_momentum_eq, gradient_hamiltonian_position_eq]
rw [equationOfMotion_iff_newtons_2nd_law _ _ hx]
have hderiv_smul : ∀ t, ∂ₜ (fun t' => S.m • ∂ₜ xₜ t') t = S.m • ∂ₜ (∂ₜ xₜ) t := by
intro t
... | lemma | ClassicalMechanics.HarmonicOscillator.equationOfMotion_iff_hamiltonEqOp_eq_zero | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
equationOfMotion_tfae (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (hx : ContDiff ℝ ∞ xₜ) :
List.TFAE [S.EquationOfMotion xₜ,
(∀ t, S.m • ∂ₜ (∂ₜ xₜ) t = force S (xₜ t)),
hamiltonEqOp S (fun t => S.toCanonicalMomentum t (xₜ t) (∂ₜ xₜ t)) xₜ = 0,
(δ (q':=xₜ), ∫ t, lagrangian S t (q' t) (fderiv ℝ q' t 1)) ... | by
rw [← equationOfMotion_iff_hamiltonEqOp_eq_zero, ← equationOfMotion_iff_newtons_2nd_law]
rw [hamiltons_equations_varGradient, euler_lagrange_varGradient]
simp only [List.tfae_cons_self]
rw [← gradLagrangian_eq_eulerLagrangeOp, ← equationOfMotion_iff_gradLagrangian_zero]
simp only [List.tfae_cons_self]
er... | lemma | ClassicalMechanics.HarmonicOscillator.equationOfMotion_tfae | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
ConfigurationSpace where
/-- The underlying real coordinate. -/
val : ℝ | structure | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | The configuration space of the harmonic oscillator. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
ext {x y : ConfigurationSpace} (h : x.val = y.val) : x = y | by
cases x
cases y
simp at h
simp [h] | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.ext | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
zero_val : (0 : ConfigurationSpace).val = 0 | rfl | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.zero_val | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
add_val (x y : ConfigurationSpace) : (x + y).val = x.val + y.val | rfl | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.add_val | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
neg_val (x : ConfigurationSpace) : (-x).val = -x.val | rfl | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.neg_val | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
sub_val (x y : ConfigurationSpace) : (x - y).val = x.val - y.val | rfl | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.sub_val | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
smul_val (r : ℝ) (x : ConfigurationSpace) : (r • x).val = r * x.val | rfl | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.smul_val | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
apply_zero (x : ConfigurationSpace) : x 0 = x.val | rfl | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.apply_zero | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
apply_eq_val (x : ConfigurationSpace) (i : Fin 1) : x i = x.val | rfl | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.apply_eq_val | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
dist_eq_val (x y : ConfigurationSpace) :
dist x y = ‖x.val - y.val‖ | rfl | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.dist_eq_val | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
inner_def (x y : ConfigurationSpace) : ⟪x, y⟫_ℝ = x.val * y.val | rfl | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.inner_def | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
differentiable_inner_self :
Differentiable ℝ (fun x : ConfigurationSpace => ⟪x, x⟫_ℝ) | by
have h_id : Differentiable ℝ (fun x : ConfigurationSpace => x) := differentiable_id
simpa using (Differentiable.inner (𝕜:=ℝ) (f:=fun x : ConfigurationSpace => x)
(g:=fun x : ConfigurationSpace => x) h_id h_id) | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.differentiable_inner_self | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
differentiableAt_inner_self (x : ConfigurationSpace) :
DifferentiableAt ℝ (fun y : ConfigurationSpace => ⟪y, y⟫_ℝ) x | by
have h_id : DifferentiableAt ℝ (fun y : ConfigurationSpace => y) x := differentiableAt_id
simpa using (DifferentiableAt.inner (𝕜:=ℝ) (f:=fun y : ConfigurationSpace => y)
(g:=fun y : ConfigurationSpace => y) h_id h_id) | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.differentiableAt_inner_self | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
contDiff_inner_self (n : WithTop ℕ∞) :
ContDiff ℝ n (fun x : ConfigurationSpace => ⟪x, x⟫_ℝ) | by
have h_id : ContDiff ℝ n (fun x : ConfigurationSpace => x) := contDiff_id
simpa using (ContDiff.inner (𝕜:=ℝ) (f:=fun x : ConfigurationSpace => x)
(g:=fun x : ConfigurationSpace => x) h_id h_id) | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.contDiff_inner_self | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
toRealLM : ConfigurationSpace →ₗ[ℝ] ℝ | { toFun := ConfigurationSpace.val
map_add' := by simp
map_smul' := by simp } | def | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.toRealLM | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | Linear map sending a configuration space element to its underlying real value. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
fromRealLM : ℝ →ₗ[ℝ] ConfigurationSpace | { toFun := fun x => ⟨x⟩
map_add' := by
intro x y
ext
simp
map_smul' := by
intro r x
ext
simp } | def | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.fromRealLM | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | Linear map embedding a real value into the configuration space. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
toRealCLM : ConfigurationSpace →L[ℝ] ℝ | toRealLM.mkContinuous 1 (by
intro x
simp [toRealLM, norm]) | def | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.toRealCLM | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | Continuous linear map sending a configuration space element to its underlying real value. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
fromRealCLM : ℝ →L[ℝ] ConfigurationSpace | fromRealLM.mkContinuous 1 (by
intro x
simp [fromRealLM, norm]) | def | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.fromRealCLM | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | Continuous linear map embedding a real value into the configuration space. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
valHomeomorphism : ConfigurationSpace ≃ₜ ℝ | where
toFun := ConfigurationSpace.val
invFun := fun t => ⟨t⟩
left_inv := by
intro t
cases t
rfl
right_inv := by
intro t
rfl
continuous_toFun := by
simpa [toRealCLM, toRealLM] using toRealCLM.continuous
continuous_invFun := by
simpa [fromRealCLM, fromRealLM] using fromRealCLM.cont... | def | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.valHomeomorphism | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | Homeomorphism between configuration space and `ℝ` given by `ConfigurationSpace.val`. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
toSpace (q : ConfigurationSpace) : Space 1 | ⟨fun _ => q.val⟩ | def | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.toSpace | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [
"Space"
] | The position in one-dimensional space associated to the configuration. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
toSpace_apply (q : ConfigurationSpace) (i : Fin 1) : q.toSpace i = q.val | rfl | lemma | ClassicalMechanics.HarmonicOscillator.ConfigurationSpace.toSpace_apply | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/ConfigurationSpace.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
InitialConditions where
/-- The initial position of the harmonic oscillator. -/
x₀ : EuclideanSpace ℝ (Fin 1)
/-- The initial velocity of the harmonic oscillator. -/
v₀ : EuclideanSpace ℝ (Fin 1) | structure | ClassicalMechanics.HarmonicOscillator.InitialConditions | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | The initial conditions for the harmonic oscillator specified by an initial position,
and an initial velocity.
The `@[ext]` attribute provides an extensionality lemma for `InitialConditions`.
That is, a lemma which states that two initial conditions are equal if their
initial positions and initial velocities are equa... | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
InitialConditionsAtTime where
/-- The time at which the initial conditions are specified. -/
t₀ : Time
/-- The position at time t₀. -/
x_t₀ : EuclideanSpace ℝ (Fin 1)
/-- The velocity at time t₀. -/
v_t₀ : EuclideanSpace ℝ (Fin 1) | structure | ClassicalMechanics.HarmonicOscillator.InitialConditionsAtTime | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [
"Time"
] | Initial conditions for the harmonic oscillator specified at an arbitrary time `t₀`.
This structure allows specifying the position and velocity at any time `t₀`, not necessarily
at `t=0`. This is useful for problems where the natural reference time is not zero.
The conditions can be converted to the standard `In... | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
toInitialConditions (S : HarmonicOscillator)
(IC : InitialConditionsAtTime) : InitialConditions | where
x₀ := cos (S.ω * IC.t₀) • IC.x_t₀ - (sin (S.ω * IC.t₀) / S.ω) • IC.v_t₀
v₀ := S.ω • sin (S.ω * IC.t₀) • IC.x_t₀ + cos (S.ω * IC.t₀) • IC.v_t₀
/-!
The correctness proofs showing that the conversion produces the expected trajectory
are given later in section D.1, after the trajectory machinery has been defined... | def | ClassicalMechanics.HarmonicOscillator.InitialConditionsAtTime.toInitialConditions | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | Convert initial conditions at time `t₀` to standard initial conditions at `t=0`.
This conversion uses the harmonic oscillator solution formula with time-reversal.
The resulting `InitialConditions` will produce a trajectory that passes through
`x_t₀` with velocity `v_t₀` at time `t₀`.
See `toInitialConditions_... | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
x₀_zero : x₀ 0 = 0 | rfl | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.x₀_zero | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | The zero initial condition has zero starting point. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
v₀_zero : v₀ 0 = 0 | rfl | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.v₀_zero | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | The zero initial condition has zero starting velocity. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
trajectory (IC : InitialConditions) : Time → EuclideanSpace ℝ (Fin 1) | fun t =>
cos (S.ω * t) • IC.x₀ + (sin (S.ω * t)/S.ω) • IC.v₀ | def | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [
"Time"
] | Given initial conditions, the solution to the classical harmonic oscillator. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
trajectory_eq (IC : InitialConditions) :
IC.trajectory S = fun t : Time => cos (S.ω * t) • IC.x₀ + (sin (S.ω * t)/S.ω) • IC.v₀ | rfl | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory_eq | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
trajectory_zero : trajectory S 0 = fun _ => 0 | by
simp [trajectory_eq] | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory_zero | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | For zero initial conditions, the trajectory is zero. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
trajectory_contDiff (S : HarmonicOscillator) (IC : InitialConditions) {n : WithTop ℕ∞} :
ContDiff ℝ n (IC.trajectory S) | by
rw [trajectory_eq]
apply ContDiff.add
· apply fun_smul
· change ContDiff ℝ _ (((fun x => cos x) ∘ (fun y => S.ω * y))∘ Time.toRealCLM)
refine ContDiff.comp_continuousLinearMap (ContDiff.comp contDiff_cos ?_)
fun_prop
· fun_prop
· have hx := contDiff_sin (n := n)
apply fun_smul
· c... | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory_contDiff | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [
"Time.toRealCLM"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
trajectory_velocity (IC : InitialConditions) : ∂ₜ (IC.trajectory S) =
fun t : Time => - S.ω • sin (S.ω * t.val) • IC.x₀ + cos (S.ω * t.val) • IC.v₀ | by
funext t
rw [trajectory_eq, Time.deriv, fderiv_fun_add (by fun_prop) (by fun_prop)]
rw [fderiv_smul_const (by fun_prop), fderiv_smul_const (by fun_prop)]
have h1 : (fderiv ℝ (fun t => sin (S.ω * t.val) / S.ω) t) =
(1/ S.ω) • (fderiv ℝ (fun t => sin (S.ω * t.val)) t) := by
rw [← fderiv_mul_const]
... | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory_velocity | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [
"Time",
"Time.deriv"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
trajectory_acceleration (IC : InitialConditions) : ∂ₜ (∂ₜ (IC.trajectory S)) =
fun t : Time => - S.ω^2 • cos (S.ω * t.val) • IC.x₀ - S.ω • sin (S.ω * t.val) • IC.v₀ | by
funext t
rw [trajectory_velocity, Time.deriv, fderiv_fun_add (by fun_prop) (by fun_prop)]
rw [fderiv_smul_const (by fun_prop), fderiv_fun_const_smul (by fun_prop),
fderiv_smul_const (by fun_prop)]
simp only [neg_smul, ContinuousLinearMap.add_apply, ContinuousLinearMap.smulRight_apply]
rw [fderiv_cos (b... | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory_acceleration | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [
"Time",
"Time.deriv"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
trajectory_position_at_zero (IC : InitialConditions) : IC.trajectory S 0 = IC.x₀ | by
simp [trajectory] | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory_position_at_zero | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | For a set of initial conditions `IC` the position of the solution at time `0` is
`IC.x₀`. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
trajectory_velocity_at_zero (IC : InitialConditions) : ∂ₜ (IC.trajectory S) 0 = IC.v₀ | by
simp [trajectory_velocity] | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory_velocity_at_zero | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
trajectory_equationOfMotion (IC : InitialConditions) :
EquationOfMotion S (IC.trajectory S) | by
have hcont : ContDiff ℝ ∞ (IC.trajectory S) := trajectory_contDiff S IC
rw [EquationOfMotion, gradLagrangian_eq_force (S := S) (xₜ := IC.trajectory S) hcont]
funext t
simp only [Pi.zero_apply]
rw [trajectory_acceleration, force_eq_linear]
ext
have hω : S.ω ≠ 0 := ω_ne_zero S
have hωm : S.ω ^ 2 * S.m ... | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory_equationOfMotion | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
trajectories_unique (IC : InitialConditions) (x : Time → EuclideanSpace ℝ (Fin 1))
(hx : ContDiff ℝ ∞ x) :
S.EquationOfMotion x ∧ x 0 = IC.x₀ ∧ ∂ₜ x 0 = IC.v₀ →
x = IC.trajectory S | by
intro h
rcases h with ⟨hEOM, hx0, hv0⟩
-- Newton form for x
have hNewt_x :
∀ t, S.m • ∂ₜ (∂ₜ x) t = force S (x t) :=
(S.equationOfMotion_iff_newtons_2nd_law (xₜ := x) hx).1 hEOM
-- Newton form for the explicit trajectory
have hTrajContDiff : ContDiff ℝ ∞ (IC.trajectory S) := by
-- traject... | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectories_unique | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [
"Time",
"Time.deriv"
] | The trajectories to the equation of motion for a given set of initial conditions
are unique.
Semiformal implementation:
- One may needed the added condition of smoothness on `x` here.
- `EquationOfMotion` needs defining before this can be proved. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
trajectory_energy (IC : InitialConditions) : S.energy (IC.trajectory S) =
fun _ => 1/2 * (S.m * ‖IC.v₀‖ ^2 + S.k * ‖IC.x₀‖ ^ 2) | by
funext t
rw [energy_conservation_of_equationOfMotion' _ _ (by fun_prop) (trajectory_equationOfMotion S IC)]
simp [energy, kineticEnergy, potentialEnergy]
ring | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory_energy | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
toInitialConditions_trajectory_at_t₀ (S : HarmonicOscillator)
(IC : InitialConditionsAtTime) :
(IC.toInitialConditions S).trajectory S IC.t₀ = IC.x_t₀ | by
rw [InitialConditions.trajectory_eq, toInitialConditions]
ext i
simp only [smul_add, PiLp.add_apply, PiLp.smul_apply, PiLp.sub_apply, smul_eq_mul]
have h1 : cos (S.ω * IC.t₀.val) ^ 2 + sin (S.ω * IC.t₀.val) ^ 2 = 1 :=
cos_sq_add_sin_sq (S.ω * IC.t₀.val)
field_simp [S.ω_ne_zero]
nth_rw 2 [← mul_one (S... | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditionsAtTime.toInitialConditions_trajectory_at_t₀ | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | The trajectory resulting from `toInitialConditions` passes through the specified
position `x_t₀` at time `t₀`. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
toInitialConditions_velocity_at_t₀ (S : HarmonicOscillator)
(IC : InitialConditionsAtTime) :
∂ₜ ((IC.toInitialConditions S).trajectory S) IC.t₀ = IC.v_t₀ | by
rw [InitialConditions.trajectory_velocity, toInitialConditions]
ext i
simp only [neg_smul, smul_add, PiLp.add_apply, PiLp.neg_apply, PiLp.smul_apply, PiLp.sub_apply,
smul_eq_mul]
have h1 : cos (S.ω * IC.t₀.val) ^ 2 + sin (S.ω * IC.t₀.val) ^ 2 = 1 :=
cos_sq_add_sin_sq (S.ω * IC.t₀.val)
field_simp [S... | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditionsAtTime.toInitialConditions_velocity_at_t₀ | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | The trajectory resulting from `toInitialConditions` has the specified
velocity `v_t₀` at time `t₀`. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
toInitialConditions_energy_at_t₀ (S : HarmonicOscillator)
(IC : InitialConditionsAtTime) :
S.energy ((IC.toInitialConditions S).trajectory S) IC.t₀ =
1/2 * (S.m * ‖IC.v_t₀‖^2 + S.k * ‖IC.x_t₀‖^2) | by
unfold energy kineticEnergy potentialEnergy
simp only [toInitialConditions_trajectory_at_t₀, toInitialConditions_velocity_at_t₀]
rw [real_inner_self_eq_norm_sq, real_inner_self_eq_norm_sq]
simp only [smul_eq_mul]
ring | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditionsAtTime.toInitialConditions_energy_at_t₀ | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | The energy of the trajectory at time `t₀` equals the energy computed from the
initial conditions at `t₀`. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
tan_time_eq_of_trajectory_velocity_eq_zero (IC : InitialConditions) (t : Time)
(h : ∂ₜ (IC.trajectory S) t = 0) (hx : IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0) :
tan (S.ω * t) = IC.v₀ 0 / (S.ω * IC.x₀ 0) | by
rw [trajectory_velocity] at h
simp at h
have hx : S.ω ≠ 0 := by exact ω_ne_zero S
by_cases h1 : IC.x₀ ≠ 0
by_cases h2 : IC.v₀ ≠ 0
have h1' : IC.x₀ 0 ≠ 0 := by
intro hn
apply h1
ext i
fin_cases i
simp [hn]
have hcos : cos (S.ω * t.val) ≠ 0 := by
by_contra hn
rw [hn] at h
... | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.tan_time_eq_of_trajectory_velocity_eq_zero | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
trajectory_velocity_eq_zero_at_arctan (IC : InitialConditions) (hx : IC.x₀ ≠ 0) :
(∂ₜ (IC.trajectory S)) (arctan (IC.v₀ 0 / (S.ω * IC.x₀ 0)) / S.ω) = 0 | by
rw [trajectory_velocity]
simp [neg_smul]
have hx' : S.ω ≠ 0 := by exact ω_ne_zero S
field_simp
rw [Real.sin_arctan, Real.cos_arctan]
ext i
simp [one_div]
trans (-(S.ω * (IC.v₀ 0 / (S.ω * IC.x₀ 0) * IC.x₀ 0)) + IC.v₀ 0) *
(√(1 + (IC.v₀ 0 / (S.ω * IC.x₀ 0)) ^ 2))⁻¹
· fin_cases i
simp only [Fi... | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory_velocity_eq_zero_at_arctan | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
trajectory_velocity_eq_zero_iff (IC : InitialConditions) (t : Time) :
∂ₜ (IC.trajectory S) t = 0 ↔
‖(IC.trajectory S) t‖ = √(‖IC.x₀‖^2 + (‖IC.v₀‖/S.ω)^2) | by
have := by exact energy_eq S (trajectory S IC)
have h_energy_t := congrFun this t
simp only [kineticEnergy_eq, one_div, potentialEnergy_eq, smul_eq_mul] at h_energy_t
rw [real_inner_self_eq_norm_sq (trajectory S IC t)] at h_energy_t
have := by exact trajectory_energy S IC
have h_init := congrFun this t
... | lemma | ClassicalMechanics.HarmonicOscillator.InitialConditions.trajectory_velocity_eq_zero_iff | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [
"Time"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
period (S : HarmonicOscillator) : ℝ | 2 * π / S.ω | def | ClassicalMechanics.HarmonicOscillator.period | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | The period of a harmonic oscillator is `2 * π / ω`. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
period_eq : T S = 2 * π / S.ω | rfl | lemma | ClassicalMechanics.HarmonicOscillator.period_eq | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
period_pos : 0 < T S | by
have := S.ω_pos
rw [period_eq]
positivity | lemma | ClassicalMechanics.HarmonicOscillator.period_pos | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
trajectory_periodic (IC : InitialConditions) :
Function.Periodic (IC.trajectory S) (T S) | fun t ↦ by
have h : S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π := by
have := S.ω_ne_zero
ring_nf; field_simp
rw [InitialConditions.trajectory, add_val, period_eq, h, cos_add_two_pi, sin_add_two_pi]
rfl
/-!
## F. Some open TODOs
We give some open TODOs for the classical harmonic oscillator.
-/
... | lemma | ClassicalMechanics.HarmonicOscillator.trajectory_periodic | ClassicalMechanics.HarmonicOscillator | Physlib/ClassicalMechanics/HarmonicOscillator/Solution.lean | [] | [] | The trajectory of the harmonic oscillator is periodic with period of `2 * π / ω`. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
IsTotalTimeDerivative {n : ℕ}
(δL : EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin n) → ℝ → ℝ) : Prop | ∃ (F : EuclideanSpace ℝ (Fin n) × ℝ → ℝ) (_ : Differentiable ℝ F),
∀ r v t, δL r v t = fderiv ℝ F (r, t) (v, 1) | def | ClassicalMechanics.Lagrangian.IsTotalTimeDerivative | ClassicalMechanics.Lagrangian | Physlib/ClassicalMechanics/Lagrangian/TotalDerivativeEquivalence.lean | [] | [] | A function δL(r, v, t) is a total time derivative if it can be written as d/dt F(r, t)
for some function F that depends on position and time but not velocity.
Mathematically: δL(r, v, t) = fderiv ℝ F (r, t) (v, 1)
By the chain rule, this equals ∂F/∂t(r, t) + ⟨∇ᵣF(r, t), v⟩.
This is the most general f... | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
isTotalTimeDerivativeVelocity {n : ℕ}
(δL : EuclideanSpace ℝ (Fin n) → ℝ)
(hδL0 : δL 0 = 0)
(h : IsTotalTimeDerivative (fun _ v _ => δL v)) :
∃ g : EuclideanSpace ℝ (Fin n), ∀ v, δL v = ⟪g, v⟫_ℝ | by
classical
rcases h with ⟨F, hFdiff, hEq⟩
-- Derivative of F at (0,0)
let dF : (EuclideanSpace ℝ (Fin n) × ℝ) →L[ℝ] ℝ :=
fderiv ℝ F ((0 : EuclideanSpace ℝ (Fin n)), (0 : ℝ))
-- The "time-direction" derivative must vanish because δL 0 = 0.
have h_time : dF ((0 : EuclideanSpace ℝ (Fin n)), (1 : ℝ)) = ... | lemma | ClassicalMechanics.Lagrangian.isTotalTimeDerivativeVelocity | ClassicalMechanics.Lagrangian | Physlib/ClassicalMechanics/Lagrangian/TotalDerivativeEquivalence.lean | [] | [] | A velocity-only function that is a total time derivative must be linear in velocity.
If δL depends only on velocity and equals d/dt F(r, t) for some F,
then δL(v) = ⟨g, v⟩ for some constant vector g.
This characterization comes from the requirement that:
- d/dt F(r, t) = ∂F/∂t + ⟨∇F, ṙ⟩ = ∂F/∂t + ⟨∇F,... | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
MassUnit where
/-- The underlying scale of the unit. -/
val : ℝ
property : 0 < val | structure | MassUnit | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [] | The choices of translationally-invariant metrics on the mass-manifold.
Such a choice corresponds to a choice of units for mass. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
val_ne_zero (x : MassUnit) : x.val ≠ 0 | by
exact Ne.symm (ne_of_lt x.property) | lemma | MassUnit.val_ne_zero | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
val_pos (x : MassUnit) : 0 < x.val | x.property | lemma | MassUnit.val_pos | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
div_eq_val (x y : MassUnit) :
x / y = (⟨x.val / y.val, div_nonneg (le_of_lt x.val_pos) (le_of_lt y.val_pos)⟩ : ℝ≥0) | rfl | lemma | MassUnit.div_eq_val | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
div_ne_zero (x y : MassUnit) : ¬ x / y = (0 : ℝ≥0) | by
rw [div_eq_val]
refine coe_ne_zero.mp ?_
simp [toReal] | lemma | MassUnit.div_ne_zero | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
div_pos (x y : MassUnit) : (0 : ℝ≥0) < x/ y | by
apply lt_of_le_of_ne
· exact zero_le
· exact Ne.symm (div_ne_zero x y) | lemma | MassUnit.div_pos | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
div_self (x : MassUnit) :
x / x = (1 : ℝ≥0) | by
simp [div_eq_val, x.val_ne_zero]
rfl | lemma | MassUnit.div_self | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
div_symm (x y : MassUnit) :
x / y = (y / x)⁻¹ | NNReal.eq <| by
rw [div_eq_val, inv_eq_one_div, div_eq_val]
simp only [one_div, NNReal.coe_inv]
rw [toReal, inv_div] | lemma | MassUnit.div_symm | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
div_mul_div_coe (x y z : MassUnit) :
(x / y : ℝ) * (y / z : ℝ) = x / z | by
simp [div_eq_val, toReal]
field_simp | lemma | MassUnit.div_mul_div_coe | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
scale (r : ℝ) (x : MassUnit) (hr : 0 < r := by norm_num) : MassUnit | ⟨r * x.val, mul_pos hr x.val_pos⟩ | def | MassUnit.scale | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | The scaling of a mass unit by a positive real. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
scale_div_self (x : MassUnit) (r : ℝ) (hr : 0 < r) :
scale r x hr / x = (⟨r, le_of_lt hr⟩ : ℝ≥0) | by
simp [scale, div_eq_val] | lemma | MassUnit.scale_div_self | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
self_div_scale (x : MassUnit) (r : ℝ) (hr : 0 < r) :
x / scale r x hr = (⟨1/r, _root_.div_nonneg (by simp) (le_of_lt hr)⟩ : ℝ≥0) | by
simp [scale, div_eq_val]
field_simp | lemma | MassUnit.self_div_scale | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
scale_one (x : MassUnit) : scale 1 x = x | by
simp [scale] | lemma | MassUnit.scale_one | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
scale_div_scale (x1 x2 : MassUnit) {r1 r2 : ℝ} (hr1 : 0 < r1) (hr2 : 0 < r2) :
scale r1 x1 hr1 / scale r2 x2 hr2 = (⟨r1, le_of_lt hr1⟩ / ⟨r2, le_of_lt hr2⟩) * (x1 / x2) | by
refine NNReal.eq ?_
simp [scale, div_eq_val]
rw [toReal]
field_simp | lemma | MassUnit.scale_div_scale | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
scale_scale (x : MassUnit) (r1 r2 : ℝ) (hr1 : 0 < r1) (hr2 : 0 < r2) :
scale r1 (scale r2 x hr2) hr1 = scale (r1 * r2) x (mul_pos hr1 hr2) | by
simp [scale]
ring | lemma | MassUnit.scale_scale | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 | |
kilograms : MassUnit | ⟨1, by norm_num⟩ | def | MassUnit.kilograms | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | The definition of a mass unit of kilograms. | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
micrograms : MassUnit | scale ((1/10) ^ 9) kilograms | def | MassUnit.micrograms | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | The mass unit of a microgram (10^(-9) of a kilogram). | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
milligrams : MassUnit | scale ((1/10) ^ 6) kilograms | def | MassUnit.milligrams | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | The mass unit of milligram (10^(-6) of a kilogram). | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
grams : MassUnit | scale ((1/10) ^ 3) kilograms | def | MassUnit.grams | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | The mass unit of grams (10^(-3) of a kilogram). | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
ounces : MassUnit | scale (0.028349523125) kilograms | def | MassUnit.ounces | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | The mass unit of (avoirdupois) ounces (0.028 349 523 125 of a kilogram). | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
pounds : MassUnit | scale (0.45359237) kilograms | def | MassUnit.pounds | ClassicalMechanics.Mass | Physlib/ClassicalMechanics/Mass/MassUnit.lean | [] | [
"MassUnit"
] | The mass unit of (avoirdupois) pounds (0.453 592 37 of a kilogram). | https://github.com/HEPLean/PhysLean | 01143d7c9702318879b3c86bd9eadcdc60a13cc3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.