Imports
/-
Copyright (c) 2026 Giuseppe Sorge. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Giuseppe Sorge
-/
module
public import Physlib.ClassicalMechanics.RigidBody.Basic
public import Physlib.SpaceAndTime.Time.Derivatives
public import Physlib.SpaceAndTime.Time.MatrixDerivatives
public import Mathlib.LinearAlgebra.UnitaryGroupRigid body motion
The static RigidBody records a body-fixed mass distribution. To describe a rigid body in
motion we record, in addition, the trajectory of its centre of mass in the inertial frame and the
body's time-dependent orientation (a rotation about the centre of mass).
From this configuration we define the velocity of the centre of mass and the body's linear momentum. The reference point is taken to be the centre of mass, following the decomposition of a rigid motion into a translation of the centre of mass plus a rotation about it.
References
Landau and Lifshitz, Mechanics, Section 32.
@[expose] public sectionattribute [local instance] Matrix.linftyOpNormedAddCommGroup Matrix.linftyOpNormedSpace
Matrix.linftyOpNormedRing Matrix.linftyOpNormedAlgebra
A motion of a rigid body in d-dimensional space: the body together with the inertial-frame
trajectory of its centre of mass and its time-dependent orientation (a rotation about the centre
of mass).
The position of the centre of mass in the inertial frame as a function of time.
The orientation of the body, a rotation about the centre of mass, as a function of time.
structure RigidBodyMotion (d : ℕ) extends RigidBody d where comTrajectory : Time → Space d orientation : Time → Matrix.specialOrthogonalGroup (Fin d) ℝ
The orientation matrix is special orthogonal, so R Rᵀ = 1.
lemma orientation_mul_transpose {d : ℕ} (M : RigidBodyMotion d) (t : Time) :
(M.orientation t).1 * ((M.orientation t).1)ᵀ = 1 :=
(mem_orthogonalGroup_iff (Fin d) ℝ).mp
(mem_specialOrthogonalGroup_iff.mp (M.orientation t).2).1lemma centerOfMassVelocity_eq {d : ℕ} (M : RigidBodyMotion d) :
M.centerOfMassVelocity = ∂ₜ M.comTrajectory := rflA rigid body whose centre of mass is stationary has zero centre-of-mass velocity.
d:ℕM:RigidBodyMotion dc:Space dh:M.comTrajectory = fun x => c⊢ (∂ₜ fun x => c) = 0
funext t d:ℕM:RigidBodyMotion dc:Space dh:M.comTrajectory = fun x => ct:Time⊢ ∂ₜ (fun x => c) t = 0 t
exact Time.deriv_const c All goals completed! 🐙lemma linearMomentum_eq {d : ℕ} (M : RigidBodyMotion d) :
M.linearMomentum = fun t => M.mass • M.centerOfMassVelocity t := rflTODO "Define an action of the rotation and translation groups on `RigidBodyMotion`, and recover
`displacement` as the composite of those group actions."
The k-th coordinate of the rigid displacement applied to y.
lemma displacement_apply {d : ℕ} (M : RigidBodyMotion d) (t : Time) (y : Space d) (k : Fin d) :
M.displacement t y k =
(∑ j, (M.orientation t).val k j * (y j - M.centerOfMass j)) + M.comTrajectory t k := rfllemma displacement_contDiff {d : ℕ} (M : RigidBodyMotion d) (t : Time) :
ContDiff ℝ ⊤ (M.displacement t) := by d:ℕM:RigidBodyMotion dt:Time⊢ ContDiff ℝ ⊤ (M.displacement t)
unfold displacement d:ℕM:RigidBodyMotion dt:Time⊢ ContDiff ℝ ⊤ fun y =>
{ val := fun k => ∑ j, ↑(M.orientation t) k j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory t).val k }
fun_prop All goals completed! 🐙
Rotating the body-frame position of y relative to the centre of mass gives its
inertial-frame position relative to the moving centre of mass:
R(t) (y − c) = displacement t y − comTrajectory t.
lemma orientation_mulVec_sub_centerOfMass {d : ℕ} (M : RigidBodyMotion d) (t : Time)
(y : Space d) :
(M.orientation t).1 *ᵥ (fun j => y j - M.centerOfMass j)
= fun j => M.displacement t y j - M.comTrajectory t j := by d:ℕM:RigidBodyMotion dt:Timey:Space d⊢ (↑(M.orientation t) *ᵥ fun j => y.val j - M.centerOfMass.val j) = fun j =>
(M.displacement t y).val j - (M.comTrajectory t).val j
funext k d:ℕM:RigidBodyMotion dt:Timey:Space dk:Fin d⊢ (↑(M.orientation t) *ᵥ fun j => y.val j - M.centerOfMass.val j) k =
(M.displacement t y).val k - (M.comTrajectory t).val k
show ((M.orientation t).1 *ᵥ fun j => y j - M.centerOfMass j) k
= M.displacement t y k - M.comTrajectory t k d:ℕM:RigidBodyMotion dt:Timey:Space dk:Fin d⊢ (↑(M.orientation t) *ᵥ fun j => y.val j - M.centerOfMass.val j) k =
(M.displacement t y).val k - (M.comTrajectory t).val k
rw [eq_sub_iff_add_eq, d:ℕM:RigidBodyMotion dt:Timey:Space dk:Fin d⊢ (↑(M.orientation t) *ᵥ fun j => y.val j - M.centerOfMass.val j) k + (M.comTrajectory t).val k =
(M.displacement t y).val k d:ℕM:RigidBodyMotion dt:Timey:Space dk:Fin d⊢ (↑(M.orientation t) *ᵥ fun j => y.val j - M.centerOfMass.val j) k + (M.comTrajectory t).val k =
∑ j, ↑(M.orientation t) k j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory t).val k displacement_apply d:ℕM:RigidBodyMotion dt:Timey:Space dk:Fin d⊢ (↑(M.orientation t) *ᵥ fun j => y.val j - M.centerOfMass.val j) k + (M.comTrajectory t).val k =
∑ j, ↑(M.orientation t) k j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory t).val k d:ℕM:RigidBodyMotion dt:Timey:Space dk:Fin d⊢ (↑(M.orientation t) *ᵥ fun j => y.val j - M.centerOfMass.val j) k + (M.comTrajectory t).val k =
∑ j, ↑(M.orientation t) k j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory t).val k] d:ℕM:RigidBodyMotion dt:Timey:Space dk:Fin d⊢ (↑(M.orientation t) *ᵥ fun j => y.val j - M.centerOfMass.val j) k + (M.comTrajectory t).val k =
∑ j, ↑(M.orientation t) k j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory t).val k
rfl All goals completed! 🐙
The motion preserves the total mass: the mass distribution at any time t has the same total
mass as the body.
@[simp]
lemma massDistribution_mass {d : ℕ} (M : RigidBodyMotion d) (t : Time) :
(M.massDistribution t).mass = M.mass := by d:ℕM:RigidBodyMotion dt:Time⊢ (M.massDistribution t).mass = M.mass
simp only [RigidBody.mass, massDistribution, LinearMap.coe_mk, AddHom.coe_mk] d:ℕM:RigidBodyMotion dt:Time⊢ M.ρ (ContMDiffMap.comp ⟨fun x => 1, ⋯⟩ ⟨M.displacement t, ⋯⟩) = M.ρ ⟨fun x => 1, ⋯⟩
congr 1 All goals completed! 🐙Evaluation commutes with finite sums of smooth functions.
private lemma contMDiffMap_sum_apply {d : ℕ} {ι : Type*} (s : Finset ι)
(f : ι → C^⊤⟮𝓘(ℝ, Space d), Space d; 𝓘(ℝ, ℝ), ℝ⟯) (y : Space d) :
(∑ j ∈ s, f j) y = ∑ j ∈ s, f j y := by d:ℕι:Type u_1s:Finset ιf:ι → C^⊤⟮𝓘(ℝ, Space d), Space d; 𝓘(ℝ, ℝ), ℝ⟯y:Space d⊢ (∑ j ∈ s, f j) y = ∑ j ∈ s, (f j) y
classical
induction s using Finset.induction with
| empty => empty d:ℕι:Type u_1f:ι → C^⊤⟮𝓘(ℝ, Space d), Space d; 𝓘(ℝ, ℝ), ℝ⟯y:Space d⊢ (∑ j ∈ ∅, f j) y = ∑ j ∈ ∅, (f j) y simp All goals completed! 🐙
| insert a s ha ih => insert d:ℕι:Type u_1f:ι → C^⊤⟮𝓘(ℝ, Space d), Space d; 𝓘(ℝ, ℝ), ℝ⟯y:Space da:ιs:Finset ιha:a ∉ sih:(∑ j ∈ s, f j) y = ∑ j ∈ s, (f j) y⊢ (∑ j ∈ insert a s, f j) y = ∑ j ∈ insert a s, (f j) y
simp only [Finset.sum_insert ha, ContMDiffMap.coe_add, Pi.add_apply, ih] All goals completed! 🐙
The centre of mass of the moving mass distribution tracks the prescribed trajectory: for a
body of nonzero mass, the centre of mass of massDistribution M t is exactly comTrajectory t.
This is the decisive check that comTrajectory and orientation are wired correctly in
RigidBodyMotion.
lemma massDistribution_centerOfMass {d : ℕ} (M : RigidBodyMotion d) (t : Time) (h : M.mass ≠ 0) :
(M.massDistribution t).centerOfMass = M.comTrajectory t := by d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0⊢ (M.massDistribution t).centerOfMass = M.comTrajectory t
ext i d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin d⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i
have hdecomp :
ContMDiffMap.comp (cmap (fun x => x i) (by d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin d⊢ ContDiff ℝ ⊤ fun x => x.val i d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i fun_prop All goals completed! 🐙 d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i))
⟨M.displacement t, (M.displacement_contDiff t).contMDiff⟩
= (∑ j, (M.orientation t).val i j •
cmap (fun y => y j - M.centerOfMass j) (by d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dj:Fin d⊢ ContDiff ℝ ⊤ fun y => y.val j - M.centerOfMass.val j d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i fun_prop All goals completed! 🐙 d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i))
+ M.comTrajectory t i • (1 : C^⊤⟮𝓘(ℝ, Space d), Space d; 𝓘(ℝ, ℝ), ℝ⟯) := by d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0⊢ (M.massDistribution t).centerOfMass = M.comTrajectory t d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i
ext y d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dy:Space d⊢ ((cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩) y =
(∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1) y d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i
simp only [ContMDiffMap.comp_apply, cmap_apply, ContMDiffMap.coeFn_mk, displacement_apply,
ContMDiffMap.coe_add, ContMDiffMap.coe_smul, ContMDiffMap.coe_one, Pi.add_apply,
Pi.smul_apply, Pi.one_apply, smul_eq_mul, mul_one, contMDiffMap_sum_apply] d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i
have key : (M.massDistribution t).ρ (cmap (fun x => x i) (by d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ ContDiff ℝ ⊤ fun x => x.val i d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i fun_prop All goals completed! 🐙 d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i))
= M.comTrajectory t i * M.mass := by d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0⊢ (M.massDistribution t).centerOfMass = M.comTrajectory t d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i
simp only [massDistribution, LinearMap.coe_mk, AddHom.coe_mk] d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ M.ρ ((cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩) = (M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i
rw [hdecomp, d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ M.ρ (∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1) =
(M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ ∑ x, M.ρ (↑(M.orientation t) i x • cmap (fun y => y.val x - M.centerOfMass.val x) ⋯) +
(M.comTrajectory t).val i • M.mass =
(M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i map_add, d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ M.ρ (∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯) +
M.ρ ((M.comTrajectory t).val i • 1) =
(M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ ∑ x, M.ρ (↑(M.orientation t) i x • cmap (fun y => y.val x - M.centerOfMass.val x) ⋯) +
(M.comTrajectory t).val i • M.mass =
(M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i map_sum, d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ ∑ x, M.ρ (↑(M.orientation t) i x • cmap (fun y => y.val x - M.centerOfMass.val x) ⋯) +
M.ρ ((M.comTrajectory t).val i • 1) =
(M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ ∑ x, M.ρ (↑(M.orientation t) i x • cmap (fun y => y.val x - M.centerOfMass.val x) ⋯) +
(M.comTrajectory t).val i • M.mass =
(M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i map_smul, d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ ∑ x, M.ρ (↑(M.orientation t) i x • cmap (fun y => y.val x - M.centerOfMass.val x) ⋯) +
(M.comTrajectory t).val i • M.ρ 1 =
(M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ ∑ x, M.ρ (↑(M.orientation t) i x • cmap (fun y => y.val x - M.centerOfMass.val x) ⋯) +
(M.comTrajectory t).val i • M.mass =
(M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i M.rho_one d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ ∑ x, M.ρ (↑(M.orientation t) i x • cmap (fun y => y.val x - M.centerOfMass.val x) ⋯) +
(M.comTrajectory t).val i • M.mass =
(M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ ∑ x, M.ρ (↑(M.orientation t) i x • cmap (fun y => y.val x - M.centerOfMass.val x) ⋯) +
(M.comTrajectory t).val i • M.mass =
(M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i] d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1⊢ ∑ x, M.ρ (↑(M.orientation t) i x • cmap (fun y => y.val x - M.centerOfMass.val x) ⋯) +
(M.comTrajectory t).val i • M.mass =
(M.comTrajectory t).val i * M.mass d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i
simp only [map_smul, M.rho_coord_sub_centerOfMass h, smul_eq_mul, mul_zero,
Finset.sum_const_zero, zero_add] d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.massDistribution t).centerOfMass.val i = (M.comTrajectory t).val i
rw [show (M.massDistribution t).centerOfMass i
= (1 / (M.massDistribution t).mass) •
(M.massDistribution t).ρ (cmap (fun x => x i) (by d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ ContDiff ℝ ⊤ fun x => x.val i All goals completed! 🐙 fun_prop All goals completed! 🐙 All goals completed! 🐙)) from rfl,
massDistribution_mass, d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (1 / M.mass) • (M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i All goals completed! 🐙 key, d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (1 / M.mass) • ((M.comTrajectory t).val i * M.mass) = (M.comTrajectory t).val i All goals completed! 🐙 smul_eq_mul, d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ 1 / M.mass * ((M.comTrajectory t).val i * M.mass) = (M.comTrajectory t).val i All goals completed! 🐙 mul_comm, d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.comTrajectory t).val i * M.mass * (1 / M.mass) = (M.comTrajectory t).val i All goals completed! 🐙 mul_one_div, d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.comTrajectory t).val i * M.mass / M.mass = (M.comTrajectory t).val i All goals completed! 🐙 mul_div_assoc, d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.comTrajectory t).val i * (M.mass / M.mass) = (M.comTrajectory t).val i All goals completed! 🐙 div_self h, d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.comTrajectory t).val i * 1 = (M.comTrajectory t).val i All goals completed! 🐙
mul_one d:ℕM:RigidBodyMotion dt:Timeh:M.mass ≠ 0i:Fin dhdecomp:(cmap (fun x => x.val i) ⋯).comp ⟨M.displacement t, ⋯⟩ =
∑ j, ↑(M.orientation t) i j • cmap (fun y => y.val j - M.centerOfMass.val j) ⋯ + (M.comTrajectory t).val i • 1key:(M.massDistribution t).ρ (cmap (fun x => x.val i) ⋯) = (M.comTrajectory t).val i * M.mass⊢ (M.comTrajectory t).val i = (M.comTrajectory t).val i All goals completed! 🐙] All goals completed! 🐙lemma velocity_eq {d : ℕ} (M : RigidBodyMotion d) (y : Space d) (t : Time) :
M.velocity y t = ∂ₜ (fun s => M.displacement s y) t := rfl
The i-th component of the velocity of a body point is the time derivative of the i-th
coordinate of its inertial-frame trajectory.
lemma velocity_apply {d : ℕ} (M : RigidBodyMotion d) (y : Space d) (t : Time) (i : Fin d)
(hd : Differentiable ℝ (fun s => M.displacement s y)) :
M.velocity y t i = ∂ₜ (fun s => M.displacement s y i) t := by d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhd:Differentiable ℝ fun s => M.displacement s y⊢ (M.velocity y t).val i = ∂ₜ (fun s => (M.displacement s y).val i) t
rw [velocity_eq d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhd:Differentiable ℝ fun s => M.displacement s y⊢ (∂ₜ (fun s => M.displacement s y) t).val i = ∂ₜ (fun s => (M.displacement s y).val i) t d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhd:Differentiable ℝ fun s => M.displacement s y⊢ (∂ₜ (fun s => M.displacement s y) t).val i = ∂ₜ (fun s => (M.displacement s y).val i) t] d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhd:Differentiable ℝ fun s => M.displacement s y⊢ (∂ₜ (fun s => M.displacement s y) t).val i = ∂ₜ (fun s => (M.displacement s y).val i) t
exact (Time.deriv_space hd t i).symm All goals completed! 🐙
The material point at the centre of mass moves with the centre-of-mass velocity, for any
motion: v(centreOfMass) = V. This is the velocity counterpart of massDistribution_centerOfMass.
lemma velocity_centerOfMass {d : ℕ} (M : RigidBodyMotion d) :
M.velocity M.centerOfMass = M.centerOfMassVelocity := by d:ℕM:RigidBodyMotion d⊢ M.velocity M.centerOfMass = M.centerOfMassVelocity
funext t d:ℕM:RigidBodyMotion dt:Time⊢ M.velocity M.centerOfMass t = M.centerOfMassVelocity t
rw [velocity_eq, d:ℕM:RigidBodyMotion dt:Time⊢ ∂ₜ (fun s => M.displacement s M.centerOfMass) t = M.centerOfMassVelocity t d:ℕM:RigidBodyMotion dt:Time⊢ ∂ₜ (fun s => M.displacement s M.centerOfMass) t = ∂ₜ M.comTrajectory t centerOfMassVelocity_eq d:ℕM:RigidBodyMotion dt:Time⊢ ∂ₜ (fun s => M.displacement s M.centerOfMass) t = ∂ₜ M.comTrajectory t d:ℕM:RigidBodyMotion dt:Time⊢ ∂ₜ (fun s => M.displacement s M.centerOfMass) t = ∂ₜ M.comTrajectory t] d:ℕM:RigidBodyMotion dt:Time⊢ ∂ₜ (fun s => M.displacement s M.centerOfMass) t = ∂ₜ M.comTrajectory t
congr 1 e_f d:ℕM:RigidBodyMotion dt:Time⊢ (fun s => M.displacement s M.centerOfMass) = M.comTrajectory
funext s e_f d:ℕM:RigidBodyMotion dt:Times:Time⊢ M.displacement s M.centerOfMass = M.comTrajectory s
ext k e_f d:ℕM:RigidBodyMotion dt:Times:Timek:Fin d⊢ (M.displacement s M.centerOfMass).val k = (M.comTrajectory s).val k
rw [displacement_apply e_f d:ℕM:RigidBodyMotion dt:Times:Timek:Fin d⊢ ∑ j, ↑(M.orientation s) k j * (M.centerOfMass.val j - M.centerOfMass.val j) + (M.comTrajectory s).val k =
(M.comTrajectory s).val k e_f d:ℕM:RigidBodyMotion dt:Times:Timek:Fin d⊢ ∑ j, ↑(M.orientation s) k j * (M.centerOfMass.val j - M.centerOfMass.val j) + (M.comTrajectory s).val k =
(M.comTrajectory s).val k]e_f d:ℕM:RigidBodyMotion dt:Times:Timek:Fin d⊢ ∑ j, ↑(M.orientation s) k j * (M.centerOfMass.val j - M.centerOfMass.val j) + (M.comTrajectory s).val k =
(M.comTrajectory s).val k
simp All goals completed! 🐙
A rigid body in pure translation (constant orientation) has every point moving with the
centre-of-mass velocity: v = V.
lemma velocity_of_orientation_const {d : ℕ} (M : RigidBodyMotion d) (y : Space d)
(R : Matrix.specialOrthogonalGroup (Fin d) ℝ) (h : M.orientation = fun _ => R) :
M.velocity y = M.centerOfMassVelocity := by d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => R⊢ M.velocity y = M.centerOfMassVelocity
funext t d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Time⊢ M.velocity y t = M.centerOfMassVelocity t
rw [velocity_eq, d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Time⊢ ∂ₜ (fun s => M.displacement s y) t = M.centerOfMassVelocity t d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Time⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t centerOfMassVelocity_eq d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Time⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Time⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t] d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Time⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t
have hdisp : (fun s => M.displacement s y)
= fun s => (⟨fun k => ∑ j, R.1 k j * (y j - M.centerOfMass j)⟩ : Space d)
+ M.comTrajectory s := by d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => R⊢ M.velocity y = M.centerOfMassVelocity d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t
funext s d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Times:Time⊢ M.displacement s y = { val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t
ext k d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Times:Timek:Fin d⊢ (M.displacement s y).val k =
({ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s).val k d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t
rw [displacement_apply, d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Times:Timek:Fin d⊢ ∑ j, ↑(M.orientation s) k j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory s).val k =
({ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s).val k d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Times:Timek:Fin d⊢ ∑ j, ↑((fun x => R) s) k j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory s).val k =
({ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s).val k d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t h d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Times:Timek:Fin d⊢ ∑ j, ↑((fun x => R) s) k j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory s).val k =
({ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s).val k d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Times:Timek:Fin d⊢ ∑ j, ↑((fun x => R) s) k j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory s).val k =
({ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s).val k d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t] d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Times:Timek:Fin d⊢ ∑ j, ↑((fun x => R) s) k j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory s).val k =
({ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s).val k d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t
simp d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ ∂ₜ (fun s => M.displacement s y) t = ∂ₜ M.comTrajectory t
rw [hdisp d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ ∂ₜ (fun s => { val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s) t =
∂ₜ M.comTrajectory t d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ ∂ₜ (fun s => { val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s) t =
∂ₜ M.comTrajectory t] d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ ∂ₜ (fun s => { val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s) t =
∂ₜ M.comTrajectory t
simp only [Time.deriv_eq] d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ (fderiv ℝ (fun s => { val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s) t) 1 =
(fderiv ℝ M.comTrajectory t) 1
rw [fderiv_const_add d:ℕM:RigidBodyMotion dy:Space dR:↥(specialOrthogonalGroup (Fin d) ℝ)h:M.orientation = fun x => Rt:Timehdisp:(fun s => M.displacement s y) = fun s =>
{ val := fun k => ∑ j, ↑R k j * (y.val j - M.centerOfMass.val j) } + M.comTrajectory s⊢ (fderiv ℝ M.comTrajectory t) 1 = (fderiv ℝ M.comTrajectory t) 1 All goals completed! 🐙] All goals completed! 🐙
The velocity of a body point decomposes as v = Ṙ (y − c) + V: the rate of change of the
orientation acting on the body-frame position, plus the centre-of-mass velocity.
lemma velocity_eq_deriv_orientation {d : ℕ} (M : RigidBodyMotion d) (y : Space d) (t : Time)
(i : Fin d) (hR : Differentiable ℝ (fun s => (M.orientation s).1))
(hX : Differentiable ℝ M.comTrajectory) :
M.velocity y t i
= (∂ₜ (fun s => (M.orientation s).1) t *ᵥ fun j => y j - M.centerOfMass j) i
+ M.centerOfMassVelocity t i := by d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectory⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
have hentry : ∀ a b : Fin d, Differentiable ℝ (fun s => (M.orientation s).1 a b) := fun a b =>
((Matrix.entryLinearMap ℝ ℝ a b).toContinuousLinearMap).differentiable.comp hR d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a b⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
have hXcoord : ∀ k : Fin d, Differentiable ℝ (fun s => M.comTrajectory s k) := fun k =>
(Space.eval_differentiable k).comp hX d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val k⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
have hd : Differentiable ℝ (fun s => M.displacement s y) := by
have hcoord : ∀ k : Fin d, Differentiable ℝ (fun s => M.displacement s y k) := by d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectory⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.displacement s y).val k⊢ Differentiable ℝ fun s => M.displacement s y d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s y⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
intro k d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val kk:Fin d⊢ Differentiable ℝ fun s => (M.displacement s y).val k d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.displacement s y).val k⊢ Differentiable ℝ fun s => M.displacement s y d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s y⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
simp only [displacement_apply] d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val kk:Fin d⊢ Differentiable ℝ fun s => ∑ j, ↑(M.orientation s) k j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory s).val k d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.displacement s y).val k⊢ Differentiable ℝ fun s => M.displacement s y d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s y⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
exact (Differentiable.fun_sum
(fun j _ => (hentry k j).mul_const (y j - M.centerOfMass j))).add (hXcoord k) d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.displacement s y).val k⊢ Differentiable ℝ fun s => M.displacement s y d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s y⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.displacement s y).val k⊢ Differentiable ℝ fun s => M.displacement s y d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s y⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
exact Space.mk_differentiable.comp (differentiable_pi.mpr hcoord) d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s y⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s y⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
have hmv : (∂ₜ (fun s => (M.orientation s).1) t *ᵥ fun j => y j - M.centerOfMass j) i
= ∑ j, (∂ₜ (fun s => (M.orientation s).1) t) i j * (y j - M.centerOfMass j) := rfl d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ (M.velocity y t).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
rw [M.velocity_apply y t i hd d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∂ₜ (fun s => (M.displacement s y).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∂ₜ (fun s => (M.displacement s y).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i] d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∂ₜ (fun s => (M.displacement s y).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
simp only [displacement_apply] d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∂ₜ (fun s => ∑ j, ↑(M.orientation s) i j * (y.val j - M.centerOfMass.val j) + (M.comTrajectory s).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
rw [Time.deriv_add (fun s => ∑ j, (M.orientation s).1 i j * (y j - M.centerOfMass j))
(fun s => M.comTrajectory s i)
((Differentiable.fun_sum
fun j _ => (hentry i j).mul_const (y j - M.centerOfMass j)) t) ((hXcoord i) t), d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∂ₜ (fun s => ∑ j, ↑(M.orientation s) i j * (y.val j - M.centerOfMass.val j)) t +
∂ₜ (fun s => (M.comTrajectory s).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∑ j, ∂ₜ (fun s => ↑(M.orientation s) i j) t * (y.val j - M.centerOfMass.val j) +
∂ₜ (fun s => (M.comTrajectory s).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
Time.deriv_fun_sum Finset.univ
(fun j s => (M.orientation s).1 i j * (y j - M.centerOfMass j))
(fun j _ => ((hentry i j).mul_const (y j - M.centerOfMass j)) t), d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∑ i_1, ∂ₜ (fun s => ↑(M.orientation s) i i_1 * (y.val i_1 - M.centerOfMass.val i_1)) t +
∂ₜ (fun s => (M.comTrajectory s).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∑ j, ∂ₜ (fun s => ↑(M.orientation s) i j) t * (y.val j - M.centerOfMass.val j) +
∂ₜ (fun s => (M.comTrajectory s).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
Finset.sum_congr rfl (fun j (_ : j ∈ Finset.univ) =>
Time.deriv_mul_const (fun s => (M.orientation s).1 i j)
(y j - M.centerOfMass j) ((hentry i j) t)) d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∑ j, ∂ₜ (fun s => ↑(M.orientation s) i j) t * (y.val j - M.centerOfMass.val j) +
∂ₜ (fun s => (M.comTrajectory s).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∑ j, ∂ₜ (fun s => ↑(M.orientation s) i j) t * (y.val j - M.centerOfMass.val j) +
∂ₜ (fun s => (M.comTrajectory s).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i] d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∑ j, ∂ₜ (fun s => ↑(M.orientation s) i j) t * (y.val j - M.centerOfMass.val j) +
∂ₜ (fun s => (M.comTrajectory s).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
simp only [Time.deriv_matrix_apply (fun s => (M.orientation s).1) t (hR t)] d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∑ x, ∂ₜ (fun s => ↑(M.orientation s)) t i x * (y.val x - M.centerOfMass.val x) +
∂ₜ (fun s => (M.comTrajectory s).val i) t =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
rw [hmv, d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∑ x, ∂ₜ (fun s => ↑(M.orientation s)) t i x * (y.val x - M.centerOfMass.val x) +
∂ₜ (fun s => (M.comTrajectory s).val i) t =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j) + (M.centerOfMassVelocity t).val i All goals completed! 🐙 Time.deriv_space hX t i, d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∑ x, ∂ₜ (fun s => ↑(M.orientation s)) t i x * (y.val x - M.centerOfMass.val x) + (∂ₜ M.comTrajectory t).val i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j) + (M.centerOfMassVelocity t).val i All goals completed! 🐙 ← centerOfMassVelocity_eq d:ℕM:RigidBodyMotion dy:Space dt:Timei:Fin dhR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryhentry:∀ (a b : Fin d), Differentiable ℝ fun s => ↑(M.orientation s) a bhXcoord:∀ (k : Fin d), Differentiable ℝ fun s => (M.comTrajectory s).val khd:Differentiable ℝ fun s => M.displacement s yhmv:(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j)⊢ ∑ x, ∂ₜ (fun s => ↑(M.orientation s)) t i x * (y.val x - M.centerOfMass.val x) + (M.centerOfMassVelocity t).val i =
∑ j, ∂ₜ (fun s => ↑(M.orientation s)) t i j * (y.val j - M.centerOfMass.val j) + (M.centerOfMassVelocity t).val i All goals completed! 🐙] All goals completed! 🐙
The i-th coordinate of the closed-form velocity.
lemma velocityClosedForm_apply {d : ℕ} (M : RigidBodyMotion d) (t : Time) (y : Space d)
(i : Fin d) :
M.velocityClosedForm t y i
= (∂ₜ (fun s => (M.orientation s).1) t *ᵥ fun j => y j - M.centerOfMass j) i
+ M.centerOfMassVelocity t i := by d:ℕM:RigidBodyMotion dt:Timey:Space di:Fin d⊢ (M.velocityClosedForm t y).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
simp only [velocityClosedForm, Space.add_apply] All goals completed! 🐙
The closed-form velocity as a plain vector-valued function of the coordinates of y.
lemma velocityClosedForm_val {d : ℕ} (M : RigidBodyMotion d) (t : Time) (y : Space d) :
(M.velocityClosedForm t y : Fin d → ℝ)
= (∂ₜ (fun s => (M.orientation s).1) t *ᵥ fun j => y j - M.centerOfMass j)
+ (M.centerOfMassVelocity t : Fin d → ℝ) := by d:ℕM:RigidBodyMotion dt:Timey:Space d⊢ (M.velocityClosedForm t y).val =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) + (M.centerOfMassVelocity t).val
funext i d:ℕM:RigidBodyMotion dt:Timey:Space di:Fin d⊢ (M.velocityClosedForm t y).val i =
((∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) + (M.centerOfMassVelocity t).val) i
rw [Pi.add_apply d:ℕM:RigidBodyMotion dt:Timey:Space di:Fin d⊢ (M.velocityClosedForm t y).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i d:ℕM:RigidBodyMotion dt:Timey:Space di:Fin d⊢ (M.velocityClosedForm t y).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i] d:ℕM:RigidBodyMotion dt:Timey:Space di:Fin d⊢ (M.velocityClosedForm t y).val i =
(∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i
exact M.velocityClosedForm_apply t y i All goals completed! 🐙For a differentiable motion the closed-form velocity is the honest point velocity.
lemma velocityClosedForm_eq_velocity {d : ℕ} (M : RigidBodyMotion d) (t : Time)
(hR : Differentiable ℝ (fun s => (M.orientation s).1))
(hX : Differentiable ℝ M.comTrajectory) (y : Space d) :
M.velocityClosedForm t y = M.velocity y t := by d:ℕM:RigidBodyMotion dt:TimehR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryy:Space d⊢ M.velocityClosedForm t y = M.velocity y t
ext i d:ℕM:RigidBodyMotion dt:TimehR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryy:Space di:Fin d⊢ (M.velocityClosedForm t y).val i = (M.velocity y t).val i
rw [velocityClosedForm_apply, d:ℕM:RigidBodyMotion dt:TimehR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryy:Space di:Fin d⊢ (∂ₜ (fun s => ↑(M.orientation s)) t *ᵥ fun j => y.val j - M.centerOfMass.val j) i + (M.centerOfMassVelocity t).val i =
(M.velocity y t).val i All goals completed! 🐙 ← M.velocity_eq_deriv_orientation y t i hR hX d:ℕM:RigidBodyMotion dt:TimehR:Differentiable ℝ fun s => ↑(M.orientation s)hX:Differentiable ℝ M.comTrajectoryy:Space di:Fin d⊢ (M.velocity y t).val i = (M.velocity y t).val i All goals completed! 🐙] All goals completed! 🐙The squared speed of a body point, in closed form, is a smooth function of the point.
lemma contDiff_velocityClosedForm_inner {d : ℕ} (M : RigidBodyMotion d) (t : Time) :
ContDiff ℝ ⊤ fun y : Space d => (⟪M.velocityClosedForm t y, M.velocityClosedForm t y⟫_ℝ) := by d:ℕM:RigidBodyMotion dt:Time⊢ ContDiff ℝ ⊤ fun y => ⟪M.velocityClosedForm t y, M.velocityClosedForm t y⟫_ℝ
simp only [Space.inner_eq_sum, velocityClosedForm_apply, Matrix.mulVec, dotProduct] d:ℕM:RigidBodyMotion dt:Time⊢ ContDiff ℝ ⊤ fun y =>
∑ x,
(∑ x_1, ∂ₜ (fun s => ↑(M.orientation s)) t x x_1 * (y.val x_1 - M.centerOfMass.val x_1) +
(M.centerOfMassVelocity t).val x) *
(∑ x_1, ∂ₜ (fun s => ↑(M.orientation s)) t x x_1 * (y.val x_1 - M.centerOfMass.val x_1) +
(M.centerOfMassVelocity t).val x)
fun_prop All goals completed! 🐙