Why is this isomorphism $M \otimes_K L \stackrel{\simeq}{\longrightarrow} M^{[L:K]}$ an isomorphism of $M$ - algebras?

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?

-
My question is: What motivates your question? The primitive element theorem is a basic tool in field theory. And your proof is standard. –  Martin Brandenburg Dec 21 '12 at 12:35
@MartinBrandenburg Sorry I just realised I can do it without the primitive element theorem by inducting on the number of elements that we adjoint to $K$ to obtain $L$. I have changed my question now. I am sorry. –  fpqc Dec 21 '12 at 12:36
Don't you naturally get an $L$-algebra structure on the tensor product of two $L$-algebras? The algebra being commutative, $M$ will inject into its center, so you get an $M$-algebra structure, no? –  Jyrki Lahtonen Dec 21 '12 at 12:50
@JyrkiLahtonen You're saying that $M \otimes_K L$ is a $K$ - algebra (I get that) and hence an $M$ - algebra (which I don't get)? –  fpqc Dec 21 '12 at 12:58

Let $S$ be the set of $K$-algebra morphisms $L\to M$ and consider the morphism of $K$-algebras $$f:L\to M^S:l\mapsto (\sigma (l))_{\sigma \in S}$$Since $M^S$ is an $M$-algebra, by the universal property of extension of scalars for algebras, $f$ extends to a morphism of $M$-algebras $$F:M\otimes_K L\to M^S:m\otimes l\mapsto (m\cdot \sigma (l))_{\sigma \in S}$$ [Notice that the scalar multiplication by elements of $M$ on $M\otimes_K L$ occurs via the left factor.]
This morphism is surjective because of the theorem of $M$-linear independence of the $K$-homomorphisms $L\to M$.
Hence $F$ is an isomorphism of $M$-algebras, by dimension count.

Conclusion
The morphism $$F:M\otimes_K L\to M^S:m\otimes l\mapsto (m\cdot \sigma (l))_{\sigma \in S}$$ is an isomorphism of $M$-algebras.
Since $L/K$ is a separable extension, we have $\text {card}S=[L:K]$ so that your question is answered (and using $S$ instead of $[L:K]$ makes the reasoning more canonical).

Edit
For the sake of completeness let me remind what Dedekind's theorem on linear independence of homomorphisms says:
Given an algebra $A$ over a field $K$ and an arbitrary field extension $K\subset M$, the set of algebra homomorphisms $Hom_{K-alg}(A,M)$ [a set absolutely devoid of any algebraic structure, very possibly empty !] is linearly independent in the $M$-vector space $\mathcal L_{K-lin}(A,M)$

-
I always love it when you answer my questions because man that answer above was slick! I should have noticed that $M \otimes_K L$ was just a way of "changing our coefficients". However, that being said in my proof above is there a way to see why my sequence of isomorphisms are isomorphisms of $M$ - algebras? –  fpqc Dec 21 '12 at 22:11
Dear BenjaLim, thanks for the kind words. My proof is, despite appearances, quite close to yours: the various $K$-homomorphisms $\sigma_i: L=K[a]\to M$ are obtained by sending $a$ to the various roots $a_i$ of the separable polynomial $f$ [in your notation $f_i=x-a_i$], so I think that you could prove that your isomorphism is one of $M$-algebras by following what happens to a decomposable tensor $m\otimes l \in M\otimes L$ along your displayed isomorphisms. –  Georges Elencwajg Dec 21 '12 at 23:05
I like your proof in that it does not use the primitive element theorem. My proof will still work by induction (since any finite extension $L/K$ is always of the form $L = K(a_1,\ldots,a_k)$ for $a_1,\ldots,a_k \in L$) but of course an element-free approach is always nicest. I will get back to you if I have any problems with my isomorphisms above. –  fpqc Dec 21 '12 at 23:26
I see the edit that you made above about Dedekind's theorem. Is this the same one on linear independence of characters as in page 51 of here? Thanks. –  fpqc Dec 21 '12 at 23:57
Dear BenjaLim, Milne's independence of characters is a corollary of the more general version I quote, obtained by taking $L=K$, $A=K[G]$ (the group algebra) and using the adjunction formula $Hom_{grp}(G,K^*)=Hom_{K-alg}(K[G],K)$. –  Georges Elencwajg Dec 22 '12 at 8:07