PhyslibSearch

Physlib.SpaceAndTime.Space.Derivatives.MultiIndex

24 declarations

instance

Decidability of I=JI = J for multi-indices

#instDecidableEqMultiIndex

For any dimension dd, it is decidable whether two multi-indices I,JI, J on dd coordinates are equal. This provides an algorithm to determine the truth value of the proposition I=JI = J.

instance

Multi-index as a function I:{0,,d1}NI: \{0, \dots, d-1\} \to \mathbb{N}

#instCoeFunForallFinNat

This definition provides a coercion that allows a multi-index II of dimension dd to be treated as a function from the set of indices {0,,d1}\{0, \dots, d-1\} to the natural numbers N\mathbb{N}. Under this coercion, for any i{0,,d1}i \in \{0, \dots, d-1\}, the expression I(i)I(i) denotes the ii-th component of the multi-index.

instance

Zero multi-index on dd coordinates

#instZero

The zero multi-index 00 in the space of multi-indices on dd coordinates is defined as the multi-index where each component is 00. That is, for a multi-index viewed as a function I:{0,,d1}NI: \{0, \dots, d-1\} \to \mathbb{N}, the zero element satisfies I(i)=0I(i) = 0 for all ii.

instance

Addition of multi-indices on dd coordinates

#instAdd

The addition of two multi-indices II and JJ in the space of multi-indices on dd coordinates is defined by the component-wise sum of their underlying functions from {0,,d1}\{0, \dots, d-1\} to N\mathbb{N}. For each i{0,,d1}i \in \{0, \dots, d-1\}, the ii-th component of the sum is given by (I+J)(i)=I(i)+J(i)(I + J)(i) = I(i) + J(i).

definition

Order I|I| of a multi-index II

#order

For a multi-index II on dd coordinates, represented as a function I:{0,,d1}NI: \{0, \dots, d-1\} \to \mathbb{N}, its order I|I| is defined as the sum of its components: I=i=0d1Ii|I| = \sum_{i=0}^{d-1} I_i

definition

Incrementing the ii-th coordinate of a multi-index II

#increment

Given a multi-index II on dd coordinates, represented as a function I:{0,,d1}NI: \{0, \dots, d-1\} \to \mathbb{N}, and a specific coordinate index i{0,,d1}i \in \{0, \dots, d-1\}, the increment function returns a new multi-index by increasing the value of the ii-th coordinate by one. This is equivalent to adding the unit multi-index eie_i (which has 1 at the ii-th position and 0 elsewhere) to II.

theorem

I=JI = J if Ii=JiI_i = J_i for all ii

#ext

Two multi-indices II and JJ on dd coordinates are equal if all their components are equal. That is, if Ii=JiI_i = J_i for all i{0,,d1}i \in \{0, \dots, d-1\}, then I=JI = J.

theorem

The ii-th component of the zero multi-index is 00

#zero_apply

For any index i{0,,d1}i \in \{0, \dots, d-1\}, the ii-th component of the zero multi-index 00 is 00.

theorem

(I+J)i=Ii+Ji(I + J)_i = I_i + J_i for multi-indices

#add_apply

For any multi-indices II and JJ on dd coordinates and any index i{0,,d1}i \in \{0, \dots, d-1\}, the ii-th component of the sum I+JI + J is equal to the sum of the ii-th components of II and JJ. That is, (I+J)i=Ii+Ji(I + J)_i = I_i + J_i.

theorem

(increment I i)i=Ii+1(\text{increment } I \ i)_i = I_i + 1

#increment_apply_same

Let II be a multi-index on dd coordinates, represented as a function I:{0,,d1}NI: \{0, \dots, d-1\} \to \mathbb{N}. For any coordinate index i{0,,d1}i \in \{0, \dots, d-1\}, the ii-th coordinate of the multi-index obtained by incrementing II at position ii is equal to Ii+1I_i + 1. That is, (increment(I,i))i=Ii+1(\text{increment}(I, i))_i = I_i + 1.

theorem

(increment I i)j=Ij(\text{increment } I \ i)_j = I_j for jij \neq i

#increment_apply_ne

Let II be a multi-index on dd coordinates, which is defined as a function I:{0,,d1}NI: \{0, \dots, d-1\} \to \mathbb{N}. For any two coordinate indices i,j{0,,d1}i, j \in \{0, \dots, d-1\} such that jij \neq i, the jj-th coordinate of the multi-index obtained by incrementing II at position ii is equal to the original jj-th coordinate of II. That is, (increment(I,i))j=Ij(\text{increment}(I, i))_j = I_j.

theorem

0=0|0| = 0 for multi-indices

#order_zero

For the zero multi-index 00 on dd coordinates, its order 0|0| is equal to 00. Here, the order of a multi-index is defined as the sum of its components.

theorem

I+J=I+J|I + J| = |I| + |J| for multi-indices

#order_add

For any two multi-indices II and JJ on dd coordinates, the order of their sum is equal to the sum of their individual orders, denoted as I+J=I+J|I + J| = |I| + |J|. Here, the order I|I| of a multi-index II is defined as the sum of its components.

theorem

ei=1|e_i| = 1 for multi-indices

#order_single

For any coordinate index i{0,,d1}i \in \{0, \dots, d-1\}, the multi-index on dd coordinates that has the value 11 at the ii-th position and 00 at all other positions has an order equal to 11. In other words, if eie_i is the unit multi-index in the ii-th direction, its order is ei=1|e_i| = 1.

theorem

increment(I,i)=I+1|\operatorname{increment}(I, i)| = |I| + 1 for a multi-index II

#order_increment

For a multi-index II on dd coordinates and a coordinate index i{0,,d1}i \in \{0, \dots, d-1\}, the order of the multi-index obtained by incrementing II at the ii-th coordinate is equal to I+1|I| + 1. Here, the order I|I| is the sum of the components of the multi-index, and the increment operation increases the ii-th component of II by one.

definition

Tail of a multi-index INd+1I \in \mathbb{N}^{d+1}

#tail

Given a multi-index II of dimension d+1d+1, which can be viewed as an element of Nd+1\mathbb{N}^{d+1} or a sequence (I0,I1,,Id)(I_0, I_1, \dots, I_d), the tail function maps II to a multi-index of dimension dd by dropping the 00-th coordinate. Specifically, the resulting multi-index is (I1,I2,,Id)(I_1, I_2, \dots, I_d), where the ii-th component of the tail corresponds to the (i+1)(i+1)-th component of the original multi-index II.

definition

Canonical list of coordinate indices for a multi-index INdI \in \mathbb{N}^d

#toList

For a multi-index II of dimension dd, which can be viewed as an element (I0,I1,,Id1)Nd(I_0, I_1, \dots, I_{d-1}) \in \mathbb{N}^d, the function `toList` returns the canonical ordered list of coordinate directions. This list contains each coordinate index i{0,,d1}i \in \{0, \dots, d-1\} exactly IiI_i times, sorted in non-decreasing order. Recursively, if d=0d=0 the list is empty, and if d>0d > 0, the list consists of I0I_0 copies of the index 00 followed by the indices of the tail multi-index (I1,,Id1)(I_1, \dots, I_{d-1}) shifted by 11.

theorem

tail(0)=0\text{tail}(0) = 0 for multi-indices

#tail_zero

For the zero multi-index 00 on d+1d+1 coordinates, its tail—the multi-index of dimension dd obtained by dropping the first coordinate—is equal to the zero multi-index 00 on dd coordinates.

theorem

tail(increment(I,0))=tail(I)\text{tail}(\text{increment}(I, 0)) = \text{tail}(I)

#tail_increment_zero

For any multi-index II of dimension d+1d+1, the tail of the multi-index obtained by incrementing its 00-th coordinate is equal to the tail of the original multi-index II. That is, if increment(I,0)\text{increment}(I, 0) is the multi-index where the 00-th component is increased by 11 and tail(I)\text{tail}(I) is the multi-index of dimension dd formed by dropping the 00-th coordinate, then tail(increment(I,0))=tail(I)\text{tail}(\text{increment}(I, 0)) = \text{tail}(I).

theorem

tail(increment(I,i+1))=increment(tail(I),i)\text{tail}(\text{increment}(I, i+1)) = \text{increment}(\text{tail}(I), i)

#tail_increment_succ

For any multi-index II of dimension d+1d+1 (represented as an element (I0,I1,,Id)Nd+1(I_0, I_1, \dots, I_d) \in \mathbb{N}^{d+1}) and any coordinate index i{0,,d1}i \in \{0, \dots, d-1\}, the tail of II after incrementing its (i+1)(i+1)-th coordinate is equal to the tail of II incremented at its ii-th coordinate. Specifically, if increment(I,k)\text{increment}(I, k) denotes the operation of increasing the kk-th component of a multi-index by one, and tail(I)\text{tail}(I) denotes the operation of dropping the 00-th component (I1,,Id)(I_1, \dots, I_d), then: tail(increment(I,i+1))=increment(tail(I),i)\text{tail}(\text{increment}(I, i+1)) = \text{increment}(\text{tail}(I), i)

theorem

toList(0)=[]\text{toList}(0) = [\,] for multi-indices

#toList_zero

For the zero multi-index 00 of dimension dd (where every component is zero), its canonical list of coordinate indices toList(0)\text{toList}(0) is the empty list [][\,]. This is consistent with the definition that the list contains each coordinate index ii exactly IiI_i times; since Ii=0I_i = 0 for all ii in the zero multi-index, the resulting list is empty.

theorem

The length of the list `toList I` equals the order I|I|

#length_toList

For a multi-index II of dimension dd (an element of Nd\mathbb{N}^d), the length of its canonical list of coordinate indices, `toList I`, is equal to its order I|I|. The order I|I| is defined as the sum of the components of the multi-index: I=i=0d1Ii|I| = \sum_{i=0}^{d-1} I_i The list `toList I` is the sequence containing each index i{0,,d1}i \in \{0, \dots, d-1\} exactly IiI_i times.

theorem

toList(increment(I,0))=0::toList(I)\text{toList}(\text{increment}(I, 0)) = 0 :: \text{toList}(I)

#toList_increment_zero

For any multi-index II of dimension d+1d+1, the canonical sorted list of coordinate indices for the multi-index obtained by incrementing the 00-th coordinate of II is equal to the list obtained by prepending the index 00 to the canonical list of II. Mathematically, toList(increment(I,0))=0::toList(I)\text{toList}(\text{increment}(I, 0)) = 0 :: \text{toList}(I) where increment(I,0)\text{increment}(I, 0) increases the first component I0I_0 by 11, and toList(I)\text{toList}(I) is the sorted list containing each index i{0,,d}i \in \{0, \dots, d\} exactly IiI_i times.

theorem

toList(increment(0,i))=[i]\text{toList}(\text{increment}(0, i)) = [i] for multi-indices

#toList_single

For any coordinate index i{0,,d1}i \in \{0, \dots, d-1\}, let the multi-index II be the unit multi-index obtained by incrementing the ii-th component of the zero multi-index 00. The canonical list of coordinate directions for II, denoted as toList(I)\text{toList}(I), is the singleton list containing only the index ii. Mathematically, toList(increment(0,i))=[i]\text{toList}(\text{increment}(0, i)) = [i] where increment(0,i)\text{increment}(0, i) is the multi-index with 11 at position ii and 00 elsewhere.