Dataset Viewer
Auto-converted to Parquet Duplicate
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
AdmissibleVariation (d : ℕ) (U : Type*) [NormedAddCommGroup U] [NormedSpace ℝ U] where /-- The underlying variation function. -/ toFun : Space d → U /-- Smoothness and compact support of the variation. -/ isTestFunction : IsTestFunction toFun
structure
ClassicalFieldTheory.Local.AdmissibleVariation
ClassicalFieldTheory.Local
Physlib/ClassicalFieldTheory/Local/Variation.lean
[]
[ "IsTestFunction", "Space" ]
An admissible local variation is a smooth compactly supported map `Space d → U`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
hasCompactSupport (η : AdmissibleVariation d U) : HasCompactSupport (η.toFun)
η.isTestFunction.supp
lemma
ClassicalFieldTheory.Local.AdmissibleVariation.hasCompactSupport
ClassicalFieldTheory.Local
Physlib/ClassicalFieldTheory/Local/Variation.lean
[]
[]
An admissible variation has compact support.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
toCompactlySupportedContinuousMap (η : AdmissibleVariation d U) : CompactlySupportedContinuousMap (Space d) U
η.isTestFunction.toCompactlySupportedContinuousMap
def
ClassicalFieldTheory.Local.AdmissibleVariation.toCompactlySupportedContinuousMap
ClassicalFieldTheory.Local
Physlib/ClassicalFieldTheory/Local/Variation.lean
[]
[ "Space" ]
View an admissible variation as a compactly supported continuous map.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
zero_apply (x : Space d) : (0 : AdmissibleVariation d U) x = 0
rfl
lemma
ClassicalFieldTheory.Local.AdmissibleVariation.zero_apply
ClassicalFieldTheory.Local
Physlib/ClassicalFieldTheory/Local/Variation.lean
[]
[ "Space" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
neg_apply (η : AdmissibleVariation d U) (x : Space d) : (-η) x = -η x
rfl
lemma
ClassicalFieldTheory.Local.AdmissibleVariation.neg_apply
ClassicalFieldTheory.Local
Physlib/ClassicalFieldTheory/Local/Variation.lean
[]
[ "Space" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
add_apply (η ξ : AdmissibleVariation d U) (x : Space d) : (η + ξ) x = η x + ξ x
rfl
lemma
ClassicalFieldTheory.Local.AdmissibleVariation.add_apply
ClassicalFieldTheory.Local
Physlib/ClassicalFieldTheory/Local/Variation.lean
[]
[ "Space" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
sub_apply (η ξ : AdmissibleVariation d U) (x : Space d) : (η - ξ) x = η x - ξ x
rfl
lemma
ClassicalFieldTheory.Local.AdmissibleVariation.sub_apply
ClassicalFieldTheory.Local
Physlib/ClassicalFieldTheory/Local/Variation.lean
[]
[ "Space" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
smul_apply (c : ℝ) (η : AdmissibleVariation d U) (x : Space d) : (c • η) x = c • η x
rfl
lemma
ClassicalFieldTheory.Local.AdmissibleVariation.smul_apply
ClassicalFieldTheory.Local
Physlib/ClassicalFieldTheory/Local/Variation.lean
[]
[ "Space" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
coord {m : ℕ} (η : AdmissibleVariation d (Space m)) (a : Fin m) : IsTestFunction (fun x => (η.toFun x).coord a)
by simpa [Space.coord] using IsTestFunction.coord η.isTestFunction a
lemma
ClassicalFieldTheory.Local.AdmissibleVariation.coord
ClassicalFieldTheory.Local
Physlib/ClassicalFieldTheory/Local/Variation.lean
[]
[ "IsTestFunction", "IsTestFunction.coord", "Space", "Space.coord" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
eulerLagrangeOp (L : Time → X → X → ℝ) (q : Time → X) : Time → X
fun t => gradient (L t · (∂ₜ q t)) (q t) - ∂ₜ (fun t' => gradient (L t' (q t') ·) (∂ₜ q t')) t
def
ClassicalMechanics.eulerLagrangeOp
ClassicalMechanics
Physlib/ClassicalMechanics/EulerLagrange.lean
[]
[ "Time" ]
The Euler Lagrange operator, for a trajectory `q : Time → X`, and a lagrangian `Time → X → X → ℝ`, the Euler-Lagrange operator is `∂L/∂q - dₜ(∂L/∂(dₜ q))`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
eulerLagrangeOp_eq (L : Time → X → X → ℝ) (q : Time → X) : eulerLagrangeOp L q = fun t => gradient (L t · (∂ₜ q t)) (q t) - ∂ₜ (fun t' => gradient (L t' (q t') ·) (∂ₜ q t')) t
by rfl
lemma
ClassicalMechanics.eulerLagrangeOp_eq
ClassicalMechanics
Physlib/ClassicalMechanics/EulerLagrange.lean
[]
[ "Time" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
eulerLagrangeOp_zero (q : Time → X) : eulerLagrangeOp (fun _ _ _ => 0) q = fun _ => 0
by simp [eulerLagrangeOp_eq, Time.deriv_eq]
lemma
ClassicalMechanics.eulerLagrangeOp_zero
ClassicalMechanics
Physlib/ClassicalMechanics/EulerLagrange.lean
[]
[ "Time", "Time.deriv_eq" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
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] apply HasVarGradientAt.varGradient apply HasVarGradientAt.intro _ · apply HasVarAdjDerivAt.comp (F := fun (φ : Time → X × X) t => L t (φ t).fst (φ t).snd) (G := fun (φ : Time → X) t => (φ t, fderiv ℝ φ t 1)) · apply HasVarAdjDerivAt.fmap (f ...
theorem
ClassicalMechanics.euler_lagrange_varGradient
ClassicalMechanics
Physlib/ClassicalMechanics/EulerLagrange.lean
[]
[ "DifferentiableAt.hasAdjFDerivAt", "HasVarAdjDerivAt.comp", "HasVarAdjDerivAt.fderiv", "HasVarAdjDerivAt.fmap", "HasVarAdjDerivAt.id", "HasVarAdjDerivAt.prod", "HasVarGradientAt.varGradient", "Time", "Time.deriv_eq", "adjFDeriv_uncurry", "gradient_eq_adjFDeriv" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
hamiltonEqOp (H : Time → X → X → ℝ) (p : Time → X) (q : Time → X) : Time → X × X
fun t => (∂ₜ q t + -gradient (fun x => H t x (q t)) (p t), - ∂ₜ p t + -gradient (fun x => H t (p t) x) (q t))
def
ClassicalMechanics.hamiltonEqOp
ClassicalMechanics
Physlib/ClassicalMechanics/HamiltonsEquations.lean
[]
[ "Time" ]
Given a hamiltonian `H : Time → X → X → ℝ` the operator which when set to zero implies the Hamilton equations.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
hamiltonEqOp_eq (H : Time → X → X → ℝ) (p : Time → X) (q : Time → X) : hamiltonEqOp H p q = fun t => (∂ₜ q t + -gradient (fun x => H t x (q t)) (p t), - ∂ₜ p t + -gradient (fun x => H t (p t) x) (q t))
by rfl
lemma
ClassicalMechanics.hamiltonEqOp_eq
ClassicalMechanics
Physlib/ClassicalMechanics/HamiltonsEquations.lean
[]
[ "Time" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
hamiltonEqOp_eq_zero_iff_hamiltons_equations (H : Time → X → X → ℝ) (p : Time → X) (q : Time → 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 con...
lemma
ClassicalMechanics.hamiltonEqOp_eq_zero_iff_hamiltons_equations
ClassicalMechanics
Physlib/ClassicalMechanics/HamiltonsEquations.lean
[]
[ "Time", "Time.deriv_eq" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
hamiltons_equations_varGradient (H : Time → X → X → ℝ) (pq : Time → X × X) (hp : ContDiff ℝ ∞ pq) (hL : ContDiff ℝ ∞ ↿H) : (δ (pq':= pq), ∫ t, ⟪(pq' t).1, ∂ₜ (Prod.snd ∘ pq') t⟫_ℝ - H t (pq' t).1 (pq' t).2) = fun t => hamiltonEqOp H (fun t => (pq t).1) (fun t => (pq t).2) t
by apply HasVarGradientAt.varGradient apply HasVarGradientAt.intro _ · apply HasVarAdjDerivAt.add · let i := fun (t : Time) (x : X × X) => ⟪x.1, x.2⟫_ℝ apply HasVarAdjDerivAt.comp (F := fun (φ : Time → X × X) t => i t (φ t)) (G := fun (φ : Time → X × X) t => ((φ t).1, fderiv ℝ (Prod.snd ...
theorem
ClassicalMechanics.hamiltons_equations_varGradient
ClassicalMechanics
Physlib/ClassicalMechanics/HamiltonsEquations.lean
[]
[ "DifferentiableAt.hasAdjFDerivAt", "HasVarAdjDerivAt", "HasVarAdjDerivAt.add", "HasVarAdjDerivAt.comp", "HasVarAdjDerivAt.fderiv'", "HasVarAdjDerivAt.fmap", "HasVarAdjDerivAt.fst", "HasVarAdjDerivAt.id", "HasVarAdjDerivAt.neg", "HasVarAdjDerivAt.prod", "HasVarGradientAt.varGradient", "Time", ...
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
DampedHarmonicOscillator extends HarmonicOscillator where /-- The damping coefficient of the oscillator. -/ γ : ℝ /-- The damping coefficient is nonnegative. -/ γ_nonneg : 0 ≤ γ
structure
ClassicalMechanics.DampedHarmonicOscillator
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The classical damped harmonic oscillator is specified by a mass `m`, a spring constant `k`, and a damping coefficient `γ`. The mass and spring constant are inherited from `HarmonicOscillator` and are positive. The damping coefficient is assumed to be nonnegative.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
EquationOfMotion (xₜ : Time → EuclideanSpace ℝ (Fin 1)) : Prop
∀ t : Time, S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t + S.k • xₜ t = 0
def
ClassicalMechanics.DampedHarmonicOscillator.EquationOfMotion
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[ "Time" ]
The equation of motion for the damped harmonic oscillator: `m ẍ + γ ẋ + k x = 0`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
energy_dissipation_rate (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (t : Time) (h1 : S.EquationOfMotion xₜ) (hx : ContDiff ℝ ∞ xₜ) : ∂ₜ (S.energy xₜ) t = - S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ
by rw [S.energy_deriv xₜ hx] simp only have heom := h1 t have hforce : S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t = - S.γ • ∂ₜ xₜ t := by have hsum : (S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t) + S.γ • ∂ₜ xₜ t = 0 := by simpa [add_assoc, add_left_comm, add_comm] using heom simpa [neg_smul] using eq_neg_of_add_eq_zero_...
lemma
ClassicalMechanics.DampedHarmonicOscillator.energy_dissipation_rate
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[ "Time" ]
Along a smooth solution of the damped equation of motion, the derivative of the mechanical energy is `-γ ‖ẋ‖^2`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
energy_not_conserved (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (t : Time) (h1 : S.EquationOfMotion xₜ) (hx : ContDiff ℝ ∞ xₜ) (hdx : ∂ₜ xₜ t ≠ 0) (hγ : 0 < S.γ) : ∂ₜ (S.energy xₜ) t < 0
by rw [energy_dissipation_rate S xₜ t h1 hx] rw [neg_mul] exact neg_neg_of_pos (mul_pos hγ (real_inner_self_pos.mpr hdx))
lemma
ClassicalMechanics.DampedHarmonicOscillator.energy_not_conserved
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[ "Time" ]
If `0 < γ` and the velocity is nonzero at a time, the mechanical energy is strictly decreasing at that time.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
force (S : DampedHarmonicOscillator) (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (t : Time) : EuclideanSpace ℝ (Fin 1)
- S.k • xₜ t - S.γ • ∂ₜ xₜ t
def
ClassicalMechanics.DampedHarmonicOscillator.force
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[ "Time" ]
The force of the damped harmonic oscillator at a given position and time.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
equationOfMotion_iff_newtons_2nd_law (xₜ : Time → EuclideanSpace ℝ (Fin 1)) : S.EquationOfMotion xₜ ↔ (∀ t : Time, S.m • ∂ₜ (∂ₜ xₜ) t = force S xₜ t)
by simp only [EquationOfMotion, force] constructor · intro h t have h' : S.m • ∂ₜ (∂ₜ xₜ) t + (S.γ • ∂ₜ xₜ t + S.k • xₜ t) = 0 := by simpa [add_assoc] using h t have ha : S.m • ∂ₜ (∂ₜ xₜ) t = -(S.γ • ∂ₜ xₜ t + S.k • xₜ t) := eq_neg_of_add_eq_zero_left h' simpa [sub_eq_add_n...
lemma
ClassicalMechanics.DampedHarmonicOscillator.equationOfMotion_iff_newtons_2nd_law
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[ "Time" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
discriminant : ℝ
S.γ^2 - 4 * S.m * S.k
def
ClassicalMechanics.DampedHarmonicOscillator.discriminant
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The discriminant that determines the damping regime.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
decayRate : ℝ
S.γ / (2 * S.m)
def
ClassicalMechanics.DampedHarmonicOscillator.decayRate
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The exponential decay rate `γ / (2 * m)`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
IsUnderdamped : Prop
S.discriminant < 0
def
ClassicalMechanics.DampedHarmonicOscillator.IsUnderdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The system is underdamped when γ² < 4mk.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
IsCriticallyDamped : Prop
S.discriminant = 0
def
ClassicalMechanics.DampedHarmonicOscillator.IsCriticallyDamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The system is critically damped when γ² = 4mk.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
IsOverdamped : Prop
0 < S.discriminant
def
ClassicalMechanics.DampedHarmonicOscillator.IsOverdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The system is overdamped when 4mk < γ².
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
IsUndamped : Prop
S.γ = 0
def
ClassicalMechanics.DampedHarmonicOscillator.IsUndamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The system is undamped when γ = 0.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
angularFrequency : ℝ
by classical exact if S.IsUnderdamped then sqrt (- S.discriminant) / (2 * S.m) else if S.IsCriticallyDamped then 0 else sqrt S.discriminant / (2 * S.m)
def
ClassicalMechanics.DampedHarmonicOscillator.angularFrequency
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The real frequency selected by the damping regime. In the underdamped regime this is the oscillation frequency. In the critically damped regime it is `0`. In the overdamped regime this is the real split rate between the two roots.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq : S.discriminant = 4 * S.m^2 * (S.decayRate^2 - S.ω^2)
by rw [discriminant, decayRate, S.ω_sq] field_simp [S.m_ne_zero] ring
lemma
ClassicalMechanics.DampedHarmonicOscillator.discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The relationship between the discriminant, decay rate, and natural angular frequency.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
decayRate_nonneg : 0 ≤ S.decayRate
by rw [decayRate] exact div_nonneg S.γ_nonneg (by nlinarith [S.m_pos])
lemma
ClassicalMechanics.DampedHarmonicOscillator.decayRate_nonneg
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The decay rate is nonnegative.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
isUnderdamped_of_gamma_eq_zero (hγ : S.γ = 0) : S.IsUnderdamped
by rw [IsUnderdamped, discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq S, decayRate] rw [hγ] ring_nf nlinarith [sq_pos_of_pos S.m_pos, sq_pos_of_pos S.ω_pos]
lemma
ClassicalMechanics.DampedHarmonicOscillator.isUnderdamped_of_gamma_eq_zero
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
An undamped oscillator lies in the underdamped regime.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
isUnderdamped_decayRate (hS : S.IsUnderdamped) : S.decayRate < S.ω
by rw [IsUnderdamped] at hS rw [discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq] at hS have hm_sq_pos : 0 < 4 * S.m^2 := by have hsq : 0 < S.m^2 := sq_pos_of_pos S.m_pos nlinarith have hsq : S.decayRate^2 < S.ω^2 := by nlinarith nlinarith [S.decayRate_nonneg, S.ω_pos]
lemma
ClassicalMechanics.DampedHarmonicOscillator.isUnderdamped_decayRate
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
An underdamped system has decay rate less than the natural frequency.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
isCriticallyDamped_decayRate (hS : S.IsCriticallyDamped) : S.ω = S.decayRate
by rw [IsCriticallyDamped] at hS rw [discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq] at hS have hm_sq_ne_zero : 4 * S.m^2 ≠ 0 := by have hm_sq_pos : 0 < 4 * S.m^2 := by have hsq : 0 < S.m^2 := sq_pos_of_pos S.m_pos nlinarith exact ne_of_gt hm_sq_pos have hsq : S.decayRate^2 = S.ω^2 ...
lemma
ClassicalMechanics.DampedHarmonicOscillator.isCriticallyDamped_decayRate
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
A critically damped system has decay rate equal to the natural frequency.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
gamma_eq_two_mul_m_mul_decayRate : S.γ = 2 * S.m * S.decayRate
by rw [decayRate] field_simp [S.m_ne_zero]
lemma
ClassicalMechanics.DampedHarmonicOscillator.gamma_eq_two_mul_m_mul_decayRate
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The damping coefficient is twice mass times the decay rate.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
k_eq_m_mul_ω_sq : S.k = S.m * S.ω^2
by rw [S.ω_sq] field_simp [S.m_ne_zero]
lemma
ClassicalMechanics.DampedHarmonicOscillator.k_eq_m_mul_ω_sq
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The spring constant is `m * ω^2`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
k_eq_m_mul_decayRate_sq_of_criticallyDamped (hS : S.IsCriticallyDamped) : S.k = S.m * S.decayRate^2
by have hωa : S.ω = S.decayRate := S.isCriticallyDamped_decayRate hS have hωsq : S.decayRate ^ 2 = S.k / S.m := by simpa [hωa] using S.ω_sq field_simp [S.m_ne_zero] at hωsq nlinarith
lemma
ClassicalMechanics.DampedHarmonicOscillator.k_eq_m_mul_decayRate_sq_of_criticallyDamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
In the critically damped regime, `k = m * decayRate^2`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
isOverdamped_decayRate (hS : S.IsOverdamped) : S.ω < S.decayRate
by rw [IsOverdamped] at hS rw [discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq] at hS have hm_sq_pos : 0 < 4 * S.m^2 := by have hsq : 0 < S.m^2 := sq_pos_of_pos S.m_pos nlinarith have hsq : S.ω^2 < S.decayRate^2 := by nlinarith nlinarith [S.decayRate_nonneg, S.ω_pos]
lemma
ClassicalMechanics.DampedHarmonicOscillator.isOverdamped_decayRate
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
An overdamped system has decay rate greater than the natural frequency.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
angularFrequency_eq_underdamped (hS : S.IsUnderdamped) : S.angularFrequency = sqrt (- S.discriminant) / (2 * S.m)
by classical simp [angularFrequency, hS]
lemma
ClassicalMechanics.DampedHarmonicOscillator.angularFrequency_eq_underdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
In the underdamped regime, the selected frequency uses the oscillation frequency.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
angularFrequency_eq_criticallyDamped (hS : S.IsCriticallyDamped) : S.angularFrequency = 0
by classical have hnotUnder : ¬ S.IsUnderdamped := by intro hUnder rw [IsUnderdamped] at hUnder rw [IsCriticallyDamped] at hS linarith simp [angularFrequency, hnotUnder, hS]
lemma
ClassicalMechanics.DampedHarmonicOscillator.angularFrequency_eq_criticallyDamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
In the critically damped regime, the selected frequency is zero.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
angularFrequency_eq_overdamped (hS : S.IsOverdamped) : S.angularFrequency = sqrt S.discriminant / (2 * S.m)
by classical have hnotUnder : ¬ S.IsUnderdamped := by intro hUnder rw [IsUnderdamped] at hUnder rw [IsOverdamped] at hS linarith have hnotCritical : ¬ S.IsCriticallyDamped := by intro hCritical rw [IsCriticallyDamped] at hCritical rw [IsOverdamped] at hS linarith simp [angularFre...
lemma
ClassicalMechanics.DampedHarmonicOscillator.angularFrequency_eq_overdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
In the overdamped regime, the selected frequency uses the real split rate.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
angularFrequency_sq_of_underdamped (hS : S.IsUnderdamped) : S.angularFrequency^2 = S.ω^2 - S.decayRate^2
by rw [S.angularFrequency_eq_underdamped hS, div_pow, sq_sqrt] · rw [discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq] field_simp [S.m_ne_zero] ring · rw [IsUnderdamped] at hS exact le_of_lt (neg_pos.mpr hS)
lemma
ClassicalMechanics.DampedHarmonicOscillator.angularFrequency_sq_of_underdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
In the underdamped regime, the selected angular frequency squares to `ω^2 - decayRate^2`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
angularFrequency_pos_of_underdamped (hS : S.IsUnderdamped) : 0 < S.angularFrequency
by rw [S.angularFrequency_eq_underdamped hS] apply div_pos · rw [IsUnderdamped] at hS exact sqrt_pos.mpr (neg_pos.mpr hS) · nlinarith [S.m_pos]
lemma
ClassicalMechanics.DampedHarmonicOscillator.angularFrequency_pos_of_underdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The selected angular frequency is positive in the underdamped regime.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
angularFrequency_ne_zero_of_underdamped (hS : S.IsUnderdamped) : S.angularFrequency ≠ 0
Ne.symm (ne_of_lt (S.angularFrequency_pos_of_underdamped hS))
lemma
ClassicalMechanics.DampedHarmonicOscillator.angularFrequency_ne_zero_of_underdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The selected angular frequency is nonzero in the underdamped regime.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
angularFrequency_sq_of_overdamped (hS : S.IsOverdamped) : S.angularFrequency^2 = S.decayRate^2 - S.ω^2
by rw [S.angularFrequency_eq_overdamped hS, div_pow, sq_sqrt] · rw [discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq] field_simp [S.m_ne_zero] ring · rw [IsOverdamped] at hS exact le_of_lt hS
lemma
ClassicalMechanics.DampedHarmonicOscillator.angularFrequency_sq_of_overdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
In the overdamped regime, the selected angular frequency squares to `decayRate^2 - ω^2`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
angularFrequency_pos_of_overdamped (hS : S.IsOverdamped) : 0 < S.angularFrequency
by rw [S.angularFrequency_eq_overdamped hS] apply div_pos · rw [IsOverdamped] at hS exact sqrt_pos.mpr hS · nlinarith [S.m_pos]
lemma
ClassicalMechanics.DampedHarmonicOscillator.angularFrequency_pos_of_overdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The selected angular frequency is positive in the overdamped regime.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
angularFrequency_ne_zero_of_overdamped (hS : S.IsOverdamped) : S.angularFrequency ≠ 0
Ne.symm (ne_of_lt (S.angularFrequency_pos_of_overdamped hS))
lemma
ClassicalMechanics.DampedHarmonicOscillator.angularFrequency_ne_zero_of_overdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
The selected angular frequency is nonzero in the overdamped regime.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
toUndamped (S : DampedHarmonicOscillator) (_hS : S.IsUndamped) : HarmonicOscillator
S.toHarmonicOscillator
def
ClassicalMechanics.DampedHarmonicOscillator.toUndamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[]
Convert a damped oscillator to its underlying undamped oscillator when `γ = 0`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
toUndamped_equationOfMotion (S : DampedHarmonicOscillator) (hS : S.IsUndamped) (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (hx : ContDiff ℝ ∞ xₜ) : S.EquationOfMotion xₜ ↔ (S.toUndamped hS).EquationOfMotion xₜ
by have hγ : S.γ = 0 := by simpa [IsUndamped] using hS rw [S.equationOfMotion_iff_newtons_2nd_law xₜ, (S.toUndamped hS).equationOfMotion_iff_newtons_2nd_law xₜ hx] constructor · intro h t calc (S.toUndamped hS).m • ∂ₜ (∂ₜ xₜ) t = S.m • ∂ₜ (∂ₜ xₜ) t := rfl _ = force S xₜ t := h t _ ...
lemma
ClassicalMechanics.DampedHarmonicOscillator.toUndamped_equationOfMotion
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Basic.lean
[]
[ "Time" ]
When `γ = 0`, the damped equation of motion is equivalent to the equation of motion for the corresponding undamped harmonic oscillator.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
InitialConditions where /-- The initial position of the damped harmonic oscillator. -/ x₀ : EuclideanSpace ℝ (Fin 1) /-- The initial velocity of the damped harmonic oscillator. -/ v₀ : EuclideanSpace ℝ (Fin 1)
structure
ClassicalMechanics.DampedHarmonicOscillator.InitialConditions
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[]
The initial conditions for the damped harmonic oscillator, specified by an initial position and an initial velocity.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
underdampedBase (IC : InitialConditions) : Time → EuclideanSpace ℝ (Fin 1)
fun t => cos (S.angularFrequency * t) • IC.x₀ + (sin (S.angularFrequency * t)/S.angularFrequency) • (IC.v₀ + S.decayRate • IC.x₀)
def
ClassicalMechanics.DampedHarmonicOscillator.underdampedBase
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time" ]
The oscillatory part of the underdamped trajectory before exponential decay.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
criticallyDampedBase (IC : InitialConditions) : Time → EuclideanSpace ℝ (Fin 1)
fun t => IC.x₀ + (t : ℝ) • (IC.v₀ + S.decayRate • IC.x₀)
def
ClassicalMechanics.DampedHarmonicOscillator.criticallyDampedBase
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time" ]
The polynomial part of the critically damped trajectory before exponential decay.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
overdampedBase (IC : InitialConditions) : Time → EuclideanSpace ℝ (Fin 1)
fun t => cosh (S.angularFrequency * t) • IC.x₀ + (sinh (S.angularFrequency * t) / S.angularFrequency) • (IC.v₀ + S.decayRate • IC.x₀)
def
ClassicalMechanics.DampedHarmonicOscillator.overdampedBase
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time" ]
The hyperbolic part of the overdamped trajectory before exponential decay.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
trajectory (IC : InitialConditions) : Time → EuclideanSpace ℝ (Fin 1)
by classical exact if S.IsUnderdamped then fun t : Time => exp (-S.decayRate * t) • S.underdampedBase IC t else if S.IsCriticallyDamped then fun t : Time => exp (-S.decayRate * t) • S.criticallyDampedBase IC t else fun t : Time => exp (-S.decayRate * t) • S.overdampedBase IC t
def
ClassicalMechanics.DampedHarmonicOscillator.trajectory
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time" ]
Given initial conditions, the solution selected from the damping regime of the oscillator.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
trajectory_eq_of_underdamped (IC : InitialConditions) (hS : S.IsUnderdamped) : S.trajectory IC = fun t : Time => exp (-S.decayRate * t) • S.underdampedBase IC t
by classical simp [trajectory, hS]
lemma
ClassicalMechanics.DampedHarmonicOscillator.trajectory_eq_of_underdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time" ]
In the underdamped regime, the selected trajectory uses the trigonometric base.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
trajectory_eq_of_criticallyDamped (IC : InitialConditions) (hS : S.IsCriticallyDamped) : S.trajectory IC = fun t : Time => exp (-S.decayRate * t) • S.criticallyDampedBase IC t
by classical have hnotUnder : ¬ S.IsUnderdamped := by intro hUnder rw [IsUnderdamped] at hUnder rw [IsCriticallyDamped] at hS linarith simp [trajectory, hnotUnder, hS]
lemma
ClassicalMechanics.DampedHarmonicOscillator.trajectory_eq_of_criticallyDamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time" ]
In the critically damped regime, the selected trajectory uses the polynomial base.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
trajectory_eq_of_overdamped (IC : InitialConditions) (hS : S.IsOverdamped) : S.trajectory IC = fun t : Time => exp (-S.decayRate * t) • S.overdampedBase IC t
by classical have hnotUnder : ¬ S.IsUnderdamped := by intro hUnder rw [IsUnderdamped] at hUnder rw [IsOverdamped] at hS linarith have hnotCritical : ¬ S.IsCriticallyDamped := by intro hCritical rw [IsCriticallyDamped] at hCritical rw [IsOverdamped] at hS linarith simp [trajectory...
lemma
ClassicalMechanics.DampedHarmonicOscillator.trajectory_eq_of_overdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time" ]
In the overdamped regime, the selected trajectory uses the hyperbolic base.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
exp_decay_smul_velocity (a : ℝ) (y : Time → EuclideanSpace ℝ (Fin 1)) (hy : Differentiable ℝ y) : ∂ₜ (fun t : Time => exp (-a * t.val) • y t) = fun t : Time => exp (-a * t.val) • (∂ₜ y t - a • y t)
by funext t rw [Time.deriv] rw [fderiv_fun_smul (by fun_prop) (hy t)] rw [fderiv_exp (by fun_prop), fderiv_fun_mul (by fun_prop) (by fun_prop)] simp only [ContinuousLinearMap.add_apply, ContinuousLinearMap.smulRight_apply, fderiv_fun_neg, fderiv_fun_const, Pi.zero_apply, Time.fderiv_val, ContinuousLin...
lemma
ClassicalMechanics.DampedHarmonicOscillator.exp_decay_smul_velocity
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time", "Time.deriv", "Time.deriv_eq", "Time.fderiv_val" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
exp_decay_smul_acceleration (a μ : ℝ) (y : Time → EuclideanSpace ℝ (Fin 1)) (hy : Differentiable ℝ y) (hdy : Differentiable ℝ (∂ₜ y)) (hy'' : ∂ₜ (∂ₜ y) = fun t => μ • y t) : ∂ₜ (∂ₜ (fun t : Time => exp (-a * t.val) • y t)) = fun t : Time => exp (-a * t.val) • (μ • y t - (2 * a) • ∂ₜ y t + ...
by rw [exp_decay_smul_velocity a y hy] funext t rw [Time.deriv] rw [fderiv_fun_smul (by fun_prop) (by fun_prop)] rw [fderiv_exp (by fun_prop), fderiv_fun_mul (by fun_prop) (by fun_prop)] rw [fderiv_fun_sub (hdy t) (by fun_prop)] rw [fderiv_fun_const_smul (hy t)] have hy''_t := congrFun hy'' t rw [Time...
lemma
ClassicalMechanics.DampedHarmonicOscillator.exp_decay_smul_acceleration
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time", "Time.deriv", "Time.deriv_eq", "Time.fderiv_val" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
exp_decay_smul_equationOfMotion (a μ : ℝ) (y : Time → EuclideanSpace ℝ (Fin 1)) (hy : Differentiable ℝ y) (hdy : Differentiable ℝ (∂ₜ y)) (hy'' : ∂ₜ (∂ₜ y) = fun t => μ • y t) (hγ : S.γ = 2 * S.m * a) (hk : S.k = S.m * (a^2 - μ)) : S.EquationOfMotion (fun t : Time => exp (-a * t.val) • y t)
by intro t rw [exp_decay_smul_acceleration a μ y hy hdy hy''] rw [exp_decay_smul_velocity a y hy] rw [hγ, hk] simp [smul_add, smul_sub, smul_smul] module
lemma
ClassicalMechanics.DampedHarmonicOscillator.exp_decay_smul_equationOfMotion
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
criticallyDampedBase_velocity (IC : InitialConditions) : ∂ₜ (S.criticallyDampedBase IC) = fun _ : Time => IC.v₀ + S.decayRate • IC.x₀
by funext t change ∂ₜ (fun t : Time => IC.x₀ + t.val • (IC.v₀ + S.decayRate • IC.x₀)) t = _ rw [Time.deriv] rw [fderiv_fun_add (by fun_prop) (by fun_prop)] rw [fderiv_fun_const] rw [fderiv_smul_const (by fun_prop)] simp
lemma
ClassicalMechanics.DampedHarmonicOscillator.criticallyDampedBase_velocity
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time", "Time.deriv" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
criticallyDampedBase_acceleration (IC : InitialConditions) : ∂ₜ (∂ₜ (S.criticallyDampedBase IC)) = fun _ => (0 : EuclideanSpace ℝ (Fin 1))
by rw [criticallyDampedBase_velocity] funext t simp
lemma
ClassicalMechanics.DampedHarmonicOscillator.criticallyDampedBase_acceleration
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
underdampedBase_velocity (IC : InitialConditions) (hS : S.IsUnderdamped) : ∂ₜ (fun t : Time => cos (S.angularFrequency * t.val) • IC.x₀ + (sin (S.angularFrequency * t.val) / S.angularFrequency) • (IC.v₀ + S.decayRate • IC.x₀)) = fun t : Time => (-S.angularFrequency * sin (S.angular...
by funext t rw [Time.deriv] rw [fderiv_fun_add (by fun_prop) (by fun_prop)] rw [fderiv_smul_const (by fun_prop)] rw [fderiv_smul_const (by fun_prop)] have hΩ : S.angularFrequency ≠ 0 := S.angularFrequency_ne_zero_of_underdamped hS have hcos : (fderiv ℝ (fun y : Time => cos (S.angularFrequency * y.va...
lemma
ClassicalMechanics.DampedHarmonicOscillator.underdampedBase_velocity
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time", "Time.deriv" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
underdampedBase_acceleration (IC : InitialConditions) (hS : S.IsUnderdamped) : ∂ₜ (∂ₜ (fun t : Time => cos (S.angularFrequency * t.val) • IC.x₀ + (sin (S.angularFrequency * t.val) / S.angularFrequency) • (IC.v₀ + S.decayRate • IC.x₀))) = fun t : Time => -S.angularFrequency^2 • (cos...
by funext t rw [S.underdampedBase_velocity IC hS] rw [Time.deriv] rw [fderiv_fun_add (by fun_prop) (by fun_prop)] rw [fderiv_smul_const (by fun_prop)] rw [fderiv_smul_const (by fun_prop)] have hΩ : S.angularFrequency ≠ 0 := S.angularFrequency_ne_zero_of_underdamped hS have hsin : (fderiv ℝ (fun y ...
lemma
ClassicalMechanics.DampedHarmonicOscillator.underdampedBase_acceleration
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time", "Time.deriv" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
overdampedBase_velocity (IC : InitialConditions) (hS : S.IsOverdamped) : ∂ₜ (fun t : Time => cosh (S.angularFrequency * t.val) • IC.x₀ + (sinh (S.angularFrequency * t.val) / S.angularFrequency) • (IC.v₀ + S.decayRate • IC.x₀)) = fun t : Time => (S.angularFrequency * sinh (S.angular...
by funext t rw [Time.deriv] rw [fderiv_fun_add (by fun_prop) (by fun_prop)] rw [fderiv_smul_const (by fun_prop)] rw [fderiv_smul_const (by fun_prop)] have hLambda : S.angularFrequency ≠ 0 := S.angularFrequency_ne_zero_of_overdamped hS have hcosh : (fderiv ℝ (fun y : Time => cosh (S.angularFrequency ...
lemma
ClassicalMechanics.DampedHarmonicOscillator.overdampedBase_velocity
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time", "Time.deriv" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
overdampedBase_acceleration (IC : InitialConditions) (hS : S.IsOverdamped) : ∂ₜ (∂ₜ (fun t : Time => cosh (S.angularFrequency * t.val) • IC.x₀ + (sinh (S.angularFrequency * t.val) / S.angularFrequency) • (IC.v₀ + S.decayRate • IC.x₀))) = fun t : Time => S.angularFrequency^2 • (cosh...
by funext t rw [S.overdampedBase_velocity IC hS] rw [Time.deriv] rw [fderiv_fun_add (by fun_prop) (by fun_prop)] rw [fderiv_smul_const (by fun_prop)] rw [fderiv_smul_const (by fun_prop)] have hLambda : S.angularFrequency ≠ 0 := S.angularFrequency_ne_zero_of_overdamped hS have hsinh : (fderiv ℝ (fu...
lemma
ClassicalMechanics.DampedHarmonicOscillator.overdampedBase_acceleration
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time", "Time.deriv" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
trajectory_equationOfMotion_of_criticallyDamped (IC : InitialConditions) (hS : S.IsCriticallyDamped) : S.EquationOfMotion (S.trajectory IC)
by rw [S.trajectory_eq_of_criticallyDamped IC hS] have hγ : S.γ = 2 * S.m * S.decayRate := S.gamma_eq_two_mul_m_mul_decayRate have hk : S.k = S.m * (S.decayRate^2 - 0) := by simpa [sub_zero] using S.k_eq_m_mul_decayRate_sq_of_criticallyDamped hS have hbase : ∂ₜ (∂ₜ (S.criticallyDampedBase IC)) = ...
lemma
ClassicalMechanics.DampedHarmonicOscillator.trajectory_equationOfMotion_of_criticallyDamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time" ]
In the critically damped regime, the selected trajectory satisfies the damped equation of motion.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
trajectory_equationOfMotion_of_underdamped (IC : InitialConditions) (hS : S.IsUnderdamped) : S.EquationOfMotion (S.trajectory IC)
by rw [S.trajectory_eq_of_underdamped IC hS] have hγ : S.γ = 2 * S.m * S.decayRate := S.gamma_eq_two_mul_m_mul_decayRate have hk : S.k = S.m * (S.decayRate^2 - (-S.angularFrequency^2)) := by rw [S.k_eq_m_mul_ω_sq, S.angularFrequency_sq_of_underdamped hS] ring have hbase : ∂ₜ (∂ₜ (S.underdampedBase...
lemma
ClassicalMechanics.DampedHarmonicOscillator.trajectory_equationOfMotion_of_underdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time" ]
In the underdamped regime, the selected trajectory satisfies the damped equation of motion.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
trajectory_equationOfMotion_of_overdamped (IC : InitialConditions) (hS : S.IsOverdamped) : S.EquationOfMotion (S.trajectory IC)
by rw [S.trajectory_eq_of_overdamped IC hS] have hγ : S.γ = 2 * S.m * S.decayRate := S.gamma_eq_two_mul_m_mul_decayRate have hk : S.k = S.m * (S.decayRate^2 - S.angularFrequency^2) := by rw [S.k_eq_m_mul_ω_sq, S.angularFrequency_sq_of_overdamped hS] ring have hbase : ∂ₜ (∂ₜ (S.overdampedBase IC)) ...
lemma
ClassicalMechanics.DampedHarmonicOscillator.trajectory_equationOfMotion_of_overdamped
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[ "Time" ]
In the overdamped regime, the selected trajectory satisfies the damped equation of motion.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
trajectory_equationOfMotion (IC : InitialConditions) : S.EquationOfMotion (S.trajectory IC)
by by_cases hUnder : S.IsUnderdamped · exact S.trajectory_equationOfMotion_of_underdamped IC hUnder · by_cases hCritical : S.IsCriticallyDamped · exact S.trajectory_equationOfMotion_of_criticallyDamped IC hCritical · have hOver : S.IsOverdamped := by rw [IsOverdamped, IsUnderdamped, IsCriticallyDa...
lemma
ClassicalMechanics.DampedHarmonicOscillator.trajectory_equationOfMotion
ClassicalMechanics.DampedHarmonicOscillator
Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean
[]
[]
The selected trajectory satisfies the damped equation of motion.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
FreeParticle where /-- The mass of the free particle. This parameter determines the inertial response of the particle in Newton's second law. -/ mass : ℝ mass_pos : 0 < mass
structure
ClassicalMechanics.FreeParticle
ClassicalMechanics.FreeParticle
Physlib/ClassicalMechanics/FreeParticle/Basic.lean
[]
[]
A classical free particle with positive mass. A free particle is a mechanical system evolving in the absence of external forces. The dynamics are therefore entirely determined by Newton's second law with zero force. The only parameter of the system is the particle mass. The assumption that the mass is strictly positi...
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
Trajectory
Time → ℝ
abbrev
ClassicalMechanics.FreeParticle.Trajectory
ClassicalMechanics.FreeParticle
Physlib/ClassicalMechanics/FreeParticle/Basic.lean
[]
[ "Time" ]
A trajectory is a time-dependent position function describing the motion of the particle in one spatial dimension. Defining the trajectory.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
velocity (s : FreeParticle) (q : Trajectory) (t : Time) : ℝ
deriv q t
def
ClassicalMechanics.FreeParticle.velocity
ClassicalMechanics.FreeParticle
Physlib/ClassicalMechanics/FreeParticle/Basic.lean
[]
[ "Time" ]
The velocity of a trajectory at a given time. This is defined as the time derivative of the position function.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
kineticEnergy (s : FreeParticle) (q : Trajectory) (t : Time) : ℝ
(1 / 2) * s.mass * (s.velocity q t)^2
def
ClassicalMechanics.FreeParticle.kineticEnergy
ClassicalMechanics.FreeParticle
Physlib/ClassicalMechanics/FreeParticle/Basic.lean
[]
[ "Time" ]
The kinetic energy of the free particle along a trajectory. This is given by the classical expression `E = (1 / 2) m v²`, where `m` is the particle mass and `v` is the velocity.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
NewtonsSecondLaw (s : FreeParticle) (q : Trajectory) (t : Time) : Prop
s.mass * deriv (s.velocity q) t = 0
def
ClassicalMechanics.FreeParticle.NewtonsSecondLaw
ClassicalMechanics.FreeParticle
Physlib/ClassicalMechanics/FreeParticle/Basic.lean
[]
[ "Time" ]
Newton's second law for the free particle. Since no external forces act on the particle, Newton's second law reduces to the equation `m q'' = 0`, expressing that the acceleration vanishes identically.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
accel_zero (s : FreeParticle) (q : Trajectory) (h : ∀ t, s.NewtonsSecondLaw q t) : ∀ t, deriv (deriv q) t = 0
by intro t have h₀ : s.mass ≠ 0 := ne_of_gt s.mass_pos have h1 := h t exact (mul_eq_zero.mp h1).resolve_left h₀
lemma
ClassicalMechanics.FreeParticle.accel_zero
ClassicalMechanics.FreeParticle
Physlib/ClassicalMechanics/FreeParticle/Basic.lean
[]
[]
Newton's second law for a free particle implies that the acceleration vanishes identically. Since the particle mass is strictly positive, the equation `m q'' = 0` can be simplified to `q'' = 0` by cancelling the mass factor.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
velocity_const_of_zero_acc (q : Time → ℝ) (h : ∀ t, deriv (deriv q) t = 0) (hcont : ContDiff ℝ 1 q) : ∃ v₀, ∀ t, deriv q t = v₀
by -- this is a standard analysis result (related to `is_const_of_fderiv_eq_zero`) sorry
lemma
ClassicalMechanics.FreeParticle.velocity_const_of_zero_acc
ClassicalMechanics.FreeParticle
Physlib/ClassicalMechanics/FreeParticle/Basic.lean
[]
[ "Time" ]
If the acceleration of a trajectory vanishes everywhere, then the velocity is constant. More precisely, if the second derivative of the trajectory is zero for all times, then there exists a constant `v₀` such that the velocity is equal to `v₀` at every time. The continuity assumption on `deriv q` is included to apply...
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
kineticEnergy_conserved (s : FreeParticle) (q : Trajectory) (h : ∀ t, s.NewtonsSecondLaw q t) (hcont : ContDiff ℝ 1 q) : ∃ E, ∀ t, s.kineticEnergy q t = E
by -- get q'' = 0 have h_acc : ∀ t, deriv (deriv q) t = 0 := accel_zero s q h -- get constant velocity rcases velocity_const_of_zero_acc q h_acc hcont with ⟨v₀, hv⟩ -- energy is constant refine ⟨(1 / 2) * s.mass * v₀^2, fun t => ?_⟩ unfold kineticEnergy velocity rw [hv t]
theorem
ClassicalMechanics.FreeParticle.kineticEnergy_conserved
ClassicalMechanics.FreeParticle
Physlib/ClassicalMechanics/FreeParticle/Basic.lean
[]
[]
A free particle satisfying the equation of motion conserves kinetic energy. The proof follows the standard argument from classical mechanics: Newton's second law implies that the acceleration vanishes, which in turn implies that the velocity is constant. Since the kinetic energy depends only on the square of the veloc...
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
HarmonicOscillator where /-- The mass of the harmonic Oscillator. -/ m : ℝ /-- The spring constant of the harmonic oscillator. -/ k : ℝ m_pos : 0 < m k_pos : 0 < k
structure
ClassicalMechanics.HarmonicOscillator
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[]
The classical harmonic oscillator is specified by a mass `m`, and a spring constant `k`. Both the mass and the string constant are assumed to be positive.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
k_ne_zero : S.k ≠ 0
Ne.symm (ne_of_lt S.k_pos)
lemma
ClassicalMechanics.HarmonicOscillator.k_ne_zero
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
m_ne_zero : S.m ≠ 0
Ne.symm (ne_of_lt S.m_pos)
lemma
ClassicalMechanics.HarmonicOscillator.m_ne_zero
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
ω : ℝ
√(S.k / S.m)
def
ClassicalMechanics.HarmonicOscillator.ω
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[]
The angular frequency of the classical harmonic oscillator, `ω`, is defined as `√(k/m)`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
ω_pos : 0 < S.ω
sqrt_pos.mpr (div_pos S.k_pos S.m_pos)
lemma
ClassicalMechanics.HarmonicOscillator.ω_pos
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[]
The angular frequency of the classical harmonic oscillator is positive.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
ω_sq : S.ω^2 = S.k / S.m
by rw [ω, sq_sqrt] exact div_nonneg (le_of_lt S.k_pos) (le_of_lt S.m_pos)
lemma
ClassicalMechanics.HarmonicOscillator.ω_sq
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[]
The square of the angular frequency of the classical harmonic oscillator is equal to `k/m`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
ω_ne_zero : S.ω ≠ 0
Ne.symm (ne_of_lt S.ω_pos)
lemma
ClassicalMechanics.HarmonicOscillator.ω_ne_zero
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[]
The angular frequency of the classical harmonic oscillator is not equal to zero.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
inverse_ω_sq : (S.ω ^ 2)⁻¹ = S.m/S.k
by rw [ω_sq] field_simp
lemma
ClassicalMechanics.HarmonicOscillator.inverse_ω_sq
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[]
The inverse of the square of the angular frequency of the classical harmonic oscillator is `m/k`.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
kineticEnergy (xₜ : Time → EuclideanSpace ℝ (Fin 1)) : Time → ℝ
fun t => (1 / (2 : ℝ)) * S.m * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ
def
ClassicalMechanics.HarmonicOscillator.kineticEnergy
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[ "Time" ]
The kinetic energy of the harmonic oscillator is $\frac{1}{2} m ‖\dot x‖^2$.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
potentialEnergy (x : EuclideanSpace ℝ (Fin 1)) : ℝ
(1 / (2 : ℝ)) • S.k • ⟪x, x⟫_ℝ
def
ClassicalMechanics.HarmonicOscillator.potentialEnergy
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[]
The potential energy of the harmonic oscillator is `1/2 k x ^ 2`
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
energy (xₜ : Time → EuclideanSpace ℝ (Fin 1)) : Time → ℝ
fun t => kineticEnergy S xₜ t + potentialEnergy S (xₜ t)
def
ClassicalMechanics.HarmonicOscillator.energy
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[ "Time" ]
The energy of the harmonic oscillator is the kinetic energy plus the potential energy.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
kineticEnergy_eq (xₜ : Time → EuclideanSpace ℝ (Fin 1)) : kineticEnergy S xₜ = fun t => (1 / (2 : ℝ)) * S.m * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ
by rfl
lemma
ClassicalMechanics.HarmonicOscillator.kineticEnergy_eq
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[ "Time" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
potentialEnergy_eq (x : EuclideanSpace ℝ (Fin 1)) : potentialEnergy S x = (1 / (2 : ℝ)) • S.k • ⟪x, x⟫_ℝ
by rfl
lemma
ClassicalMechanics.HarmonicOscillator.potentialEnergy_eq
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
energy_eq (xₜ : Time → EuclideanSpace ℝ (Fin 1)) : energy S xₜ = fun t => kineticEnergy S xₜ t + potentialEnergy S (xₜ t)
by rfl
lemma
ClassicalMechanics.HarmonicOscillator.energy_eq
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[ "Time" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
kineticEnergy_differentiable (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (hx : ContDiff ℝ ∞ xₜ) : Differentiable ℝ (kineticEnergy S xₜ)
by rw [kineticEnergy_eq] change Differentiable ℝ ((fun x => (1 / (2 : ℝ)) * S.m * ⟪x, x⟫_ℝ) ∘ (fun t => ∂ₜ xₜ t)) apply Differentiable.comp · fun_prop · exact deriv_differentiable_of_contDiff xₜ hx
lemma
ClassicalMechanics.HarmonicOscillator.kineticEnergy_differentiable
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[ "Time" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
potentialEnergy_differentiable (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (hx : ContDiff ℝ ∞ xₜ) : Differentiable ℝ (fun t => potentialEnergy S (xₜ t))
by simp only [potentialEnergy_eq, one_div, smul_eq_mul] change Differentiable ℝ ((fun x => 2⁻¹ * (S.k * ⟪x, x⟫_ℝ)) ∘ xₜ) apply Differentiable.comp · fun_prop · rw [contDiff_infty_iff_fderiv] at hx exact hx.1
lemma
ClassicalMechanics.HarmonicOscillator.potentialEnergy_differentiable
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[ "Time" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
energy_differentiable (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (hx : ContDiff ℝ ∞ xₜ) : Differentiable ℝ (energy S xₜ)
by rw [energy_eq] fun_prop
lemma
ClassicalMechanics.HarmonicOscillator.energy_differentiable
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[ "Time" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
kineticEnergy_deriv (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (hx : ContDiff ℝ ∞ xₜ) : ∂ₜ (kineticEnergy S xₜ) = fun t => ⟪∂ₜ xₜ t, S.m • ∂ₜ (∂ₜ xₜ) t⟫_ℝ
by funext t unfold kineticEnergy conv_lhs => simp only [Time.deriv, one_div, ringHom_apply] change (fderiv ℝ ((fun x => 2⁻¹ * S.m * ⟪x, x⟫_ℝ) ∘ (fun t => ∂ₜ xₜ t)) t) 1 = _ rw [fderiv_comp] rw [fderiv_const_mul (by fun_prop)] simp only [ContinuousLinearMap.smul_comp, ContinuousLinearMap.coe_smul', Con...
lemma
ClassicalMechanics.HarmonicOscillator.kineticEnergy_deriv
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[ "Time", "Time.deriv" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
potentialEnergy_deriv (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (hx : ContDiff ℝ ∞ xₜ) : ∂ₜ (fun t => potentialEnergy S (xₜ t)) = fun t => ⟪∂ₜ xₜ t, S.k • xₜ t⟫_ℝ
by funext t unfold potentialEnergy conv_lhs => simp only [Time.deriv, one_div, smul_eq_mul] change (fderiv ℝ ((fun x => 2⁻¹ * (S.k * ⟪x, x⟫_ℝ)) ∘ (fun t => xₜ t)) t) 1 = _ rw [fderiv_comp] rw [fderiv_const_mul (by fun_prop), fderiv_const_mul (by fun_prop)] simp only [ContinuousLinearMap.smul_comp, Continu...
lemma
ClassicalMechanics.HarmonicOscillator.potentialEnergy_deriv
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[ "Time", "Time.deriv" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
energy_deriv (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (hx : ContDiff ℝ ∞ xₜ) : ∂ₜ (energy S xₜ) = fun t => ⟪∂ₜ xₜ t, S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t⟫_ℝ
by unfold energy funext t rw [Time.deriv_eq] rw [fderiv_fun_add (by fun_prop) (by apply S.potentialEnergy_differentiable xₜ hx)] simp only [ContinuousLinearMap.add_apply] rw [← Time.deriv_eq, ← Time.deriv_eq] rw [potentialEnergy_deriv, kineticEnergy_deriv] simp only rw [← inner_add_right] fun_prop ...
lemma
ClassicalMechanics.HarmonicOscillator.energy_deriv
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[ "Time", "Time.deriv_eq" ]
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
lagrangian (t : Time) (x : EuclideanSpace ℝ (Fin 1)) (v : EuclideanSpace ℝ (Fin 1)) : ℝ
1 / (2 : ℝ) * S.m * ⟪v, v⟫_ℝ - S.potentialEnergy x
def
ClassicalMechanics.HarmonicOscillator.lagrangian
ClassicalMechanics.HarmonicOscillator
Physlib/ClassicalMechanics/HarmonicOscillator/Basic.lean
[]
[ "Time" ]
The lagrangian of the harmonic oscillator is the kinetic energy minus the potential energy.
https://github.com/HEPLean/PhysLean
01143d7c9702318879b3c86bd9eadcdc60a13cc3
End of preview. Expand in Data Studio

Lean4-PhysLean

Structured dataset from PhysLean — Formalization of physics.

Source

Schema

Column Type Description
statement string Declaration signature/claim with the leading keyword removed (verbatim slice); the full declaration minus its proof
proof string Verbatim proof/body, empty if the declaration has none
type string Declaration keyword
symbolic_name string Declaration identifier
library string Sub-library
filename string Repository-relative source path
imports list[string] File-level Require/Import modules
deps list[string] Intra-corpus identifiers referenced
docstring string Preceding documentation comment, empty if absent
source_url string Upstream repository
commit string Upstream commit extracted

Statistics

  • Entries: 10,342
  • With proof: 10,170 (98.3%)
  • With docstring: 3,665 (35.4%)
  • Libraries: 156

By type

Type Count
lemma 6,273
def 2,097
theorem 1,513
instance 142
abbrev 139
structure 122
inductive 22
class 22
macro 11
class abbrev 1

Example

toCompactlySupportedContinuousMap (η : AdmissibleVariation d U) :
    CompactlySupportedContinuousMap (Space d) U
η.isTestFunction.toCompactlySupportedContinuousMap
  • type: def | symbolic_name: ClassicalFieldTheory.Local.AdmissibleVariation.toCompactlySupportedContinuousMap | Physlib/ClassicalFieldTheory/Local/Variation.lean

Use

Each declaration is split into a statement (signature/claim) and a proof (body) that are disjoint and together form the complete declaration, for proof modeling, autoformalization, retrieval, and dependency analysis via deps.

Citation

@misc{lean4_physlean_dataset,
  title  = {Lean4-PhysLean},
  author = {Norton, Charles},
  year   = {2026},
  note   = {Extracted from https://github.com/HEPLean/PhysLean, commit 01143d7c9702},
  url    = {https://huggingface.co/datasets/phanerozoic/Lean4-PhysLean}
}
Downloads last month
80

Collection including phanerozoic/Lean4-PhysLean