[Tex/LaTex] Operators with subscripts, superscripts, and accents

math-operators

In mathematics, the tensor product between two vector spaces U and V is often notated

UK V,

if the scalar field is called K. This is usually typed in TeX like U\otimes_K V. I wonder if this is the right way to type this? \otimes is usually a binary operator, but does TeX still see it this way when I add a subscript to it? Should I perhaps write something like U\mathbin{\otimes_K} V instead?

MWE (even if I don't really see the point in this case):

\documentclass{article}

\begin{document}

$U\otimes_K V$

\end{document}

Best Answer

A math atom has three fields: the base, the subscript and the superscript. When you attach a subscript or superscript to a symbol, it doesn't lose its type. So the whole

\otimes_{K}

(the braces could be omitted here, because the subscript has just one token) is considered as a Bin atom. Thus with

U \otimes_{K} V

you get the sequence

[U]Ord [medium space] [⊗K]Bin [medium space] [V]Ord

(where brackets isolate atoms and spacings and the subscripts to ] denote an atom's type).

You have only to pay attention to other cases: suppose you want to denote the tensor product of the right module MA with the left module AN. In this case

N_{A} \otimes {}_AM

should be used, because in

N_{A} \otimes _AM

the subscript would be interpreted as given to \otimes.

While I'm on it, I'll present a different situation. Suppose you need a “completed tensor product”. If you try

$U \hat{\otimes} V$

the spacing will be wrong. This is because \hat{...} builds an Acc atom (accent), which is then regarded as Ord when spaces are being added during the transformation of the math list into boxes. For this case \mathbin is necessary; of course it's better to define a command:

\newcommand{\ctens}{\mathbin{\hat{\otimes}}}

so that you can type

$U \ctens V$

or even

$U \ctens_{K} V$

and the subscript will be attached to the whole Bin atom resulting from \ctens.

Full example

\documentclass{article}

\newcommand{\ctens}{\mathbin{\hat{\otimes}}}

\begin{document}

$U\otimes_K V$ (good)

$U\mathbin{\otimes_K} V$ (the same)

$M_{A}\otimes {}_{A}N$ (good)

$M_{A}\otimes _{A}N$ (bad)

$U \hat{\otimes} V$ (bad)

$U \ctens V$ (good)

$U \ctens_{K} V$ (good)

\end{document}

enter image description here

Related Question