# A group and an associated digraph

I am trying to understand the proof of the following statement:

Let $\Gamma=\{g_1,\cdots,g_n\}$ be a group. Define a digraph $G$ by joining $g_i$ to $g_j$ by an edge of color $k$ if $g_ig_j^{-1}=g_k$. The automorphism group of the resulting colored digraph is isomorphic to $\Gamma$.

The proof in the book, constructs a map $\phi:\Gamma\to Aut(G)$ defined by $\phi(g)=f_g$ where $f_g\in Aut(G)$ such that $f_g(g_i)=g_ig$. Then it shows that $\phi$ is bijective.

The next sentence in the book (and the sentence I have a problem with) is:

Since it is easy to see that the multiplication of elements of $\Gamma$ is the same as multiplication between the corresponding automorphisms of $G$, we conclude that the automorphism group of $G$ is isomorphic with $\Gamma$.

Obviously the meaning here is that $\phi$ is a homomorphism. However, I don't understand why $\phi(g_ig_j)=\phi(g_i)\circ\phi(g_j)$. Indeed, $f_{g_ig_j}(g_k)=g_kg_ig_j\ne g_kg_jg_i=f_{g_i}\circ f_{g_j}(g_k)$, and so $\phi(g_ig_j)\ne\phi(g_i)\circ\phi(g_j)$, in general.

-

There are $2$ kinds of mathematicians: one that writes composition of functions from right to left, and one from left to right.
If you instead consider the (other) $\phi$ acting from the left: $\phi(g)= x\mapsto gx$, then all is going to fit again. Or, alternatively, instead of $\circ$ you can think about its dual operation in $Aut(G)$.
And, it also might be a typo ['$f_g(g_i)=gg_i$'], or the book uses something in the other direction.
Finally, among groups, it doesn't really matter, because if we have such a 'contravariant' homomorphism, i.e. which satisfies $$\phi(ab)=\phi(b)\phi(a)$$ then the mapping $x\mapsto \phi(x)^{-1}$ will be an ordinary group homomorphism, preserving the direction of the group operation.