# Farey Symbols and Fundamental Domains

One method of finding fundamental domains for congruence subgroups is the method of Farey Symbols, as described by Kulkarni [[Kulkarni, 1991](../../references.md#cite-kulkarni)].

A *generalized Farey sequence* is a sequence of rationals

$$
{a_1 \over b_1}< {a_2 \over b_2}< \dots
< {a_n \over b_n}
$$

such that for a consecutive pair of fractions ${b \over d}, {a \over c}$ in the sequence, written in lowest terms, we have $ad - bc = 1$. We extend the rationals to ${\mathbb{Q}}\cup\{-\infty,\infty\}$, where we use the convention $-\infty = {-1\over 0}$ and $\infty = {1\over 0}$.

A *Farey Symbol* is a Farey sequence of length $n$ starting with ${-1\over 0}$, and ending with ${1\over 0}$, together with a sequence of $n-1$ labels. We use the convention that labels can be any elements of ${\mathbb{N}}_{>0}\cup\{-2,-3\}$. The sequence of labels must satisfy the condition that each element of ${\mathbb{N}}_{>0}$ appears in the sequence either exactly twice or not at all. For example, the sequences $\left[{-1\over 0},{0\over 1}, {1\over 2},{2\over 3},{5\over 7},{3\over 4},{1\over 1},{1\over 0}\right]$ and $\left[ 1,2,2,-3,-2,-2,1\right]$ define a Farey symbol, which is generally written in the following format:

$$
\begin{matrix}&1&& 2&& 2&& -3&&-2&& -3 && 1 \\
\left\{{-1\over 0}\right.,&&{0\over 1},&&
{1\over 2},&&{2\over 3},&&{5\over 7},&&{3\over 4},&&{1\over 1},&&\left.{1\over 0}\right\}.\end{matrix}
$$

Farey symbols are used to define certain fundamental domains for congruence subgroups of ${\operatorname{PSL}}_2({\mathbb{Z}})$. The sequence of fractions gives cusps which are vertices of the domain, and the labels give edge identifications. For $a_i,a_{i+1}$ in the Farey sequence, with corresponding label $l_i$ not $-3$, the corresponding edge of the domain is a geodesic between $a_i$ and $a_{i+1}$. If the label is $-3$, there is an extra elliptic point of order $3$ on the boundary of the domain between the two cusps, and the two edges between these cusps are identified. The label $l_i=-2$ indicates an elliptic point of order $2$ on the boundary between the two cusps $a_i$ and $a_{i+1}$. This point is on the geodesic between $a_i$ and $a_{i+1}$, and the two halves of the geodesic are identified.

## `FareySymbol(G): GrpPSL2 -> SymFry`

Computes the Farey Symbol of a congruence subgroup $G$ in ${\operatorname{PSL}}_2({\mathbb{Z}})$.

## `Cusps(FS): SymFry -> SeqEnum`

Returns the cusp sequence of the Farey symbol $FS$. Note, this is not a sequence of inequivalent cusps of the corresponding group.

## `Labels(FS): SymFry -> SeqEnum`

Returns the sequence of edge labels of a Farey symbol $FS$.

## `Generators(FS): SymFry -> SeqEnum`

Returns the generators of the congruence subgroup corresponding to the Farey symbol $FS$.

## `Group(FS): SymFry -> GrpPSL2`

Returns the congruence subgroup corresponding to the Farey Symbol $FS$.

## `Widths(FS): SymFry -> SeqEnum`

Returns the sequence of integers giving twice the widths of the cusp list of the Farey symbol $FS$.

## `Index(FS): SymFry -> RngIntElt`

Returns the index of `Group(FS)` in ${\operatorname{PSL}}_2({\mathbb{Z}})$.

## `FundamentalDomain(FS): SymFry -> SeqEnum`

## `FundamentalDomain(FS, H): SymFry, SpcHyp -> SeqEnum`

Returns the vertices in the upper half plane of the fundamental domain described by the Farey Sequence $FS$. A second argument may be given to specify the upper half plane $H$.

## `CosetRepresentatives(FS): SymFry -> SeqEnum`

Returns the coset representatives of the congruence subgroup of ${\operatorname{PSL}}_2({\mathbb{Z}})$ corresponding to the Farey symbol $FS$.

## `InternalEdges(FS): SymFry -> SeqEnum`

Returns a sequence of pairs of cusps which are cusps of the Farey Symbol $FS$, and which are not adjacent in $FS$ but which are images of $0$ and infinity under some matrix in ${\operatorname{PSL}}_2({\mathbb{Z}})$.
