This question regards counting the cusps of $Γ_0 (N)$.

I’ve been trying for a while to understand the following argument to count the cusps of $Γ_0(N)$ given in *A First Course in Modular Forms* by Diamond & Shurman, so here is the full argument for reference (you can find it in chapter 3.8. page 103):

To count the cusps of $Γ_0 (N)$ recall from Proposition 3.8.3 that for this group, vectors $\begin{bmatrix}a \\ c\end{bmatrix}$ and $\begin{bmatrix}a' \\ c'\end{bmatrix}$ with $\gcd(a,c) = \gcd(a',c') = 1$ represent the same cusp when $\begin{bmatrix}ya' \\ c'\end{bmatrix} \equiv \begin{bmatrix}a +jc \\ c\end{bmatrix}\bmod{N}$ for some $j$ and $y$ with $\gcd(y,N)$. The bottom condition, $c' \equiv yc \mod{N}$ for some such $y$, is equivalent to $\gcd(c',N) = \gcd(c,N)$, in wich case letting $d = \gcd(c,N)$ and letting $y_0 ∈ ℤ$ satisfy $y_0 \equiv c'c^{-1} \bmod{N}$ makes the condition equivalent to $y \equiv y_0 + iN/d \bmod{N}$ for some $i$ (confirming the calculatons in the paragraph is Exercise 3.8.4.). For any divisor $d$ of $N$, pick one value $c$ modulo $N$ such that $\gcd(c,n) = d$. Then any cusp of $Γ_0(N)$ represented by some Vector $\begin{bmatrix}a' \\ c'\end{bmatrix}$ with $\gcd(c',N) = d$ is also represented by $\begin{bmatrix}a \\ c\end{bmatrix}$ whenever $(y_0 + iN/d)a' \equiv a+jc \bmod{N}$ for some $i$ and $j$, or $a \equiv y_0a' \bmod \gcd(c,N,a'N/d)$, or $a \equiv y_0 a' \bmod{\gcd(d,N/d)}$. Also, $a$ is relatively prime to $d$ since $\gcd(a,d) \mid \gcd(a,c) = 1$, so $a$ is relatively prime to $\gcd(d,N/d)$. Thus for each divisor $d$ of $N$ there are $ϕ(\gcd(d,N/d))$ cusps, and the number of cusps of $\Gamma_0 (N)$ is therefore $ \sum_{d \mid N} ϕ(\gcd(d,N/d))$.

First of all I have a problem with this sentence:

Then any cusp of $Γ_0(N)$ represented by some Vector $\begin{bmatrix}a' \\ c'\end{bmatrix}$ with $\gcd(c',N) = d$ is also represented by $\begin{bmatrix}a \\ c\end{bmatrix}$ whenever $(y_0 + iN/d)a' \equiv a+jc \bmod{N}$ for some $i$ and $j$, or $a \equiv y_0a' \bmod \gcd(c,N,a'N/d)$, …

As I understand it, $y_0 + i N/d$ doesn’t need to be a number relatively prime to $N$, so this can’t be an equivalence. Therefore, to me the argument only shows that two vectors which represent the same cusp and have relatively prime components have the same upper component modulo $\gcd(d,N/d)$ and this component is relatively prime to $\gcd(d,N/d)$. But this doesn’t mean, that any element less than and relatively prime to $\gcd(d,N/d)$ can be interpreted as the first component of vector representing a cusp. Nor does it mean that any two different such elements give rise to different cusps.

Can anyone shed some light on how to understand this argument?

I feel very unsure about whether this is the right place to ask. I’ve already asked similar questions on math.stackexchange:

- In $ℤ/Nℤ$, which units are succesors to zero divisors?, and
- Which assignment defines a bijection here? And what is its inverse? And why?

This queston might just be a little too localized for any of these sites while it hardly counts as a research question, so it might better be fitting math.stackexchange. I just get the impression that I have better chances here of getting an answer, so I’ll just give it a shot. I do not know whether such questions are tolerated here.

I also feel unsure about the tags. I now tagged the question as combinatorics and number-theory, since it’s about counting things using divisibility arguments.