Example 2.2.2.4 (Bimodules). We define a $2$-category $\mathrm{Bimod}$ as follows:
The objects of $\mathrm{Bimod}$ are associative rings.
For every pair of associative rings $A$ and $B$, we take $\underline{\operatorname{Hom}}_{\mathrm{Bimod}}( B, A)$ to be the category whose objects are $A$-$B$ bimodules: that is, abelian groups $M = {}_{A}^{}M_{B}$ equipped with commuting actions of $A$ on the left and $B$ on the right.
For every triple of associative rings $A$, $B$, and $C$, we take the composition law
\[ \underline{\operatorname{Hom}}_{\mathrm{Bimod}}( B, A) \times \underline{\operatorname{Hom}}_{\mathrm{Bimod}}( C,B ) \rightarrow \underline{\operatorname{Hom}}_{\mathrm{Bimod}}( C, A) \]to be the relative tensor product functor
\[ ( M, N ) \mapsto M {\otimes _{B}} N \]For every associative ring $A$, we take the identity object of $\underline{\operatorname{Hom}}_{\mathrm{Bimod}}( A, A)$ to be the ring $A$ (regarded as a bimodule over itself) and the unit constraint $\upsilon _{A}: A \otimes _{A} A \xrightarrow {\sim } A$ is the map given by $\upsilon _{A}(x \otimes y) = xy$.
For every quadruple of associative rings $A$, $B$, $C$, and $D$ equipped with bimodules $M = {}_{A}^{}M_ B$, $N = {}_{B}^{}N_ C$, and $P = {}_{C}^{}P_ D$, we define the associativity constraint
\[ \alpha _{M,N,P}: M \otimes _{B} (N \otimes _{C} P) \xRightarrow {\sim } ( M \otimes _{B} N) \otimes _{C} P \]to be the isomorphism characterized by the identity $\alpha _{M, N, P}(x \otimes (y \otimes z)) = (x \otimes y) \otimes z$.