TITLE: What is the formal definition of a dual category?
QUESTION [10 upvotes]: I'm reading this book as an introduction to category and I have a problem with the definition of the dual category given on page 25. The right way to get the dual category can be described by turning around arrows and permuting the order of their composition. However I don't know how this works out with the statement
$$\text{hom}_{\bf{A^{OP}}}(A,B)=\text{hom}_{\bf{A}}(B,A).$$
The set of morphisms $\text{hom}_{\bf{A}}(B,A)$ is already defined and the category $\bf{A}^{OP}$ is sopposed to contain morphisms, which are turned around, i.e. morphisms with different domain and codomain. How can these new ones equal the one from the first category? I remember reading this before in a book, and although the english wikipedia doesn't use this expression, the russian (?) one seems to use this definition as well.
So say I have a category $\bf{C}$ with only two objects $a,b$, as well as a single morphism $f$ from $a$ to $b$. From the description I think the dual category $\bf{C}^{OP}$ is the one with $a,b$ and an arrow from $b$ to $a$. How does the formula work if this new morphism isn't contained in $\bf{C}$, so that $\text{hom}_{\bf{C}}(b,a)$ is essentially empty?

REPLY [4 votes]: I think MacLane's "Categories for the working mathematician" says it better than your book: 

"To each category $\cal{C}$ we also associate the opposite category $\cal{C}^{op}$. The objects of  $\cal{C}^{op}$ are the objects of  $\cal{C}$, the arrows of  $\cal{C}^{op}$ are arrows $f^{op}$ in one-one correspondence $f \mapsto f^{op}$ with the arrows $f$ of  $\cal{C}$. For each arrow $f: a \longrightarrow b$ of  $\cal{C}$, the domain and codomain of the corresponding arrow $f^{op}$ are as in $f^{op}: b \longrightarrow a$ (the direction reversed). The composite $f^{op}g^{op} = (gf)^{op}$ is defined in  $\cal{C}^{op}$ exactly when the composite $gf$ is defined in  $\cal{C}$.