Suppose that $L/K$ is a finite separable extension of fields and let $M$ denote the Galois closure of $L$. Let $\textrm{Hom}_K(L,M)$ denote the set of all $K$ - algebra homomorphisms from $L$ to $M$. Since $L/K$ is separable we know that the number of elements in $\textrm{Hom}_K(L,M)$ is equal to $[L:K]$. Now I want to prove that we have an isomorphism of $M$ - algebras
$\varphi : M \otimes_K L \stackrel{\simeq}{\longrightarrow} M^{[L:K]}$
Proof that they are isomorphic as $K$ - modules : Write $L = K(a)$ for some $ a\in L$ (we can do this via the primitive element theorem). Then
$\begin{eqnarray*} M \otimes_K L &=& M \otimes_K K[a] \\ &\cong& M\otimes_K K[x]/(f) \hspace{3mm} \text{where $f$ is the minimal polynomial of $a$ over $K$} \\ &\cong& M[x]/(f)\\ &\cong& M[x]/(f_1\ldots f_{[L:K]}) \hspace{3mm} \text{where the $f_i$ are the distinct}\\ && \hspace{1.5in} \text{irreducible factors of $f$ since $M/L$ is Galois} \\ &\cong& M^{[L:K]}\end{eqnarray*}$
where the last step was using the Chinese remainder theorem. For the third last step, we consider the ses
$ 0 \to (f) \to K[x] \to K[x]/(f) \to 0$
and tensor with the exact functor $-\otimes_K M$ to get $0 \to (f) \otimes_K M \to K[x] \otimes_K M \to K[x]/(f) \otimes_K M \to 0$
and so $\begin{eqnarray*} M \otimes_K K[x]/(f) &\cong& K[x]/(f) \otimes_{K} M \\ &\cong& \frac{K[x] \otimes_{K} M}{f \otimes_K M}\\ & \cong& M[x]/(f) \end{eqnarray*}$ where $(f)$ is now viewed as an ideal of $M[x]$.
My question is: The tensor product $M \otimes_K L$ is a left $M$ - module, but why is it also an $M$ - algebra? Also why are the isomorphisms above isomorphisms of $M$ - algebras and not just $K$ - modules?