Jacobi's four square theorem I hope that this question is appropriate here. I am Interested in the Proof for the named theorem only using modular forms. I read on Wikipedia that the Proof actually breaks down to an Identitiy for theta series  on the congruence sub Group  $\Gamma_1(4)$ and weight  $k=2$. I have to say that I only know some Basic stuff About modular forms and only very little to nothing About theta series at this point. Also I want to ask if one needs Lambert series for this Proof? I would appreciate any help. And maybe you know a good Source for a Proof using this method.
 A: This is detailed p.11 and p.95 of Diamond & Shurman book.
Let $\vartheta(z) = \sum_{n=-\infty}^\infty e^{2i \pi n^2 z}$ and $r_4(n) = \# \{v \in \mathbb{Z},n = \sum_{j=1}^4 v_j^2 \}$ and $f(z) = \sum_{n=1}^\infty r_4(n)e^{2i \pi n z}$.  Then $$\vartheta(z)^4 = f(z)$$


*

*Using the Poisson formula show that $\vartheta(z)$ is modular of weight $1/2$ for $\Gamma_0(4)$, and together with the fact that $\vartheta(z)^4$ is holomorphic at the cusp, you get that $f(z) \in M_2(\Gamma_0(4))$ the vector space of modular forms of weight $2$ for $\Gamma_0(4)$.

*Furthermore $G_{2,2}(z) = G_2(z) - 2 G_2(2z)$ and $G_{2,4}(z) = G_2(z) - 4 G_2(4z)$ are linearly independent and are in $M_2(\Gamma_0(4))$

*The Riemann-Roch theorem applied to the compact Riemann surface $X(\Gamma_0(4))$ which is $Y(\Gamma_0(4))=\mathcal{H}\setminus \Gamma_0(4)$ compactified with the cusps added, give $\text{dim}(M_2(\Gamma_0(4))=2$.

*And hence $f(z) = \alpha G_{2,2}(z)+\beta G_{2,4}(z)$ for some $\alpha,\beta \in \mathbb{C}$. Computing the first few coefficients give $\alpha = 0,\beta=\frac{-1}{\pi^2}$, i.e. with the Fourier expansion of $G_k(z) = 1+C_k\sum_{n=1}^\infty e^{2i \pi n z} \sum_{d |n} d^{k-1}$ : $$r_4(n) = 8 \sum_{d | n, 4 \nmid d} d$$
A: Don Zagier's chapter 'Elliptic Modular Forms and Their Applications' from the book '1-2-3 of modular forms' has a section on theta series and how it can be used to prove the sum of two and four squares theorem. 
