Properties of diagonal and permutation matrices.

I've been reading about equivalent codes, and the topic of monomial automorphisms came up. These are the set of monomial matrices (square matrices with exactly one nonzero entry in each row and column) that map a code $\mathcal{C}$ to itself. There are several properties mentioned that I am having trouble verifying, and I was wondering if anyone can help. The properties are:

For diagonal matrices $D_i$, permutation matrices $P_i$ and automorphisms $\gamma_i$ of the field $\mathbb{F}_q$:

(a) $(D_1P_1\gamma_1)(D_2P_2\gamma_2) = (D_3P_3\gamma_3)$

(b) $(D_4P_4\gamma_4)^{-1} = D_5P_5\gamma_5$

For (a), I am having trouble finding $D_3$, $P_3$, and $\gamma_3$ in terms of $D_1, D_2, P_1, P_2, \gamma_1,$ and $\gamma_2$. For (b), I am having trouble finding $D_5, P_5,$ and $\gamma_5$ in terms of $D_4, P_4,$ and $\gamma_4$.

Any help would be greatly appreciated.

EDIT

If $\gamma$ is a field automorphism of $\mathbb{F}_q$, $\sigma$ is the permutation associated with $P$, and $M = DP$ is a monomial map with entries in $\mathbb{F}_q$, then applying the map $M\gamma$ to a vector $x$ goes as follows:

1. Multiply the $i$th component of $x$ by the $i$th diagonal entry of $D$,
2. Move this product to the coordinate position $i\sigma$,
3. Apply $\gamma$ to this component.

So basically, you apply the permutaion to the diagonal matrix, and then you apply the field automorphism on the right of the elements in the resulting matrix.

-

A fact that seems quite crucial is that if $D$ is diagonal, and $P$ is a permutation matrix (so that in particular $PP^\top = I$, the identity matrix), then you have: $$DP = P P^\top D P = P D'$$ where $D' = P^\top D P$ is diagonal again ($D'$ is basically $D$ with entries permutated by $P$).
You can use this for instance to find that: $$P_1 D_1 P_2 D_2 = P_1 P_2 D'_1 D_2 = P_3 D_3$$ where $P_3 = P_1 P_2$ is a permutation matrix, and $D_3 = D_1' D_2$ is diagoal.
By using the definition, I'm thinking that $\gamma_3 = \gamma_2 \circ \gamma_1$, that is apply $\gamma_1$, then apply $\gamma_2$ to the entries of the resulting $P_3 D_3$ matrix. –  josh Sep 15 '12 at 20:31
For part (b), I was able to use a similar trick you used for part (a) to get: $D_4 P_4 = P_4 P^{\top}_{4} D_4 P_4$. Therefore, $(D_4 P_4)^{-1} = (P^{\top}_{4} D^{-1}_4 P_4)(P^{\top}_{4})$. Thus, $D_5 = P^{\top}_{4} D^{-1}_4 P_4$ and $P_5 = P^{\top}_{4}$. –  josh Sep 15 '12 at 21:06