If modules $A$ and $B$ are decomposable into direct sum and product, then $Hom(A,B) \sim \Pi Hom(A_u, B_v)$, question about proof I'm trying to understand a part of the theorem below:

in the beggining of the proof, it talks about an arbitrary element of $P = \Pi_{(u,v)} Hom(A_u, B_v)$ as being a function defined on $M\times N$. But as I understand direct products, it should be a n-uple of elements of $Hom(A_u, B_v)$, so it should be an n-uple of homomorphisms from $A_u$ to $B_v$, but it says it's a function $f(u,v)$ in $Hom(A_u, B_v)$
 A: I learned this theorem in my third year of undergrad.  It finally became "obvious" to me in the last year or so.  
In topology, you can take the cartesian product of two topological spaces $X$ and $Y$ and give it a topology called the product topology: the open sets in $X \times Y$ are by definition unions of sets of the form $U \times V$, where $U$ is open in $X$ and $V$ is open in $Y$.  What's special about this topology is that it gives you a nice way to characterize continuous maps into $X \times Y$.  If $Z$ is any topological space, then to give a continuous map of $Z$ into $X \times Y$ is the same thing as giving a pair of continuous maps $Z \rightarrow X, Z \rightarrow Y$.  A nice way of saying this is that the map $f \mapsto (\pi_X \circ f, \pi_Y \circ f)$
$$\textrm{Hom}_{\textrm{cont}}(Z, X \times Y) \rightarrow \textrm{Hom}_{\textrm{cont}}(Z, X) \times \textrm{Hom}_{\textrm{cont}}(Z,Y)$$
is a bijection of sets.
To answer your question, there are really two things going on here: direct products can be taken out of the second variable in $\textrm{Hom}$, and direct sums can be taken out of the first variable to become direct products.  By combining both principles into one theorem, your book gives a slick proof, but it is obfuscating what is really going on.
Products:
Let $N_i : i \in I$ be a collection of $R$-modules.  The important thing about the product $\prod\limits_{i \in I} N_i$ is not its literal form, but the nice way in which homomorphisms into it can be characterized.  Namely, if you want to give a homomorphism of a module $M$ into $\prod\limits_{i \in I} N_i$, that's the same thing as giving a collection of homomorphisms of $M$ into each $N_i$.  This is obvious if you think about it.  Another way of saying this is that 
$$\textrm{Hom}_R(M, \prod\limits_{i \in I} N_i) \rightarrow \prod\limits_{i \in I} \textrm{Hom}_R(M,N_i)$$
$$ f \mapsto (\pi_i \circ f)_i$$
is a bijection of sets, where $\pi_j: \prod\limits_{i \in I} N_i \rightarrow N_j$ is the projection homomorphism.  Less interestingly, this map is an $R$-module homomorphism.  Being also a bijection, it is an isomorphism of $R$-modules.
Coproducts:
Let $M_i : i \in I$ be a collection of $R$-modules.  The important thing about the coproduct (or direct sum, whatever) $\bigoplus\limits_{i \in I} M_i$ is not its literal form, but the nice way in which homomorphisms out of it can be characterized.  Namely, if you want to give a homomorphism of $\bigoplus\limits_{i \in I} M_i$ into a module $N$, that's the same thing as giving a collection of homomorphisms of each $M_i$ into $N$.  This is obvious if you think about it.  Another way of saying this is that 
$$\textrm{Hom}_R(\bigoplus\limits_{i \in I} M_i,  N) \rightarrow \prod\limits_{i \in I} \textrm{Hom}_R(M_i,N)$$
$$ f \mapsto (f \circ \iota_i)_i$$
is a bijection of sets, where $\iota_j: M_j \rightarrow \bigoplus\limits_{i \in I} M_i$ is the inclusion homomorphism.  Less interestingly, this map is an $R$-module homomorphism.  Being also a bijection, it is an isomorphism of $R$-modules.
