What is the definition of tensor contraction?

Solution 1:

Yes, this is correct, but I don't think you should get too used to contracting indices that aren't adjacent. Most of this formalism is quite general and in particular there are contexts where you have tensor products and duals but either there is no symmetry $X \otimes Y \to Y \otimes X$ or the symmetry is nontrivial in some way, and when you contract indices that aren't adjacent in this context what you are really doing is permuting some indices, contracting some indices, then permuting some more indices, and in general you have to keep track of what you're permuting.

To be more precise, in a braided monoidal category you have distinguished isomorphisms $\gamma_{A, B} : A \otimes B \to B \otimes A$ but you aren't guaranteed that $\gamma_{A, B} \gamma_{B, A} = \text{id}$, and even when you do have this condition $\gamma_{A, B}$ doesn't necessarily do the obvious thing. For example, on the category of $\mathbb{Z}$-graded vector spaces you can introduce the braiding $a \otimes b \mapsto (-1)^{|a| |b|} b \otimes a$ where $|a|, |b|$ refers to the grading. If you don't keep track of what permutations you're doing before and after you contract, you'll drop a sign.

Solution 2:

Yes, that looks correct to me. I'm afraid I can't speak to what common alternative definitions are, however.