Physlib

Physlib.Relativity.Tensors.Contraction.CrossToEnd

Cross contraction at named slots

i. Overview

`contrT` contracts two slots of a single tensor. Contracting a slot of one tensor against a slot of another (`T^{μν} u_ν`, `g_{μν} v^ν`) is `prodT` then `contrT`, which leaves every call site to locate the two post-product slots and discharge the distinctness and `τ`-duality goals.

`crossToEnd i j hc` performs that contraction at named slots `i` and `j`, with `hc : S.τ (cA i) = cB j` recording their `τ`-duality. The output color is `Fin.append (cA ∘ i.succAbove) (cB ∘ j.succAbove)`: every slot of `cA` except `i`, in order, then every slot of `cB` except `j`. These are the survivors. Any slot is reachable: `crossToEnd 2 0 _ R u` reads as `R_{μνρσ} u^ρ`. The survivors are appended rather than interleaved, and appending is associative, so both bracketings of a chain produce the same survivor list in the same order.

The complementary convention keeps the replacement index in place. Contracting slot `1` of `![c₀, c₁, c₂, c₃]` against a rank-two `![S.τ c₁, d]` gives `![c₀, c₂, c₃, d]` here and `![c₀, d, c₂, c₃]` there; that operation is `crossToSlot`, built on this substrate in `Physlib.Relativity.Tensors.Contraction.CrossToSlot`.

ii. Key results

- `TensorSpecies.Tensor.crossToEnd` : the slot-addressed cross contraction. - `TensorSpecies.Tensor.crossToEnd_two` : at rank two on each factor, a plain `contrT` of the product on slots `1, 2`. - `TensorSpecies.Tensor.crossToEnd_equivariant` : the contraction commutes with the `G`-action. - `TensorSpecies.Tensor.crossToEnd_assoc_rankTwo` : rebracket the chain `A —(iA·0)— B —(last·0)— C` at rank-two `B` and `C`, up to `permT id`. Not full associativity. - `TensorSpecies.Tensor.crossToEnd_permT_left` / `crossToEnd_permT_right` : move a relabelling of the left or right factor through the contraction, the contracted slot moving with it.

iii. Table of contents

  • A. Slot-addressed cross contraction
  • B. Equivariance
  • C. Rebracketing the metric chain
  • D. Permutation commutators

iv. References

A. Slot-addressed cross contraction

B. Equivariance

`crossToEnd i j hc` is the curried bilinear map `LinearMap.compr₂ prodT` post-composed with the linear `permT`/`contrT` factors, so additivity, scalar multiplication, and finite sums in either argument are already the generic `map_add`/`map_smul`/`map_sum` and need no lemmas of their own.

C. Rebracketing the metric chain

Both bracketings reduce to one product contracted at its two seams in opposite order, then drop to the pure-tensor level, so the seam permutation never crosses a contraction under `whnf`; `Pure.permP_dropPair_dropPair_congr` closes the step.

D. Permutation commutators

Moving a relabelling of one factor through the slot-addressed contraction. The relabelling `σ` need not fix the contracted slot, so it carries the contraction from slot `i` to slot `σ i` and restricts to the survivors as a map `σ'` filling the square `(σ i).succAbove ∘ σ' = σ ∘ i.succAbove`. Taking `σ'` as an argument rather than deriving it lets a caller supply the survivor map it wants (`id`, a swap-induced map) instead of an opaque composite.

6 declarations

definition

Slot-addressed cross contraction of slot ii and slot jj

Let SS be a tensor species over a ring kk. Given two color sequences cA:Fin(nA+1)Cc_A: \text{Fin}(n_A+1) \to C and cB:Fin(nB+1)Cc_B: \text{Fin}(n_B+1) \to C, let iFin(nA+1)i \in \text{Fin}(n_A+1) and jFin(nB+1)j \in \text{Fin}(n_B+1) be indices such that the color at cA(i)c_A(i) is dual to the color at cB(j)c_B(j) (i.e., S.τ(cA(i))=cB(j)S.\tau(c_A(i)) = c_B(j)). The cross contraction `crossToEnd` is the kk-bilinear map: TensorS(cA)×TensorS(cB)TensorS(cout)\text{Tensor}_S(c_A) \times \text{Tensor}_S(c_B) \to \text{Tensor}_S(c_{out}) which takes tensors t1t_1 and t2t_2 and returns the contraction of the ii-th slot of t1t_1 with the jj-th slot of t2t_2. The resulting color sequence coutc_{out} is the concatenation of cAc_A (omitting index ii) and cBc_B (omitting index jj), specifically cout=(cAsuccAbovei)(cBsuccAbovej)c_{out} = (c_A \circ \text{succAbove}_i) \oplus (c_B \circ \text{succAbove}_j), where succAbovek\text{succAbove}_k is the order-preserving map that skips index kk.

theorem

`crossToEnd` of Rank-2 Tensors Equals `contrT` of Product on Slots 1 and 2

Let SS be a tensor species over a ring kk. Let cA,cB:Fin 2Cc_A, c_B : \text{Fin } 2 \to C be color sequences for rank-2 tensors. If the last slot of cAc_A is dual to the first slot of cBc_B, such that h:S.τ(cA(1))=cB(0)h : S.\tau(c_A(1)) = c_B(0), then for any tensors ATensorS(cA)A \in \text{Tensor}_S(c_A) and BTensorS(cB)B \in \text{Tensor}_S(c_B), the cross contraction of the second slot of AA with the first slot of BB is equivalent to the contraction of their tensor product ABA \otimes B at the middle indices 1 and 2, up to a color-recasting reindexing: crossToEnd(1,0,h)(A,B)=permT(id,ϕ)(contrT1,2(AB))\text{crossToEnd}(1, 0, h)(A, B) = \text{permT}(\text{id}, \phi)(\text{contrT}_{1,2}(A \otimes B)) where contrT1,2\text{contrT}_{1,2} denotes the contraction of the slots at indices 1 and 2 of the rank-4 product tensor, and permT(id,ϕ)\text{permT}(\text{id}, \phi) is the reindexing map associated with the identity permutation used to match the resulting color sequences.

theorem

GG-Equivariance of Slot-Addressed Cross Contraction: crossToEnd(gt1,gt2)=gcrossToEnd(t1,t2)\text{crossToEnd}(g \cdot t_1, g \cdot t_2) = g \cdot \text{crossToEnd}(t_1, t_2)

Let SS be a tensor species over a ring kk and GG be a group acting on the tensors. Given two tensors t1TensorS(cA)t_1 \in \text{Tensor}_S(c_A) and t2TensorS(cB)t_2 \in \text{Tensor}_S(c_B), and indices iFin(nA+1)i \in \text{Fin}(n_A + 1) and jFin(nB+1)j \in \text{Fin}(n_B + 1) such that the color of the ii-th slot of t1t_1 is dual to the color of the jj-th slot of t2t_2 (i.e., S.τ(cA(i))=cB(j)S.\tau(c_A(i)) = c_B(j)), the slot-addressed cross contraction is equivariant under the action of GG. That is, for any group element gGg \in G: crossToEndi,j(gt1,gt2)=gcrossToEndi,j(t1,t2)\text{crossToEnd}_{i, j}(g \cdot t_1, g \cdot t_2) = g \cdot \text{crossToEnd}_{i, j}(t_1, t_2) This property follows from the fact that the underlying operations of tensor product (`prodT`), single-tensor contraction (`contrT`), and permutation (`permT`) are all GG-equivariant.

theorem

Associativity of tensor contraction for rank-two chains (tAtB)tC=tA(tBtC)(t_A \cdot t_B) \cdot t_C = t_A \cdot (t_B \cdot t_C)

Let SS be a tensor species over a ring kk. Let tAt_A be a tensor of rank nA+1n_A + 1 with color sequence cAc_A, and let tBt_B and tCt_C be tensors of rank 2 with color sequences cBc_B and cCc_C. Given a slot iAi_A in tAt_A, suppose that the iAi_A-th slot of tAt_A is dual to the 00-th slot of tBt_B (i.e., S.τ(cA(iA))=cB(0)S.\tau(c_A(i_A)) = c_B(0)), and the 11-st slot of tBt_B is dual to the 00-th slot of tCt_C (i.e., S.τ(cB(1))=cC(0)S.\tau(c_B(1)) = c_C(0)). Then the result of first contracting tAt_A and tBt_B at slots iAi_A and 00, and then contracting the result with tCt_C at the slot corresponding to tBt_B's survivor and tCt_C's 00-th slot, is equal to the result of first contracting tBt_B and tCt_C at slots 11 and 00, and then contracting tAt_A with that result at slot iAi_A and the slot corresponding to tBt_B's survivor. This equality holds up to a color reindexing permT(id)\text{permT}(\text{id}). Symbolically, if i,j\cdot_{i,j} denotes the `crossToEnd` contraction at slots ii and jj, then: (tAiA,0tB)last,0tC=permT(id)(tAiA,0(tB1,0tC))(t_A \cdot_{i_A, 0} t_B) \cdot_{\text{last}, 0} t_C = \text{permT}(\text{id}) (t_A \cdot_{i_A, 0} (t_B \cdot_{1, 0} t_C)) where last\text{last} refers to the index in the intermediate product where the survivor slot of the rank-two tensor tBt_B resides.

theorem

Reindexing Commutes with Left Side of Cross Contraction

Let SS be a tensor species over a ring kk. Consider two tensors t1t_1 and t2t_2 of rank nA+1n_A + 1 and nB+1n_B + 1 with color sequences cAc_A and cBc_B, respectively. Let σ\sigma be a reindexing (a color-preserving bijection) of the indices of t1t_1, and let ii and jj be indices such that the ii-th slot of the reindexed tensor permT(σ,t1)\text{permT}(\sigma, t_1) is dual to the jj-th slot of t2t_2 (i.e., S.τ(cA(σ(i)))=cB(j)S.\tau(c_A(\sigma(i))) = c_B(j)). If σ:Fin(nA)Fin(nA)\sigma': \text{Fin}(n_A) \to \text{Fin}(n_A) is a reindexing of the surviving indices of t1t_1 that satisfies the consistency condition (succAboveσ(i)σ)=(σsuccAbovei)(\text{succAbove}_{\sigma(i)} \circ \sigma') = (\sigma \circ \text{succAbove}_i), then contracting the ii-th slot of the permuted tensor permT(σ,t1)\text{permT}(\sigma, t_1) with the jj-th slot of t2t_2 is equivalent to first contracting the σ(i)\sigma(i)-th slot of the original tensor t1t_1 with the jj-th slot of t2t_2, and then reindexing the resulting survivors. Specifically: crossToEndij(permTσ(t1),t2)=permTσid(crossToEndσ(i)j(t1,t2))\text{crossToEnd}_i^j(\text{permT}_\sigma(t_1), t_2) = \text{permT}_{\sigma' \oplus \text{id}}(\text{crossToEnd}_{\sigma(i)}^j(t_1, t_2)) where σid\sigma' \oplus \text{id} is the reindexing on the nA+nBn_A + n_B surviving indices that applies σ\sigma' to the slots originating from t1t_1 and the identity map to the slots originating from t2t_2.

theorem

Commutativity of cross contraction with right-factor reindexing

Let SS be a tensor species. Let t1t_1 be a tensor of rank nA+1n_A + 1 with index colors cAc_A, and let t2t_2 be a tensor of rank nB+1n_B + 1 with index colors cBc_B. Let σ\sigma be a reindexing (permutation) of the indices of t2t_2 such that the permuted tensor t2t_2' has colors cBc_B'. Suppose we contract the ii-th slot of t1t_1 with the jj-th slot of the permuted tensor t2t_2'. This theorem states that this is equivalent to contracting the ii-th slot of t1t_1 with the σ(j)\sigma(j)-th slot of the original tensor t2t_2, and then reindexing the resulting survivors. The reindexing of the final tensor is defined by the identity map on the indices originating from t1t_1 and the map σ\sigma' on the indices originating from t2t_2, where σ\sigma' is the permutation of the nBn_B surviving slots of t2t_2 that satisfies (σ(j)).succAboveσ=σj.succAbove(\sigma(j)).\text{succAbove} \circ \sigma' = \sigma \circ j.\text{succAbove}.