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.
2 Answers
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$$
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.

- 556
Then $$f(z)=c\cdot \vartheta(z)^r, \ \text{with} \ c=\lim_{y\to \infty}f(z).$$ I then took the solution and just prove that it satisfy the conditions. But I see your way is the one to approach a actual solution. However, until I am at this level, I have to learn more.
– deavor Nov 23 '16 at 02:02