I came across Shimura (1971) notes about cosets representatives of the congruence subgroups $ \Gamma_0(N) $. He firstly proves that its index in the modular group $\Gamma$ is

\begin{equation} [\Gamma : \Gamma_0(N)]=N \cdot \prod_{p|N} (1+p^{-1} ) \end{equation}

Then he comes up with a sets of cosets representatives for $\Gamma_0(N)$ in $\Gamma$ made in this way: we first choose pairs $(c,d)$ of positive integers such that

\begin{equation} (c,d)=1, \qquad d|N, \qquad 0 < c \le N/d \end{equation}

then for each pairs we fix integers $a,b$ such that $ad-bc=1$. Our list of cosets representatives is made of the matrices with such entries.

However, let us take for example $N=12$ when we know the index is 24 and thus this is the cardinality of the set of cosets representatives. Using the rule above, I only find 22 cosets representatives, namely the ones corresponding to the following $(c,d)$ pairs: $$(1,1),(2,1),\dots,(12,1),(1,2),(3,2),(5,2),(1,3),(2,3),(4,3),(1,4),(3,4),(1,6),(1,12).$$

I also tried to run SAGE and it gives me 24 cosets representatives but they seem redundant, for example $[[1, 0] [2, 1]]$ and $[[1, 2][2, 5]]$ are listed as different cosets representatives, but

$$\begin{pmatrix} 1 & 0 \\ 2 & 1 \end{pmatrix} \cdot \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}=\begin{pmatrix} 1 & 2 \\ 2 & 5 \end{pmatrix}$$

and thus it seems to me that these 2 matrices belong in fact to the same coset.

Something is clearly wrong, I hope you can help me.

`$\left(\begin{smallmatrix}a&b\\ c&d\end{smallmatrix}\right)$`

for which $c$ is divisible by $N$, then of course $1\in\Gamma$ is in the coset represented by $(N,1)$ (and (0,1) is just another rep for that). Moreover, $(1,0)$ and $(1,N)$ also represent the same coset. $\endgroup$ – Max Horn Dec 19 '11 at 13:10