Imports
/-
Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Nathaneal Sajan, Joseph Tooby-Smith, Lode Vermeulen
-/
module
public import Physlib.ClassicalMechanics.HarmonicOscillator.Basic
public import Mathlib.Analysis.SpecialFunctions.Complex.ArgSolutions to the classical harmonic oscillator
i. Overview
In this module we define the solutions to the classical harmonic oscillator, prove that they satisfy the equation of motion, and prove some properties of the solutions.
ii. Key results
InitialConditions is a structure for the initial conditions for the harmonic oscillator.
trajectories is the trajectories to the harmonic oscillator for given initial conditions.
trajectories_equationOfMotion proves that the solution satisfies the equation of motion.
iii. Table of contents
A. The initial conditions
A.1. Definition of the initial conditions
A.2. Relation to other types of initial conditions
A.2.1. Initial conditions at arbitrary time
A.2.2. Initial conditions from two positions at different times
A.2.3. Initial conditions from two velocities at different times
A.3. The zero initial conditions
A.3.1. Simple results for the zero initial conditions
B. Trajectories associated with the initial conditions
B.1. The trajectory associated with the initial conditions
B.1.1. Definitional equality for the trajectory
B.2. The trajectory for zero initial conditions
B.3. Smoothness of the trajectories
B.4. Velocity of the trajectories
B.5. Acceleration of the trajectories
B.6. The initial conditions of the trajectories
C. Trajectories and Equation of motion
C.1. Uniqueness of the solutions
D. The energy of the trajectories
D.1. Correctness of InitialConditionsAtTime conversion
D.2. Correctness of InitialConditionsFromTwoPositions conversion
D.3. Correctness of InitialConditionsFromTwoVelocities conversion
E. Amplitude–phase parametrization
E.1. The amplitude–phase initial conditions
E.2. Conversion to standard initial conditions
E.3. The trajectory in normal form
E.4. Recovering the amplitude and phase
F. Special conditions of the trajectory
F.1. Normal form for standard initial conditions
F.2. Times at which the velocity is zero
F.3. The position when the velocity is zero
F.4. Times at which the trajectory passes through zero
G. Periodicity and recurrence
G.1. The period
G.2. Periodicity of the trajectory
G.3. Return to the initial state
iv. References
References for the classical harmonic oscillator include:
Landau & Lifshitz, Mechanics, page 58, section 21.
TODO "Split this file into smaller modules, keeping `Solution.lean` as an umbrella import.
The intended organization is:
- `Solution.Basic` for trajectory construction and equation-of-motion facts;
- `Solution.Energy` for energy-related lemmas;
- `Solution.InitialData` for alternative initial-condition parametrizations;
- `Solution.AmplitudePhase` for the amplitude-phase normal form;
- `Solution.SpecialTimes` for velocity-zero times, turning points, and zero crossings;
- `Solution.Periodicity` for period and recurrence facts."@[expose] public sectionA. The initial conditions
We define the type of initial conditions for the harmonic oscillator.
The initial conditions are currently defined as an initial position and an initial velocity,
that is the values of the solution and its time derivative at time 0.
A.1. Definition of the initial conditions
We start by defining the type of initial conditions for the harmonic oscillator.
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 equal.
The initial position of the harmonic oscillator.
The initial velocity of the harmonic oscillator.
@[ext] structure InitialConditions where x₀ : EuclideanSpace ℝ (Fin 1) v₀ : EuclideanSpace ℝ (Fin 1)A.2. Relation to other types of initial conditions
We relate the initial condition given by an initial position and an initial velocity to other specifications of initial conditions.
In this section, we implement alternative ways to specify initial conditions for the harmonic
oscillator. The standard InitialConditions type specifies position and velocity at time t=0,
but in practice it is often useful to specify initial conditions at other times or in other forms.
Currently implemented:
Initial conditions at arbitrary time: Specify 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.
Initial conditions from two positions at different times: Specify the position at two
distinct times t₁ and t₂ that satisfy the non-degeneracy condition.
Initial conditions from two velocities at different times: Specify the velocity at two
distinct times t₁ and t₂ that satisfy the non-degeneracy condition.
Amplitude–phase parametrization: Specify the solution as a single shifted cosine
x(t) = A cos (ω t - φ) with amplitude A and phase φ.
All alternative forms can be converted to the standard InitialConditions type via conversion
functions, and we prove that the converted initial conditions produce trajectories that satisfy
the original specifications.
A.2.1. Initial conditions at arbitrary time
We define a type for initial conditions specified at an arbitrary time t₀, rather than at t=0.
This is useful when the natural reference point for a problem is not at time zero.
The conversion to the standard InitialConditions works by "running the trajectory backward in
time" from t₀ to 0. Given that we know x(t₀) and v(t₀), we use the harmonic oscillator
solution formula with time-reversal to determine what x(0) and v(0) must have been.
Mathematically, if x(t) = cos(ωt)·x₀ + (sin(ωt)/ω)·v₀, then setting t = t₀:
x(t₀) = cos(ωt₀)·x₀ + (sin(ωt₀)/ω)·v₀
v(t₀) = -ω·sin(ωt₀)·x₀ + cos(ωt₀)·v₀
Solving this linear system for x₀ and v₀ gives the formulas in toInitialConditions below.
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 InitialConditions format (at t=0)
using the toInitialConditions function.
The time at which the initial conditions are specified.
The position at time t₀.
The velocity at time t₀.
@[ext] structure InitialConditionsAtTime where t₀ : Time x_t₀ : EuclideanSpace ℝ (Fin 1) v_t₀ : EuclideanSpace ℝ (Fin 1)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.
A.2.2. Initial conditions from two positions at different times
We define a type for initial conditions specified by two measured positions x_t₁ and x_t₂
at two distinct times t₁ and t₂.
The conversion to the standard InitialConditions is obtained by solving for x₀ and v₀ the
two equations given by evaluating the trajectory at t₁ and t₂:
x_t₁ = cos(ωt₁)·x₀ + (sin(ωt₁)/ω)·v₀
x_t₂ = cos(ωt₂)·x₀ + (sin(ωt₂)/ω)·v₀
This linear system has determinant (cos(ωt₁)·sin(ωt₂) - cos(ωt₂)·sin(ωt₁))/ω = sin(ω(t₂-t₁))/ω.
Writing Δ = sin(ω(t₂-t₁)), solving the system gives the formulas used below:
x₀ = (sin(ωt₂)·x_t₁ - sin(ωt₁)·x_t₂)/Δ
v₀ = ω·(cos(ωt₁)·x_t₂ - cos(ωt₂)·x_t₁)/Δ
The conversion is defined as a total function, but it recovers the initial conditions only when
Δ = sin(ω(t₂-t₁)) ≠ 0, i.e. when t₂ - t₁ is not an integer multiple of half a period. The
correctness proofs, under this nondegeneracy condition, are given later in section D.2.
Initial conditions for the harmonic oscillator specified by two positions
x_t₁ and x_t₂ measured at two times t₁ and t₂ respectively.
The conditions can be converted to the standard InitialConditions format
using the toInitialConditions function.
The first measurement time.
The position at time t₁.
The second measurement time.
The position at time t₂.
@[ext] structure InitialConditionsFromTwoPositions where t₁ : Time x_t₁ : EuclideanSpace ℝ (Fin 1) t₂ : Time x_t₂ : EuclideanSpace ℝ (Fin 1)A.2.3. Initial conditions from two velocities at different times
We define a type for initial conditions specified by two measured velocities v_t₁ and v_t₂
at two distinct times t₁ and t₂.
The conversion to the standard InitialConditions is obtained by solving for x₀ and v₀ the
two equations given by evaluating the velocity of the trajectory at t₁ and t₂:
v_t₁ = -ω·sin(ωt₁)·x₀ + cos(ωt₁)·v₀
v_t₂ = -ω·sin(ωt₂)·x₀ + cos(ωt₂)·v₀
This linear system has determinant ω·(cos(ωt₁)·sin(ωt₂) - cos(ωt₂)·sin(ωt₁)) = ω·sin(ω(t₂-t₁)).
Writing Δ = sin(ω(t₂-t₁)), solving the system gives the formulas used below:
x₀ = (cos(ωt₂)·v_t₁ - cos(ωt₁)·v_t₂)/(ω·Δ)
v₀ = (sin(ωt₂)·v_t₁ - sin(ωt₁)·v_t₂)/Δ
The conversion is defined as a total function, but it recovers the initial conditions only when
Δ = sin(ω(t₂-t₁)) ≠ 0, i.e. when t₂ - t₁ is not an integer multiple of half a period. The
correctness proofs, under this nondegeneracy condition, are given later in section D.3.
Initial conditions for the harmonic oscillator specified by two velocities
v_t₁ and v_t₂ measured at two times t₁ and t₂ respectively.
The conditions can be converted to the standard InitialConditions format
using the toInitialConditions function.
The first measurement time.
The velocity at time t₁.
The second measurement time.
The velocity at time t₂.
@[ext] structure InitialConditionsFromTwoVelocities where t₁ : Time v_t₁ : EuclideanSpace ℝ (Fin 1) t₂ : Time v_t₂ : EuclideanSpace ℝ (Fin 1)A.3. The zero initial conditions
The zero initial conditions are the initial conditions with zero initial position and zero initial velocity.
In the end, we will see that this corresponds to the solution which is identically zero, i.e. the particle remains at rest at the origin.
The zero initial condition.
instance : Zero InitialConditions := ⟨0, 0⟩A.3.1. Simple results for the zero initial conditions
Some simple results about the zero initial conditions.
The zero initial condition has zero starting point.
@[simp]
lemma x₀_zero : x₀ 0 = 0 := rflThe zero initial condition has zero starting velocity.
@[simp]
lemma v₀_zero : v₀ 0 = 0 := rflB. Trajectories associated with the initial conditions
To each initial condition we association a trajectory. We will prove some basic properties of these trajectories.
Eventually we will show that these trajectories satisfy the equation of motion, for now we can think of them as some choice of trajectory associated with the initial conditions.
B.1. The trajectory associated with the initial conditions
B.1.1. Definitional equality for the trajectory
We show a basic definitional equality for the trajectory.
lemma trajectory_eq (IC : InitialConditions) :
IC.trajectory S = fun t : Time => cos (S.ω * t) • IC.x₀ + (sin (S.ω * t)/S.ω) • IC.v₀ := rflB.2. The trajectory for zero initial conditions
The trajectory for zero initial conditions is the zero function.
For zero initial conditions, the trajectory is zero.
@[simp]
lemma trajectory_zero : trajectory S 0 = fun _ => 0 := S:HarmonicOscillator⊢ trajectory S 0 = fun x => 0
All goals completed! 🐙B.3. Smoothness of the trajectories
The trajectories for any initial conditions are smooth functions of time.
S:HarmonicOscillatorIC:InitialConditionsn:ℕ∞ω⊢ ContDiff ℝ n fun t => Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀
have h : ContDiff ℝ n (Time.val : Time → ℝ) := Time.toRealCLM.contDiff S:HarmonicOscillatorIC:InitialConditionsn:ℕ∞ωh:ContDiff ℝ n val⊢ ContDiff ℝ n fun t => Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀
fun_prop All goals completed! 🐙B.4. Velocity of the trajectories
We give a simplification of the velocity of the trajectory.
lemma trajectory_velocity (IC : InitialConditions) : ∂ₜ (IC.trajectory S) =
fun t : Time => - S.ω • sin (S.ω * t.val) • IC.x₀ + cos (S.ω * t.val) • IC.v₀ := by S:HarmonicOscillatorIC:InitialConditions⊢ ∂ₜ (trajectory S IC) = fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀
funext t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ∂ₜ (trajectory S IC) t = -S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀
rw [trajectory_eq, S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ∂ₜ (fun t => Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀ S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀ Time.deriv, S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t) 1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀ S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀ fderiv_fun_add (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.cos (S.ω * t.val) • IC.x₀) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀) (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀)] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀
rw [fderiv_smul_const (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.cos (S.ω * t.val)) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀), fderiv_smul_const (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀)] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀
have h1 : (fderiv ℝ (fun t => sin (S.ω * t.val) / S.ω) t) =
(1/ S.ω) • (fderiv ℝ (fun t => sin (S.ω * t.val)) t) := by S:HarmonicOscillatorIC:InitialConditions⊢ ∂ₜ (trajectory S IC) = fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀ S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀
rw [← fderiv_mul_const S:HarmonicOscillatorIC:InitialConditionst:Time⊢ fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = fderiv ℝ (fun y => Real.sin (S.ω * y.val) * (1 / S.ω)) thc S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.sin (S.ω * t.val)) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = fderiv ℝ (fun y => Real.sin (S.ω * y.val) * (1 / S.ω)) thc S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.sin (S.ω * t.val)) t S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = fderiv ℝ (fun y => Real.sin (S.ω * y.val) * (1 / S.ω)) thc S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.sin (S.ω * t.val)) t S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀
congr e_f S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fun t => Real.sin (S.ω * t.val) / S.ω) = fun y => Real.sin (S.ω * y.val) * (1 / S.ω)hc S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.sin (S.ω * t.val)) t S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀
funext t e_f S:HarmonicOscillatorIC:InitialConditionst✝:Timet:Time⊢ Real.sin (S.ω * t.val) / S.ω = Real.sin (S.ω * t.val) * (1 / S.ω)hc S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.sin (S.ω * t.val)) t S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀
field_simp hc S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.sin (S.ω * t.val)) t S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀
fun_prop S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀ S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ ((fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t).smulRight IC.v₀)
1 =
-S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀
simp [h1] S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ (fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t) 1 • IC.x₀ +
(S.ω⁻¹ * (fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t) 1) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀
rw [fderiv_cos (by S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ DifferentiableAt ℝ (fun t => S.ω * t.val) t S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ (-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.x₀ +
(S.ω⁻¹ * (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ (-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.x₀ +
(S.ω⁻¹ * (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀), fderiv_sin (by S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ DifferentiableAt ℝ (fun t => S.ω * t.val) t S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ (-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.x₀ +
(S.ω⁻¹ * (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ (-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.x₀ +
(S.ω⁻¹ * (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀),
fderiv_fun_mul (by S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ DifferentiableAt ℝ (fun t => S.ω) t S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ (-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.x₀ +
(S.ω⁻¹ * (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ (-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.x₀ +
(S.ω⁻¹ * (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀) (by S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ DifferentiableAt ℝ val t S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ (-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.x₀ +
(S.ω⁻¹ * (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ (-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.x₀ +
(S.ω⁻¹ * (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀)] S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ (-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.x₀ +
(S.ω⁻¹ * (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀
simp only [fderiv_fun_const, Pi.zero_apply, smul_zero, add_zero, neg_smul,
_root_.neg_apply, FunLike.coe_smul, Pi.smul_apply, fderiv_val,
smul_eq_mul, mul_one] S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ -((Real.sin (S.ω * t.val) * S.ω) • IC.x₀) + (S.ω⁻¹ * (Real.cos (S.ω * t.val) * S.ω)) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀
field_simp [S.ω_ne_zero] S:HarmonicOscillatorIC:InitialConditionst:Timeh1:fderiv ℝ (fun t => Real.sin (S.ω * t.val) / S.ω) t = (1 / S.ω) • fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t⊢ -((S.ω * Real.sin (S.ω * t.val)) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀ =
-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀
module All goals completed! 🐙B.5. Acceleration of the trajectories
We give a simplification of the acceleration of the trajectory.
lemma 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 S:HarmonicOscillatorIC:InitialConditions⊢ ∂ₜ (∂ₜ (trajectory S IC)) = fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀
funext t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ∂ₜ (∂ₜ (trajectory S IC)) t = -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀
rw [trajectory_velocity, S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ∂ₜ (fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀) t =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀ S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.v₀) t) 1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀ Time.deriv, S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀) t) 1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀ S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.v₀) t) 1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀ fderiv_fun_add (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.v₀) t) 1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.v₀) t) 1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.cos (S.ω * t.val) • IC.v₀) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.v₀) t) 1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.v₀) t) 1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀)] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (fderiv ℝ (fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀) t + fderiv ℝ (fun t => Real.cos (S.ω * t.val) • IC.v₀) t) 1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀
rw [fderiv_smul_const (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.cos (S.ω * t.val)) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-S.ω • (fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.v₀)
1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-S.ω • (fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.v₀)
1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀), fderiv_fun_const_smul (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.sin (S.ω * t.val) • IC.x₀) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-S.ω • (fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.v₀)
1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-S.ω • (fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.v₀)
1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀),
fderiv_smul_const (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => Real.sin (S.ω * t.val)) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-S.ω • (fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.v₀)
1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-S.ω • (fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.v₀)
1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀)] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-S.ω • (fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t).smulRight IC.x₀ +
(fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t).smulRight IC.v₀)
1 =
-S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀
simp only [neg_smul, add_apply, ContinuousLinearMap.smulRight_apply] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-(S.ω • (fderiv ℝ (fun t => Real.sin (S.ω * t.val)) t).smulRight IC.x₀)) 1 +
(fderiv ℝ (fun t => Real.cos (S.ω * t.val)) t) 1 • IC.v₀ =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀
rw [fderiv_cos (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => S.ω * t.val) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-(S.ω • (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)).smulRight IC.x₀)) 1 +
(-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.v₀ =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-(S.ω • (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)).smulRight IC.x₀)) 1 +
(-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.v₀ =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀), fderiv_sin (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => S.ω * t.val) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-(S.ω • (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)).smulRight IC.x₀)) 1 +
(-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.v₀ =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-(S.ω • (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)).smulRight IC.x₀)) 1 +
(-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.v₀ =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀),
fderiv_fun_mul (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ (fun t => S.ω) t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-(S.ω • (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)).smulRight IC.x₀)) 1 +
(-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.v₀ =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-(S.ω • (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)).smulRight IC.x₀)) 1 +
(-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.v₀ =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀) (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ DifferentiableAt ℝ val t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-(S.ω • (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)).smulRight IC.x₀)) 1 +
(-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.v₀ =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀ fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-(S.ω • (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)).smulRight IC.x₀)) 1 +
(-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.v₀ =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀)] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-(S.ω • (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)).smulRight IC.x₀)) 1 +
(-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.v₀ =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀
field_simp [smul_smul] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ (-(S.ω • (Real.cos (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)).smulRight IC.x₀)) 1 +
(-Real.sin (S.ω * t.val) • (S.ω • fderiv ℝ val t + t.val • fderiv ℝ (fun t => S.ω) t)) 1 • IC.v₀ =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀
simp only [fderiv_fun_const, Pi.ofNat_apply, smul_zero, add_zero, _root_.neg_apply,
FunLike.coe_smul, Pi.smul_apply, ContinuousLinearMap.smulRight_apply, fderiv_val,
smul_eq_mul, mul_one, neg_smul] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ -(S.ω • (Real.cos (S.ω * t.val) * S.ω) • IC.x₀) + -((Real.sin (S.ω * t.val) * S.ω) • IC.v₀) =
-(S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀) - S.ω • Real.sin (S.ω * t.val) • IC.v₀
module All goals completed! 🐙B.6. The initial conditions of the trajectories
We show that, unsurprisingly, the trajectories have the initial conditions used to define them.
For a set of initial conditions IC the position of the solution at time 0 is
IC.x₀.
@[simp]
lemma trajectory_position_at_zero (IC : InitialConditions) : IC.trajectory S 0 = IC.x₀ := by S:HarmonicOscillatorIC:InitialConditions⊢ trajectory S IC 0 = IC.x₀
simp [trajectory] All goals completed! 🐙@[simp]
lemma trajectory_velocity_at_zero (IC : InitialConditions) : ∂ₜ (IC.trajectory S) 0 = IC.v₀ := by S:HarmonicOscillatorIC:InitialConditions⊢ ∂ₜ (trajectory S IC) 0 = IC.v₀
simp [trajectory_velocity] All goals completed! 🐙C. Trajectories and Equation of motion
The trajectories satisfy the equation of motion for the harmonic oscillator.
lemma trajectory_equationOfMotion (IC : InitialConditions) :
EquationOfMotion S (IC.trajectory S) := by S:HarmonicOscillatorIC:InitialConditions⊢ S.EquationOfMotion (trajectory S IC)
rw [EquationOfMotion, S:HarmonicOscillatorIC:InitialConditions⊢ S.gradLagrangian (trajectory S IC) = 0 S:HarmonicOscillatorIC:InitialConditions⊢ (fun t => S.force (trajectory S IC t) - S.m • ∂ₜ (∂ₜ (trajectory S IC)) t) = 0 gradLagrangian_eq_force (S := S) (xₜ := IC.trajectory S)
(trajectory_contDiff S IC) S:HarmonicOscillatorIC:InitialConditions⊢ (fun t => S.force (trajectory S IC t) - S.m • ∂ₜ (∂ₜ (trajectory S IC)) t) = 0 S:HarmonicOscillatorIC:InitialConditions⊢ (fun t => S.force (trajectory S IC t) - S.m • ∂ₜ (∂ₜ (trajectory S IC)) t) = 0] S:HarmonicOscillatorIC:InitialConditions⊢ (fun t => S.force (trajectory S IC t) - S.m • ∂ₜ (∂ₜ (trajectory S IC)) t) = 0
funext t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ S.force (trajectory S IC t) - S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = 0 t
simp only [Pi.zero_apply] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ S.force (trajectory S IC t) - S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = 0
rw [trajectory_acceleration, S:HarmonicOscillatorIC:InitialConditionst:Time⊢ S.force (trajectory S IC t) -
S.m • (fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) t =
0 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ -S.k • trajectory S IC t -
S.m • (fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) t =
0 force_eq_linear S:HarmonicOscillatorIC:InitialConditionst:Time⊢ -S.k • trajectory S IC t -
S.m • (fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) t =
0 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ -S.k • trajectory S IC t -
S.m • (fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) t =
0] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ -S.k • trajectory S IC t -
S.m • (fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) t =
0
ext S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1⊢ (-S.k • trajectory S IC t -
S.m • (fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) t).ofLp
i✝ =
WithLp.ofLp 0 i✝
have hωm : S.ω ^ 2 * S.m = S.k := by S:HarmonicOscillatorIC:InitialConditions⊢ S.EquationOfMotion (trajectory S IC) S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1hωm:S.ω ^ 2 * S.m = S.k⊢ (-S.k • trajectory S IC t -
S.m • (fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) t).ofLp
i✝ =
WithLp.ofLp 0 i✝
rw [ω_sq S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1⊢ S.k / S.m * S.m = S.k S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1⊢ S.k / S.m * S.m = S.k S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1hωm:S.ω ^ 2 * S.m = S.k⊢ (-S.k • trajectory S IC t -
S.m • (fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) t).ofLp
i✝ =
WithLp.ofLp 0 i✝] S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1⊢ S.k / S.m * S.m = S.k S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1hωm:S.ω ^ 2 * S.m = S.k⊢ (-S.k • trajectory S IC t -
S.m • (fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) t).ofLp
i✝ =
WithLp.ofLp 0 i✝
field_simp [m_ne_zero S] S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1hωm:S.ω ^ 2 * S.m = S.k⊢ (-S.k • trajectory S IC t -
S.m • (fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) t).ofLp
i✝ =
WithLp.ofLp 0 i✝ S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1hωm:S.ω ^ 2 * S.m = S.k⊢ (-S.k • trajectory S IC t -
S.m • (fun t => -S.ω ^ 2 • Real.cos (S.ω * t.val) • IC.x₀ - S.ω • Real.sin (S.ω * t.val) • IC.v₀) t).ofLp
i✝ =
WithLp.ofLp 0 i✝
simp [trajectory_eq, smul_add, smul_smul, mul_comm] S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1hωm:S.ω ^ 2 * S.m = S.k⊢ -(S.k * Real.cos (t.val * S.ω) * IC.x₀.ofLp i✝) + -(S.k * (Real.sin (t.val * S.ω) / S.ω) * IC.v₀.ofLp i✝) -
S.m * (-(S.ω ^ 2 * Real.cos (t.val * S.ω) * IC.x₀.ofLp i✝) - S.ω * Real.sin (t.val * S.ω) * IC.v₀.ofLp i✝) =
0
rw [← hωm S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1hωm:S.ω ^ 2 * S.m = S.k⊢ -(S.ω ^ 2 * S.m * Real.cos (t.val * S.ω) * IC.x₀.ofLp i✝) +
-(S.ω ^ 2 * S.m * (Real.sin (t.val * S.ω) / S.ω) * IC.v₀.ofLp i✝) -
S.m * (-(S.ω ^ 2 * Real.cos (t.val * S.ω) * IC.x₀.ofLp i✝) - S.ω * Real.sin (t.val * S.ω) * IC.v₀.ofLp i✝) =
0 S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1hωm:S.ω ^ 2 * S.m = S.k⊢ -(S.ω ^ 2 * S.m * Real.cos (t.val * S.ω) * IC.x₀.ofLp i✝) +
-(S.ω ^ 2 * S.m * (Real.sin (t.val * S.ω) / S.ω) * IC.v₀.ofLp i✝) -
S.m * (-(S.ω ^ 2 * Real.cos (t.val * S.ω) * IC.x₀.ofLp i✝) - S.ω * Real.sin (t.val * S.ω) * IC.v₀.ofLp i✝) =
0] S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1hωm:S.ω ^ 2 * S.m = S.k⊢ -(S.ω ^ 2 * S.m * Real.cos (t.val * S.ω) * IC.x₀.ofLp i✝) +
-(S.ω ^ 2 * S.m * (Real.sin (t.val * S.ω) / S.ω) * IC.v₀.ofLp i✝) -
S.m * (-(S.ω ^ 2 * Real.cos (t.val * S.ω) * IC.x₀.ofLp i✝) - S.ω * Real.sin (t.val * S.ω) * IC.v₀.ofLp i✝) =
0
field_simp [ω_ne_zero S] S:HarmonicOscillatorIC:InitialConditionst:Timei✝:Fin 1hωm:S.ω ^ 2 * S.m = S.k⊢ S.ω * S.m *
(-(S.ω * Real.cos (S.ω * t.val) * IC.x₀.ofLp i✝) + -(Real.sin (S.ω * t.val) * IC.v₀.ofLp i✝) -
(-(S.ω * Real.cos (S.ω * t.val) * IC.x₀.ofLp i✝) - Real.sin (S.ω * t.val) * IC.v₀.ofLp i✝)) =
0
ring All goals completed! 🐙C.1. Uniqueness of the solutions
We show that the trajectories are the unique solutions to the equation of motion for the given initial conditions.
The trajectories to the equation of motion for a given set of initial conditions are unique.
Given any smooth x satisfying the equation of motion with the same initial
position and velocity, the difference y = x - IC.trajectory S also solves the
equation of motion with zero initial conditions; energy conservation then forces
its energy, and hence y, to vanish identically, so x = IC.trajectory S.
lemma 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 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ x⊢ S.EquationOfMotion x ∧ x 0 = IC.x₀ ∧ ∂ₜ x 0 = IC.v₀ → x = trajectory S IC
rintro ⟨hEOM, hx0, hv0⟩ S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀⊢ x = trajectory S IC
have hTraj : ContDiff ℝ ∞ (IC.trajectory S) := by S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ x⊢ S.EquationOfMotion x ∧ x 0 = IC.x₀ ∧ ∂ₜ x 0 = IC.v₀ → x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)⊢ x = trajectory S IC fun_prop S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)⊢ x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)⊢ x = trajectory S IC
-- Time-derivative of a difference of differentiable functions, used below on `x - traj`.
have dsub : ∀ f g : Time → EuclideanSpace ℝ (Fin 1),
Differentiable ℝ f → Differentiable ℝ g →
∂ₜ (fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g t := by S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ x⊢ S.EquationOfMotion x ∧ x 0 = IC.x₀ ∧ ∂ₜ x 0 = IC.v₀ → x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g t⊢ x = trajectory S IC
intro f g hf hg S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)f:Time → EuclideanSpace ℝ (Fin 1)g:Time → EuclideanSpace ℝ (Fin 1)hf:Differentiable ℝ fhg:Differentiable ℝ g⊢ (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g t S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g t⊢ x = trajectory S IC
funext t S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)f:Time → EuclideanSpace ℝ (Fin 1)g:Time → EuclideanSpace ℝ (Fin 1)hf:Differentiable ℝ fhg:Differentiable ℝ gt:Time⊢ ∂ₜ (fun t => f t - g t) t = ∂ₜ f t - ∂ₜ g t S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g t⊢ x = trajectory S IC
simp only [Time.deriv_eq, fderiv_fun_sub (hf t) (hg t), sub_apply] S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g t⊢ x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g t⊢ x = trajectory S IC
-- The difference `y := x - traj` is smooth, again solves the equation of motion (the force is
-- linear), and has vanishing initial data; energy conservation then forces `y = 0`.
set y : Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - IC.trajectory S t with hydef S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC t⊢ x = trajectory S IC
have hyContDiff : ContDiff ℝ ∞ y := hx.sub hTraj S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ y⊢ x = trajectory S IC
have hy_deriv : ∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (IC.trajectory S) t :=
dsub x _ (hx.differentiable (by S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ y⊢ ∞ ≠ 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) t⊢ x = trajectory S IC simp All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) t⊢ x = trajectory S IC)) (hTraj.differentiable (by S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ y⊢ ∞ ≠ 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) t⊢ x = trajectory S IC simp All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) t⊢ x = trajectory S IC)) S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) t⊢ x = trajectory S IC
have hy_deriv2 : ∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (IC.trajectory S)) t := by S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ x⊢ S.EquationOfMotion x ∧ x 0 = IC.x₀ ∧ ∂ₜ x 0 = IC.v₀ → x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) t⊢ x = trajectory S IC
rw [hy_deriv S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) t⊢ (∂ₜ fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) t) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) t S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) t⊢ (∂ₜ fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) t) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) t S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) t⊢ x = trajectory S IC] S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) t⊢ (∂ₜ fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) t) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) t S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) t⊢ x = trajectory S IC
exact dsub _ _ (deriv_differentiable_of_contDiff _ hx)
(deriv_differentiable_of_contDiff _ hTraj) S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) t⊢ x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) t⊢ x = trajectory S IC
have hNewt_x := (S.equationOfMotion_iff_newtons_2nd_law x hx).1 hEOM S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)⊢ x = trajectory S IC
have hNewt_traj := (S.equationOfMotion_iff_newtons_2nd_law (IC.trajectory S) hTraj).1
(trajectory_equationOfMotion S IC) S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)⊢ x = trajectory S IC
have hEOM_y : S.EquationOfMotion y :=
(S.equationOfMotion_iff_newtons_2nd_law y hyContDiff).2 fun t => by S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)t:Time⊢ S.m • ∂ₜ (∂ₜ y) t = S.force (y t) S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion y⊢ x = trajectory S IC
rw [hy_deriv2 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)t:Time⊢ S.m • (fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) t) t = S.force (y t) S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)t:Time⊢ S.m • (fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) t) t = S.force (y t) S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion y⊢ x = trajectory S IC] S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)t:Time⊢ S.m • (fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) t) t = S.force (y t) S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion y⊢ x = trajectory S IC
simp [smul_sub, hNewt_x, hNewt_traj, hydef, force_eq_linear] S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion y⊢ x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion y⊢ x = trajectory S IC
have hE : ∀ t, S.energy y t = 0 := fun t =>
(S.energy_conservation_of_equationOfMotion' y hyContDiff hEOM_y t).trans <| by S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Time⊢ S.energy y 0 = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0⊢ x = trajectory S IC
have hy0 : y 0 = 0 := by simp [hydef, hx0] S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0⊢ S.energy y 0 = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0⊢ x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0⊢ S.energy y 0 = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0⊢ x = trajectory S IC
have hyv0 : ∂ₜ y 0 = 0 := by
rw [congrFun hy_deriv 0, S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0⊢ ∂ₜ x 0 - ∂ₜ (trajectory S IC) 0 = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0⊢ IC.v₀ - IC.v₀ = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0hyv0:∂ₜ y 0 = 0⊢ S.energy y 0 = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0⊢ x = trajectory S IC hv0, S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0⊢ IC.v₀ - ∂ₜ (trajectory S IC) 0 = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0⊢ IC.v₀ - IC.v₀ = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0hyv0:∂ₜ y 0 = 0⊢ S.energy y 0 = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0⊢ x = trajectory S IC trajectory_velocity_at_zero S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0⊢ IC.v₀ - IC.v₀ = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0⊢ IC.v₀ - IC.v₀ = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0hyv0:∂ₜ y 0 = 0⊢ S.energy y 0 = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0⊢ x = trajectory S IC] S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0⊢ IC.v₀ - IC.v₀ = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0hyv0:∂ₜ y 0 = 0⊢ S.energy y 0 = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0⊢ x = trajectory S IC; simp S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0hyv0:∂ₜ y 0 = 0⊢ S.energy y 0 = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0⊢ x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yt:Timehy0:y 0 = 0hyv0:∂ₜ y 0 = 0⊢ S.energy y 0 = 0 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0⊢ x = trajectory S IC
simp [HarmonicOscillator.energy, HarmonicOscillator.kineticEnergy,
HarmonicOscillator.potentialEnergy, hy0, hyv0, one_div, smul_eq_mul] S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0⊢ x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0⊢ x = trajectory S IC
-- Both energies are nonnegative, so a vanishing total energy forces `y t = 0`.
funext t S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Time⊢ x t = trajectory S IC t
have hk : 0 ≤ S.kineticEnergy y t := by S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ x⊢ S.EquationOfMotion x ∧ x 0 = IC.x₀ ∧ ∂ₜ x 0 = IC.v₀ → x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y t⊢ x t = trajectory S IC t
simp only [HarmonicOscillator.kineticEnergy] S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Time⊢ 0 ≤ 1 / 2 * S.m * Inner.inner ℝ (∂ₜ y t) (∂ₜ y t) S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y t⊢ x t = trajectory S IC t
exact mul_nonneg (mul_nonneg (by S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Time⊢ 0 ≤ 1 / 2 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y t⊢ x t = trajectory S IC t norm_num All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y t⊢ x t = trajectory S IC t) S.m_pos.le) real_inner_self_nonneg S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y t⊢ x t = trajectory S IC t
have hp : 0 ≤ S.potentialEnergy (y t) := by S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ x⊢ S.EquationOfMotion x ∧ x 0 = IC.x₀ ∧ ∂ₜ x 0 = IC.v₀ → x = trajectory S IC S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)⊢ x t = trajectory S IC t
simp only [HarmonicOscillator.potentialEnergy, smul_eq_mul] S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y t⊢ 0 ≤ 1 / 2 * (S.k * Inner.inner ℝ (y t) (y t)) S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)⊢ x t = trajectory S IC t
exact mul_nonneg (by S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y t⊢ 0 ≤ 1 / 2 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)⊢ x t = trajectory S IC t norm_num All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)⊢ x t = trajectory S IC t) (mul_nonneg S.k_pos.le real_inner_self_nonneg) S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)⊢ x t = trajectory S IC t
have hpe : S.potentialEnergy (y t) = 0 := ((add_eq_zero_iff_of_nonneg hk hp).mp (hE t)).2 S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)hpe:S.potentialEnergy (y t) = 0⊢ x t = trajectory S IC t
simp only [HarmonicOscillator.potentialEnergy, smul_eq_mul] at hpe S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)hpe:1 / 2 * (S.k * Inner.inner ℝ (y t) (y t)) = 0⊢ x t = trajectory S IC t
rcases mul_eq_zero.mp hpe with h | h inl S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)hpe:1 / 2 * (S.k * Inner.inner ℝ (y t) (y t)) = 0h:1 / 2 = 0⊢ x t = trajectory S IC tinr S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)hpe:1 / 2 * (S.k * Inner.inner ℝ (y t) (y t)) = 0h:S.k * Inner.inner ℝ (y t) (y t) = 0⊢ x t = trajectory S IC t
· inl S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)hpe:1 / 2 * (S.k * Inner.inner ℝ (y t) (y t)) = 0h:1 / 2 = 0⊢ x t = trajectory S IC t norm_num at h All goals completed! 🐙
· inr S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)hpe:1 / 2 * (S.k * Inner.inner ℝ (y t) (y t)) = 0h:S.k * Inner.inner ℝ (y t) (y t) = 0⊢ x t = trajectory S IC t have hyt : x t - IC.trajectory S t = 0 :=
inner_self_eq_zero.mp ((mul_eq_zero.mp h).resolve_left S.k_ne_zero) inr S:HarmonicOscillatorIC:InitialConditionsx:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xhEOM:S.EquationOfMotion xhx0:x 0 = IC.x₀hv0:∂ₜ x 0 = IC.v₀hTraj:ContDiff ℝ ∞ (trajectory S IC)dsub:∀ (f g : Time → EuclideanSpace ℝ (Fin 1)),
Differentiable ℝ f → Differentiable ℝ g → (∂ₜ fun t => f t - g t) = fun t => ∂ₜ f t - ∂ₜ g ty:Time → EuclideanSpace ℝ (Fin 1) := fun t => x t - trajectory S IC thydef:y = fun t => x t - trajectory S IC thyContDiff:ContDiff ℝ ∞ yhy_deriv:∂ₜ y = fun t => ∂ₜ x t - ∂ₜ (trajectory S IC) thy_deriv2:∂ₜ (∂ₜ y) = fun t => ∂ₜ (∂ₜ x) t - ∂ₜ (∂ₜ (trajectory S IC)) thNewt_x:∀ (t : Time), S.m • ∂ₜ (∂ₜ x) t = S.force (x t)hNewt_traj:∀ (t : Time), S.m • ∂ₜ (∂ₜ (trajectory S IC)) t = S.force (trajectory S IC t)hEOM_y:S.EquationOfMotion yhE:∀ (t : Time), S.energy y t = 0t:Timehk:0 ≤ S.kineticEnergy y thp:0 ≤ S.potentialEnergy (y t)hpe:1 / 2 * (S.k * Inner.inner ℝ (y t) (y t)) = 0h:S.k * Inner.inner ℝ (y t) (y t) = 0hyt:x t - trajectory S IC t = 0⊢ x t = trajectory S IC t
exact sub_eq_zero.mp hyt All goals completed! 🐙D. The energy of the trajectories
For a given set of initial conditions, the energy of the trajectory is constant, due to the conservation of energy. Here we show it's value.
lemma trajectory_energy (IC : InitialConditions) : S.energy (IC.trajectory S) =
fun _ => 1/2 * (S.m * ‖IC.v₀‖ ^2 + S.k * ‖IC.x₀‖ ^ 2) := by S:HarmonicOscillatorIC:InitialConditions⊢ S.energy (trajectory S IC) = fun x => 1 / 2 * (S.m * ‖IC.v₀‖ ^ 2 + S.k * ‖IC.x₀‖ ^ 2)
funext t S:HarmonicOscillatorIC:InitialConditionst:Time⊢ S.energy (trajectory S IC) t = 1 / 2 * (S.m * ‖IC.v₀‖ ^ 2 + S.k * ‖IC.x₀‖ ^ 2)
rw [energy_conservation_of_equationOfMotion' _ _ (by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ContDiff ℝ ∞ (trajectory S IC) S:HarmonicOscillatorIC:InitialConditionst:Time⊢ S.energy (trajectory S IC) 0 = 1 / 2 * (S.m * ‖IC.v₀‖ ^ 2 + S.k * ‖IC.x₀‖ ^ 2) fun_prop All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionst:Time⊢ S.energy (trajectory S IC) 0 = 1 / 2 * (S.m * ‖IC.v₀‖ ^ 2 + S.k * ‖IC.x₀‖ ^ 2)) (trajectory_equationOfMotion S IC)] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ S.energy (trajectory S IC) 0 = 1 / 2 * (S.m * ‖IC.v₀‖ ^ 2 + S.k * ‖IC.x₀‖ ^ 2)
simp [energy, kineticEnergy, potentialEnergy] S:HarmonicOscillatorIC:InitialConditionst:Time⊢ 2⁻¹ * S.m * ‖IC.v₀‖ ^ 2 + 2⁻¹ * (S.k * ‖IC.x₀‖ ^ 2) = 2⁻¹ * (S.m * ‖IC.v₀‖ ^ 2 + S.k * ‖IC.x₀‖ ^ 2)
ring All goals completed! 🐙D.1. Correctness of InitialConditionsAtTime conversion
We now prove the correctness lemmas for the InitialConditionsAtTime.toInitialConditions
conversion function. These show that the conversion produces a trajectory that passes through
the specified position and velocity at the specified time.
The trajectory resulting from toInitialConditions passes through the specified
position x_t₀ at time t₀.
@[simp]
lemma toInitialConditions_trajectory_at_t₀ (S : HarmonicOscillator)
(IC : InitialConditionsAtTime) :
(IC.toInitialConditions S).trajectory S IC.t₀ = IC.x_t₀ := by S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ InitialConditions.trajectory S (toInitialConditions S IC) IC.t₀ = IC.x_t₀
rw [InitialConditions.trajectory_eq, S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ (fun t =>
Real.cos (S.ω * t.val) • (toInitialConditions S IC).x₀ +
(Real.sin (S.ω * t.val) / S.ω) • (toInitialConditions S IC).v₀)
IC.t₀ =
IC.x_t₀ S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ (fun t =>
Real.cos (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.v₀)
IC.t₀ =
IC.x_t₀ toInitialConditions S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ (fun t =>
Real.cos (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.v₀)
IC.t₀ =
IC.x_t₀ S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ (fun t =>
Real.cos (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.v₀)
IC.t₀ =
IC.x_t₀] S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ (fun t =>
Real.cos (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.v₀)
IC.t₀ =
IC.x_t₀
ext i S:HarmonicOscillatorIC:InitialConditionsAtTimei:Fin 1⊢ ((fun t =>
Real.cos (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.v₀)
IC.t₀).ofLp
i =
IC.x_t₀.ofLp i
simp only [smul_add, PiLp.add_apply, PiLp.smul_apply, PiLp.sub_apply, smul_eq_mul] S:HarmonicOscillatorIC:InitialConditionsAtTimei:Fin 1⊢ Real.cos (S.ω * IC.t₀.val) *
(Real.cos (S.ω * IC.t₀.val) * IC.x_t₀.ofLp i - Real.sin (S.ω * IC.t₀.val) / S.ω * IC.v_t₀.ofLp i) +
(Real.sin (S.ω * IC.t₀.val) / S.ω * (S.ω * (Real.sin (S.ω * IC.t₀.val) * IC.x_t₀.ofLp i)) +
Real.sin (S.ω * IC.t₀.val) / S.ω * (Real.cos (S.ω * IC.t₀.val) * IC.v_t₀.ofLp i)) =
IC.x_t₀.ofLp i
field_simp [S.ω_ne_zero] S:HarmonicOscillatorIC:InitialConditionsAtTimei:Fin 1⊢ Real.cos (S.ω * IC.t₀.val) *
(S.ω * Real.cos (S.ω * IC.t₀.val) * IC.x_t₀.ofLp i - Real.sin (S.ω * IC.t₀.val) * IC.v_t₀.ofLp i) +
Real.sin (S.ω * IC.t₀.val) *
(S.ω * IC.x_t₀.ofLp i * Real.sin (S.ω * IC.t₀.val) + Real.cos (S.ω * IC.t₀.val) * IC.v_t₀.ofLp i) =
S.ω * IC.x_t₀.ofLp i
linear_combination (S.ω * IC.x_t₀.ofLp i) * cos_sq_add_sin_sq (S.ω * IC.t₀.val) All goals completed! 🐙
The trajectory resulting from toInitialConditions has the specified
velocity v_t₀ at time t₀.
@[simp]
lemma toInitialConditions_velocity_at_t₀ (S : HarmonicOscillator)
(IC : InitialConditionsAtTime) :
∂ₜ ((IC.toInitialConditions S).trajectory S) IC.t₀ = IC.v_t₀ := by S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ ∂ₜ (InitialConditions.trajectory S (toInitialConditions S IC)) IC.t₀ = IC.v_t₀
rw [InitialConditions.trajectory_velocity, S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ (fun t =>
-S.ω • Real.sin (S.ω * t.val) • (toInitialConditions S IC).x₀ +
Real.cos (S.ω * t.val) • (toInitialConditions S IC).v₀)
IC.t₀ =
IC.v_t₀ S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.x₀ +
Real.cos (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.v₀)
IC.t₀ =
IC.v_t₀ toInitialConditions S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.x₀ +
Real.cos (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.v₀)
IC.t₀ =
IC.v_t₀ S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.x₀ +
Real.cos (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.v₀)
IC.t₀ =
IC.v_t₀] S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.x₀ +
Real.cos (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.v₀)
IC.t₀ =
IC.v_t₀
ext i S:HarmonicOscillatorIC:InitialConditionsAtTimei:Fin 1⊢ ((fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.x₀ +
Real.cos (S.ω * t.val) •
{ x₀ := Real.cos (S.ω * IC.t₀.val) • IC.x_t₀ - (Real.sin (S.ω * IC.t₀.val) / S.ω) • IC.v_t₀,
v₀ := S.ω • Real.sin (S.ω * IC.t₀.val) • IC.x_t₀ + Real.cos (S.ω * IC.t₀.val) • IC.v_t₀ }.v₀)
IC.t₀).ofLp
i =
IC.v_t₀.ofLp i
simp only [neg_smul, smul_add, PiLp.add_apply, PiLp.neg_apply, PiLp.smul_apply, PiLp.sub_apply,
smul_eq_mul] S:HarmonicOscillatorIC:InitialConditionsAtTimei:Fin 1⊢ -(S.ω *
(Real.sin (S.ω * IC.t₀.val) *
(Real.cos (S.ω * IC.t₀.val) * IC.x_t₀.ofLp i - Real.sin (S.ω * IC.t₀.val) / S.ω * IC.v_t₀.ofLp i))) +
(Real.cos (S.ω * IC.t₀.val) * (S.ω * (Real.sin (S.ω * IC.t₀.val) * IC.x_t₀.ofLp i)) +
Real.cos (S.ω * IC.t₀.val) * (Real.cos (S.ω * IC.t₀.val) * IC.v_t₀.ofLp i)) =
IC.v_t₀.ofLp i
field_simp [S.ω_ne_zero] S:HarmonicOscillatorIC:InitialConditionsAtTimei:Fin 1⊢ -(Real.sin (S.ω * IC.t₀.val) *
(S.ω * Real.cos (S.ω * IC.t₀.val) * IC.x_t₀.ofLp i - Real.sin (S.ω * IC.t₀.val) * IC.v_t₀.ofLp i)) +
Real.cos (S.ω * IC.t₀.val) *
(S.ω * Real.sin (S.ω * IC.t₀.val) * IC.x_t₀.ofLp i + Real.cos (S.ω * IC.t₀.val) * IC.v_t₀.ofLp i) =
IC.v_t₀.ofLp i
linear_combination (IC.v_t₀.ofLp i) * cos_sq_add_sin_sq (S.ω * IC.t₀.val) All goals completed! 🐙
The energy of the trajectory at time t₀ equals the energy computed from the
initial conditions at t₀.
lemma 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 S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ S.energy (InitialConditions.trajectory S (toInitialConditions S IC)) IC.t₀ =
1 / 2 * (S.m * ‖IC.v_t₀‖ ^ 2 + S.k * ‖IC.x_t₀‖ ^ 2)
unfold energy kineticEnergy potentialEnergy S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ 1 / 2 * S.m *
Inner.inner ℝ (∂ₜ (InitialConditions.trajectory S (toInitialConditions S IC)) IC.t₀)
(∂ₜ (InitialConditions.trajectory S (toInitialConditions S IC)) IC.t₀) +
(1 / 2) •
S.k •
Inner.inner ℝ (InitialConditions.trajectory S (toInitialConditions S IC) IC.t₀)
(InitialConditions.trajectory S (toInitialConditions S IC) IC.t₀) =
1 / 2 * (S.m * ‖IC.v_t₀‖ ^ 2 + S.k * ‖IC.x_t₀‖ ^ 2)
simp only [toInitialConditions_trajectory_at_t₀, toInitialConditions_velocity_at_t₀] S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ 1 / 2 * S.m * Inner.inner ℝ IC.v_t₀ IC.v_t₀ + (1 / 2) • S.k • Inner.inner ℝ IC.x_t₀ IC.x_t₀ =
1 / 2 * (S.m * ‖IC.v_t₀‖ ^ 2 + S.k * ‖IC.x_t₀‖ ^ 2)
simp only [real_inner_self_eq_norm_sq, smul_eq_mul] S:HarmonicOscillatorIC:InitialConditionsAtTime⊢ 1 / 2 * S.m * ‖IC.v_t₀‖ ^ 2 + 1 / 2 * (S.k * ‖IC.x_t₀‖ ^ 2) = 1 / 2 * (S.m * ‖IC.v_t₀‖ ^ 2 + S.k * ‖IC.x_t₀‖ ^ 2)
ring All goals completed! 🐙D.2. Correctness of InitialConditionsFromTwoPositions conversion
The conversion recovers the initial conditions only when sin (S.ω * (t₂ - t₁)) ≠ 0. This
condition fails exactly when ω·(t₂ - t₁) = n·π for some integer n, i.e. when t₂ - t₁ is an
integer multiple of half a period; in that case x(t₂) = (-1)^n · x(t₁) for every trajectory,
independent of v₀, so the two positions do not determine the initial conditions.
Under this nondegeneracy condition, we prove that the resulting trajectory passes through x_t₁
at t₁ and x_t₂ at t₂.
The trajectory from toInitialConditions passes through x_t₁ at time t₁,
provided sin (S.ω * (t₂ - t₁)) ≠ 0.
lemma toInitialConditions_trajectory_at_t₁ (S : HarmonicOscillator)
(IC : InitialConditionsFromTwoPositions)
(hΔ : sin (S.ω * (IC.t₂ - IC.t₁)) ≠ 0) :
(IC.toInitialConditions S).trajectory S IC.t₁ = IC.x_t₁ := by S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ InitialConditions.trajectory S (toInitialConditions S IC) IC.t₁ = IC.x_t₁
rw [InitialConditions.trajectory_eq, S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
Real.cos (S.ω * t.val) • (toInitialConditions S IC).x₀ +
(Real.sin (S.ω * t.val) / S.ω) • (toInitialConditions S IC).v₀)
IC.t₁ =
IC.x_t₁ S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.v₀)
IC.t₁ =
IC.x_t₁ toInitialConditions S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.v₀)
IC.t₁ =
IC.x_t₁ S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.v₀)
IC.t₁ =
IC.x_t₁] S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.v₀)
IC.t₁ =
IC.x_t₁
ext i S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ ((fun t =>
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.v₀)
IC.t₁).ofLp
i =
IC.x_t₁.ofLp i
simp only [PiLp.add_apply, PiLp.smul_apply, PiLp.sub_apply, smul_eq_mul] S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ Real.cos (S.ω * IC.t₁.val) *
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.x_t₁.ofLp i -
Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.x_t₂.ofLp i) +
Real.sin (S.ω * IC.t₁.val) / S.ω *
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.x_t₂.ofLp i -
S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.x_t₁.ofLp i) =
IC.x_t₁.ofLp i
field_simp [S.ω_ne_zero] S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ Real.cos (S.ω * IC.t₁.val) *
(Real.sin (S.ω * IC.t₂.val) * IC.x_t₁.ofLp i - Real.sin (S.ω * IC.t₁.val) * IC.x_t₂.ofLp i) +
Real.sin (S.ω * IC.t₁.val) *
(Real.cos (S.ω * IC.t₁.val) * IC.x_t₂.ofLp i - IC.x_t₁.ofLp i * Real.cos (S.ω * IC.t₂.val)) =
Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.x_t₁.ofLp i
grind [mul_sub, Real.sin_sub] All goals completed! 🐙
The trajectory from toInitialConditions passes through x_t₂ at time t₂,
provided sin (S.ω * (t₂ - t₁)) ≠ 0.
lemma toInitialConditions_trajectory_at_t₂ (S : HarmonicOscillator)
(IC : InitialConditionsFromTwoPositions)
(hΔ : sin (S.ω * (IC.t₂ - IC.t₁)) ≠ 0) :
(IC.toInitialConditions S).trajectory S IC.t₂ = IC.x_t₂ := by S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ InitialConditions.trajectory S (toInitialConditions S IC) IC.t₂ = IC.x_t₂
rw [InitialConditions.trajectory_eq, S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
Real.cos (S.ω * t.val) • (toInitialConditions S IC).x₀ +
(Real.sin (S.ω * t.val) / S.ω) • (toInitialConditions S IC).v₀)
IC.t₂ =
IC.x_t₂ S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.v₀)
IC.t₂ =
IC.x_t₂ toInitialConditions S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.v₀)
IC.t₂ =
IC.x_t₂ S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.v₀)
IC.t₂ =
IC.x_t₂] S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.v₀)
IC.t₂ =
IC.x_t₂
ext i S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ ((fun t =>
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{
x₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂,
v₀ :=
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₂ -
(S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.x_t₁ }.v₀)
IC.t₂).ofLp
i =
IC.x_t₂.ofLp i
simp only [PiLp.add_apply, PiLp.smul_apply, PiLp.sub_apply, smul_eq_mul] S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ Real.cos (S.ω * IC.t₂.val) *
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.x_t₁.ofLp i -
Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.x_t₂.ofLp i) +
Real.sin (S.ω * IC.t₂.val) / S.ω *
(S.ω * Real.cos (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.x_t₂.ofLp i -
S.ω * Real.cos (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.x_t₁.ofLp i) =
IC.x_t₂.ofLp i
field_simp [S.ω_ne_zero] S:HarmonicOscillatorIC:InitialConditionsFromTwoPositionshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ Real.cos (S.ω * IC.t₂.val) *
(Real.sin (S.ω * IC.t₂.val) * IC.x_t₁.ofLp i - Real.sin (S.ω * IC.t₁.val) * IC.x_t₂.ofLp i) +
Real.sin (S.ω * IC.t₂.val) *
(IC.x_t₂.ofLp i * Real.cos (S.ω * IC.t₁.val) - Real.cos (S.ω * IC.t₂.val) * IC.x_t₁.ofLp i) =
Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.x_t₂.ofLp i
grind [mul_sub, Real.sin_sub] All goals completed! 🐙D.3. Correctness of InitialConditionsFromTwoVelocities conversion
The conversion recovers the initial conditions only when sin (S.ω * (t₂ - t₁)) ≠ 0. Under this
nondegeneracy condition, we prove that the resulting trajectory has velocity v_t₁ at t₁ and
v_t₂ at t₂.
The trajectory from toInitialConditions has velocity v_t₁ at time t₁,
provided sin (S.ω * (t₂ - t₁)) ≠ 0.
lemma toInitialConditions_velocity_at_t₁ (S : HarmonicOscillator)
(IC : InitialConditionsFromTwoVelocities)
(hΔ : sin (S.ω * (IC.t₂ - IC.t₁)) ≠ 0) :
∂ₜ ((IC.toInitialConditions S).trajectory S) IC.t₁ = IC.v_t₁ := by S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ ∂ₜ (InitialConditions.trajectory S (toInitialConditions S IC)) IC.t₁ = IC.v_t₁
rw [InitialConditions.trajectory_velocity, S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
-S.ω • Real.sin (S.ω * t.val) • (toInitialConditions S IC).x₀ +
Real.cos (S.ω * t.val) • (toInitialConditions S IC).v₀)
IC.t₁ =
IC.v_t₁ S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.x₀ +
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.v₀)
IC.t₁ =
IC.v_t₁ toInitialConditions S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.x₀ +
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.v₀)
IC.t₁ =
IC.v_t₁ S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.x₀ +
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.v₀)
IC.t₁ =
IC.v_t₁] S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.x₀ +
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.v₀)
IC.t₁ =
IC.v_t₁
ext i S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ ((fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.x₀ +
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.v₀)
IC.t₁).ofLp
i =
IC.v_t₁.ofLp i
simp only [neg_smul, PiLp.add_apply, PiLp.neg_apply, PiLp.smul_apply, PiLp.sub_apply,
smul_eq_mul] S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ -(S.ω *
(Real.sin (S.ω * IC.t₁.val) *
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) * IC.v_t₁.ofLp i -
Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) * IC.v_t₂.ofLp i))) +
Real.cos (S.ω * IC.t₁.val) *
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.v_t₁.ofLp i -
Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.v_t₂.ofLp i) =
IC.v_t₁.ofLp i
field_simp [S.ω_ne_zero] S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ -(Real.sin (S.ω * IC.t₁.val) *
(Real.cos (S.ω * IC.t₂.val) * IC.v_t₁.ofLp i - Real.cos (S.ω * IC.t₁.val) * IC.v_t₂.ofLp i)) +
Real.cos (S.ω * IC.t₁.val) *
(IC.v_t₁.ofLp i * Real.sin (S.ω * IC.t₂.val) - Real.sin (S.ω * IC.t₁.val) * IC.v_t₂.ofLp i) =
Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.v_t₁.ofLp i
grind [mul_sub, Real.sin_sub] All goals completed! 🐙
The trajectory from toInitialConditions has velocity v_t₂ at time t₂,
provided sin (S.ω * (t₂ - t₁)) ≠ 0.
lemma toInitialConditions_velocity_at_t₂ (S : HarmonicOscillator)
(IC : InitialConditionsFromTwoVelocities)
(hΔ : sin (S.ω * (IC.t₂ - IC.t₁)) ≠ 0) :
∂ₜ ((IC.toInitialConditions S).trajectory S) IC.t₂ = IC.v_t₂ := by S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ ∂ₜ (InitialConditions.trajectory S (toInitialConditions S IC)) IC.t₂ = IC.v_t₂
rw [InitialConditions.trajectory_velocity, S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
-S.ω • Real.sin (S.ω * t.val) • (toInitialConditions S IC).x₀ +
Real.cos (S.ω * t.val) • (toInitialConditions S IC).v₀)
IC.t₂ =
IC.v_t₂ S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.x₀ +
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.v₀)
IC.t₂ =
IC.v_t₂ toInitialConditions S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.x₀ +
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.v₀)
IC.t₂ =
IC.v_t₂ S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.x₀ +
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.v₀)
IC.t₂ =
IC.v_t₂] S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.x₀ +
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.v₀)
IC.t₂ =
IC.v_t₂
ext i S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ ((fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.x₀ +
Real.cos (S.ω * t.val) •
{
x₀ :=
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₁ -
(Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)))) • IC.v_t₂,
v₀ :=
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₁ -
(Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) • IC.v_t₂ }.v₀)
IC.t₂).ofLp
i =
IC.v_t₂.ofLp i
simp only [neg_smul, PiLp.add_apply, PiLp.neg_apply, PiLp.smul_apply, PiLp.sub_apply,
smul_eq_mul] S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ -(S.ω *
(Real.sin (S.ω * IC.t₂.val) *
(Real.cos (S.ω * IC.t₂.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) * IC.v_t₁.ofLp i -
Real.cos (S.ω * IC.t₁.val) / (S.ω * Real.sin (S.ω * (IC.t₂.val - IC.t₁.val))) * IC.v_t₂.ofLp i))) +
Real.cos (S.ω * IC.t₂.val) *
(Real.sin (S.ω * IC.t₂.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.v_t₁.ofLp i -
Real.sin (S.ω * IC.t₁.val) / Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.v_t₂.ofLp i) =
IC.v_t₂.ofLp i
field_simp [S.ω_ne_zero] S:HarmonicOscillatorIC:InitialConditionsFromTwoVelocitieshΔ:Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) ≠ 0i:Fin 1⊢ -(Real.sin (S.ω * IC.t₂.val) *
(Real.cos (S.ω * IC.t₂.val) * IC.v_t₁.ofLp i - Real.cos (S.ω * IC.t₁.val) * IC.v_t₂.ofLp i)) +
Real.cos (S.ω * IC.t₂.val) *
(Real.sin (S.ω * IC.t₂.val) * IC.v_t₁.ofLp i - IC.v_t₂.ofLp i * Real.sin (S.ω * IC.t₁.val)) =
Real.sin (S.ω * (IC.t₂.val - IC.t₁.val)) * IC.v_t₂.ofLp i
grind [mul_sub, Real.sin_sub] All goals completed! 🐙E. Amplitude–phase parametrization
The state of the harmonic oscillator at t = 0 is captured by InitialConditions as a position
x₀ and a velocity v₀. An equivalent and often more physical description writes the solution as
a single shifted cosine of amplitude A and phase φ:
x(t) = A cos (ω t - φ).
Expanding with the angle-subtraction identity,
A cos (ω t - φ) = (A cos φ) cos (ω t) + (A sin φ) sin (ω t),
and matching coefficients against the standard solution
x(t) = cos (ω t) x₀ + (sin (ω t) / ω) v₀
gives the change of coordinates
x₀ = A cos φ, v₀ = A ω sin φ.
We implement the forward map (A, φ) ↦ (x₀, v₀) as toInitialConditions, prove the resulting
trajectory is the cosine normal form above (with velocity -A ω sin (ω t - φ)), and implement the
inverse map (x₀, v₀) ↦ (A, φ) as fromInitialConditions, recovering A and φ as the polar
coordinates of the phase vector (x₀, v₀ / ω).
E.1. The amplitude–phase initial conditions
We define a type for initial conditions specified by an amplitude A and a phase angle φ. Being
an amplitude and an angle, these are stored as scalars, rather than as vectors as for the other
initial-condition types.
Initial conditions for the harmonic oscillator specified by an amplitude A and a phase
offset φ, describing the solution x(t) = A cos (ω t - φ).
The conditions can be converted to the standard InitialConditions format using the
toInitialConditions function.
The amplitude of the oscillation.
The phase offset of the oscillation.
@[ext] structure AmplitudePhase where A : ℝ φ : ℝE.2. Conversion to standard initial conditions
Using x₀ = A cos φ and v₀ = A ω sin φ, we convert amplitude–phase data to the standard initial
position and velocity at t = 0.
E.3. The trajectory in normal form
The trajectory built from amplitude–phase data is exactly the single cosine
x(t) = A cos (ω t - φ), with velocity v(t) = -A ω sin (ω t - φ). In the position identity the
factor 1 / ω of the standard solution cancels the ω in v₀ = A ω sin φ, which uses ω ≠ 0.
The trajectory of amplitude–phase initial conditions is the cosine normal form
x(t) = A cos (ω t - φ).
lemma toInitialConditions_trajectory_eq_cos (S : HarmonicOscillator) (IC : AmplitudePhase)
(t : Time) :
(IC.toInitialConditions S).trajectory S t
= EuclideanSpace.single 0 (IC.A * cos (S.ω * t - IC.φ)) := by S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ InitialConditions.trajectory S (toInitialConditions S IC) t =
EuclideanSpace.single 0 (IC.A * Real.cos (S.ω * t.val - IC.φ))
rw [InitialConditions.trajectory_eq, S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ (fun t =>
Real.cos (S.ω * t.val) • (toInitialConditions S IC).x₀ +
(Real.sin (S.ω * t.val) / S.ω) • (toInitialConditions S IC).v₀)
t =
EuclideanSpace.single 0 (IC.A * Real.cos (S.ω * t.val - IC.φ)) S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ (fun t =>
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t =
EuclideanSpace.single 0 (IC.A * Real.cos (S.ω * t.val - IC.φ)) toInitialConditions S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ (fun t =>
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t =
EuclideanSpace.single 0 (IC.A * Real.cos (S.ω * t.val - IC.φ)) S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ (fun t =>
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t =
EuclideanSpace.single 0 (IC.A * Real.cos (S.ω * t.val - IC.φ))] S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ (fun t =>
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t =
EuclideanSpace.single 0 (IC.A * Real.cos (S.ω * t.val - IC.φ))
ext i S:HarmonicOscillatorIC:AmplitudePhaset:Timei:Fin 1⊢ ((fun t =>
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t).ofLp
i =
(EuclideanSpace.single 0 (IC.A * Real.cos (S.ω * t.val - IC.φ))).ofLp i
fin_cases i «0» S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ ((fun t =>
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
(Real.sin (S.ω * t.val) / S.ω) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t).ofLp
((fun i => i) ⟨0, ⋯⟩) =
(EuclideanSpace.single 0 (IC.A * Real.cos (S.ω * t.val - IC.φ))).ofLp ((fun i => i) ⟨0, ⋯⟩)
simp [Real.cos_sub] «0» S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ Real.cos (S.ω * t.val) * (IC.A * Real.cos IC.φ) + Real.sin (S.ω * t.val) / S.ω * (IC.A * S.ω * Real.sin IC.φ) =
IC.A * (Real.cos (S.ω * t.val) * Real.cos IC.φ + Real.sin (S.ω * t.val) * Real.sin IC.φ)
field_simp [S.ω_ne_zero] All goals completed! 🐙
The velocity of the amplitude–phase trajectory is v(t) = -A ω sin (ω t - φ).
lemma toInitialConditions_velocity_eq_sin (S : HarmonicOscillator) (IC : AmplitudePhase)
(t : Time) :
∂ₜ ((IC.toInitialConditions S).trajectory S) t
= EuclideanSpace.single 0 (-(IC.A * S.ω * sin (S.ω * t.val - IC.φ))) := by S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ ∂ₜ (InitialConditions.trajectory S (toInitialConditions S IC)) t =
EuclideanSpace.single 0 (-(IC.A * S.ω * Real.sin (S.ω * t.val - IC.φ)))
rw [InitialConditions.trajectory_velocity, S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ (fun t =>
-S.ω • Real.sin (S.ω * t.val) • (toInitialConditions S IC).x₀ +
Real.cos (S.ω * t.val) • (toInitialConditions S IC).v₀)
t =
EuclideanSpace.single 0 (-(IC.A * S.ω * Real.sin (S.ω * t.val - IC.φ))) S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t =
EuclideanSpace.single 0 (-(IC.A * S.ω * Real.sin (S.ω * t.val - IC.φ))) toInitialConditions S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t =
EuclideanSpace.single 0 (-(IC.A * S.ω * Real.sin (S.ω * t.val - IC.φ))) S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t =
EuclideanSpace.single 0 (-(IC.A * S.ω * Real.sin (S.ω * t.val - IC.φ)))] S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ (fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t =
EuclideanSpace.single 0 (-(IC.A * S.ω * Real.sin (S.ω * t.val - IC.φ)))
ext i S:HarmonicOscillatorIC:AmplitudePhaset:Timei:Fin 1⊢ ((fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t).ofLp
i =
(EuclideanSpace.single 0 (-(IC.A * S.ω * Real.sin (S.ω * t.val - IC.φ)))).ofLp i
fin_cases i «0» S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ ((fun t =>
-S.ω •
Real.sin (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.x₀ +
Real.cos (S.ω * t.val) •
{ x₀ := EuclideanSpace.single 0 (IC.A * Real.cos IC.φ),
v₀ := EuclideanSpace.single 0 (IC.A * S.ω * Real.sin IC.φ) }.v₀)
t).ofLp
((fun i => i) ⟨0, ⋯⟩) =
(EuclideanSpace.single 0 (-(IC.A * S.ω * Real.sin (S.ω * t.val - IC.φ)))).ofLp ((fun i => i) ⟨0, ⋯⟩)
simp [Real.sin_sub] «0» S:HarmonicOscillatorIC:AmplitudePhaset:Time⊢ -(S.ω * (Real.sin (S.ω * t.val) * (IC.A * Real.cos IC.φ))) + Real.cos (S.ω * t.val) * (IC.A * S.ω * Real.sin IC.φ) =
-(IC.A * S.ω * (Real.sin (S.ω * t.val) * Real.cos IC.φ - Real.cos (S.ω * t.val) * Real.sin IC.φ))
ring All goals completed! 🐙E.4. Recovering the amplitude and phase
The inverse map (x₀, v₀) ↦ (A, φ) must solve x₀ = A cos φ and v₀ / ω = A sin φ. Recovering
the angle with the real arctan covers only (-π/2, π/2) and forces a case split at x₀ = 0; we
instead embed the phase vector as the complex number z = x₀ + (v₀ / ω) i and read off A = ‖z‖
and φ = Complex.arg z, with arg in the canonical range (-π, π]. The degenerate state
x₀ = v₀ = 0 is covered by the convention arg 0 = 0, so no case split is needed.
We prove that converting initial conditions to amplitude–phase form and back returns the original initial conditions.
fromInitialConditions is a right inverse of toInitialConditions: converting initial
conditions to amplitude–phase form and back recovers them exactly.
lemma toInitialConditions_fromInitialConditions (S : HarmonicOscillator)
(IC : InitialConditions) :
(fromInitialConditions S IC).toInitialConditions S = IC := by S:HarmonicOscillatorIC:InitialConditions⊢ toInitialConditions S (fromInitialConditions S IC) = IC
have hω : S.ω ≠ 0 := S.ω_ne_zero S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0⊢ toInitialConditions S (fromInitialConditions S IC) = IC
set z : ℂ := (⟨IC.x₀ 0, IC.v₀ 0 / S.ω⟩ : ℂ) S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }⊢ toInitialConditions S (fromInitialConditions S IC) = IC
-- polar identities
have hcos : ‖z‖ * cos (Complex.arg z) = z.re := Complex.norm_mul_cos_arg z S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.re⊢ toInitialConditions S (fromInitialConditions S IC) = IC
have hsin : ‖z‖ * sin (Complex.arg z) = z.im := Complex.norm_mul_sin_arg z S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.im⊢ toInitialConditions S (fromInitialConditions S IC) = IC
-- By construction the parts of `z` are exactly the original data.
have hre : z.re = IC.x₀ 0 := rfl S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0⊢ toInitialConditions S (fromInitialConditions S IC) = IC
have him : z.im = IC.v₀ 0 / S.ω := rfl S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ toInitialConditions S (fromInitialConditions S IC) = IC
apply InitialConditions.ext x₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ (toInitialConditions S (fromInitialConditions S IC)).x₀ = IC.x₀v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ (toInitialConditions S (fromInitialConditions S IC)).v₀ = IC.v₀
· x₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ (toInitialConditions S (fromInitialConditions S IC)).x₀ = IC.x₀ -- Position: `‖z‖ cos (arg z) = Re z = IC.x₀ 0`, and `single 0 (IC.x₀ 0) = IC.x₀`.
show EuclideanSpace.single 0 (‖z‖ * cos (Complex.arg z)) = IC.x₀ x₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ EuclideanSpace.single 0 (‖z‖ * Real.cos z.arg) = IC.x₀
rw [hcos, x₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ EuclideanSpace.single 0 z.re = IC.x₀ x₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ EuclideanSpace.single 0 (IC.x₀.ofLp 0) = IC.x₀ hre x₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ EuclideanSpace.single 0 (IC.x₀.ofLp 0) = IC.x₀ x₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ EuclideanSpace.single 0 (IC.x₀.ofLp 0) = IC.x₀]x₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ EuclideanSpace.single 0 (IC.x₀.ofLp 0) = IC.x₀
ext i x₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωi:Fin 1⊢ (EuclideanSpace.single 0 (IC.x₀.ofLp 0)).ofLp i = IC.x₀.ofLp i; fin_cases i x₀.«0» S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ (EuclideanSpace.single 0 (IC.x₀.ofLp 0)).ofLp ((fun i => i) ⟨0, ⋯⟩) = IC.x₀.ofLp ((fun i => i) ⟨0, ⋯⟩); simp All goals completed! 🐙
· v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ (toInitialConditions S (fromInitialConditions S IC)).v₀ = IC.v₀ -- Velocity: `‖z‖ ω sin (arg z) = ω · Im z = ω · (v₀ / ω) = IC.v₀ 0`, then reassemble.
show EuclideanSpace.single 0 (‖z‖ * S.ω * sin (Complex.arg z)) = IC.v₀ v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ EuclideanSpace.single 0 (‖z‖ * S.ω * Real.sin z.arg) = IC.v₀
have hv : ‖z‖ * S.ω * sin (Complex.arg z) = IC.v₀ 0 := by S:HarmonicOscillatorIC:InitialConditions⊢ toInitialConditions S (fromInitialConditions S IC) = IC v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0⊢ EuclideanSpace.single 0 (‖z‖ * S.ω * Real.sin z.arg) = IC.v₀
rw [mul_right_comm, S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ ‖z‖ * Real.sin z.arg * S.ω = IC.v₀.ofLp 0 S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ IC.v₀.ofLp 0 / S.ω * S.ω = IC.v₀.ofLp 0v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0⊢ EuclideanSpace.single 0 (‖z‖ * S.ω * Real.sin z.arg) = IC.v₀ hsin, S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ z.im * S.ω = IC.v₀.ofLp 0 S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ IC.v₀.ofLp 0 / S.ω * S.ω = IC.v₀.ofLp 0v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0⊢ EuclideanSpace.single 0 (‖z‖ * S.ω * Real.sin z.arg) = IC.v₀ him S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ IC.v₀.ofLp 0 / S.ω * S.ω = IC.v₀.ofLp 0 S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ IC.v₀.ofLp 0 / S.ω * S.ω = IC.v₀.ofLp 0v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0⊢ EuclideanSpace.single 0 (‖z‖ * S.ω * Real.sin z.arg) = IC.v₀] S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ω⊢ IC.v₀.ofLp 0 / S.ω * S.ω = IC.v₀.ofLp 0v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0⊢ EuclideanSpace.single 0 (‖z‖ * S.ω * Real.sin z.arg) = IC.v₀; field_simpv₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0⊢ EuclideanSpace.single 0 (‖z‖ * S.ω * Real.sin z.arg) = IC.v₀v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0⊢ EuclideanSpace.single 0 (‖z‖ * S.ω * Real.sin z.arg) = IC.v₀
rw [hv v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0⊢ EuclideanSpace.single 0 (IC.v₀.ofLp 0) = IC.v₀ v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0⊢ EuclideanSpace.single 0 (IC.v₀.ofLp 0) = IC.v₀]v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0⊢ EuclideanSpace.single 0 (IC.v₀.ofLp 0) = IC.v₀
ext i v₀ S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0i:Fin 1⊢ (EuclideanSpace.single 0 (IC.v₀.ofLp 0)).ofLp i = IC.v₀.ofLp i; fin_cases i v₀.«0» S:HarmonicOscillatorIC:InitialConditionshω:S.ω ≠ 0z:ℂ := { re := IC.x₀.ofLp 0, im := IC.v₀.ofLp 0 / S.ω }hcos:‖z‖ * Real.cos z.arg = z.rehsin:‖z‖ * Real.sin z.arg = z.imhre:z.re = IC.x₀.ofLp 0him:z.im = IC.v₀.ofLp 0 / S.ωhv:‖z‖ * S.ω * Real.sin z.arg = IC.v₀.ofLp 0⊢ (EuclideanSpace.single 0 (IC.v₀.ofLp 0)).ofLp ((fun i => i) ⟨0, ⋯⟩) = IC.v₀.ofLp ((fun i => i) ⟨0, ⋯⟩); simp All goals completed! 🐙F. Special conditions of the trajectory
We use the amplitude-phase parametrization from section E to describe the special times of a
trajectory. After converting arbitrary initial conditions to amplitude and phase, every trajectory
has the form x(t) = A cos (ω t - φ) and its velocity has the form v(t) = -Aω sin (ω t - φ).
Thus the turning points of the motion are controlled by the zeros of sin (ω t - φ), while the
times at which the trajectory passes through the origin are controlled by the zeros of
cos (ω t - φ).
F.1. Normal form for standard initial conditions
The amplitude-phase normal form was first proved for data already expressed as an
AmplitudePhase. We now transport those identities back to ordinary InitialConditions using
AmplitudePhase.fromInitialConditions.
Every trajectory of the harmonic oscillator is a single shifted cosine after converting its initial conditions to amplitude-phase form.
lemma trajectory_eq_cos (IC : InitialConditions) (t : Time) :
IC.trajectory S t =
EuclideanSpace.single 0 ((AmplitudePhase.fromInitialConditions S IC).A *
cos (S.ω * t - (AmplitudePhase.fromInitialConditions S IC).φ)) := by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ trajectory S IC t =
EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))
conv_lhs =>
rw [← AmplitudePhase.toInitialConditions_fromInitialConditions S IC] S:HarmonicOscillatorIC:InitialConditionst:Time| trajectory S (AmplitudePhase.toInitialConditions S (AmplitudePhase.fromInitialConditions S IC)) t
exact AmplitudePhase.toInitialConditions_trajectory_eq_cos S
(AmplitudePhase.fromInitialConditions S IC) t All goals completed! 🐙The velocity of every trajectory is the corresponding shifted sine in amplitude-phase form.
lemma trajectory_velocity_eq_sin (IC : InitialConditions) (t : Time) :
∂ₜ (IC.trajectory S) t =
EuclideanSpace.single 0 (-((AmplitudePhase.fromInitialConditions S IC).A * S.ω *
sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))) := by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ∂ₜ (trajectory S IC) t =
EuclideanSpace.single 0
(-((AmplitudePhase.fromInitialConditions S IC).A * S.ω *
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ)))
conv_lhs =>
rw [← AmplitudePhase.toInitialConditions_fromInitialConditions S IC] S:HarmonicOscillatorIC:InitialConditionst:Time| ∂ₜ (trajectory S (AmplitudePhase.toInitialConditions S (AmplitudePhase.fromInitialConditions S IC))) t
exact AmplitudePhase.toInitialConditions_velocity_eq_sin S
(AmplitudePhase.fromInitialConditions S IC) t All goals completed! 🐙F.2. Times at which the velocity is zero
In amplitude-phase form the velocity is v(t) = -Aω sin (ω t - φ). For nonzero amplitude this
vanishes exactly when sin (ω t - φ) = 0, equivalently when ω t - φ is an
integer multiple of π.
For nonzero amplitude, the velocity vanishes exactly when the sine factor in amplitude-phase form vanishes.
lemma trajectory_velocity_eq_zero_iff_sin_eq_zero (IC : InitialConditions)
(hA : (AmplitudePhase.fromInitialConditions S IC).A ≠ 0) (t : Time) :
∂ₜ (IC.trajectory S) t = 0 ↔
sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 := by S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ ∂ₜ (trajectory S IC) t = 0 ↔ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0
rw [trajectory_velocity_eq_sin S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ EuclideanSpace.single 0
(-((AmplitudePhase.fromInitialConditions S IC).A * S.ω *
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))) =
0 ↔
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ EuclideanSpace.single 0
(-((AmplitudePhase.fromInitialConditions S IC).A * S.ω *
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))) =
0 ↔
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0] S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ EuclideanSpace.single 0
(-((AmplitudePhase.fromInitialConditions S IC).A * S.ω *
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))) =
0 ↔
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0
simp [hA, S.ω_ne_zero] All goals completed! 🐙
For nonzero amplitude, the velocity is zero exactly at phase times φ + nπ.
lemma trajectory_velocity_eq_zero_iff_exists_int (IC : InitialConditions)
(hA : (AmplitudePhase.fromInitialConditions S IC).A ≠ 0) (t : Time) :
∂ₜ (IC.trajectory S) t = 0 ↔
∃ n : ℤ,
(t : ℝ) =
((AmplitudePhase.fromInitialConditions S IC).φ + n * π) / S.ω := by S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ ∂ₜ (trajectory S IC) t = 0 ↔ ∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω
rw [trajectory_velocity_eq_zero_iff_sin_eq_zero S IC hA t S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω] S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω
constructor mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 →
∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ωmpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ (∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω) →
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0
· mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 →
∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω intro h mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0⊢ ∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω
obtain ⟨n, hn⟩ := Real.sin_eq_zero_iff.mp h mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:↑n * π = S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ⊢ ∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω
refine ⟨n, ?_⟩ mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:↑n * π = S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ⊢ t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω
rw [eq_div_iff S.ω_ne_zero, mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:↑n * π = S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ⊢ t.val * S.ω = (AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:↑n * π = S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ⊢ S.ω * t.val = (AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π mul_comm mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:↑n * π = S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ⊢ S.ω * t.val = (AmplitudePhase.fromInitialConditions S IC).φ + ↑n * πmp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:↑n * π = S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ⊢ S.ω * t.val = (AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π]mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:↑n * π = S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ⊢ S.ω * t.val = (AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π
linarith All goals completed! 🐙
· mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ (∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω) →
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 rintro ⟨n, hn⟩ mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0
rw [Real.sin_eq_zero_iff, mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω⊢ ∃ n, ↑n * π = S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω⊢ ∃ n_1,
↑n_1 * π =
S.ω * (((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω) -
(AmplitudePhase.fromInitialConditions S IC).φ hn mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω⊢ ∃ n_1,
↑n_1 * π =
S.ω * (((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω) -
(AmplitudePhase.fromInitialConditions S IC).φmpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω⊢ ∃ n_1,
↑n_1 * π =
S.ω * (((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω) -
(AmplitudePhase.fromInitialConditions S IC).φ]mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω⊢ ∃ n_1,
↑n_1 * π =
S.ω * (((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω) -
(AmplitudePhase.fromInitialConditions S IC).φ
refine ⟨n, ?_⟩ mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω⊢ ↑n * π =
S.ω * (((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω) - (AmplitudePhase.fromInitialConditions S IC).φ
field_simp [S.ω_ne_zero] mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π) / S.ω⊢ ↑n * π = (AmplitudePhase.fromInitialConditions S IC).φ + ↑n * π - (AmplitudePhase.fromInitialConditions S IC).φ
ring All goals completed! 🐙F.3. The position when the velocity is zero
The zeros of the velocity are the turning points of the oscillator. In amplitude-phase form,
these are the times when sin (ω t - φ) = 0; equivalently, cos (ω t - φ) is 1 or -1.
At exactly those times the trajectory has maximal norm, equal to the amplitude A.
The statement also covers the degenerate case A = 0: then the trajectory and its velocity are
identically zero, so both sides of the equivalence hold at every time.
The velocity vanishes exactly when the trajectory has norm equal to the amplitude.
lemma trajectory_velocity_eq_zero_iff_norm_eq_amplitude (IC : InitialConditions)
(t : Time) :
∂ₜ (IC.trajectory S) t = 0 ↔
‖IC.trajectory S t‖ = (AmplitudePhase.fromInitialConditions S IC).A := by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ∂ₜ (trajectory S IC) t = 0 ↔ ‖trajectory S IC t‖ = (AmplitudePhase.fromInitialConditions S IC).A
by_cases hA : (AmplitudePhase.fromInitialConditions S IC).A = 0 pos S:HarmonicOscillatorIC:InitialConditionst:TimehA:(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ ∂ₜ (trajectory S IC) t = 0 ↔ ‖trajectory S IC t‖ = (AmplitudePhase.fromInitialConditions S IC).Aneg S:HarmonicOscillatorIC:InitialConditionst:TimehA:¬(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ ∂ₜ (trajectory S IC) t = 0 ↔ ‖trajectory S IC t‖ = (AmplitudePhase.fromInitialConditions S IC).A
· pos S:HarmonicOscillatorIC:InitialConditionst:TimehA:(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ ∂ₜ (trajectory S IC) t = 0 ↔ ‖trajectory S IC t‖ = (AmplitudePhase.fromInitialConditions S IC).A rw [trajectory_velocity_eq_sin, pos S:HarmonicOscillatorIC:InitialConditionst:TimehA:(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ EuclideanSpace.single 0
(-((AmplitudePhase.fromInitialConditions S IC).A * S.ω *
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))) =
0 ↔
‖trajectory S IC t‖ = (AmplitudePhase.fromInitialConditions S IC).A pos S:HarmonicOscillatorIC:InitialConditionst:TimehA:(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ EuclideanSpace.single 0
(-((AmplitudePhase.fromInitialConditions S IC).A * S.ω *
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))) =
0 ↔
‖EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))‖ =
(AmplitudePhase.fromInitialConditions S IC).A trajectory_eq_cos pos S:HarmonicOscillatorIC:InitialConditionst:TimehA:(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ EuclideanSpace.single 0
(-((AmplitudePhase.fromInitialConditions S IC).A * S.ω *
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))) =
0 ↔
‖EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))‖ =
(AmplitudePhase.fromInitialConditions S IC).A pos S:HarmonicOscillatorIC:InitialConditionst:TimehA:(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ EuclideanSpace.single 0
(-((AmplitudePhase.fromInitialConditions S IC).A * S.ω *
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))) =
0 ↔
‖EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))‖ =
(AmplitudePhase.fromInitialConditions S IC).A]pos S:HarmonicOscillatorIC:InitialConditionst:TimehA:(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ EuclideanSpace.single 0
(-((AmplitudePhase.fromInitialConditions S IC).A * S.ω *
Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))) =
0 ↔
‖EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))‖ =
(AmplitudePhase.fromInitialConditions S IC).A
simp [hA] All goals completed! 🐙
rw [trajectory_velocity_eq_zero_iff_sin_eq_zero S IC hA t, neg S:HarmonicOscillatorIC:InitialConditionst:TimehA:¬(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
‖trajectory S IC t‖ = (AmplitudePhase.fromInitialConditions S IC).A neg S:HarmonicOscillatorIC:InitialConditionst:TimehA:¬(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
‖EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))‖ =
(AmplitudePhase.fromInitialConditions S IC).A trajectory_eq_cos neg S:HarmonicOscillatorIC:InitialConditionst:TimehA:¬(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
‖EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))‖ =
(AmplitudePhase.fromInitialConditions S IC).Aneg S:HarmonicOscillatorIC:InitialConditionst:TimehA:¬(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
‖EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))‖ =
(AmplitudePhase.fromInitialConditions S IC).A]neg S:HarmonicOscillatorIC:InitialConditionst:TimehA:¬(AmplitudePhase.fromInitialConditions S IC).A = 0⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
‖EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))‖ =
(AmplitudePhase.fromInitialConditions S IC).A
set A := (AmplitudePhase.fromInitialConditions S IC).A neg S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0⊢ Real.sin (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
‖EuclideanSpace.single 0 (A * Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ))‖ = A
set θ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ neg S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ⊢ Real.sin θ = 0 ↔ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A
show sin θ = 0 ↔ ‖EuclideanSpace.single 0 (A * cos θ)‖ = A neg S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ⊢ Real.sin θ = 0 ↔ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A
have hA' : A ≠ 0 := by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ∂ₜ (trajectory S IC) t = 0 ↔ ‖trajectory S IC t‖ = (AmplitudePhase.fromInitialConditions S IC).A neg S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0⊢ Real.sin θ = 0 ↔ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A simpa [A] using hAneg S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0⊢ Real.sin θ = 0 ↔ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Aneg S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0⊢ Real.sin θ = 0 ↔ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A
have hA_nonneg : 0 ≤ A := norm_nonneg (⟨IC.x₀ 0, IC.v₀ 0 / S.ω⟩ : ℂ) neg S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ A⊢ Real.sin θ = 0 ↔ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A
have hA_pos : 0 < A := lt_of_le_of_ne hA_nonneg (Ne.symm hA') neg S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < A⊢ Real.sin θ = 0 ↔ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A
constructor neg.mp S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < A⊢ Real.sin θ = 0 → ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Aneg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < A⊢ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A → Real.sin θ = 0
· neg.mp S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < A⊢ Real.sin θ = 0 → ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A intro hsin neg.mp S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahsin:Real.sin θ = 0⊢ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A
rcases Real.sin_eq_zero_iff_cos_eq.mp hsin with hcos | hcos neg.mp.inl S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahsin:Real.sin θ = 0hcos:Real.cos θ = 1⊢ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Aneg.mp.inr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahsin:Real.sin θ = 0hcos:Real.cos θ = -1⊢ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A <;> neg.mp.inl S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahsin:Real.sin θ = 0hcos:Real.cos θ = 1⊢ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Aneg.mp.inr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahsin:Real.sin θ = 0hcos:Real.cos θ = -1⊢ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A
simp [hcos, abs_of_pos hA_pos] All goals completed! 🐙
· neg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < A⊢ ‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A → Real.sin θ = 0 intro hnorm neg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = A⊢ Real.sin θ = 0
have hnorm' : |A * cos θ| = A := by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ∂ₜ (trajectory S IC) t = 0 ↔ ‖trajectory S IC t‖ = (AmplitudePhase.fromInitialConditions S IC).A neg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':|A * Real.cos θ| = A⊢ Real.sin θ = 0
simpa using hnormneg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':|A * Real.cos θ| = A⊢ Real.sin θ = 0neg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':|A * Real.cos θ| = A⊢ Real.sin θ = 0
have hcos_abs : |cos θ| = 1 := by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ ∂ₜ (trajectory S IC) t = 0 ↔ ‖trajectory S IC t‖ = (AmplitudePhase.fromInitialConditions S IC).A neg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':|A * Real.cos θ| = Ahcos_abs:|Real.cos θ| = 1⊢ Real.sin θ = 0
rw [abs_mul, S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':|A| * |Real.cos θ| = A⊢ |Real.cos θ| = 1 S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':A * |Real.cos θ| = A⊢ |Real.cos θ| = 1neg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':|A * Real.cos θ| = Ahcos_abs:|Real.cos θ| = 1⊢ Real.sin θ = 0 abs_of_pos hA_pos S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':A * |Real.cos θ| = A⊢ |Real.cos θ| = 1 S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':A * |Real.cos θ| = A⊢ |Real.cos θ| = 1neg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':|A * Real.cos θ| = Ahcos_abs:|Real.cos θ| = 1⊢ Real.sin θ = 0] at hnorm' S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':A * |Real.cos θ| = A⊢ |Real.cos θ| = 1neg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':|A * Real.cos θ| = Ahcos_abs:|Real.cos θ| = 1⊢ Real.sin θ = 0
exact mul_left_cancel₀ hA' (hnorm'.trans (mul_one A).symm)neg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':|A * Real.cos θ| = Ahcos_abs:|Real.cos θ| = 1⊢ Real.sin θ = 0neg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':|A * Real.cos θ| = Ahcos_abs:|Real.cos θ| = 1⊢ Real.sin θ = 0
obtain ⟨n, hn⟩ := Real.abs_cos_eq_one_iff.mp hcos_abs neg.mpr S:HarmonicOscillatorIC:InitialConditionst:TimeA:ℝ := (AmplitudePhase.fromInitialConditions S IC).AhA:¬A = 0θ:ℝ := S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φhA':A ≠ 0hA_nonneg:0 ≤ AhA_pos:0 < Ahnorm:‖EuclideanSpace.single 0 (A * Real.cos θ)‖ = Ahnorm':|A * Real.cos θ| = Ahcos_abs:|Real.cos θ| = 1n:ℤhn:↑n * π = θ⊢ Real.sin θ = 0
exact Real.sin_eq_zero_iff.mpr ⟨n, hn⟩ All goals completed! 🐙F.4. Times at which the trajectory passes through zero
In amplitude-phase form the trajectory is x(t) = A cos (ω t - φ). For nonzero amplitude this
vanishes exactly when cos (ω t - φ) = 0, equivalently when the phase is an odd multiple
of π / 2.
For nonzero amplitude, the trajectory passes through zero exactly when the cosine factor in amplitude-phase form vanishes.
lemma trajectory_eq_zero_iff_cos_eq_zero (IC : InitialConditions)
(hA : (AmplitudePhase.fromInitialConditions S IC).A ≠ 0) (t : Time) :
IC.trajectory S t = 0 ↔
cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 := by S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ trajectory S IC t = 0 ↔ Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0
rw [trajectory_eq_cos S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ)) =
0 ↔
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ)) =
0 ↔
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0] S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ EuclideanSpace.single 0
((AmplitudePhase.fromInitialConditions S IC).A *
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ)) =
0 ↔
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0
simp [hA] All goals completed! 🐙
For nonzero amplitude, the trajectory passes through zero exactly at phase times
φ + (2n + 1)π / 2.
lemma trajectory_eq_zero_iff_exists_int (IC : InitialConditions)
(hA : (AmplitudePhase.fromInitialConditions S IC).A ≠ 0) (t : Time) :
IC.trajectory S t = 0 ↔
∃ n : ℤ,
(t : ℝ) =
((AmplitudePhase.fromInitialConditions S IC).φ + (2 * n + 1) * π / 2) / S.ω := by S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ trajectory S IC t = 0 ↔ ∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω
rw [trajectory_eq_zero_iff_cos_eq_zero S IC hA t S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω] S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 ↔
∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω
constructor mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 →
∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ωmpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ (∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω) →
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0
· mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 →
∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω intro h mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0⊢ ∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω
obtain ⟨n, hn⟩ := Real.cos_eq_zero_iff.mp h mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ = (2 * ↑n + 1) * π / 2⊢ ∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω
refine ⟨n, ?_⟩ mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ = (2 * ↑n + 1) * π / 2⊢ t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω
rw [eq_div_iff S.ω_ne_zero, mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ = (2 * ↑n + 1) * π / 2⊢ t.val * S.ω = (AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2 mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ = (2 * ↑n + 1) * π / 2⊢ S.ω * t.val = (AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2 mul_comm mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ = (2 * ↑n + 1) * π / 2⊢ S.ω * t.val = (AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ = (2 * ↑n + 1) * π / 2⊢ S.ω * t.val = (AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2]mp S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timeh:Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0n:ℤhn:S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ = (2 * ↑n + 1) * π / 2⊢ S.ω * t.val = (AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2
linarith All goals completed! 🐙
· mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Time⊢ (∃ n, t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω) →
Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0 rintro ⟨n, hn⟩ mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω⊢ Real.cos (S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ) = 0
rw [Real.cos_eq_zero_iff, mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω⊢ ∃ k, S.ω * t.val - (AmplitudePhase.fromInitialConditions S IC).φ = (2 * ↑k + 1) * π / 2 mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω⊢ ∃ k,
S.ω * (((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω) -
(AmplitudePhase.fromInitialConditions S IC).φ =
(2 * ↑k + 1) * π / 2 hn mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω⊢ ∃ k,
S.ω * (((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω) -
(AmplitudePhase.fromInitialConditions S IC).φ =
(2 * ↑k + 1) * π / 2mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω⊢ ∃ k,
S.ω * (((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω) -
(AmplitudePhase.fromInitialConditions S IC).φ =
(2 * ↑k + 1) * π / 2]mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω⊢ ∃ k,
S.ω * (((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω) -
(AmplitudePhase.fromInitialConditions S IC).φ =
(2 * ↑k + 1) * π / 2
refine ⟨n, ?_⟩ mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω⊢ S.ω * (((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω) -
(AmplitudePhase.fromInitialConditions S IC).φ =
(2 * ↑n + 1) * π / 2
field_simp [S.ω_ne_zero] mpr S:HarmonicOscillatorIC:InitialConditionshA:(AmplitudePhase.fromInitialConditions S IC).A ≠ 0t:Timen:ℤhn:t.val = ((AmplitudePhase.fromInitialConditions S IC).φ + (2 * ↑n + 1) * π / 2) / S.ω⊢ (AmplitudePhase.fromInitialConditions S IC).φ * 2 + (2 * ↑n + 1) * π -
(AmplitudePhase.fromInitialConditions S IC).φ * 2 =
(2 * ↑n + 1) * π
ring All goals completed! 🐙G. Periodicity and recurrence
Every trajectory is a shifted cosine of angular frequency ω, so it repeats after a fixed period
T = 2π / ω. We record the period, show the trajectory is periodic, and prove that — for
non-trivial initial data — the trajectory returns to its initial position and velocity exactly at
integer multiples of the period.
G.1. The period
The period T = 2π / ω is the time for one complete oscillation; it is positive since ω > 0.
@[inherit_doc period]
scoped notation "T" => HarmonicOscillator.periodlemma period_eq : T S = 2 * π / S.ω := rfllemma period_pos : 0 < T S := div_pos (by S:HarmonicOscillator⊢ 0 < 2 * π positivity All goals completed! 🐙) S.ω_posG.2. Periodicity of the trajectory
The trajectory satisfies x(t + T) = x(t): advancing time by one period shifts the phase ω t
by 2π, leaving cos and sin unchanged.
The trajectory of the harmonic oscillator is periodic with period of 2 * π / ω.
lemma trajectory_periodic (IC : InitialConditions) :
Function.Periodic (IC.trajectory S) (T S) := fun t ↦ by S:HarmonicOscillatorIC:InitialConditionst:Time⊢ InitialConditions.trajectory S IC (t + { val := T S }) = InitialConditions.trajectory S IC t
have h : S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π := by
have := S.ω_ne_zero S:HarmonicOscillatorIC:InitialConditionst:Timethis:S.ω ≠ 0⊢ S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ InitialConditions.trajectory S IC (t + { val := T S }) = InitialConditions.trajectory S IC t
ring_nf S:HarmonicOscillatorIC:InitialConditionst:Timethis:S.ω ≠ 0⊢ S.ω * t.val + S.ω * π * S.ω⁻¹ * 2 = S.ω * t.val + π * 2 S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ InitialConditions.trajectory S IC (t + { val := T S }) = InitialConditions.trajectory S IC t; field_simp S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ InitialConditions.trajectory S IC (t + { val := T S }) = InitialConditions.trajectory S IC t S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ InitialConditions.trajectory S IC (t + { val := T S }) = InitialConditions.trajectory S IC t
rw [InitialConditions.trajectory, S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * (t + { val := T S }).val) • IC.x₀ + (Real.sin (S.ω * (t + { val := T S }).val) / S.ω) • IC.v₀ =
InitialConditions.trajectory S IC t S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀ = InitialConditions.trajectory S IC t add_val, S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * (t.val + { val := T S }.val)) • IC.x₀ + (Real.sin (S.ω * (t.val + { val := T S }.val)) / S.ω) • IC.v₀ =
InitialConditions.trajectory S IC t S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀ = InitialConditions.trajectory S IC t period_eq, S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * (t.val + { val := 2 * π / S.ω }.val)) • IC.x₀ +
(Real.sin (S.ω * (t.val + { val := 2 * π / S.ω }.val)) / S.ω) • IC.v₀ =
InitialConditions.trajectory S IC t S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀ = InitialConditions.trajectory S IC t h, S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * t.val + 2 * π) • IC.x₀ + (Real.sin (S.ω * t.val + 2 * π) / S.ω) • IC.v₀ =
InitialConditions.trajectory S IC t S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀ = InitialConditions.trajectory S IC t cos_add_two_pi, S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val + 2 * π) / S.ω) • IC.v₀ = InitialConditions.trajectory S IC t S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀ = InitialConditions.trajectory S IC t sin_add_two_pi S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀ = InitialConditions.trajectory S IC t S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀ = InitialConditions.trajectory S IC t] S:HarmonicOscillatorIC:InitialConditionst:Timeh:S.ω * (t.val + 2 * π / S.ω) = S.ω * t.val + 2 * π⊢ Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀ = InitialConditions.trajectory S IC t
rfl All goals completed! 🐙G.3. Return to the initial state
For non-trivial initial data, the trajectory returns to its initial position and velocity only at integer multiples of the period.
Assuming that the initial coordinate and velocity are not simultaneously zero, the time stamps when the harmonic oscillator returns to its initial coordinate and velocity is a multiple of its period
lemma return_time (IC : InitialConditions) (non_trivial : IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0)
(t : Time) (ht : IC.trajectory S t = IC.x₀ ∧ ∂ₜ (IC.trajectory S) t = IC.v₀) :
∃ n : ℤ, (n : ℝ) * (T S) = t := by S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀⊢ ∃ n, ↑n * T S = t.val
have htx := ht.left S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀htx:InitialConditions.trajectory S IC t = IC.x₀⊢ ∃ n, ↑n * T S = t.val
have htv := ht.right S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀htx:InitialConditions.trajectory S IC t = IC.x₀htv:∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀⊢ ∃ n, ↑n * T S = t.val
rw [InitialConditions.trajectory_eq S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀htx:(fun t => Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t = IC.x₀htv:∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀⊢ ∃ n, ↑n * T S = t.val S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀htx:(fun t => Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t = IC.x₀htv:∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀⊢ ∃ n, ↑n * T S = t.val] at htx S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀htx:(fun t => Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t = IC.x₀htv:∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀⊢ ∃ n, ↑n * T S = t.val
rw [InitialConditions.trajectory_velocity S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀htx:(fun t => Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t = IC.x₀htv:(fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀) t = IC.v₀⊢ ∃ n, ↑n * T S = t.val S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀htx:(fun t => Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t = IC.x₀htv:(fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀) t = IC.v₀⊢ ∃ n, ↑n * T S = t.val] at htv S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀htx:(fun t => Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀) t = IC.x₀htv:(fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀) t = IC.v₀⊢ ∃ n, ↑n * T S = t.val
simp at htx S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀htx:Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀ = IC.x₀htv:(fun t => -S.ω • Real.sin (S.ω * t.val) • IC.x₀ + Real.cos (S.ω * t.val) • IC.v₀) t = IC.v₀⊢ ∃ n, ↑n * T S = t.val
simp at htv S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀htx:Real.cos (S.ω * t.val) • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + Real.cos (S.ω * t.val) • IC.v₀ = IC.v₀⊢ ∃ n, ↑n * T S = t.val
set c := cos (S.ω * t) S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)htx:c • IC.x₀ + (Real.sin (S.ω * t.val) / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • Real.sin (S.ω * t.val) • IC.x₀) + c • IC.v₀ = IC.v₀⊢ ∃ n, ↑n * T S = t.val
set s := sin (S.ω * t) S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀⊢ ∃ n, ↑n * T S = t.val
set xx := inner ℝ IC.x₀ IC.x₀ S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀⊢ ∃ n, ↑n * T S = t.val
set vv := inner ℝ IC.v₀ IC.v₀ S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀⊢ ∃ n, ↑n * T S = t.val
set xv := inner ℝ IC.x₀ IC.v₀ S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀⊢ ∃ n, ↑n * T S = t.val
set det := vv + xx * S.ω^2 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2⊢ ∃ n, ↑n * T S = t.val
have hxx0 : 0 ≤ xx := real_inner_self_nonneg S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xx⊢ ∃ n, ↑n * T S = t.val
have hvv0 : 0 ≤ vv := real_inner_self_nonneg S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vv⊢ ∃ n, ↑n * T S = t.val
have hω2 : 0 < S.ω ^ 2 := pow_pos S.ω_pos 2 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2⊢ ∃ n, ↑n * T S = t.val
have zero_lt_det : 0 < det := by
show 0 < vv + xx * S.ω ^ 2 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2⊢ 0 < vv + xx * S.ω ^ 2 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < det⊢ ∃ n, ↑n * T S = t.val
rcases non_trivial with hx | hv inl S:HarmonicOscillatorIC:InitialConditionst:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2hx:IC.x₀ ≠ 0⊢ 0 < vv + xx * S.ω ^ 2inr S:HarmonicOscillatorIC:InitialConditionst:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2hv:IC.v₀ ≠ 0⊢ 0 < vv + xx * S.ω ^ 2 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < det⊢ ∃ n, ↑n * T S = t.val
· inl S:HarmonicOscillatorIC:InitialConditionst:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2hx:IC.x₀ ≠ 0⊢ 0 < vv + xx * S.ω ^ 2 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < det⊢ ∃ n, ↑n * T S = t.val nlinarith [real_inner_self_pos.mpr hx] All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < det⊢ ∃ n, ↑n * T S = t.val
· inr S:HarmonicOscillatorIC:InitialConditionst:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2hv:IC.v₀ ≠ 0⊢ 0 < vv + xx * S.ω ^ 2 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < det⊢ ∃ n, ↑n * T S = t.val nlinarith [real_inner_self_pos.mpr hv] S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < det⊢ ∃ n, ↑n * T S = t.val S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < det⊢ ∃ n, ↑n * T S = t.val
have det_ne_zero : det ≠ 0 := zero_lt_det.ne' S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0⊢ ∃ n, ↑n * T S = t.val
have hxx : c * xx + (s / S.ω) * xv = xx := by
have h := congrArg (inner ℝ IC.x₀) htx S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0h:Inner.inner ℝ IC.x₀ (c • IC.x₀ + (s / S.ω) • IC.v₀) = Inner.inner ℝ IC.x₀ IC.x₀⊢ c * xx + s / S.ω * xv = xx S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xx⊢ ∃ n, ↑n * T S = t.val
simpa only [inner_add_right, real_inner_smul_right] using h S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xx⊢ ∃ n, ↑n * T S = t.val S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xx⊢ ∃ n, ↑n * T S = t.val
have hvv : - S.ω * s * xv + c * vv = vv := by
have h := congrArg (fun w => inner ℝ w IC.v₀) htv S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxh:Inner.inner ℝ (-(S.ω • s • IC.x₀) + c • IC.v₀) IC.v₀ = Inner.inner ℝ IC.v₀ IC.v₀⊢ -S.ω * s * xv + c * vv = vv S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vv⊢ ∃ n, ↑n * T S = t.val
simpa only [inner_add_left, inner_neg_left, real_inner_smul_left, neg_mul, mul_assoc] using h S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vv⊢ ∃ n, ↑n * T S = t.val S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vv⊢ ∃ n, ↑n * T S = t.val
have hcos : 1 = cos (S.ω * t) := by
calc
1 = det / det := by S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vv⊢ 1 = det / det S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val simp only [ne_eq, det_ne_zero, not_false_eq_true, div_self] All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val
_ = (vv + xx * S.ω^2 ) / det := by S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vv⊢ det / det = (vv + xx * S.ω ^ 2) / det S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val rfl All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val
_ = c * ((vv + xx * S.ω^2) / det) + s * xv *S.ω* (S.ω/S.ω-1 ) / det := by S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vv⊢ (vv + xx * S.ω ^ 2) / det = c * ((vv + xx * S.ω ^ 2) / det) + s * xv * S.ω * (S.ω / S.ω - 1) / det S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val
nth_rewrite 1 [← hvv, ← hxx] S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vv⊢ (-S.ω * s * xv + c * vv + (c * xx + s / S.ω * xv) * S.ω ^ 2) / det =
c * ((vv + xx * S.ω ^ 2) / det) + s * xv * S.ω * (S.ω / S.ω - 1) / det S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val
ring_nf All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val
_ = c * ((vv + xx * S.ω^2) / det ) := by S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vv⊢ c * ((vv + xx * S.ω ^ 2) / det) + s * xv * S.ω * (S.ω / S.ω - 1) / det = c * ((vv + xx * S.ω ^ 2) / det) S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val
simp only [ne_eq, S.ω_ne_zero, not_false_eq_true,
div_self, sub_self, mul_zero, zero_div, add_zero] All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val
_ = c * (det / det) := by S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vv⊢ c * ((vv + xx * S.ω ^ 2) / det) = c * (det / det) S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val rfl All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val
_ = c := by S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vv⊢ c * (det / det) = c S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val simp only [ne_eq, det_ne_zero, not_false_eq_true, div_self, mul_one] All goals completed! 🐙 S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val
_ = _ := by S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vv⊢ c = Real.cos (S.ω * t.val) S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val rfl S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)⊢ ∃ n, ↑n * T S = t.val
obtain ⟨n, hn⟩ := (Real.cos_eq_one_iff (S.ω * t)).mp hcos.symm S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)n:ℤhn:↑n * (2 * π) = S.ω * t.val⊢ ∃ n, ↑n * T S = t.val
refine ⟨n, ?_⟩ S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)n:ℤhn:↑n * (2 * π) = S.ω * t.val⊢ ↑n * T S = t.val
rw [period_eq S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)n:ℤhn:↑n * (2 * π) = S.ω * t.val⊢ ↑n * (2 * π / S.ω) = t.val S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)n:ℤhn:↑n * (2 * π) = S.ω * t.val⊢ ↑n * (2 * π / S.ω) = t.val] S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)n:ℤhn:↑n * (2 * π) = S.ω * t.val⊢ ↑n * (2 * π / S.ω) = t.val
field_simp [S.ω_ne_zero] S:HarmonicOscillatorIC:InitialConditionsnon_trivial:IC.x₀ ≠ 0 ∨ IC.v₀ ≠ 0t:Timeht:InitialConditions.trajectory S IC t = IC.x₀ ∧ ∂ₜ (InitialConditions.trajectory S IC) t = IC.v₀c:ℝ := Real.cos (S.ω * t.val)s:ℝ := Real.sin (S.ω * t.val)htx:c • IC.x₀ + (s / S.ω) • IC.v₀ = IC.x₀htv:-(S.ω • s • IC.x₀) + c • IC.v₀ = IC.v₀xx:ℝ := Inner.inner ℝ IC.x₀ IC.x₀vv:ℝ := Inner.inner ℝ IC.v₀ IC.v₀xv:ℝ := Inner.inner ℝ IC.x₀ IC.v₀det:ℝ := vv + xx * S.ω ^ 2hxx0:0 ≤ xxhvv0:0 ≤ vvhω2:0 < S.ω ^ 2zero_lt_det:0 < detdet_ne_zero:det ≠ 0hxx:c * xx + s / S.ω * xv = xxhvv:-S.ω * s * xv + c * vv = vvhcos:1 = Real.cos (S.ω * t.val)n:ℤhn:↑n * (2 * π) = S.ω * t.val⊢ ↑n * 2 * π = S.ω * t.val
linear_combination hn All goals completed! 🐙