Physlib

Physlib.Relativity.Tensors.Reindexing

Reindexing of tensor components

In this file we give results related to the reindexing of tensors. If a tensor has indices specified by a list of colors `c : Fin n → C`, then reindexing the tensor corresponds to a bijection `σ : Fin m → Fin n` such that `c ∘ σ = c1` for some other list of colors `c1 : Fin m → C`. A reindexing might take a tensor ψⁱⱼ to a tensor ψʲᵢ by reordering the indices, or it might take a tensor ψⁱⱼᵏ to a tensor ψⁱᵏ.

We are interested in the interaction of reindexing with the following operations on tensors: - `Fin.append` corresponds to the product of tensors. - `Fin.succAbove` corresponds to the evaluation of a tensor at a given index. - `Fin.succSuccAbove` corresponds to the contraction of a tensor at two given indices.

Properties of the underlying function

Constructors

36 declarations

definition

σ\sigma is a reindexing from cc to c1c_1

Given two sequences of tensor index types (or "colors") c:{0,,n1}Cc: \{0, \dots, n-1\} \to C and c1:{0,,m1}Cc_1: \{0, \dots, m-1\} \to C, a map σ:{0,,m1}{0,,n1}\sigma: \{0, \dots, m-1\} \to \{0, \dots, n-1\} satisfies the `IsReindexing` property if σ\sigma is a bijection and it preserves the index types such that c(σ(i))=c1(i)c(\sigma(i)) = c_1(i) for all ii. This implies that the composition cσc \circ \sigma is equal to c1c_1.

theorem

A reindexing map σ\sigma is injective

Let c:Fin nCc : \text{Fin } n \to C and c1:Fin mCc_1 : \text{Fin } m \to C be sequences of tensor index types (or "colors"). If a map σ:Fin mFin n\sigma : \text{Fin } m \to \text{Fin } n is a reindexing from cc to c1c_1 (meaning σ\sigma is a bijection such that cσ=c1c \circ \sigma = c_1), then σ\sigma is injective.

theorem

A tensor reindexing map is surjective

Let c:{0,,n1}Cc: \{0, \dots, n-1\} \to C and c1:{0,,m1}Cc_1: \{0, \dots, m-1\} \to C be sequences of tensor index types (or "colors"). If the map σ:{0,,m1}{0,,n1}\sigma: \{0, \dots, m-1\} \to \{0, \dots, n-1\} is a reindexing from cc to c1c_1, then σ\sigma is surjective.

theorem

The identity map is a reindexing iff c=c1c = c_1

Let cc and c1c_1 be two sequences of tensor index types (or colors) mapping {0,,n1}\{0, \dots, n-1\} to CC. The identity map id:{0,,n1}{0,,n1}\text{id} : \{0, \dots, n-1\} \to \{0, \dots, n-1\} is a reindexing from cc to c1c_1 if and only if c(i)=c1(i)c(i) = c_1(i) for all i{0,,n1}i \in \{0, \dots, n-1\}.

theorem

The identity map is a reindexing from cc to c1c_1 if it is a reindexing from c1c_1 to cc

Let cc and c1c_1 be two sequences of index colors from {0,,n1}\{0, \dots, n-1\} to CC. If the identity map id:{0,,n1}{0,,n1}\text{id}: \{0, \dots, n-1\} \to \{0, \dots, n-1\} is a valid reindexing from c1c_1 to cc, then id\text{id} is also a valid reindexing from cc to c1c_1.

definition

Inverse of a reindexing map σ\sigma

Given a map σ:{0,,m1}{0,,n1}\sigma: \{0, \dots, m-1\} \to \{0, \dots, n-1\} that is a reindexing from index colors cc to c1c_1 (which implies that σ\sigma is a bijection and cσ=c1c \circ \sigma = c_1), this function represents the inverse map σ1:{0,,n1}{0,,m1}\sigma^{-1}: \{0, \dots, n-1\} \to \{0, \dots, m-1\}.

definition

Equivalence {0,,n1}{0,,m1}\{0, \dots, n-1\} \simeq \{0, \dots, m-1\} induced by reindexing σ\sigma

Given a reindexing map σ:{0,,m1}{0,,n1}\sigma: \{0, \dots, m-1\} \to \{0, \dots, n-1\} between index colorings cc and c1c_1 (which implies σ\sigma is a bijection and cσ=c1c \circ \sigma = c_1), the definition provides an equivalence (bijection) between the index sets {0,,n1}{0,,m1}\{0, \dots, n-1\} \simeq \{0, \dots, m-1\}. In this equivalence, the forward mapping is the inverse function σ1\sigma^{-1}, and the inverse mapping is the original map σ\sigma.

theorem

σ1(σ(x))=x\sigma^{-1}(\sigma(x)) = x for a reindexing map σ\sigma

Let c:Fin nCc: \text{Fin } n \to C and c1:Fin mCc_1: \text{Fin } m \to C be mappings from tensor indices to a set of colors CC. Suppose σ:Fin mFin n\sigma: \text{Fin } m \to \text{Fin } n is a reindexing from cc to c1c_1, which implies that σ\sigma is a bijection satisfying cσ=c1c \circ \sigma = c_1. If σ1:Fin nFin m\sigma^{-1}: \text{Fin } n \to \text{Fin } m is the inverse of σ\sigma, then for any index xFin mx \in \text{Fin } m, it holds that σ1(σ(x))=x\sigma^{-1}(\sigma(x)) = x.

theorem

σ(σ1(x))=x\sigma(\sigma^{-1}(x)) = x for a reindexing map σ\sigma

Let c:{0,,n1}Cc: \{0, \dots, n-1\} \to C and c1:{0,,m1}Cc_1: \{0, \dots, m-1\} \to C be sequences of tensor index colors. If σ:{0,,m1}{0,,n1}\sigma: \{0, \dots, m-1\} \to \{0, \dots, n-1\} is a reindexing from cc to c1c_1 and σ1:{0,,n1}{0,,m1}\sigma^{-1}: \{0, \dots, n-1\} \to \{0, \dots, m-1\} is its inverse map, then for every index x{0,,n1}x \in \{0, \dots, n-1\}, it holds that σ(σ1(x))=x\sigma(\sigma^{-1}(x)) = x.

theorem

Reindexing map σ\sigma preserves index colors (c1=cσc_1 = c \circ \sigma)

Let c:Fin nCc: \text{Fin } n \to C and c1:Fin mCc_1: \text{Fin } m \to C be mappings from tensor indices to a set of colors CC. If σ:Fin mFin n\sigma: \text{Fin } m \to \text{Fin } n is a reindexing from cc to c1c_1, then for every index xFin mx \in \text{Fin } m, the color c1(x)c_1(x) is equal to the color c(σ(x))c(\sigma(x)), or equivalently, c1=cσc_1 = c \circ \sigma.

theorem

Inverse of a reindexing map preserves index colors (c1σ1=cc_1 \circ \sigma^{-1} = c)

Let c:Fin nCc: \text{Fin } n \to C and c1:Fin mCc_1: \text{Fin } m \to C be mappings from tensor indices to a set of colors CC. If σ:Fin mFin n\sigma: \text{Fin } m \to \text{Fin } n is a reindexing from cc to c1c_1 (which implies that σ\sigma is a bijection such that cσ=c1c \circ \sigma = c_1), then for every index xFin nx \in \text{Fin } n, the color c1(σ1(x))c_1(\sigma^{-1}(x)) is equal to c(x)c(x), where σ1\sigma^{-1} denotes the inverse of the reindexing map.

theorem

The inverse mapping of the equivalence induced by reindexing preserves colors: c(σ(x))=c1(x)c(\sigma(x)) = c_1(x)

Let n,mNn, m \in \mathbb{N} and let c:Fin nCc: \text{Fin } n \to C and c1:Fin mCc_1: \text{Fin } m \to C be sequences of tensor index colors. If σ:Fin mFin n\sigma: \text{Fin } m \to \text{Fin } n is a reindexing from cc to c1c_1 (meaning σ\sigma is a bijection such that cσ=c1c \circ \sigma = c_1), then for any index xFin mx \in \text{Fin } m, the color c(σ(x))c(\sigma(x)) is equal to c1(x)c_1(x), where σ\sigma corresponds to the inverse mapping of the equivalence Fin nFin m\text{Fin } n \simeq \text{Fin } m induced by the reindexing.

theorem

The inverse of a reindexing from cc to c1c_1 is a reindexing from c1c_1 to cc

Let n,mNn, m \in \mathbb{N} and let c:Fin nCc: \text{Fin } n \to C and c1:Fin mCc_1: \text{Fin } m \to C be sequences of tensor index colors. If a map σ:Fin mFin n\sigma: \text{Fin } m \to \text{Fin } n is a reindexing from cc to c1c_1 (meaning σ\sigma is a bijection and cσ=c1c \circ \sigma = c_1), then its inverse map σ1:Fin nFin m\sigma^{-1}: \text{Fin } n \to \text{Fin } m is a reindexing from c1c_1 to cc.

theorem

If id\text{id} is a reindexing from cc to c1c_1, then id\text{id} is a reindexing from c1c_1 to cc

Let nn be a natural number and c,c1:{0,,n1}Cc, c_1: \{0, \dots, n-1\} \to C be two sequences of tensor index colors. If the identity map id\text{id} is a valid reindexing from cc to c1c_1, then id\text{id} is also a valid reindexing from c1c_1 to cc. (A map σ\sigma is a reindexing if it is a bijection and cσ=c1c \circ \sigma = c_1).

theorem

Composition of Reindexings is a Reindexing

Let n,n1,n, n_1, and n2n_2 be natural numbers, and let c:Fin nCc: \text{Fin } n \to C, c1:Fin n1Cc_1: \text{Fin } n_1 \to C, and c2:Fin n2Cc_2: \text{Fin } n_2 \to C be sequences of tensor index types (colors). If σ:Fin n1Fin n\sigma: \text{Fin } n_1 \to \text{Fin } n is a reindexing from cc to c1c_1 and σ2:Fin n2Fin n1\sigma_2: \text{Fin } n_2 \to \text{Fin } n_1 is a reindexing from c1c_1 to c2c_2, then the composition σσ2:Fin n2Fin n\sigma \circ \sigma_2: \text{Fin } n_2 \to \text{Fin } n is a reindexing from cc to c2c_2. A map σ\sigma is defined as a reindexing if it is a bijection that preserves index types such that the composition of the color map and the reindexing map matches the target color map (cσ=c1c \circ \sigma = c_1).

theorem

Appending index colors to the right preserves the reindexing property of the left sequence

Let c:Fin nCc : \text{Fin } n \to C, c:Fin nCc' : \text{Fin } n' \to C, and c2:Fin n2Cc_2 : \text{Fin } n_2 \to C be sequences of tensor index colors. If σ:Fin nFin n\sigma : \text{Fin } n' \to \text{Fin } n is a reindexing from cc to cc' (meaning σ\sigma is a bijection such that cσ=cc \circ \sigma = c'), then the map Σ:Fin(n+n2)Fin(n+n2)\Sigma : \text{Fin}(n' + n_2) \to \text{Fin}(n + n_2), defined by the concatenation of σ\sigma (mapping into the first nn slots) and the identity map (mapping into the last n2n_2 slots), is a reindexing from the concatenated color sequence c append c2c \text{ append } c_2 to c append c2c' \text{ append } c_2.

theorem

If σ\sigma is a reindexing from cc to cc', then idσ\text{id} \oplus \sigma is a reindexing from c2cc_2 \oplus c to c2cc_2 \oplus c'

Let c:{0,,n1}Cc: \{0, \dots, n-1\} \to C and c:{0,,n1}Cc': \{0, \dots, n'-1\} \to C be two sequences of tensor index types (or "colors"), and let σ:{0,,n1}{0,,n1}\sigma: \{0, \dots, n'-1\} \to \{0, \dots, n-1\} be a reindexing from cc to cc'. For any additional sequence of index types c2:{0,,n21}Cc_2: \{0, \dots, n_2-1\} \to C, the map Σ:{0,,n2+n1}{0,,n2+n1}\Sigma: \{0, \dots, n_2+n'-1\} \to \{0, \dots, n_2+n-1\} defined by: Σ(i)={iif 0i<n2n2+σ(in2)if n2i<n2+n \Sigma(i) = \begin{cases} i & \text{if } 0 \le i < n_2 \\ n_2 + \sigma(i - n_2) & \text{if } n_2 \le i < n_2 + n' \end{cases} is a reindexing from the concatenated sequence (c2 append c)(c_2 \text{ append } c) to the concatenated sequence (c2 append c)(c_2 \text{ append } c').

theorem

The identity map id\text{id} is a reindexing from cc to c append c \text{ append } \emptyset

For any natural number nn, let c:Fin(n)Cc : \text{Fin}(n) \to C be a sequence of tensor index types and c1:Fin(0)Cc_1 : \text{Fin}(0) \to C be an empty sequence. Then the identity map id:Fin(n)Fin(n)\text{id} : \text{Fin}(n) \to \text{Fin}(n) is a reindexing from cc to the concatenated sequence c append c1c \text{ append } c_1.

theorem

The block-swapping map is a reindexing from c append c2c \text{ append } c_2 to c2 append cc_2 \text{ append } c

For any natural numbers n,n2n, n_2 and sequences of tensor index types c:Fin(n)Cc : \text{Fin}(n) \to C and c2:Fin(n2)Cc_2 : \text{Fin}(n_2) \to C, let σ:Fin(n2+n)Fin(n+n2)\sigma : \text{Fin}(n_2 + n) \to \text{Fin}(n + n_2) be the block-swapping map defined by σ(i)=n+i\sigma(i) = n + i for i<n2i < n_2 and σ(n2+j)=j\sigma(n_2 + j) = j for j<nj < n. Then σ\sigma is a reindexing from the concatenated sequence c append c2c \text{ append } c_2 to the sequence c2 append cc_2 \text{ append } c.

theorem

Right-associativity of index concatenation is a reindexing

For any natural numbers n1,n2,n3n_1, n_2, n_3 and sequences of tensor index types c1:Fin(n1)Cc_1: \text{Fin}(n_1) \to C, c2:Fin(n2)Cc_2: \text{Fin}(n_2) \to C, and c3:Fin(n3)Cc_3: \text{Fin}(n_3) \to C, the canonical bijection cast:Fin((n1+n2)+n3)Fin(n1+(n2+n3))\text{cast}: \text{Fin}((n_1 + n_2) + n_3) \to \text{Fin}(n_1 + (n_2 + n_3)) is a reindexing from the concatenated sequence c1 append (c2 append c3)c_1 \text{ append } (c_2 \text{ append } c_3) to the sequence (c1 append c2) append c3(c_1 \text{ append } c_2) \text{ append } c_3.

theorem

The identity map is a reindexing for the left associativity of index concatenation.

For any three sequences of tensor index colors c1:Fin n1Cc_1: \text{Fin } n_1 \to C, c2:Fin n2Cc_2: \text{Fin } n_2 \to C, and c3:Fin n3Cc_3: \text{Fin } n_3 \to C, the identity map (realized as the canonical type cast Fin ((n1+n2)+n3)Fin (n1+(n2+n3))\text{Fin } ((n_1 + n_2) + n_3) \to \text{Fin } (n_1 + (n_2 + n_3))) is a valid reindexing from the left-associated concatenation (c1c2)c3(c_1 \oplus c_2) \oplus c_3 to the right-associated concatenation c1(c2c3)c_1 \oplus (c_2 \oplus c_3).

theorem

The identity map is a reindexing between (cc1)(c \boxplus c_1) skipping index n+in+i and c(c1 skipping i)c \boxplus (c_1 \text{ skipping } i)

Let nn and n1n_1 be natural numbers. Let c:Fin nCc: \text{Fin } n \to C and c1:Fin (n1+1)Cc_1: \text{Fin } (n_1+1) \to C be sequences of index colors. For any index iFin (n1+1)i \in \text{Fin } (n_1 + 1), the identity map id\text{id} is a reindexing from the color sequence (cc1)(n+i).succAbove(c \boxplus c_1) \circ (n+i).\text{succAbove} to the color sequence c(c1i.succAbove)c \boxplus (c_1 \circ i.\text{succAbove}). Here, \boxplus denotes the concatenation of sequences (the `Fin.append` operation), and the map k.succAbove:Fin mFin (m+1)k.\text{succAbove}: \text{Fin } m \to \text{Fin } (m+1) is the increasing embedding that skips the index kk. The index n+in+i is represented by `Fin.natAdd n i`.

theorem

Skipping an index in the first factor of a concatenation is a reindexing

For any natural numbers nn and n1n_1, given color sequences c:Fin(n+1)Cc: \text{Fin}(n+1) \to C and c1:Fin(n1+1)Cc_1: \text{Fin}(n_1+1) \to C, and an index iFin(n+1)i \in \text{Fin}(n+1), the identity map (via a type cast) is a reindexing from the sequence (append(c,c1)succAbove(castAdd(n1+1,i)))(\text{append}(c, c_1) \circ \text{succAbove}(\text{castAdd}(n_1+1, i))) to the sequence (append(csuccAbove(i),c1))(\text{append}(c \circ \text{succAbove}(i), c_1)).

theorem

Identity reindexing for `Fin.append` and `succSuccAbove` on the right component

For any natural numbers nn and n1n_1, given a sequence of colors c:Fin(n+2)Cc: \text{Fin}(n+2) \to C and a sequence of colors c1:Fin(n1)Cc_1: \text{Fin}(n_1) \to C, and two indices i,jFin(n+2)i, j \in \text{Fin}(n+2), the identity map is a reindexing from the color sequence (Fin.append c1 c)succSuccAboven1+i,n1+j(\text{Fin.append } c_1 \ c) \circ \text{succSuccAbove}_{n_1+i, n_1+j} to the color sequence Fin.append c1 (csuccSuccAbovei,j)\text{Fin.append } c_1 \ (c \circ \text{succSuccAbove}_{i, j}). This states that removing the ii-th and jj-th entries from the right component cc before appending c1c_1 is equivalent to removing the (n1+i)(n_1+i)-th and (n1+j)(n_1+j)-th entries from the concatenated sequence c1cc_1 \oplus c.

theorem

σ(i)=0\sigma(i) = 0 implies a reindexing between cFin.succc \circ \text{Fin.succ} and c1i.succAbovec_1 \circ i.\text{succAbove}

Let c:Fin(n+1)Cc : \text{Fin}(n + 1) \to C and c1:Fin(n1+1)Cc_1 : \text{Fin}(n_1 + 1) \to C be two sequences of tensor index types (colors). Let σ:Fin(n1+1)Fin(n+1)\sigma : \text{Fin}(n_1 + 1) \to \text{Fin}(n + 1) be a reindexing from cc to c1c_1, which is a bijection satisfying cσ=c1c \circ \sigma = c_1. If for some index iFin(n1+1)i \in \text{Fin}(n_1 + 1), we have σ(i)=0\sigma(i) = 0, then there exists a reindexing between the sequences cFin.succc \circ \text{Fin.succ} and c1i.succAbovec_1 \circ i.\text{succAbove} given by the map jpred(σ(i.succAbove(j)))j \mapsto \text{pred}(\sigma(i.\text{succAbove}(j))). In this context, i.succAbovei.\text{succAbove} is the map from Fin(n1)\text{Fin}(n_1) to Fin(n1+1)\text{Fin}(n_1 + 1) that skips ii, and Fin.succ\text{Fin.succ} is the map from Fin(n)\text{Fin}(n) to Fin(n+1)\text{Fin}(n + 1) that skips 00.

theorem

Reindexing of Reduced Sequences for σ(i)0\sigma(i) \neq 0

Let c:Fin(n+1)Cc : \text{Fin}(n+1) \to C and c1:Fin(n1+1)Cc_1 : \text{Fin}(n_1+1) \to C be sequences of tensor index colors. Let σ:Fin(n1+1)Fin(n+1)\sigma : \text{Fin}(n_1+1) \to \text{Fin}(n+1) be a reindexing of cc by c1c_1, defined as a bijection such that cσ=c1c \circ \sigma = c_1. Given an index iFin(n1+1)i \in \text{Fin}(n_1+1) such that σ(i)0\sigma(i) \neq 0, removing the ii-th entry of c1c_1 and the σ(i)\sigma(i)-th entry of cc yields a new reindexing from the reduced sequence c(σ(i)).succAbovec \circ (\sigma(i)).\text{succAbove} to the reduced sequence c1i.succAbovec_1 \circ i.\text{succAbove} via the map (Fin.pred(σ(i))).predAboveσi.succAbove(\text{Fin.pred}(\sigma(i))).\text{predAbove} \circ \sigma \circ i.\text{succAbove}.

theorem

Reindexing is preserved under removing an index via `succAbove`

Let c:Fin(n+1)Cc: \text{Fin}(n+1) \to C and c1:Fin(n1+1)Cc_1: \text{Fin}(n_1+1) \to C be sequences of tensor index types (colors). Suppose σ:Fin(n1+1)Fin(n+1)\sigma: \text{Fin}(n_1+1) \to \text{Fin}(n+1) is a reindexing, defined as a bijection such that cσ=c1c \circ \sigma = c_1. For any index iFin(n1+1)i \in \text{Fin}(n_1+1), removing the ii-th entry from c1c_1 and the corresponding σ(i)\sigma(i)-th entry from cc yields a new reindexing between the reduced sequences c1i.succAbovec_1 \circ i.\text{succAbove} and c(σ(i)).succAbovec \circ (\sigma(i)).\text{succAbove}. The resulting reindexing map σ\sigma' is defined by: σ(j)={pred(σ(i.succAbove(j)))if σ(i)=0predAbove(pred(σ(i)),σ(i.succAbove(j)))if σ(i)0 \sigma'(j) = \begin{cases} \text{pred}(\sigma(i.\text{succAbove}(j))) & \text{if } \sigma(i) = 0 \\ \text{predAbove}(\text{pred}(\sigma(i)), \sigma(i.\text{succAbove}(j))) & \text{if } \sigma(i) \neq 0 \end{cases} where i.succAbovei.\text{succAbove} is the map that skips the ii-th index, and pred\text{pred} and predAbove\text{predAbove} are the predecessor operations on finite sets that shift indices to account for the removed entry.

theorem

Reindexing is preserved under removing two indices via `succSuccAbove`

Let c:Fin(n+2)Cc : \text{Fin}(n+2) \to C and c1:Fin(n1+2)Cc_1 : \text{Fin}(n_1+2) \to C be sequences of tensor index colors. Suppose σ:Fin(n1+2)Fin(n+2)\sigma : \text{Fin}(n_1+2) \to \text{Fin}(n+2) is a reindexing of cc by c1c_1, which means σ\sigma is a bijection such that cσ=c1c \circ \sigma = c_1. For any two distinct indices i,jFin(n1+2)i, j \in \text{Fin}(n_1+2), removing the ii-th and jj-th entries from c1c_1 and the corresponding σ(i)\sigma(i)-th and σ(j)\sigma(j)-th entries from cc results in a new reindexing between the reduced sequences. Specifically, the map σ:Fin(n1)Fin(n)\sigma' : \text{Fin}(n_1) \to \text{Fin}(n) induced by σ\sigma after skipping ii and jj (formally defined as `funPredPredAbove`) is a reindexing from the color sequence csuccSuccAboveσ(i),σ(j)c \circ \text{succSuccAbove}_{\sigma(i), \sigma(j)} to c1succSuccAbovei,jc_1 \circ \text{succSuccAbove}_{i, j}, where succSuccAbovei,j\text{succSuccAbove}_{i, j} is the order-preserving embedding that skips indices ii and jj.

theorem

Commutativity of Double Index Removal for Tensor Colors

For any natural number nn and color sequence c:Fin(n+4)Cc : \text{Fin}(n+4) \to C, let i1,j1Fin(n+4)i_1, j_1 \in \text{Fin}(n+4) be distinct indices and i2,j2Fin(n+2)i_2, j_2 \in \text{Fin}(n+2) be distinct indices. Define the shifted indices: - i2=succSuccAbove(i1,j1,i2)i_2' = \text{succSuccAbove}(i_1, j_1, i_2) and j2=succSuccAbove(i1,j1,j2)j_2' = \text{succSuccAbove}(i_1, j_1, j_2), which are the indices in Fin(n+4)\text{Fin}(n+4) corresponding to i2,j2i_2, j_2 after i1i_1 and j1j_1 are inserted. - i1=predPredAbove(i2,j2,i1)i_1' = \text{predPredAbove}(i_2', j_2', i_1) and j1=predPredAbove(i2,j2,j1)j_1' = \text{predPredAbove}(i_2', j_2', j_1), which are the indices in Fin(n+2)\text{Fin}(n+2) corresponding to i1,j1i_1, j_1 after i2i_2' and j2j_2' are removed. Then, the identity map is a reindexing between the color list obtained by first removing i1,j1i_1, j_1 and then i2,j2i_2, j_2, and the color list obtained by first removing i2,j2i_2', j_2' and then i1,j1i_1', j_1'. That is: (csuccSuccAbovei2,j2)succSuccAbovei1,j1=(csuccSuccAbovei1,j1)succSuccAbovei2,j2 (c \circ \text{succSuccAbove}_{i_2', j_2'}) \circ \text{succSuccAbove}_{i_1', j_1'} = (c \circ \text{succSuccAbove}_{i_1, j_1}) \circ \text{succSuccAbove}_{i_2, j_2} This theorem shows that removing two pairs of indices from a color list in different orders (adjusting the indices accordingly) results in the same sequence of colors.

theorem

Commutativity of Evaluation (succAbove\text{succAbove}) and Contraction (succSuccAbove\text{succSuccAbove}) Reindexing

Let nNn \in \mathbb{N} and c:Fin(n+3)Cc : \text{Fin}(n+3) \to C be a sequence of tensor index colors. Let kFin(n+3)k \in \text{Fin}(n+3) be an index and i,jFin(n+2)i, j \in \text{Fin}(n+2) be two distinct indices (iji \neq j). We define the shifted indices i=succAbovek(i)i' = \text{succAbove}_k(i) and j=succAbovek(j)j' = \text{succAbove}_k(j) in Fin(n+3)\text{Fin}(n+3), and the shifted index k=predPredAbovei,j(k)k' = \text{predPredAbove}_{i', j'}(k) in Fin(n+1)\text{Fin}(n+1). The theorem states that the identity map id\text{id} is a reindexing from the color list obtained by removing the pair of entries at ii' and jj' and then removing the entry at kk', to the color list obtained by first removing the entry at kk and then removing the pair of entries at ii and jj. That is: (csuccSuccAbovei,j)succAbovek=(csuccAbovek)succSuccAbovei,j (c \circ \text{succSuccAbove}_{i', j'}) \circ \text{succAbove}_{k'} = (c \circ \text{succAbove}_k) \circ \text{succSuccAbove}_{i, j} This result demonstrates that the operations of evaluation (removing one index) and contraction (removing two indices) commute when the indices are properly shifted.

theorem

succSuccAbove\text{succSuccAbove} and succAbove\text{succAbove} commute in tensor reindexing

For any natural number nn and any map c:Fin(n+3)Cc : \text{Fin}(n+3) \to C representing tensor index types, let kFin(n+1)k \in \text{Fin}(n+1) and i,jFin(n+3)i, j \in \text{Fin}(n+3) be indices. We define the following shifted indices: - k=succSuccAbovei,j(k)k' = \text{succSuccAbove}_{i,j}(k) (the position of kk in Fin(n+3)\text{Fin}(n+3) after skipping ii and jj) - k=predAbove0(k)k'' = \text{predAbove}_{0}(k') - i=predAbovek(i)i' = \text{predAbove}_{k''}(i) - j=predAbovek(j)j' = \text{predAbove}_{k''}(j) Then the identity map is a valid reindexing between the resulting color maps, which implies the following equality: (csuccAbovek)succSuccAbovei,j=(csuccSuccAbovei,j)succAbovek (c \circ \text{succAbove}_{k'}) \circ \text{succSuccAbove}_{i',j'} = (c \circ \text{succSuccAbove}_{i,j}) \circ \text{succAbove}_k This demonstrates that the operations of omitting two indices (via succSuccAbove\text{succSuccAbove}) and omitting one index (via succAbove\text{succAbove}) commute when the indices are appropriately adjusted.

theorem

Commutativity of sequential index removals in color lists

Let nn be a natural number and c:Fin(n+2)Cc : \text{Fin}(n+2) \to C be a sequence of colors representing the types of tensor indices. For any indices k1Fin(n+2)k_1 \in \text{Fin}(n+2) and k2Fin(n+1)k_2 \in \text{Fin}(n+1), let k2=succAbove(k1,k2)k_2' = \text{succAbove}(k_1, k_2) and k1=predAbove(k2,k1)k_1' = \text{predAbove}(k_2, k_1). Then the identity map id\text{id} is a reindexing from the color sequence (csuccAbovek2)succAbovek1(c \circ \text{succAbove}_{k_2'}) \circ \text{succAbove}_{k_1'} to the color sequence (csuccAbovek1)succAbovek2(c \circ \text{succAbove}_{k_1}) \circ \text{succAbove}_{k_2}, which implies that removing the two entries from cc in either order results in the same sequence of colors: (csuccAbovek2)succAbovek1=(csuccAbovek1)succAbovek2(c \circ \text{succAbove}_{k_2'}) \circ \text{succAbove}_{k_1'} = (c \circ \text{succAbove}_{k_1}) \circ \text{succAbove}_{k_2} Here, succAbovek\text{succAbove}_k denotes the map that embeds Fin(m)\text{Fin}(m) into Fin(m+1)\text{Fin}(m+1) by skipping the index kk, and predAbove\text{predAbove} is its partial inverse. This result confirms that the commutation of two index evaluations (removing two indices from a tensor) preserves the underlying color list.

theorem

id\text{id} is a reindexing from the concatenation of the first nn and the last entries of cc to cc

Let c:{0,,n}Cc : \{0, \dots, n\} \to C be a sequence of colors (index types) for a tensor. Let c<n:{0,,n1}Cc|_{<n} : \{0, \dots, n-1\} \to C denote the sequence of the first nn entries of cc, and let cnc_n denote the last entry of cc. Then the identity map id\text{id} is a reindexing from the sequence formed by appending cnc_n to c<nc|_{<n} to the original sequence cc. This expresses that splitting a sequence into its first nn entries and its last entry and then concatenating them recovers the original sequence.

theorem

[c(0)](c(1),,c(n))[c(0)] \oplus (c(1), \dots, c(n)) is a reindexing of cc

Given a sequence of tensor index colors c:Fin(n+1)Cc : \text{Fin}(n + 1) \to C, let c0c_0 denote the first color c(0)c(0) and crest:Fin(n)Cc_{rest} : \text{Fin}(n) \to C denote the sequence of the remaining nn colors, defined by crest(i)=c(i+1)c_{rest}(i) = c(i + 1) (or csuccAbove0c \circ \text{succAbove}_0). Then the identity map id:Fin(n+1)Fin(1+n)\text{id} : \text{Fin}(n+1) \to \text{Fin}(1+n) is a reindexing from the concatenation of [c0][c_0] and crestc_{rest} to the original sequence cc. In other words, appending the first entry of a color list to the list of its remaining entries recovers the original list via a canonical reindexing.

theorem

Fin.cast\text{Fin.cast} is a Reindexing

Let nn and n1n_1 be natural numbers and let h:n1=nh: n_1 = n be an equality. For any sequence of tensor index types c:{0,,n1}Cc: \{0, \dots, n-1\} \to C, the canonical bijection casth:{0,,n11}{0,,n1}\text{cast}_h : \{0, \dots, n_1-1\} \to \{0, \dots, n-1\} is a reindexing from cc to the sequence ccasthc \circ \text{cast}_h.

theorem

Contraction with a metric at index ii is a reindexing to the ii-dualized color list

Let c:Fin nCc: \text{Fin } n \to C be a sequence of tensor index colors and iFin ni \in \text{Fin } n be a specific index. Let cextc_{\text{ext}} be the sequence of n+2n+2 colors obtained by appending two copies of the dual color S.τ(ci)S.\tau(c_i) to the end of cc. Let σskip:Fin nFin (n+2)\sigma_{\text{skip}}: \text{Fin } n \to \text{Fin }(n+2) be the order-preserving embedding that skips the indices ii and nn (the first index of the appended pair). The theorem states that the inverse of the cyclic permutation cycleIcc(i,n1)\text{cycleIcc}(i, n-1) is a reindexing from the contracted color sequence cextσskipc_{\text{ext}} \circ \sigma_{\text{skip}} to the sequence cc where the color at index ii has been replaced by its dual S.τ(ci)S.\tau(c_i).