TITLE: How to calculate $|\operatorname {SL}_2(\mathbb Z/N\mathbb Z)|$?
QUESTION [6 upvotes]: the answer should be
$$|\operatorname {SL}_2(\mathbb Z/N\mathbb Z)|=N^{3}\prod_{p|N}(1-{1 /p^2})$$
But first how to prove
$$|\operatorname {SL}_2(\mathbb Z/p^e\mathbb Z)|=p^{3e}(1-{1 /p^2})$$

REPLY [7 votes]: The formula is the multiplication of several simpler ones, specialized to $n=2$.

$SL_n(\mathbb{Z}/N \mathbb{Z}) = \prod SL_n(\mathbb{Z}/p^e \mathbb{Z})$.  From the Chinese Remainder Theorem.
$|SL_n(\mathbb{Z}/p^e \mathbb{Z})| = p^{(n^2-1)(e-1)}|SL_n(\mathbb{Z}/p \mathbb{Z})|$.  From smoothness and ($n^2-1$)-dimensionality of $SL_n$, in any characteristic.
$|SL_n| = |GL_n|/(q - 1)$ over a finite field of cardinality $q$. From the bijection between invertible elements and cosets of $GL / SL$.
$|GL_n(\mathbb{F}_q)| = (q^n-1)(q^n-q) \dots (q^n - q^{n-1})$. "Well known".

The main point is the unobstructed Hensel lifting (step 2), which manifests the smoothness of $SL$ in every characteristic.