Example of cocompact discrete subgroups of $\operatorname{SL}_2(\mathbb R)$ Let $G = \operatorname{SL}_2(\mathbb R)$, and let $\Gamma$ be a discrete subgroup of $G$.  When studying automorphic forms, one might look at the quotient space $\Gamma \backslash \mathbb H$, where $\mathbb H$ is the upper half plane, or perhaps even $L^2(\Gamma \backslash \mathbb H)$, or $L^2(\Gamma \backslash G)$ (the elements of $\Gamma \backslash \mathbb H$ identify with right $K$-invariant functions on $\Gamma \backslash G$, where $K = \operatorname{SO}(\mathbb R)$).
Typically there will be a fundamental domain $\mathcal F$ for the action of $\Gamma$ on $\mathbb H$, through which one gets a measure $d \dot \tau$ on $\Gamma \backslash \mathbb H$, such that an "unwinding formula" holds:
$$\int\limits_{\mathbb H} f(\tau) \frac{dxdy}{y^2} = \sum\limits_{\gamma \in \Gamma} \int\limits_{\Gamma \backslash \mathbb H} f(\gamma. \tau) d \dot \tau $$
The classical case is when $\Gamma$ is a congruence subgroup of $G$.  In this case, $\Gamma \backslash \mathbb H$ and $\Gamma \backslash G$ both have finite measure, but are not compact.  
The compact case is nicer in a lot of ways.  $L^2(\Gamma \backslash G)$ and $L^2(\Gamma \backslash \mathbb H)$ decompose as a Hilbert space direct sum of irreducible representations of $G$, for example.
What are some nice examples of subgroups $\Gamma$ such that $\Gamma \backslash G$ (equivalently, $\Gamma \backslash \mathbb H$) is compact?  What does the fundamental domain look like?
 A: Many examples arise by application of the Poincare polygon theorem, which you can find for example in Theorem 11.2.1 of Ratcliffe's book "Foundations of Hyperbolic Manifolds". 
Here's a general description. Consider a finite polygon $P$ with $2n$ sides. Let $f_1,...,f_n \in \text{Isom}(\mathbb H)$ be isometries satisfying the following conditions:


*

*For each $i=1,...,n$ there exist sides $a_i,a'_i$ such that
$$P \cap f_i(P) = a_i = f_i(a'_i)
$$

*The list of sides of $P$ is $a_1,a'_1,...,a_n,a'_n$.

*The total angle of each "vertex cycle" is $2\pi$ (more can be said here, but I'll refer to topology textbooks that cover the classification of surfaces). 


The conclusion of the Poincare Polygon Theorem is that $f_1,...,f_n$ are generators of a discrete group $\Gamma$, $P$ is a fundamental polygon for $\Gamma$, the quotient map $\mathbb H \mapsto \mathbb H / \Gamma$ is a universal covering map, and the composition
$$P \hookrightarrow \mathbb H \mapsto \mathbb H / \Gamma
$$
is the quotient map obtained by gluing $a_i$ to $a'_i$ using $f_i$, for each $i=1,...,n$.
Let me just do one example to give the idea, the "standard gluing pattern" of an octagon. Let $P \subset \mathbb H$ be a regular octagon with angles $2\pi/8$, so all side lengths are equal. Starting from a vertex $v_0$ and going around in counterclockwise order, list the sides like this:
$$a_1, a_2, a'_1, a'_2, a_3, a_4, a'_3, a'_4
$$
Choose $f_i$ to be the unique orientation preserving isometry satisfying the condition above with respect to $a_i$ and $a'_i$. Now one has to check that all 8 vertices are identified to a single point on the quotient (this is what one does by going around the "vertex cycle"). Since each of these has angle $2\pi/8$, their sum is $2\pi$ as required.
