Semi simple representation identified with $\hom$ I'm reading Introduction to Representation Theory by Pavel Etingof et al.  and I have a question about a remark they make.  They say that by Shur's lemma any semi simple representation $V$ of an algebra $A$ can be identified with 
$$\oplus_X \hom_A(X,V) \otimes X$$
where $X$ runs over all irreducible representations of $A.$  They claim that the functions $f$ given by $g\otimes x \mapsto g(x)$ gives an isomorphism.
First, I just want to be sure I understand the definition of $f.$  Is it defined like this:
$$f(g_1\otimes x_1, \ldots, g_n\otimes x_n) = g_1(x) + \cdots + g_n(x)?$$
I'm having a hard time formulating the proof.  It's mostly just wording it the right way, in particular proving that $f$ is onto.  The problem comes from the fact that $X$ may appear more than once in the decomposition of $V.$  Here is my attempt:
Pick a basis for each of the $X$ appearing in the decomposition for $V$ then if $v\in V$ we can write $v = c_1x_1 + \cdots c_rx_r.$  Then we may choose $g\in\hom_A(X,V)$ to be the identity so $g_i\otimes(c_ix_i) = c_ix_i$ where $x_i\in X.$  Then 
$$f(g_1\otimes x_1, \cdots g_n\otimes x_n) = g_1(x_1) + \cdots + g(x_n) = c_1x_1 + \cdots c_nx_n$$
But there is the problem, $n$ might be smaller than $r.$  For example if $V = X \oplus X$ for some $X$ then
$$\oplus_X \hom_A(X,V) \otimes X = \hom_A(X,V)\otimes X \oplus 0 \oplus \cdots \oplus 0$$
But then if I try the proof above I have that $v = c_1x_1 + c_2x_2$ but then I only have 
$$f(g_1\otimes c_1x_1, 0 , 0 ,\ldots 0) = g_1(x_1) = c_1x_1$$
 which doesnt hit $v.$  I realize I could fix this by $f(g_1\otimes c_1x_1 + g_2\otimes c_2x_2, 0, \ldots 0)$ but how do I fix my proof to accomodate this. 
I think the answer is in writing $\hom_A(X,V) \cong \hom_A(X,X\oplus\cdots \oplus X) \cong \oplus \hom_A(X,X)$ but then the notation gets messy and Im not sure how to write it down.
Thanks
 A: Suppose that $m_i$ is the multiplicity of the simple $A$-module $X_i$ in $V$ and that
$$V=\underbrace{X_1\oplus\cdots\oplus X_1}_{m_1}\oplus\cdots\cdots\oplus\underbrace{X_n\oplus\cdots X_n}_{m_{\large n}}.$$
In particular suppose that
$$\underbrace{X_i\oplus\cdots\oplus X_i}_{m_{\large i}}=Ax_{i,1}\oplus\cdots\oplus Ax_{i,m_{\large i}}.$$
(Any simple module is cyclic i.e. generated by any nonzero element.)
Then any vector $v\in V$ may be written as a linear combination ($c_{i,j}\in A$):
$$v=\sum_{i=1}^n\sum_{j=1}^{m_{\large i}} c_{i,j}x_{i,j}.$$
Fix $v$ as above. For each $1\le i\le n,1\le j\le m_i$ fix $u_i\in X_i$ nonzero and define $g_{i,j}$ as
$$X_i\to \underbrace{X_i\oplus\cdots\oplus X_i}_{m_{\large i}}:\quad ax_{i,j}\mapsto(0,0,\cdots,0,ax_{i,j},0,\cdots,0).$$
Thus $g_{i,j}$ embeds $X_i$ into the $j$th summand in $X_i\oplus\cdots\oplus X_i$. Then
$$\bigoplus \hom(X,V)\otimes X\to V:~\left(\sum_{j=1}^{m_1}g_{1,j}\otimes c_{1,j}x_{1,j},\cdots,\sum_{j=1}^{m_n}g_{n,j}\otimes c_{n,j}x_{n,j}\right)\mapsto v$$
so every $v\in V$ is in the image of this map.
