Visualising Dirichlet Domains given Symmetric
Polygons
Norio Kosaka
Abstract
Dirichlet domains are critical structures in the study of Fuchsian groups
and hyperbolic geometry, providing key insights into the geometry andtopology of hyperbolic surfaces. This paper presents a novel approach tovisualizing Dirichlet domains generated by symmetric polygons, specifically focusing on those with three and four sides. Utilizing a grid searchalgorithm, we systematically explore the impact of base point locations on
the shapes and properties of these domains. Our methodology not only
enables detailed visual analysis but also lays the groundwork for integrating machine learning techniques to predict and analyze Dirichlet domains
in more complex Fuchsian groups. By bridging theoretical mathematics
with machine learning, we aim to enhance the understanding and predictive modeling of hyperbolic geometries, offering new avenues for research
and application in both fields.

1

Introduction

Dirichlet domains are foundational in Fuchsian group theory and hyperbolic
geometry, playing a pivotal role in understanding the geometry and topology
of hyperbolic surfaces. These domains, associated with Fuchsian groups, areconstructed as intersections of half-planes defined by perpendicular bisectors ofgeodesic segments.
The bounds on the possible number of sides of Dirichlet domains are shownin Theorem 10.5.1 [3], while Theorem 10.6.4 [3] demonstrates that for triangle groups with genus zero, the Dirichlet domains are either quadrilaterals or
hexagons. The shapes of Dirichlet domains are further shown to depend on thelocation of base points in Theorem 24 [12].
In this paper, we visually investigate the relationship between the basepoint’s location and the shape of Dirichlet domains for polygons with a small
number of sides (3 and 4). This analysis aims to provide insights for future
theoretical investigations.
We start by introducing fundamental concepts in hyperbolic geometry anddefining Dirichlet domains. We then delve into their construction algorithm andcomplexity. Our experiments focus on visualising Dirichlet domains through agrid search algorithm, analysing their shapes and properties in the context of1

triangle and quadrilateral groups. Finally, we discuss future research directions,
including the application of machine learning for analyzing and predicting the
behavior of Dirichlet domains in more intricate Fuchsian groups.

2Preliminaries

We give some definitions and properties relevant to discuss Dirichlet domains
in this section. For more detailed information, see [7] and [3].

2.1Hyperbolic Geometry

Let C be the complex plane. The hyperbolic plane is the metric space consistingof the upper half-plane H = {z ∈ C | Im(z) > 0} (similarly, D = z ∈ C | |z| < 1)endowed with a metric ρ defined below. We use the usual notation for the realand imaginary parts of z = x + iy ∈ C, where Re(z) = x and Im(z) = y.
To define the hyperbolic metric ρ, we first introduce the concept of hyperbolic
length for curves in H.
Definition 2.1 (Hyperbolic Length) Let I = [0, 1] and γ : I → H be apiecewise differentiable curve:
γ = {z(t) = x(t) + iy(t) ∈ H | t ∈ I}
The hyperbolic length of γ is given by|dz|=h(γ) =I y(t)Z

Z 1p(dx(t))2 + (dy(t))2
dt.
y(t)
0

This hyperbolic length is independent of the parametrization of γ.
Definition 2.2 (Hyperbolic Distance) The hyperbolic distance ρ(z, w) between
two points z, w ∈ H is defined by the formulaρ(z, w) = inf h(γ),γ

where the infimum is taken over all γ joining z to w in H.
Remark 2.1 The above ρ is nonnegative, symmetric and satisfies the triangle
inequality ρ(z, w) ≤ ρ(z, ξ) + ρ(ξ, w), that is, it is a distance function on H.
And, among the curves joining z and w, the one with the shortest hyperbolic
length (i.e., a geodesic) is a straight line or a semicircle orthogonal to the real
axis R = {z ∈ C | Im(z) = 0}.
a bConsider the group SL(2, R) of real matrices g =, where det(g) =c dad − bc = 1. Consider also the set of Möbius transformations of C onto itself.
It contains a subgroup containing transformations of the form {z → T (z) =
2

w
z

w

z

az+b
cz+d , |a, b, c, d ∈ R, ad − bc = 1} such that the product of two transformations

corresponds to the product of two corresponding matrices and the inverse of atransformation corresponds to the inverse matrix.
Note that a transformation of the form is represented by a pair of matrices±g ∈ SL(2, R). The group of such transformations is a subgroup in PSL(2, R)
and it is isomorphic to the quotient group SL(2, R)/{±I}.
Now, a transformation of H onto itself is called an isometry if it preserves
the hyperbolic distance on H and is a homeomorphism. The set of all isometriesof H forms a group; we shall denote it by Isom(H).
PSL(2, R) is also a topological space in which a transformation T ∈ PSL(2, R)
can be identified with the point (a, b, c, d) ∈ R4 . More precisely, we define a norm
on PSL(2, R) induced from R4 such that for T (z) = az+b
cz+d with ad − bc = 1,√
∥T ∥ = a2 + b2 + c2 + d2 . PSL(2, R) is a topological group with respect to themetric d(T, S) = ∥T − S∥, where T, S ∈ PSL(2, R).
Definition 2.3 (Discreteness) A subgroup Γ of Isom(H) is called discrete if
the induced topology on Γ is a discrete topology, i.e., if Γ is a discrete set in the
topological space Isom(H).
Definition 2.4 A discrete subgroup Γ of PSL(2, R) is called a Fuchsian group.
Definition 2.5 (Fundamental domains) Let Γ be a discrete group of isometries of H. A closed region F ⊆ H (i.e., a closure of a non-empty open set F ◦ ,called the interior of F ) is defined to be a fundamental domain for Γ if
S
1. T ∈Γ T (F ) = H,
2. F ◦ ∩ T (F ◦ ) = ∅ for all T ∈ Γ − {Id}.
The set ∂F = F − F ◦ is called the boundary of F . The family {T (F ) | T ∈ Γ}
is called the tessellation.
Now we will define the Dirichlet domains.
Definition 2.6 (Perpendicular bisectors) A perpendicular bisector of thegeodesic segment [z1 , z2 ] is the geodesic through w, the midpoint of [z1 , z2 ], orthogonal to [z1 , z2 ] such that it is a line given by {z ∈ H | ρ(z, z1 ) = ρ(z, z2 )}.
Note that when the geodesic segment [z1 , z2 ] is given, the perpendicularbisector of [z1 , z2 ] is determined uniquely.
3

Definition 2.7 (Dirichlet domains) Let Γ be an arbitrary Fuchsian group,and let p ∈ H be not fixed by any element of Γ − {Id}. We denote the perpendicular bisector of the geodesic segment [p, T (p)] where T ∈ Γ − {Id} by Lp (T ), i.e.,
Lp (T ) = {z ∈ H | ρ(z, p) = ρ(z, T (p))}, and denote the hyperbolic half-plane
containing p by Hp (T ), i.e.,
Hp (T ) = {z ∈ H | ρ(z, p) ≤ ρ(z, T (p))}.
We define the Dirichlet domain for Γ centered at p to be the set\
Dp (Γ) =Hp (T ).
T ∈Γ−{Id}

Let us introduce a couple of important notions to discuss the potential shapesof Dirichlet domains.
Definition 2.8
1. We say u, w ∈ D are congruent if they are in the sameΓ-orbit. The congruence is an equivalence relation on D, in particular on
the vertices of F . The equivalence classes of vertices are called cycles.
2. The order of the cycle C, denoted by Ord(C), is the order of the stabilizer in Γ of any vi ∈ C.
Definition 2.9 (Conifite) A Fuchsian group Γ is called cofinite if there exists
a Dirichlet domain Dp (Γ) whose hyperbolic area is finite.
Definition 2.10 (Signature) Let Γ be a finitely generated Fuchsian group.
Let mj represent the order of maximal elliptic cycles, s represent the numberof conjugacy classes of maximal parabolic cyclic subgroups, and t represent the
number of conjugacy classes of maximal hyperbolic cyclic subgroups. The symbol(g; m1 , m2 , . . . , mr ; s; t) is called the signature of Γ. Here each parameter is a
non-negative integer and mj ≥ 2.
Example 2.1 (Triangle groups [3]) A Fuchsian group with the signature (0; m1 , m2 , m3 ),where m11 + m12 + m13 < 1, is called a hyperbolic triangle group. Note that thecase where mi = ∞ is allowed.
In the context that follows, we examine the scenario where g = 0, indicating
the absence of genus.
Theorem 2.1 ([3], Theorem 10.5.1) Let Γ be a cofinite Fuchsian group withsignature (g = 0; m1 , . . . , mn ), and let Dp (Γ) be the Dirichlet polygon with centre
p with N sides. Then, 2n − 2 ≤ N ≤ 4n − 6.

3

Visualisation of Dirichlet Domains

In this section, we describe the visualisation algorithm of the Dirichlet domains.

4

3.1

Algorithm to construct Dirichlet domains

We utilised a straightforward algorithm to construct the Dirichlet domains basedon given base points. This algorithm, though simplistic in nature, effectively
generates the fundamental regions associated with Fuchsian groups.
Given a n-sided polygon P ⊂ H with sides s1 , s2 , . . . , sn with angles 0 ≤π
mi ≤ ∞ Let us denote Ri the reflection of P in the side si , for instance, R1 (P )represents P being reflected in s1 . Similarly for a point p ∈ H.
Algorithm 1 Compute vertex of Dirichlet domain
1: # Compute all perpendicular bisectors relevant to the Dirichlet domain.
2: lbisec := {Lp (Rj Ri ) ∀ i, j ∈ {1 . . . n}; i ̸= j}}
3: # Compute Intersections of lbisec as vertex candidates: pcand
4: pcand := ∪l,m∈lbisec ;l̸=m {pl ∈ l | pl ∈ m}
5: # Check if a point in pcand lies in the exterior of each bisector.
6: for all pc in pcand do
7:
if pc ∈ Hp (Rj Ri ) ∀ i, j ∈ {1 . . . n}; i ̸= j} then8:
return pc as vertex of Dirichlet domain
9:
end if
10: end for

3.1.1

Complexity analysis

Here we follow the Big-O notation as the convention to analyse algorithms.
1. Reflecting the base point twice in each side and its reflection requires O(n)operations for each side, resulting in O(n2 ) operations overall.
2. Computing all perpendicular bisectors between the reflected points requires comparing each pair of reflected points, resulting in O(n2 ) comparisons.
3. Computing intersections of bisectors as vertex candidates can result in up
to O(n4 ) intersections in the worst case.
4. Checking if a candidate is exterior to all bisectors involves comparing thecandidate with each bisector. In the worst case scenario where there areO(n4 ) candidate vertices, this step would require O(n2 ) operations foreach candidate vertex.
Therefore, in the worst-case scenario where the number of candidate vertices
is on the order of n4 , the overall computational complexity of the algorithm
would be O(n6 ).

5

3.1.2

Implementations

Our algorithm was implemented using the SageMath package [10] in Python,leveraging its rich set of functions for intuitive implementation. The core of our
implementation relies on the Hyperbolic Geometry module 1 . The source codefor our implementation is available online2 .

3.2

Empirical Verification with Triangle groups

We verify our algorithm by reconstructing the argument for a Triangle group.
In Theorem 2.1, by plugging in n = 3 (i.e., a triangle group), then N is boundedby 4 ≤ N ≤ 6 and by the construction of Dirichlet domains, we know that thepossible number of sides N is 4 or 6. For more details, See the Proof of Theorem
10.6.4 in [3] We will employ this example to verify our visualisation algorithm.
To this end, we employ the grid search algorithm that is often utilised in the
exploration of a space of the input variable of a black-box target function in
Machine learning literature.
3.2.1

Grid search

Grid search is a technique used in optimisation to search for the optimal parameters of a function. It works by evaluating a given function on a grid of configuration space (e.g., parameter values of the function of interest) and selecting
the point in the configuration space that achieves the required optimality.
Let us consider a simple example where we have f (x) = x2 in R and wewant to find the minimum value of this f . Now, we define a partition of possible
parameter values for the line R, such as x ∈ {1, 2, 3} or x ∈ {0.1, 0.2, 0.3}. Wethen evaluate the function for each parameter value x. For example, we would
evaluate the function at the points x ∈ {1, 2, 3}. Then we obtain 1, 4, 9 for f (x).
Finally, we select the point in R that gives the minimum of f .
Grid search is a powerful yet computationally expensive method for parameter tuning, especially with large parameter spaces. It depends on two key
factors: binning, which controls the granularity of the search, and range, which
defines the scope of the search space. For example, a small binning over alarge range allows for a broad exploration, while a large binning over a small
range enables a more detailed investigation. In our experiment, we focused on
the square [−0.5, 0.5] × [−0.5, 0.5] ⊂ H for our grid search implementation in
Python.
3.2.2

Result

We utilized a Grid search algorithm to compute Dirichlet domains within a
Triangle group, focusing on the symmetric triangle group where each corner has
an angle of π/4. The base polygon was centered at the origin (0, 0) in the space.
Figure 1 illustrates the following observation.
1 https://doc.sagemath.org/html/en/reference/hyperbolic_geometry/index.html
2 https://github.com/Rowing0914/sage-math-hyperbolic

6

Observation 3.1 When the base point lies:
1. On the boundary, N = 4.
2. In the interior, N = 6.
Note that, although difficult to discern, there are some bright orange points on
the boundary indicating 4-sided shapes. If we had been able to compute Dirichletdomains for all boundary points, the boundary would have been colored in brightorange. Also, areas shaded in dark blue indicate regions outside the base triangle
where the Dirichlet domain cannot be computed, resulting in 0 sides.
Note that our result obtained aligns with Theorem 24 of [12] that states
the possible shapes of dirichlet domains for a hyperbolic triangle is either aquadrilateral or a hexagon based on the location of the base point accordingly.

Figure 1: (Left) Base polygon to compute the dirichlet domain, (Right) 2D
Scatter Plot illustrating polygon sides within a square grid. The grid spansfrom -1.0 to 1.0 on both the x and y axes, with a circular boundary. The color
bar indicates the number of sides computed at grid points.

3.3

Detailed Analysis of 4-gon Construction

We expand our investigation to include hyperbolic 4-gons.
3.3.1

Grid Search Overview

We now apply a Grid search for a symmetric 4-gon centered at the origin (0, 0)with each corner being π/4. From Figure 2, we extracted the following observation.
Observation 3.2 When the base point lies;
1. On the boundary, N = 6,
7

Figure 2: (Left) Base polygon to compute the dirichlet domain, (Right) Scatterplot of polygon sides at each grid point.
2. In the intersection of diagonals or on a diagonal, N = 8,
3. In the interior, N = 10.
Note that areas shaded in dark blue indicate regions outside the base triangle
where the Dirichlet domain is not computable, resulting in 0 sides.
3.3.2

Case study: Base point Variations

We study the behaviour of the dirichlet domains in the cases depending on thelocation of the base point. In the following, all plots follow the same format
such that the red dots represent the vertices of the dirichlet domain, yellow andgreen geodesics are the perpendicular bisectors (See Algorithm 1).
(1) On Boundary: It is clear that there is a region that is constructed byreflecting the base 4-gon in each side. Thus, it posesses the same hyperbolic
area as the base 4-gon. Therefore it is a dirichlet domain by Remark 11 [12].

(2) Interior except on diagonals: This case can be considered as when
the base point moves slightly towards the center but does not reach the diagonals. Let us focus on the leftmost case to begin. Compared to the leftmost case8

of (1), two things have occurred: (i) the perpendicular bisectors that were on
the top-left and bottom-right sides of the base 4-gon have moved outwards toform two additional vertices of the Dirichlet domain, and (ii) the top-right andbottom-left green perpendicular bisectors have also moved outwards to form two
more vertices. Thus, there are 10 sides in total. The same observation applies
to the other cases compared to their corresponding ones in (1).

(3) On (a) diagonals: Let us reconsider the leftmost case (i.e., the basepoint lies at the intersection of the diagonals). Compared to the leftmost caseof (2), we observe that the two vertices at the top-right corner have merged
into one, as have those at the bottom-left corner. This results in a total of 8
vertices. In other cases, we can observe a similar transition of bisectors fromtheir corresponding plots in (2).

3.4

Scaling Experiment: Grid Search for Larger N=5

Figure 3: (Left) Base polygon to compute the dirichlet domain, (Right) Scatterplot of polygon sides at each grid point.

9

3.5

Future Directions

3.5.1

Application

There is a growing interest in the mathematics community regarding the utilization of machine learning models for exploring mathematical structures. Alessandretti et al. [2] employed data analysis techniques to analyze number-theoretic
datasets. He et al. [6] investigated the performance of standard machine learning algorithms such as Bayesian or logistic classifiers, as well as some feedforward neural networks, for predicting Arithmetic Curves. Gukov et al. [4]used the reinforcement learning algorithm Trust Region Policy Optimization(TRPO) [9] to find solutions to the problem of unknotting seemingly tangled
ropes. Even for the direct generation of mathematical structures, Halverson etal. [5] explored statistical methods.
In our work, we employed a brute-force approach to explore the configuration
space, specifically using Grid Search. However, we believe that more advanced
machine learning methods could greatly benefit the analysis of Dirichlet domains’ behavior.
3.5.2

TheoryIn terms of theoretical advancements, to the best of our knowledge, only thecase of triangle groups has been proven. Therefore, it would be interesting topursue proofs for cases with a larger number of sides. We believe the proof of
Theorem 10.6.4 in [3] could be helpful in this regard.
Investigating cases where g ̸= 0 could also be interesting [8, 1]. Additionally,
approximating the computation of Dirichlet domains can help scale the studyof their behavior [11].

4Acknowledgements

I would like to express my sincere gratitude to Prof. Komori for providing
feedback on my program.

References[1] Hirotaka Akiyoshi. Finding dirichlet domains of hyperbolic manifolds bycomputer. In Title of the Conference. Topology and Computer 2023, 10
2023.
[2] Laura Alessandretti, Andrea Baronchelli, and Yang-Hui He. Machine learning meets number theory: the data science of birch–swinnerton-dyer. In
MACHINE LEARNING: IN PURE MATHEMATICS AND THEORETICAL PHYSICS, pages 1–39. World Scientific, 2023.
[3] Alan F Beardon. The geometry of discrete groups, volume 91. Springer
Science & Business Media, 2012.
10

[4] Sergei Gukov, James Halverson, Fabian Ruehle, and Piotr Sulkowski.
Learning to unknot.
Machine Learning: Science and Technology,
2(2):025035, 2021.
[5] James Halverson and Cody Long. Statistical predictions in string theory
and deep generative models. Fortschritte der Physik, 68(5):2000005, 2020.
[6] Yang-Hui He, Kyu-Hwan Lee, and Thomas Oliver. Machine-learning arithmetic curves. arXiv preprint arXiv:2012.04084, 2020.
[7] Svetlana Katok. Fuchsian groups. University of Chicago press, 1992.
[8] Marjatta Näätänen. On the stability of identification patterns for dirichlet
regions. Annales Fennici Mathematici, 10(1):411–417, 1985.
[9] John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp
Moritz. Trust region policy optimization. In International conference on
machine learning, pages 1889–1897. PMLR, 2015.
[10] The Sage Developers. SageMath, the Sage Mathematics Software System(Version x.y.z), 2024. https://www.sagemath.org.
[11] Maria Trnková. Rigorous computations with an approximate dirichlet domain. Topology and its Applications, 268:106900, 2019.
[12] Yuriko Umemoto. On Dirichlet fundamental domains for Fuchsian groups.
PhD thesis, Master Thesis, Graduate School of Science, Osaka City University, 2011.

11