Total power of the per-link neighbour coupling on a ring of sites
DefinitionPassivityRing_powerLet and be natural numbers. A ring has sites indexed by , so and are taken modulo . Each site carries a velocity , and each link carries a real matrix . The force on site is , and the total power of the coupling is
where is the dot product on . Note that the second term uses the previous link's matrix .
This is the quantity whose identical vanishing ("passivity") the mission characterizes.
Formalization Note Sites are Fin N, whose addition and subtraction wrap around modulo ; [NeZero N] is needed for the literal in Fin N.
import Mathlib
open Matrix BigOperators
namespace PassivityRing
/-- Total power of the per-link neighbour coupling on a ring of N sites. -/
def power (N d : ℕ) [NeZero N] (W : Fin N → Matrix (Fin d) (Fin d) ℝ)
(v : Fin N → (Fin d → ℝ)) : ℝ :=
∑ i : Fin N, v i ⬝ᵥ (W i *ᵥ v (i + 1) - W (i - 1) *ᵥ v (i - 1))
end PassivityRing
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Definition PassivityRing.power. Take a natural number with , which is a standing typeclass assumption, and a natural number (which may be ). Take a family of real matrices , one for each index , and a family of real vectors with the same indexing. The definition assigns them the real number
In this formula:
- is the ordinary product of a matrix and a column vector in .
- is the standard Euclidean dot product on .
- The sum runs over all indices .
Index arithmetic is cyclic (mod ). The indices live in with wrap-around arithmetic:
- means . So .
- means . So .
There is no truncation at the boundary and no natural-number subtraction that stops at . Every term uses the neighbouring indices on a cycle of length . Expanding by linearity, the quantity is the same as
with all indices read mod .
Degenerate cases the definition includes:
- : Here , so . The single term is , so for every and .
- : Here for both indices. Each term becomes .
- : All vectors and matrices are empty, every dot product is , and .
- Inputs: No conditions are placed on the . They need not be symmetric, invertible, positive, or related to one another. Likewise no conditions are placed on the .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.