\frametitle {Arithmetic architecture and Coercion}
William Stein, D. Harvey, M. Albrecht (Bremen grad)
\begin{itemize}
\item {\bf\dred OBJECT COERCION {\tt \_coerce\_}:}
Suppose a {\tt\_coerce\_} map $R \to S$ is defined. Then:
\begin{enumerate}
\item {\tt R.category()} must be a {\dblue subcategory} of {\tt S.category()}.
\item The map $R \to S$ defined by coerce must
define a {\dblue morphism} in {\tt S.category()}.
\item If {\tt \_coerce\_} is defined in {\dblue both direction}, then the composition in both
directions must be the identity maps.
\item {\dblue Reflexive:} If {\tt R is S} is True, then {\tt \_coerce\_} must be the identity map.
\item {\dblue Transitive:} If coercion from $R$ to $S$ is defined and
coercion from $S$ to $T$ is defined, then coercion from $R$ to $T$
must also be defined, and must agree with the composition of the coercion
from $R$ to $S$ with the one from $S$ to $T$.
\end{enumerate}
\item {\bf ARITHMETIC {\tt \_\_add\_\_}, {\tt \_\_mul\_\_}, ...:}:
When doing a binary operation, if the parents are not identical
(in the sense of is), determine if {\dblue precisely one} {\tt \_coerce\_} map is defined;
if so, apply it and do the arithmetic operation. If {\dblue both} are defined,
the parents are canonically isomorphic, so use the left one.
If {\dblue neither} are defined, raise
a TypeError.
\end{itemize}