.. _ch:dim: Dimension Formulas ================== .. chapter:: 6 When computing with spaces of modular forms, it is helpful to have easy-to-compute formulas for dimensions of these spaces. Such formulas provide a check on the output of the algorithms from Chapter :ref:`ch:modsym` that compute explicit bases for spaces of modular forms. We can also use dimension formulas to improve the efficiency of some of the algorithms in Chapter :ref:`ch:modsym`, since we can use them to determine the ranks of certain matrices without having to explicitly compute those matrices. Dimension formulas can also be used in generating bases of `q`-expansions; if we know the dimension of `M_k(N,\eps)` and if we have a process for computing `q`-expansions of elements of `M_k(N,\eps)`, e.g., multiplying together `q`-expansions of certain forms of smaller weight, then we can tell when we are done generating `M_k(N,\eps)`. This chapter contains formulas for dimensions of spaces of modular forms, along with some remarks about how to evaluate these formulas. In some cases we give dimension formulas for spaces that we will define in later chapters. We also give many examples, some of which were computed using the modular symbols algorithms from Chapter :ref:`ch:modsym`. Many of the dimension formulas and algorithms we give below grew out of Shimura's book :cite:`shimura:intro` and a program that Bruce Kaskel wrote (around 1996) in PARI, which Kevin Buzzard extended. That program codified dimension formulas that Buzzard and Kaskel found or extracted from the literature (mainly :cite:`[\S2.6]{shimura:intro}`). The algorithms for dimensions of spaces with nontrivial character are from :cite:`cohen-oesterle:dimensions`, with some refinements suggested by Kevin Buzzard. For the rest of this chapter, `N` denotes a positive integer and `k\geq 2` is an integer. We will give *no simple formulas* for dimensions of spaces of weight `1` modular forms; in fact, it might not be possible to give such formulas since the methods used to derive the formulas below do not apply in the case `k=1`. If `k=0`, the only modular forms are the constants, and for `k<0` the dimension of `M_k(N,\eps)` is `0`. For a nonzero integer `N` and a prime `p`, let `v_p(N)` be the largest integer `e` such that `p^e \mid N`. In the formulas in this chapter, `p` always denotes a prime number. Let `M_k(N,\eps)` be the space of modular forms of level `N` weight `k` and character `\eps`, and let `S_k(N,\eps)` and `E_k(N,\eps)` be the cuspidal and Eisenstein subspaces, respectively. The dimension formulas below for `S_k(\Gamma_0(N))`, `S_k(\Gamma_1(N))`, `E_k(\Gamma_0(N))` and `E_k(\Gamma_1(N))` can be found in :cite:`[Ch.~3]{diamond-shurman}`, :cite:`[\S2.6]{shimura:intro}` [#f1]_ and :cite:`[\S2.5]{miyake}`. They are derived using the Riemann-Roch Theorem applied to the covering `X_0(N)\to X_0(1)` or `X_1(N)\to X_1(1)` and appropriately chosen divisors. It would be natural to give a sample argument along these lines at this point, but we will not since it easy to find such arguments in other books and survey papers (see, e.g., :cite:`diamond-im`). So you will not learn much about how to derive dimension formulas from this chapter. What you will learn is precisely what the dimension formulas are, which is something that is often hard to extract from obscure references. In addition to reading this chapter, the reader may wish to consult :cite:`martin:dims` for proofs of similar dimension formulas, asymptotic results, and a nonrecursive formula for dimensions of certain new subspaces. .. _sec:dimg0: Modular Forms for `\Gamma_0(N)` ------------------------------- For any prime `p` and any positive integer `N`, let `v_p(N)` be the power of `p` that divides `N`. Also, let .. math:: \mu_0(N) &= \prod_{p\mid N} \left( p^{v_p(N)} + p^{v_p(N)-1} \right),\\ \mu_{0,2}(N) &= \begin{cases} 0 & \text{if $4\mid N$,}\\ \prod_{p\mid N} \left(1 + \kr{-4}{p}\right) & \text{otherwise,} \end{cases}\\ \mu_{0,3}(N) &= \begin{cases} 0 & \text{if $2\mid N$ or $9\mid N$,}\\ \prod_{p\mid N} \left(1 + \kr{-3}{p}\right) & \text{otherwise,} \end{cases}\\ c_0(N) &= \sum_{d\mid N} \vphi(\gcd(d,N/d)),\\ g_0(N) &= 1 + \frac{\mu_0(N)}{12} - \frac{\mu_{0,2}(N)}{4} - \ \frac{\mu_{0,3}(N)}{3} - \frac{c_0(N)}{2}.\\ Note that `\mu_0(N)` is the index of `\Gamma_0(N)` in `\SL_2(\Z)` (see :ref:`ex:mu0n`). .. index:: pair: cusp forms; higher level dimension pair: dimension; cusp forms of higher level .. proposition:: :label: prop:dimg0 We have `\dim S_2(\Gamma_0(N)) = g_0(N)`, and for `k\geq 4` even, .. math:: \dim S_k(\Gamma_0(N)) &= (k-1) \cdot (g_0(N) - 1) \,\,+ \,\, \left( \frac{k}{2} - 1 \right) \cdot c_0(N) \,\, \\ &\qquad\qquad + \mu_{0,2}(N)\cdot \left\lfloor\frac{k}{4}\right\rfloor \,\,+ \,\, \mu_{0,3}(N)\cdot \left\lfloor \frac{k}{3}\right\rfloor. The dimension of the Eisenstein subspace is .. math:: \dim E_k(\Gamma_0(N)) = \begin{cases} c_0(N) & \text{if $k\neq 2$,}\\ c_0(N)-1 & \text{if $k=2$.} \end{cases} The following is a table of `\dim S_k(\Gamma_0(N))` for some values of `N` and `k`: .. math:: \begin{tabular}{|l|llll|}\hline $N$ & $S_2(\Gamma_0(N))$ & $S_4(\Gamma_0(N))$ & $S_6(\Gamma_0(N))$ & $S_{24}(\Gamma_0(N))$\\\hline 1 & 0 & 0 & 0 & 2\\ 10 & 0 & 3 & 5 & 33\\ 11 & 1 & 2 & 4 & 22\\ 100 & 7 & 36 & 66 & 336\\ 389 & 32 & 97 & 161 & 747\\ 1000 & 131 & 430 & 730 & 3430\\ 2007 & 221 & 806 & 1346 & 6206\\ 100000 & 14801 & 44800 & 74800 & 344800\\\hline \end{tabular} .. example:: .. index:: pair: Sage; dimension formulas Use the commands :obj:`dimension_cusp_forms`, :obj:`dimension_eis`, and :obj:`dimension_modular_forms` to compute the dimensions of the three spaces `S_k(\Gamma_0(N))`, `E_k(\Gamma_0(N))` and `M_k(\Gamma_0(N))`, respectively. For example, :: sage: dimension_cusp_forms(Gamma0(2007),2) 221 sage: dimension_eis(Gamma0(2007),2) 7 sage: dimension_modular_forms(Gamma0(2007),2) 228 .. remark:: Csirik, Wetherell, and Zieve prove in :cite:`csirik-wetherell-zieve:g0` that a random positive integer has probability `0` of being a value of .. math:: g_0(N)=\dim S_2(\Gamma_0(N)), and they give bounds on the size of the set of values of `g_0(N)` below some given `x`. For example, they show that `150, 180, 210, 286, 304, 312, \ldots` are the first few integers that are not of the form `g_0(N)` for any `N`. See :ref:`fig:dims2g0` for a plot of the very erratic function `g_0(N)`. In contrast, the function `k\mapsto \dim S_{2k}(\Gamma_0(12))` is very well behaved (see :ref:`fig:dimskg012`). .. figure:: :label: fig:dims2g0 Dimension of `S_2(\Gamma_0(N))` as a function of `N` .. image:: images/dims2g0.* :align: center .. figure:: :label: fig:dimskg012 Dimension of `S_{2k}(\Gamma_0(12))` as a function of `k`. .. image:: images/dimskg012.* :align: center .. _sec:newold: New and Old Subspaces ~~~~~~~~~~~~~~~~~~~~~ In this section we assume the reader is either familiar with newforms or has read Section :ref:`sec:ALL`. For any integer `R`, let .. math:: \overline{\mu}(R) = \begin{cases} 0 & \text{if $p^3\mid R$ for some $p$,}\\ \ds \prod_{p\mid\mid R} -2 & \text{otherwise}, \end{cases} where the product is over primes that exactly divide `R`. Note that `\overline{\mu}` is *not* the Moebius function, but it has a similar flavor. .. proposition:: :label: prop:newg0 The dimension of the new subspace is .. math:: \dim S_k(\Gamma_0(N))_{\new} = \sum_{M\mid N} \overline{\mu}(N/M) \cdot \dim S_k(\Gamma_0(M)), where the sum is over the positive divisors `M` of `N`. As a consequence of :ref:`thm:ALL`, we also have .. math:: \dim S_k(\Gamma_0(N)) = \sum_{M\mid N} \sigma_0(N/M) \dim S_k(\Gamma_0(M))_{\new}, where `\sigma_0(N/M)` is the number of divisors of `N/M`. .. example:: .. index:: pair: Sage; dimension `S_k(\Gamma_0(N))` We compute the dimension of the new subspace of `S_k(\Gamma_0(N))` using the Sage command :obj:`dimension_new_cusp_forms` as follows: :: sage: dimension_new_cusp_forms(Gamma0(11),12) 8 sage: dimension_cusp_forms(Gamma0(11),12) 10 sage: dimension_new_cusp_forms(Gamma0(2007),12) 1017 sage: dimension_cusp_forms(Gamma0(2007),12) 2460 Modular Forms for `\Gamma_1(N)` ------------------------------- This section follows Section :ref:`sec:dimg0` closely, but with suitable modifications with `\Gamma_0(N)` replaced by `\Gamma_1(N)`. Define functions of a positive integer `N` by the following formulas: .. math:: \mu_1(N) &= \begin{cases} \mu_0(N) & \text{if $N=1,2$,}\\ \ds\frac{\phi(N)\cdot \mu_0(N)}{2} & \text{otherwise,} \end{cases} \\ \mu_{1,2}(N) &= \begin{cases} 0 & \text{if $N\geq 4$,}\\ \mu_{0,2}(N) & \text{otherwise,} \end{cases}\\ \mu_{1,3}(N) &= \begin{cases} 0 & \text{if $N\geq 4$,}\\ \mu_{0,3}(N) & \text{otherwise,} \end{cases}\\ c_1(N) &= \begin{cases} c_0(N) & \text{if $N=1,2$,}\\ 3 & \text{if $N=4$,}\\ \ds \sum_{d \mid N} \frac{\phi(d)\phi(N/d)}{2} & \text{otherwise}, \end{cases} \\ g_1(N) &= 1 + \frac{\mu_1(N)}{12} - \frac{\mu_{1,2}(N)}{4} - \frac{\mu_{1,3}(N)}{3} - \frac{c_1(N)}{2}. Note that `g_1(N)` is the genus of the modular curve `X_1(N)` (associated to `\Gamma_1(N)`) and `c_1(N)` is the number of cusps of `X_1(N)`. .. index:: pair: cusp forms; higher level dimension pair: dimension; cusp forms of higher level .. proposition:: We have `\dim S_2(\Gamma_1(N)) = g_1(N)`. If `N\leq 2`, then `\Gamma_0(N)=\Gamma_1(N)` so .. math:: \dim S_k(\Gamma_1(N)) = \dim S_k(\Gamma_0(N)), where `\dim S_k(\Gamma_0(N))` is given by the formula of :ref:`prop:dimg0`. If `k\geq 3`, let .. math:: a(N,k) = (k-1)(g_1(N) - 1) + \left(\frac{k}{2} -1\right)\cdot c_1(N). Then for `N\geq 3`, .. math:: \dim S_k(\Gamma_1(N)) = \begin{cases} a + 1/2 & \text{if $N=4$ and $2\nmid k$,}\\ a + \lfloor{} k/3\rfloor{} & \text{if $N=3$,}\\ a & \text{otherwise.} \end{cases} The dimension of the Eisenstein subspace is as follows: .. math:: \dim E_k(\Gamma_1(N)) = \begin{cases} c_1(N) & \text{if $k\neq 2$,}\\ c_1(N)-1 & \text{if $k=2$.} \end{cases} The dimension of the new subspace of `M_k(\Gamma_1(N))` is .. math:: \dim S_k(\Gamma_1(N))_{\new} = \sum_{M \mid N} \overline{\mu}(N/M) \cdot \dim S_k(\Gamma_1(M)), where `\overline{\mu}` is as in the statement of :ref:`prop:newg0`. .. remark:: Since `M_k = S_k \oplus E_k`, the formulas above for `\dim S_k` and `\dim E_k` also yield a formula for the dimension of `M_k`. .. figure:: Dimension of `S_2(\Gamma_1(N))` as a function of `N`. .. image:: images/dims2g1.* :align: center The following table contains the dimension of `S_k(\Gamma_1(N))` for some sample values of `N` and `k`: .. math:: \begin{tabular}{|l|llll|}\hline $N$ & $S_2(\Gamma_1(N))$ & $S_3(\Gamma_1(N))$ & $S_4(\Gamma_1(N))$ & $S_{24}(\Gamma_1(N))$\\\hline 1 & 0 & 0 & 0 & 2\\ 10 & 0 & 2 & 5 & 65\\ 11 & 1 & 5 & 10 & 110\\ 100 & 231 & 530 & 830 & 6830\\ 389 & 6112 & 12416 & 18721 & 144821\\ 1000 & 28921 & 58920 & 88920 & 688920\\ 2007 & 147409 & 296592 & 445776 & 3429456\\ 100000 & 299792001 & 599792000 & 899792000 & 6899792000\\\hline \end{tabular} .. example:: .. index:: pair: Sage; dimension `S_k(\Gamma_1(N))` We compute dimensions of spaces of modular forms for `\Gamma_1(N)`: :: sage: dimension_cusp_forms(Gamma1(2007),2) 147409 sage: dimension_eis(Gamma1(2007),2) 3551 sage: dimension_modular_forms(Gamma1(2007),2) 150960 Modular Forms with Character ---------------------------- Fix a Dirichlet character `\eps` of modulus `N`, and let `c` be the conductor of `\eps` (we do *not* assume that `\eps` is primitive). Assume that `\eps \neq 1`, since otherwise `M_k(N,\eps) = M_k(\Gamma_0(N))` and the formulas of Section :ref:`sec:dimg0` apply. Also, assume that `\eps(-1)=(-1)^k`, since otherwise `\dim M_k(\Gamma_0(N)) = 0`. In this section we discuss formulas for computing each of `M_k(N,\eps)`, `S_k(N,\eps)` and `E_k(N,\eps)`. In :cite:`cohen-oesterle:dimensions`, Cohen and Oesterl\'e assert (without *published* proof; see Remark :ref:`rem:co` below) that for any `k\in\Z` and `N`, `\eps` as above, .. math:: \dim S_k(N,\eps) &- \dim M_{2-k}(N,\eps)\\ &= \frac{k-1}{12} \cdot \mu_0(N) \,\,-\,\, \frac{1}{2} \cdot \prod_{p\mid N} \lambda(p, N, v_p(c))\\ &\qquad + \gamma_4(k) \cdot\!\! \sum_{x \in A_4(N)} \eps(x) \,\,\,+\,\,\, \gamma_3(k) \cdot \!\! \sum_{x \in A_3(N)} \eps(x) where `\mu_0(N)` is as in Section :ref:`sec:dimg0`, `A_4(N) = \{x \in \Z/N\Z : x^2 +1 = 0\}` and `A_3(N) = \{x \in \Z/N\Z : x^2 + x + 1 = 0 \}`, and `\gamma_3, \gamma_4` are .. math:: \gamma_4(k) &= \begin{cases} -1/4 & \text{if $k\con 2\pmod{4}$,}\\ 1/4 & \text{if $k\con 0\pmod{4}$,}\\ 0 & \text{if $k$ is odd.} \end{cases}\\ \gamma_3(k) &= \begin{cases} -1/3 & \text{if $k\con 2\pmod{3}$,}\\ 1/3 & \text{if $k\con 0\pmod{3}$,}\\ 0 & \text{if $k\con 1\pmod{3}$.} \end{cases} It remains to define `\lambda`. Fix a prime divisor `p\mid N` and let `r=v_p(N)`. Then .. math:: \lambda(p,N,v_p(c)) = \begin{cases} p^{\frac{r}{2}} + p^{\frac{r}{2} - 1} & \text{if $2\cdot v_p(c)\leq r$ and $2\mid r$,}\\ 2\cdot p^{\frac{r-1}{2}} & \text{if $2\cdot v_p(c)\leq r$ and $2\nmid r$,}\\ 2\cdot p^{r-v_p(c)} & \text{if $2\cdot v_p(c) > r$.} \end{cases} This flexible formula can be used to compute the dimension of `M_k(N,\eps)`, `S_k(N,\eps)`, and `E_k(N,\eps)` for any `N`, `\eps`, `k\neq 1`, by using that .. math:: \dim S_k(N,\eps) &= 0 \qquad \text{if $k\leq 0$,}\\ \dim M_k(N,\eps) &= 0 \qquad \text{if $k<0$,}\\ \dim M_0(N,\eps) &= 1 \qquad \text{if $k=0$.} One thing that is not straightforward when implementing an algorithm to compute the above dimension formulas is how to efficiently compute the sets `A_4(N)` and `A_6(N)`. Kevin Buzzard suggested the following two algorithms. Note that if `k` is odd, then `\gamma_4(k)=0`, so the sum over `A_4(N)` is only needed when `k` is even. .. algorithm:: Sum over `A_4(N)` :label: alg:suma4 Given a positive integer `N` and an even Dirichlet character `\eps` of modulus `N`, this algorithm computes `\sum_{x \in A_4(N)} \eps(x)`. 1. [Factor `N`] Compute the prime factorization `p_1^{e_1} \cdots p_n^{e_n}` of `N`. 2. [Initialize] Set `t\set 1` and `i\set 0`. .. _alg:sum1go: 3. [Loop Over Prime Divisors] Set `i\set i+1`. If `i>n`, return `t`. Otherwise set `p\set p_i` and `e\set e_i`. .. _alg:a4_3a: a. If `p\con 3\pmod{4}`, return `0`. .. _alg:a4_3b: b. If `p=2` and `e>1`, return `0`. c. If `p=2` and `e=1`, go to step :ref:`(3) `. .. _alg:a4_3d: d. Compute a generator `a\in (\Z/p\Z)^*` using :ref:`alg:mingens`. e. Compute `\omega = a^{(p-1)/4}`. f. Use the Chinese Remainder Theorem to find `x\in\Z/N\Z` such that `x\con a\pmod{p}` and `x\con 1\pmod{N/p^e}`. .. _alg:a4_3g: g. Set `x \set x^{p^{r-1}}`. .. _alg:a4_3h: h. Set `s\set \eps(x)`. .. _alg:a4_3i: i. If `s=1`, set `t\set 2t` and go to step :ref:`(3) `. .. _alg:a4_3j: j. If `s=-1`, set `t\set -2t` and go to step :ref:`(3) `. .. proof:: Note that `\eps(-x)=\eps(x)`, since `\eps` is even. By the Chinese Remainder Theorem, the set `A_4(N)` is empty if and only if there is no square root of `-1` modulo some prime power divisor of `p`. If `A_4(N)` is empty, the algorithm correctly detects this fact in steps :ref:`(a) ` -- :ref:`(b) `. Thus assume `A_4(N)` is nonempty. For each prime power `p_i^{e_i}` that exactly divides `N`, let `x_i \in Z/N\Z` be such that `x_i^2 = -1` and `x_i\con 1\pmod{p_j^{e_j}}` for `i \neq j`. This is the value of `x` computed in steps :ref:`(d) ` -- :ref:`(g) ` (as one sees using elementary number theory). The next key observation is that .. math:: :label: eqn:a4prodsum \prod_i (\eps(x_i) + \eps(-x_i)) = \sum_{x \in A_4(N)} \eps(x), since by the Chinese Remainder Theorem the elements of `A_4(N)` are in bijection with the choices for a square root of `-1` modulo each prime power divisors of `N`. The observation :eq:`eqn:a4prodsum` is a huge gain from an efficiency point of view---if `N` had `r` prime factors, then `A_4(N)` would have size `2^r`, which could be prohibitive, where the product involves only `r` factors. To finish the proof, just note that steps :ref:`(h) ` -- :ref:`(j) ` compute the local factors `\eps(x_i) + \eps(-x_i) = 2\eps(x_i)`, where again we use that `\eps` is even. Note that a solution of `x^2+1 \con 0\pmod{p}` lifts uniquely to a solution mod `p^n` for any `n`, because the kernel of the natural homomorphism `(\Z/p^n\Z)^* \to (\Z/p\Z)^*` is a group of `p`-power order. The algorithm for computing the sum over `A_3(N)` is similar. For `k\geq 2`, to compute `\dim S_k(N,\eps)`, use the formula directly and the fact that `\dim M_{2-k}(N,\eps) = 0`, unless `\eps=1` and `k=2`. To compute `\dim M_k(N,\eps)` for `k\geq 2`, use the fact that the big formula at the beginning of this section is valid for any integer `k` to replace `k` by `2-k` and that `\dim S_k(N,\eps)=0` for `k\leq 0` to rewrite the formula as .. math:: \dim M_k(N,\eps) &= - (\dim S_{2-k}(N,\eps) - \dim M_{k}(N,\eps))\\ &=-\Bigl( \frac{1-k}{12} \cdot \mu_0(N) \,\,-\,\, \frac{1}{2} \cdot \prod_{p\mid N} \lambda(p, N, v_p(c))\\ &\qquad + \gamma_4(2-k) \cdot\!\! \sum_{x \in A_4(N)} \eps(x) \,\,\,+\,\,\, \gamma_3(2-k) \cdot \!\! \sum_{x \in A_3(N)} \eps(x)\Bigr). Note also that for `k=0`, `\dim E_k(N,\eps) = 1` if and only if `\eps` is trivial and it equals `0` otherwise. We then also obtain .. math:: \dim E_k(N,\eps) = \dim M_k(N,\eps) - \dim S_k(N,\eps). We can also compute `\dim E_k(N,\eps)` when `k=1` directly, since .. math:: \dim S_{2-1}(N,\eps) = \dim S_{1}(N,\eps). The following table contains the dimension of `S_k(N,\eps)` for some sample values of `N` and `k`. In each case, `\eps` is the product of characters `\eps_p` of maximal order corresponding to the prime power factors of `N` (i.e., the product of the generators of the group `D(N,\C^*)` of Dirichlet characters of modulus `N`). .. math:: \begin{tabular}{|l|llll|}\hline $N$ & $\dim S_2(N,\eps)$ & $\dim S_3(N,\eps)$ & $\dim S_4(N,\eps)$ & $\dim S_{24}(N,\eps)$\\\hline 1 & 0 & 0 & 0 & 2\\ 10 & 0 & 1 & 0 & 0\\ 11 & 0 & 1 & 0 & 0\\ 100 & 13 & 0 & 43 & 343\\ 389 & 0 & 64 & 0 & 0\\ 1000 & 148 & 0 & 448 & 3448\\ 2007 & 222 & 0 & 670 & 5150\\\hline \end{tabular} .. example:: We compute the last line of the above table. First we create the character `\eps`. .. index:: pair: Sage; dimension with character :: sage: G = DirichletGroup(2007) sage: e = prod(G.gens(), G(1)) Next we compute the dimension of the four spaces. .. link :: sage: dimension_cusp_forms(e,2) 222 sage: dimension_cusp_forms(e,3) 0 sage: dimension_cusp_forms(e,4) 670 sage: dimension_cusp_forms(e,24) 5150 We can also compute dimensions of the corresponding spaces of Eisenstein series. .. link :: sage: dimension_eis(e,2) 4 sage: dimension_eis(e,3) 0 sage: dimension_eis(e,4) 4 sage: dimension_eis(e,24) 4 .. remark:: :label: rem:co Cohen and Oesterl\'e also give dimension formulas for spaces of half-integral weight modular forms, which we do not give in this chapter. Note that :cite:`cohen-oesterle:dimensions` does not contain any *proofs* that their claimed formulas are correct, but instead they say only that "Les formules qui les donnent sont connues de beaucoup de gens et il existe plusieurs m\'ethodes permettant de les obtenir (th\'eor\`eme de Riemann-Roch, application des formules de trace donn\'ees par Shimura)." [#f2]_ Fortunately, in :cite:`quer:dim`, Jordi Quer derives the (integral weight) formulas of :cite:`cohen-oesterle:dimensions` along with formulas for dimensions of spaces `S_k(G)` and `M_k(G)` for more general congruence subgroups. Let `f` be the conductor of a Dirichlet character `\eps` of modulus `N`. Then the dimension of the new subspace of `M_k(N,\eps)` is .. math:: \dim S_k(N,\eps)_{\new} = \sum_{M\text{ such that }f \mid M \mid N} \overline{\mu}(N/M) \cdot \dim S_k(M,\eps'), where `\overline{\mu}` is as in the statement of :ref:`prop:newg0`, and `\eps'` is the restriction of `\eps` mod `M`. .. example:: We compute the dimension of `S_2(2007,\eps)_{\new}` for `\eps` a quadratic character of modulus `2007`. :: sage: G = DirichletGroup(2007, QQ) sage: e = prod(G.gens(), G(1)) sage: dimension_new_cusp_forms(e,2) 76 Exercises --------- .. exercise:: :label: ex:mu0n Let `\mu_0` and `\mu_1` be as in this chapter. a. Prove that `\mu_0(N) = [\SL_2(\Z):\Gamma_0(N)]`. b. Prove that for `N\geq 3`, `\mu_1(N) = [\SL_2(\Z):\Gamma_1(N)]/2`, so `\mu_1(N)` is the index of `\Gamma_1(N) \cdot \{\pm 1\}` in `\PSL_2(\Z) = \SL_2(\Z)/\{\pm 1\}`. .. exercise:: :label: ex:formsl2z Use :ref:`prop:newg0` to find a formula for `\dim S_k(\SL_2(\Z))`. Verify that this formula is the same as the one in Corollary :ref:`cor:dim1`. .. exercise:: :label: ex:newmatch Suppose either that `N=1` or that `N` is prime and `k=2`. Prove that `M_k(\Gamma_0(N))_{\new} = M_k(\Gamma_0(N))`. .. exercise:: :label: ex:suma4 Fill in the details of the proof of :ref:`alg:suma4`. .. exercise:: :label: ex:sagedim Implement a computer program to compute `\dim S_k(\Gamma_0(N))` as a function of `k` and `N`. .. rubric:: Footnotes .. [#f1] The formulas in :cite:`[\S2.6]{shimura:intro}` contain some minor mistakes. .. [#f2] The formulas that we give here are well known and there exist many methods to prove them, e.g., the Riemann-Roch theorem and applications of the trace formula of Shimura.