The modular group is the quotient of the group of integer matrices

with

by the subgroup

, where
denotes the

identity matrix. This group acts on the upper half-plane

by

. It turns out that the modular group is generated by just two elements: inversion, given by the matrix

, and translation, given by

. The fundamental domain is the subset of the upper half-plane

formed by all points

such that

and

. The action of the modular group tiles the upper half-plane exactly with images of the fundamental domain. This tiling requires the use of the entire infinite fundamental domain, so it cannot be demonstrated by
Mathematica. However, this tiling can be approximated by considering the images of a finite part of the fundamental domain under a finite number of compositions

, where each

and

is either a translation by an integer or a reflection.