Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Total power of the per-link neighbour coupling on a ring of NNN sites

Definition
PassivityRing_power

by ShapeZero · Sep 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

linear-algebramatrices

Let N≥1N \ge 1N≥1 and ddd be natural numbers. A ring has NNN sites indexed by Z/NZ\mathbb{Z}/N\mathbb{Z}Z/NZ, so i+1i+1i+1 and i−1i-1i−1 are taken modulo NNN. Each site carries a velocity vi∈Rdv_i \in \mathbb{R}^dvi​∈Rd, and each link carries a real d×dd\times dd×d matrix WiW_iWi​. The force on site iii is Wivi+1−Wi−1vi−1W_i v_{i+1} - W_{i-1} v_{i-1}Wi​vi+1​−Wi−1​vi−1​, and the total power of the coupling is

PW(v)=∑i∈Z/NZvi⋅(Wi vi+1−Wi−1 vi−1),P_W(v) = \sum_{i \in \mathbb{Z}/N\mathbb{Z}} v_i \cdot \bigl( W_i\, v_{i+1} - W_{i-1}\, v_{i-1} \bigr),PW​(v)=i∈Z/NZ∑​vi​⋅(Wi​vi+1​−Wi−1​vi−1​),

where ⋅\cdot⋅ is the dot product on Rd\mathbb{R}^dRd. Note that the second term uses the previous link's matrix Wi−1W_{i-1}Wi−1​.

This is the quantity whose identical vanishing ("passivity") the mission characterizes.

Formalization Note Sites are Fin N, whose addition and subtraction wrap around modulo NNN; [NeZero N] is needed for the literal 111 in Fin N.

Definition code
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
Source
Shape Zero LLC, "Formal Proofs of the C1 Verification Package" (August 2026), §6, Theorem 6.1 (power of the coupling): https://github.com/ShapeZeroSZ/shape-zero/blob/main/01_source/proofs/ShapeZero_C1_Formal_Proofs.pdf ; corrected in "Errata — C1 Formal Proofs (Sections 3 and 6)", Corrected Theorem 6.1(a): https://github.com/ShapeZeroSZ/shape-zero/blob/main/01_source/proofs/ERRATUM_Theorem_6.1.md
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Definition PassivityRing.power. Take a natural number NNN with N≠0N \neq 0N=0, which is a standing typeclass assumption, and a natural number ddd (which may be 000). Take a family of real d×dd \times dd×d matrices W0,…,WN−1W_0, \dots, W_{N-1}W0​,…,WN−1​, one for each index i∈Z/NZi \in \mathbb{Z}/N\mathbb{Z}i∈Z/NZ, and a family of real vectors v0,…,vN−1∈Rdv_0, \dots, v_{N-1} \in \mathbb{R}^dv0​,…,vN−1​∈Rd with the same indexing. The definition assigns them the real number

power⁡N,d(W,v)  =  ∑i=0N−1vi⋅(Wi vi+1  −  Wi−1 vi−1).\operatorname{power}_{N,d}(W, v) \;=\; \sum_{i=0}^{N-1} v_i \cdot \bigl( W_i\, v_{i+1} \;-\; W_{i-1}\, v_{i-1} \bigr).powerN,d​(W,v)=i=0∑N−1​vi​⋅(Wi​vi+1​−Wi−1​vi−1​).

In this formula:

  • Wi vi+1W_i\, v_{i+1}Wi​vi+1​ is the ordinary product of a matrix and a column vector in Rd\mathbb{R}^dRd.
  • ⋅\cdot⋅ is the standard Euclidean dot product x⋅y=∑k=0d−1xkykx \cdot y = \sum_{k=0}^{d-1} x_k y_kx⋅y=∑k=0d−1​xk​yk​ on Rd\mathbb{R}^dRd.
  • The sum runs over all NNN indices i∈{0,1,…,N−1}i \in \{0, 1, \dots, N-1\}i∈{0,1,…,N−1}.

Index arithmetic is cyclic (mod NNN). The indices live in {0,…,N−1}\{0, \dots, N-1\}{0,…,N−1} with wrap-around arithmetic:

  • i+1i+1i+1 means (i+(1 mod N)) mod N(i + (1 \bmod N)) \bmod N(i+(1modN))modN. So (N−1)+1=0(N-1)+1 = 0(N−1)+1=0.
  • i−1i-1i−1 means (i+N−(1 mod N)) mod N(i + N - (1 \bmod N)) \bmod N(i+N−(1modN))modN. So 0−1=N−10 - 1 = N-10−1=N−1.

There is no truncation at the boundary and no natural-number subtraction that stops at 000. Every term uses the neighbouring indices on a cycle of length NNN. Expanding by linearity, the quantity is the same as

∑i=0N−1viTWi vi+1  −  ∑i=0N−1viTWi−1 vi−1,\sum_{i=0}^{N-1} v_i^{\mathsf T} W_i\, v_{i+1} \;-\; \sum_{i=0}^{N-1} v_i^{\mathsf T} W_{i-1}\, v_{i-1},i=0∑N−1​viT​Wi​vi+1​−i=0∑N−1​viT​Wi−1​vi−1​,

with all indices read mod NNN.

Degenerate cases the definition includes:

  • N=1N = 1N=1: Here 1 mod 1=01 \bmod 1 = 01mod1=0, so i+1=i−1=i=0i+1 = i-1 = i = 0i+1=i−1=i=0. The single term is v0⋅(W0v0−W0v0)v_0 \cdot (W_0 v_0 - W_0 v_0)v0​⋅(W0​v0​−W0​v0​), so power⁡=0\operatorname{power} = 0power=0 for every W0W_0W0​ and v0v_0v0​.
  • N=2N = 2N=2: Here i+1=i−1i+1 = i-1i+1=i−1 for both indices. Each term becomes vi⋅((Wi−Wi−1) vi+1)v_i \cdot \bigl((W_i - W_{i-1})\, v_{i+1}\bigr)vi​⋅((Wi​−Wi−1​)vi+1​).
  • d=0d = 0d=0: All vectors and matrices are empty, every dot product is 000, and power⁡=0\operatorname{power} = 0power=0.
  • Inputs: No conditions are placed on the WiW_iWi​. They need not be symmetric, invertible, positive, or related to one another. Likewise no conditions are placed on the viv_ivi​.
Human review
  • Endorsed by Shuze Chen · Sep 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by ShapeZero · Sep 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me