1 Introduction

A very important modular form is given by the famous Dedekind eta function, which is usually defined as the infinite product

$$\begin{aligned} \eta (z)\,{:}{=}\,q^{1/24}\prod _{n=1}^\infty (1-q^n), \qquad q= e^{2 \pi i z}, \end{aligned}$$

for z in the upper half-plane \(\mathfrak {H}=\{z\in \mathbb {C}\,:\, {\text {Im}}(z)>0\}\). This function enters into mathematics in many different places, one of which is the famous first Kronecker limit formula (see e.g. [21, Chapter 1]): The Eisenstein series

$$\begin{aligned} E(z,s)\,{:}{=}\,\sum _{\begin{array}{c} m,n\in \mathbb {Z}\\ (m,n)\ne 0 \end{array}} \frac{{\text {Im}}(z)^s}{|mz+n|^{2s}},\quad {\text {Re}}(s)>1, \end{aligned}$$

has a meromorphic continuation to the entire s-plane which is holomorphic except for a simple pole in \(s=1\) and one has

$$\begin{aligned} \lim _{s\rightarrow 1}\left( E(z,s)-\frac{\pi }{s-1}\right) =2\pi \left( \gamma _E-\log (2)-\log \left( \sqrt{{\text {Im}}(z)}|\eta (z)|^2\right) \right) , \end{aligned}$$

where \(\gamma _E=0.57721566...\) denotes the Euler-Mascheroni constant.

Since the Eisenstein series is invariant under Möbius transformations

$$\begin{aligned} z\mapsto \left( {\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}\right) z\,{:}{=}\,\frac{az+b}{cz+d} \end{aligned}$$

with \(\left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) \in {\text{ SL }}_2(\mathbb {Z})\), Kronecker’s limit formula allows to deduce the well-known fact that \(\eta \) satisfies the transformation law

$$\begin{aligned} \eta \left( \frac{a z+b}{cz+d}\right) =\varepsilon (a,b,c,d)(cz+d)^{1/2}\eta (z),\quad \big ({\begin{matrix} a &{} b \\ c &{} d \end{matrix}}\big )\in {\text {SL}}_2(\mathbb {Z}), \end{aligned}$$

for some \(\varepsilon (a,b,c,d)\in \mathbb {C}\) (see (1.1) below). In particular, we find

$$\begin{aligned} \eta (z+1) = e^\frac{\pi i}{12}\eta (z),\qquad \qquad \eta \left( -\frac{1}{z}\right) = \sqrt{\frac{z}{i}}\eta (z), \end{aligned}$$

where we choose the branch of the square-root that is positive for positive real arguments. Since these transformations generate the full modular group, this implies that \(\eta \) is a modular form of weight 1/2 for the group \({\text {SL}}_2(\mathbb {Z})\) with respect to a certain multiplier system (see below). Dedekind was the first to obtain an explicit description of this multiplier system in terms of so-called Dedekind sums, which are defined for coprime integers hk as

$$\begin{aligned} s(h,k)=\sum _{\mu =1}^k \left( \hspace{-4pt}\left( \frac{h\mu }{k}\right) \hspace{-4pt}\right) \left( \hspace{-4pt}\left( \frac{\mu }{k}\right) \hspace{-4pt}\right) , \quad \text { where } \quad (\hspace{-1pt}(x)\hspace{-1pt}){:}{=}{\left\{ \begin{array}{ll} x-\lfloor x\rfloor -\frac{1}{2} &{} \text {if }x\notin \mathbb {Z},\\ 0 &{} \text {if }x\in \mathbb {Z}. \end{array}\right. } \end{aligned}$$

With those, we define the Rademacher symbol for a matrix \(\gamma =\left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) \in {\text{ SL }}_2(\mathbb {Z})\) to be

$$\begin{aligned} \Phi (\gamma )\,{:}{=}{\left\{ \begin{array}{ll} \frac{b}{d} &{} \text {if }c=0, \\ \frac{a+d}{c}-12{\text {sgn}}(c)s(d,|c|) &{} \text {if }c\ne 0. \end{array}\right. } \end{aligned}$$

It can be shown that \(\Phi (\gamma )\) is always an integer (see for instance [19, p. 50]). With this, we have for \(\left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) \in {\text{ SL }}_2(\mathbb {Z})\) that

$$\begin{aligned} \log \eta \left( \frac{az+b}{cz+d}\right) = \log \eta (z) + \frac{1}{2}{\text {sgn}}(c)^2 \log \left( \frac{cz+d}{i{\text {sgn}}(c)}\right) + \frac{\pi i}{12}\Phi \left( \begin{pmatrix} a &{}\quad b \\ c &{}\quad d \end{pmatrix}\right) ,\nonumber \\ \end{aligned}$$
(1.1)

where the second summand is understood to be 0 if \(c=0\). Note that throughout we define \({\text {sgn}}(0){:}{=}0\). The Rademacher symbol almost behaves like a logarithm on \({\text {SL}}_2(\mathbb {Z})\) since we have

$$\begin{aligned} \Phi (\gamma _1\gamma _2) = \Phi (\gamma _1) + \Phi (\gamma _2) - 3{\text {sgn}}(c_1c_2c_3), \end{aligned}$$

where \(\gamma _3=\gamma _1\gamma _2\) and \(\gamma _j = \left( {{\begin{matrix} a_j &{}{} b_j \\ c_j &{}{} d_j \end{matrix}}}\right) \). This implies that the Rademacher symbol is essentially the logarithm of a multiplier system of weight 1/2 for the full modular group. For an exact definition of this term, we refer the reader to standard textbooks on the theory of modular forms, e.g. [10, Section 2.6].

Dedekind sums and Rademacher symbols are therefore very natural objects related to the group \({\text {SL}}_2(\mathbb {Z})\). In fact, they have appeared in many different contexts in number theory, geometry, and topology. For example, Dedekind sums are present in signature related invariants of lens spaces, such as their \(\alpha \)-invariants in [9] and \(\mu \)-invariants in [17]; they also appear in the study of signatures of torus bundles over surfaces (see [14]) and generalized Casson invariant (see [24]). Furthermore, Kirby and Melvin in [12] give a geometric definition of Rademacher symbols. Their geometric definition of the Rademacher symbol arises from the action of the modular group on the upper half-plane \(\mathfrak {H}\) by fractional linear transformations. Their geometric definition is based on a certain triangulation K of \(\mathfrak {H}\) by ideal triangles obtained by successive reflections of the ideal triangle with vertices at \(0,\ 1\), and \(\infty \) on the boundary of \(\mathfrak {H}\). There are many special properties of this triangulation K; in [8], this triangulation is used to elucidate a geometric view of Pythagorean triples, the Euclidean algorithm, Pell’s equation, continued fractions, and Farey sequences.

In Section 3, we recall how elements of the modular group can be related to edges in the triangulation K by the well-known fact that the edges of the triangulation have endpoints a/c and b/d if and only if \(ad-bc = \pm 1\). Next, starting with the edge from \(\infty \) to 0, we associate a (directed) based edge path \(\alpha \) in the triangulation K that ends at the edge related to \(\left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) \) in the modular group. In [12], Kirby and Melvin use a geometric way to uniquely specify a based edge path \(\alpha \) by a list \(( a_1 , \ldots , a_k )\) of integers and give a geometric formulation of the Rademacher symbol. Before we state their result, recall that \({\text {SL}}_2(\mathbb {Z})\) is generated by the matrices \(S = \left( {{\begin{matrix} 0 &{}{} -1 \\ 1 &{}{} 0 \end{matrix}}} \right) \) and \(T = \left( {{\begin{matrix} 1 &{}{} 1 \\ 0 &{}{} 1 \end{matrix}}} \right) \).

Theorem

(Kirby & Melvin). Let \(\alpha = ( a_1 , \ldots , a_k )\in \mathbb {Z}^k\) and \(A= \left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}} \right) = S(T^{a_1} S) \cdots (T^{a_k} S)\in {\text{ SL }}_2(\mathbb {Z})\). Then the Rademacher symbol satisfies the identity

$$\begin{aligned} \Phi (A) = \tau _\alpha - 3 \sigma _\alpha , \end{aligned}$$

where \(\tau _\alpha \) and \(\sigma _\alpha \) denote the trace and signature of the matrix

whose \((i,j)^{\text {th}}\) entry is \(a_i\) if \(i = j\), 1 if \(\left| i-j\right| =1\), and 0 otherwise.

Both \(\tau _\alpha \) and \(\sigma _\alpha \) have geometric interpretations in terms of the based edge path \(\alpha \) in the triangulation K. Informally speaking, \(\tau _\alpha \) is the net number of turns made in \(\alpha \), keeping in mind the direction, and \(\sigma _\alpha \) is the difference between the number of edges of \(\alpha \) pointing left and those pointing right (see [12, Remark 1.13(c)]).

In fact, Kirby and Melvin use this geometric formulation to illustrate the appearance of Dedekind sums (and Rademacher symbols) in topology; moreover, the relation of Rademacher symbols with linking numbers of trefoil knots [6] has been generalized from the modular point of view by Duke, Imamoglu, and Tóth [5].

On the number theoretic side, the Kronecker limit formula has been generalized to arbitrary Fuchsian groups of the first kind (i.e., discrete subgroups of \({\text {SL}}_2(\mathbb {R})\) of finite covolume); moreover, the corresponding analogue of the Dedekind eta function gives rise to analogous definitions of Dedekind sums and Rademacher symbols for such groups, which are made explicit for the special case of the principal congruence subgroups in [7]. Furthermore, arithmetic and analytic properties of these generalizations have been studied for instance in [1, 2, 22, 23] (see also [3] for a survey of these results).

The current work generalizes the aforementioned theorem of Kirby and Melvin to a wider class of arithmetic groups, namely the groups \(\Gamma _0^+(p)\) for odd primes p, the normalizers in \({\text {SL}}_2(\mathbb {R})\) of the congruence subgroups

$$\begin{aligned} \Gamma _0(p) = \left\{ \begin{pmatrix} a &{} b \\ c &{} d \end{pmatrix}\in {\text{ SL }}_2(\mathbb {Z})\,:\, c\equiv 0\pmod p\right\} . \end{aligned}$$

To this end, we introduce a Rademacher symbol for \(\Gamma _0^+(p)\) as follows: For \(\gamma =\left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) \in \Gamma _0^+(p)\), we define

$$\begin{aligned} \Phi _p(\gamma )\,{:}{=}{\left\{ \begin{array}{ll} \frac{1}{2} \left[ \Phi (\gamma ) + \Phi \left( \big ( {\begin{matrix} a &{} pb \\ c/p &{} d \end{matrix}} \big ) \right) \right] &{} \text {for }\gamma \in \Gamma _0(p),\\ \Phi _p \left( \frac{1}{\sqrt{p}} \big ( {\begin{matrix} c &{} d \\ -pa &{} -pb \end{matrix}} \big ) \right) - 3{\text {sgn}}(-ac)&\text {for }\gamma \notin \Gamma _0(p). \end{array}\right. } \end{aligned}$$

Furthermore, we set

$$\begin{aligned} \eta _p(z){:}{=}\left( \eta (z)^k \eta ( p z)^k \right) ^{1/2k}, \end{aligned}$$

where k is a suitable positive integer k (see Section 2). With this, we have the following result.

Theorem 1

For all \(\gamma =\left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) \in \Gamma _0^+(p)\) and all \(z\in \mathfrak {H}\), we have

$$\begin{aligned} \log \eta _p\left( \frac{az+b}{cz+d}\right) = \log \eta _p(z) + \frac{1}{2}{\text {sgn}}(c)^2\log \left( \frac{cz+d}{i{\text {sgn}}(c)}\right) + \frac{\pi i}{12}\Phi _p(\gamma ), \end{aligned}$$

where the second term is to be interpreted as 0 if \(c=0\) as in (1.1).

With this and the geometry of based edge paths, we are able to establish an interpretation of the Rademacher symbols in terms of averaging net turns and directions arising from the geometry of two based edge paths in K; we show the following result.

Theorem 2

For \(\gamma =\left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) \in \Gamma _0^+(p)\), we have that

$$\begin{aligned} \Phi _p(\gamma ){:}{=}{\left\{ \begin{array}{ll} \frac{\tau _\alpha + \tau _\beta }{2} - 3 \left( \frac{\sigma _\alpha + \sigma _\beta }{2} \right) &{} \text {for } \gamma \in \Gamma _0(p),\\ \Phi _p \left( \frac{1}{\sqrt{p}} \big ( {\begin{matrix} c &{} d \\ -pa &{} -pb \end{matrix}} \big ) \right) - 3{\text {sgn}}(-ac)&\text {for } \gamma \notin \Gamma _0(p), \end{array}\right. } \end{aligned}$$

where \(\alpha = ( a_1, \ldots , a_k )\) and \(\beta = (b_1 , \ldots b_m)\) are two based edge paths in K made from \(\gamma \in \Gamma _0(p)\) and \(\left( {{\begin{matrix} a &{}{} pb \\ c/p &{}{} d \end{matrix}}}\right) \in {\text{ SL }}_2(\mathbb {Z})\), \(\tau _\alpha \) and \(\sigma _\alpha \) denote the trace and signature of the matrix \(M_\alpha \), and \(\tau _\beta \) and \(\sigma _\beta \) denote the trace and signature of the matrix \(M_\beta \), where

For \(M_\alpha \) (resp. \(M_\beta \)) the \((i,j)^{\text {th}}\) entry is \(a_i\) (resp. \(b_i\)) if \(i = j\), and for either matrix the \((i,j)^{\text {th}}\) entry 1 if \(\left| i-j\right| =1\), and 0 otherwise.

The rest of the paper is organized as follows: In Section 2, we motivate and prove Theorem 1; in Section 3, we recall needed geometric properties of edge paths in the triangulation K from [12]; and in Section 4, we show how two based edge paths arise in K from elements of \(\Gamma _0(p)\) and prove Theorem 2.

2 Modular construction of multipliers for \(\mathbf {\Gamma _0^+({\varvec{p}})}\)

The weight 1/2 multiplier system defined by the transformation law of the eta function is a very natural one in the following sense. The \(24^{\textrm{th}}\) power of \(\eta \) yields the unique normalized cusp form of lowest possible weight (12 in this case) for \({\text {SL}}_2(\mathbb {Z})\). This function is usually denoted by \(\Delta \) and has the important property that it never vanishes on the upper half-plane; so taking the \(24^{\textrm{th}}\) root of \(\Delta \) is well-defined, once a branch of the logarithm is chosen.

The group \(\Gamma _0^+(p)\) for an odd prime p is well-known (see e.g. [4]) to be generated by \(\Gamma _0(p)\) and the Fricke involution \( W_p = \frac{1}{\sqrt{p}} \left( {{\begin{matrix} 0 &{}{} -1 \\ p &{}{} 0 \end{matrix}}}\right) \).

As an analogue of \(\Delta \), we take any normalized (non-trivial) cusp form for \(\Gamma _0^+(p)\) of lowest possible integral weight k that does not vanish in \(\mathfrak {H}\). It follows immediately from the work of Kohnen [13, Theorem 2] (see also [20, p. 205]) that such a function is necessarily given by an eta quotient. An eta quotient of level N is an expression of the form \( f(z) = \prod _{d|N} \eta (dz)^{r_d}\), where \(r_d\in \mathbb {Z}\). In general, such a function will be a weakly holomorphic modular formFootnote 1 of weight \(\tfrac{1}{2} \sum _{d|N}r_d\) for some congruence subgroup of \({\text {SL}}_2(\mathbb {Z})\). In [15, 16], Newman gives explicit conditions on the exponents \(r_d\) that make an eta quotient a holomorphic modular form for the group \(\Gamma _0(N)\). Additionally, our desired cusp form should be invariant under the Fricke involution \(W_p\), which finally implies that the desired analogue of \(\Delta \) is given by \( \Delta _p(z){:}{=}\eta ^k(z)\eta ^k(pz) \), where k is the smallest positive even integer such that \(\frac{p-1}{24}k\) is an integer. Taking the \(2k^{\textrm{th}}\) root of this yields the definition of our analogue of the eta function

$$\begin{aligned} \eta _p(z)=\exp \left( \frac{1}{2k}\log (\Delta _p(z))\right) , \end{aligned}$$

where we choose the principal branch of the logarithm, i.e., \(\log z=\log |z|+i\arg z\) for \(z\in \mathbb {C}{\setminus }\{0\}\), where we pick \(\arg z\in (-\pi ,\pi ]\).

With this, we can now prove Theorem 1.

Proof of Theorem 1

We first assume that \(\gamma =\left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) \in \Gamma _0(p)\). Then we have

$$\begin{aligned} \eta (p\gamma z)=\eta \left( \begin{pmatrix} a &{}{} pb \\ c/p &{}{} d \end{pmatrix}(pz) \right) , \end{aligned}$$

hence the claimed transformation law follows immediately from (1.1) since the matrix \(\left( {{\begin{matrix} a &{}{}\quad pb \\ c/p &{}{}\quad d \end{matrix}}}\right) \) is in \({\text {SL}}_2(\mathbb {Z})\).

Now let \(\gamma =\left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) \in \Gamma _0^+(p)\setminus \Gamma _0(p)\); we have \(\gamma = W_p {\tilde{\gamma }}\), where

$$\begin{aligned} {\tilde{\gamma }} = W_p^{-1} \gamma = \frac{1}{\sqrt{p}}\begin{pmatrix} c &{}\quad d \\ -pa &{}\quad -pb \end{pmatrix} \in \Gamma _0(p). \end{aligned}$$

From the transformation formula \(\eta \left( -\frac{1}{z}\right) = \sqrt{\frac{z}{i}}\eta (z)\), it is easy to see that for positive integers mN, we have

$$\begin{aligned}\eta (m(W_N z))=\sqrt{\frac{(N/m)z}{i}}\eta \left( \frac{N}{m}z\right) .\end{aligned}$$

With this, we find that

$$\begin{aligned} \log \eta _p(\gamma z)&= \frac{1}{2}\left[ \log \eta (W_p{\tilde{\gamma }} z)+\log \eta (p\cdot W_p{\tilde{\gamma }} z) \right] \\&= \frac{1}{2}\left[ \log \eta (p\cdot {\tilde{\gamma }} z)+\log \eta ({\tilde{\gamma }} z)\right] +\frac{1}{4}\left[ \log \left( p\frac{{\tilde{\gamma }} z}{i}\right) +\log \left( \frac{{\tilde{\gamma }} z}{i}\right) \right] \\&= \log \eta _p( z)+\frac{1}{2}{\text {sgn}}(-\sqrt{p}a)^2\log \left( \frac{-\sqrt{p}a z-\sqrt{p}b}{i{\text {sgn}}(-\sqrt{p}a)}\right) +\frac{\pi i}{12}\Phi _p({\tilde{\gamma }}) \\&\quad + \frac{1}{4}\left[ \log \left( p\frac{{\tilde{\gamma }} z}{i}\right) +\log \left( \frac{{\tilde{\gamma }} z}{i}\right) \right] . \end{aligned}$$

Therefore the claim follows as soon as we show that

$$\begin{aligned}{} & {} {\text {sgn}}(-\sqrt{p}a)^2\log \left( \frac{-\sqrt{p}a z-\sqrt{p}b}{i{\text {sgn}}(-\sqrt{p}a)}\right) + \frac{1}{2}\left[ \log \left( p\frac{{\tilde{\gamma }} z}{i}\right) +\log \left( \frac{{\tilde{\gamma }} z}{i}\right) \right] \nonumber \\{} & {} \quad = {\text {sgn}}(c)^2\log \left( \frac{c z+d}{i{\text {sgn}}(c)}\right) -\frac{\pi i}{2}{\text {sgn}}(-ac). \end{aligned}$$
(2.1)

If \(a=0\), then we must have \(bc=-1\) (so, in particular, \(c\ne 0\)) and hence, since \({\tilde{\gamma }}\in \Gamma _0(p)\), \(b=\pm 1/\sqrt{p}\). The left-hand side of (2.1) then simplifies to

$$\begin{aligned} \log \left( \frac{c z+d}{-ipb}\right) +\frac{1}{2}\log p&=\log \left( \frac{c z+d}{i{\text {sgn}}(c)}\right) +\log \left( \frac{-{\text {sgn}}(c)}{pb}\right) +\frac{1}{2}\log p \\&= \log \left( \frac{c z+d}{i{\text {sgn}}(c)}\right) , \end{aligned}$$

which is the simplified right-hand side of (2.1). The case \(c=0\) is similar. Finally, if \(ac\ne 0\), then the left-hand side of (2.1) becomes

$$\begin{aligned}&\log \left( \frac{-\sqrt{p}a z-\sqrt{p}b}{i{\text {sgn}}(-a)}\right) +\log \left( \frac{c z+d}{i(-pa z-pb)}\right) +\frac{1}{2}\log p\\&\quad = \log \left( \frac{c z+d}{i{\text {sgn}}(c)}\right) +\log \left( \frac{{\text {sgn}}(c)}{i{\text {sgn}}(-a)}\right) = \log \left( \frac{c z+d}{i{\text {sgn}}(c)}\right) -\frac{\pi i}{2}{\text {sgn}}(-ac), \end{aligned}$$

which completes the proof. \(\square \)

Remark

As shown in [11, Theorem 12] (see also [18, Theorem 1.3]), the function \(\eta _p\) defined above (respectively some appropriate power of it) is exactly the function one encounters as the natural analogue of \(\eta \) in the Kronecker limit formula for the group \(\Gamma _0^+(p)\).

In fact, the cited works prove a Kronecker limit formula for all groups \(\Gamma _0^+(N)\) where N is square-free. These groups are generated by the congruence subgroup \(\Gamma _0(N)\) together with the so-called Atkin-Lehner involutions. Thus one obtains very similar looking Rademacher symbols associated to these groups as well (see [7]). However, we decided to focus on the simplest case where \(N=p\) is a prime in this work.

3 Based edge paths

The modular group \({\text {PSL}}_2(\mathbb {Z})\) is a discrete subgroup of \({\text {PSL}}_2(\mathbb {R})\); as such, it acts by fractional linear transformations of the upper half-plane model of the hyperbolic plane. With this action, much is known about the interactions of \({\text {PSL}}_2(\mathbb {Z})\) and the upper half-plane model \(\mathfrak {H}\) of the hyperbolic plane. A well-known triangulation of the upper half-plane \(\mathfrak {H}\) by ideal triangles is made by successive reflections of the ideal triangle with vertices at 0, 1, and \(\infty \) on the boundary of \(\mathfrak {H}\). We denote this triangulation by K (see [8] for some important properties of K). The vertices of this triangulation K are \(\mathbb {Q}\cup \{\infty \}\), where we use the common convention that the fraction notation \(\frac{1}{0}\) (or occasionally \(\frac{-1}{0}\)) identifies the point \(\infty \). An edge in K joins two fractions \(\frac{n_1}{d_1}\) and \(\frac{n_2}{d_2}\) (in lowest terms on the boundary of \(\mathfrak {H}\)) if and only if \(n_1 d_2 - n_2 d_1 = \pm 1\).

Directed edges of K can be identified with the elements of \({\text {PSL}}_2(\mathbb {Z})\), and the action of \({\text {PSL}}_2(\mathbb {Z})\) on \(\mathfrak {H}\) induces a simplicial action on K, which corresponds to left multiplication on the edges of K. For example, the directed edge from \(\infty \) to 0 will be denoted with the ordered pair \(I= \left( \frac{1}{0} , \frac{0}{1} \right) \), and its reverse direction \(\left( \frac{0}{1} , \frac{-1}{0} \right) \). We also orientate the ideal triangles of K in a counterclockwise direction.

As in [12], we define a based (directed) edge path \(\alpha \) in K as a path that starts with the initial edge \(I = E_0= \left( \frac{1}{0} , \frac{0}{1} \right) \). So given a based edge path \(\alpha \) in K, the endpoints of the edges from \(\alpha \) yield a sequence of fractions starting at \( \frac{1}{0} , \frac{0}{1} , \ldots , \frac{ n_{k-1}}{ d_{k-1} }\), and ending at \(\frac{ n_{k}}{ d_{k} } \). Figure 1 shows an example of a based edge path \(\alpha \), which gives the sequence of endpoints \( \frac{1}{0}, \frac{0}{1}, \frac{ 1 }{ 2 }, \frac{1}{3}\), and ending at \(\frac{ 3 }{ 8 } \).

Furthermore, recall from [12] that a based (directed) edge path \(\alpha \) in K is uniquely specified by the list \((a_1, \ldots , a_k)\) of integers defined geometrically as follows: the intial edge \(E_0\) of \(\alpha \) turns through \(a_1\) triangles to reach the second edge \(E_1\) (with \(a_1 > 0\) if and only if the turn is counterclockwise), the edge \(E_1\) of \(\alpha \) turns through \(a_2\) triangles to reach the third edge \(E_2\), and so on. Thus we often write \(\alpha = (a_1, \ldots , a_k)\). Figure 1 shows an example of a based edge path \(\alpha \) from the list of integers \((-2, 1, -2)\).

Fig. 1
figure 1

Example of the based edge path \(\alpha = (-2, 1, -2)\)

In fact, we can obtain the integer for the direction and number of triangles of K to turn through from the three endpoints from one edge to the next edge in the path. The proof of [12, Lemma 1.9] shows that if the three consecutive endpoints of the edge \(E_{j-1}\) to the edge \(E_j\) are \(\frac{ n_{j-1} }{ d_{j-1} } , \frac{ n_{j} }{ d_{j} }, \frac{ n_{j+1} }{ d_{j+1} } \), then the integer \(a_j\) for the direction and number of triangles of K to turn through can be found via the identities

$$\begin{aligned} \left| a_j\right| = \left| n_{j-1} d_{j+1} - n_{j+1} d_{j-1} \right| ,\quad \text {and}\quad {\text {sgn}}(a_j)={\text {sgn}}\left( n_jd_{j+1}-n_{j+1}d_j\right) . \end{aligned}$$

This relationship between the endpoints of consecutive edges and the geometry of turns in a based path can establish the next lemma (see [12, Lemma 1.9]), which relates the final edge (in reverse direction to a matrix in \({\text {PSL}}_2(\mathbb {Z})\)) of a based edge path \(\alpha \) to a product in terms of the standard generators of the modular group via the based edge path \(\alpha = \left( a_1 , \ldots , a_k \right) \).

Lemma

([12]). Let \(\alpha = ( a_1, \ldots , a_k)\) be a based edge path in K whose final (directed) edge goes from \(\frac{b}{d}\) to \(\frac{a}{c}\) where \( ad - cb = 1\). As elements of \({\text {PSL}}_2(\mathbb {Z})\), \( \left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) = S(T^{a_1} S) \cdots (T^{a_k} S)\), where \(S = \left( {{\begin{matrix} 0 &{}{} -1 \\ 1 &{}{} 0 \end{matrix}}} \right) \) and \(T = \left( {{\begin{matrix} 1 &{}{} 1 \\ 0 &{}{} 1 \end{matrix}}} \right) \).

4 Two based paths for elements of the congruence subgroup \(\Gamma _0(p)\)

Like in Section 2, we set p to be an odd prime. We start by considering elements of the congruence subgroup \(\Gamma _0(p)\). When viewing an element from \(\Gamma _0(p)\) as an edge in K, the endpoints can be multiplied by p and produce another edge of K. It is important to keep in mind that multiplication by p as a Möbius transformation does not map K to itself. However, it does map the based edge \(\left( \frac{1}{0}, \frac{0}{1} \right) \) to itself and maps edges from elements of \(\Gamma _0(p)\) to edges in K.

Proof of Theorem 2

Let \(\gamma = \left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) \in \Gamma _0(p)\), (that is, \( c\equiv 0\pmod p \)). We see that conjugating \(\gamma \) by the Möbius transformation multiplication by p is also a edge in K; that is,

$$\begin{aligned} \begin{pmatrix} p/\sqrt{p} &{}{} 0 \\ 0 &{}{} 1/\sqrt{p} \end{pmatrix} \begin{pmatrix} a &{}{} b \\ c &{}{} d \end{pmatrix} \begin{pmatrix} 1 /\sqrt{p} &{}{} 0 \\ 0 &{}{} p/\sqrt{p} \end{pmatrix} = \begin{pmatrix} a &{}{} pb \\ c/p &{}{} d \end{pmatrix}. \end{aligned}$$

We make two based paths \(\alpha = (a_1, \ldots , a_k)\) and \(\beta = (b_1 , \ldots , b_m) \) so that

$$\begin{aligned} \begin{pmatrix} a &{}{} b \\ c &{}{} d \end{pmatrix}= S(T^{a_1} S) \cdots (T^{a_k} S) \quad \text{ and } \quad \begin{pmatrix} a &{}{} pb \\ c/p &{}{} d \end{pmatrix} = S(T^{b_1} S) \cdots (T^{b_m} S). \end{aligned}$$

These two edges in K are the two ending edges (in reverse direction) for the based paths \(\alpha \) and \(\beta \). We refer to the based edge paths \(\alpha \) and \(\beta \) as being made from \(\gamma = \left( {{\begin{matrix} a &{}{} b \\ c &{}{} d \end{matrix}}}\right) \in \Gamma _0(p)\) and \(\left( {{\begin{matrix} a &{}{}\quad pb \\ c/p &{}{}\quad d \end{matrix}}}\right) \in {\text{ SL }}_2(\mathbb {Z})\).

Now we apply the theorem of Kirby and Melvin (in the introduction) to compute \(\Phi \) of these two matrices using the geometric formulation of the Rademacher symbol

$$\begin{aligned} \Phi (\gamma ) = \tau _\alpha - 3 \sigma _\alpha \quad \text{ and } \quad \Phi \left( \begin{pmatrix} a &{}{} pb \\ c/p &{}{} d \end{pmatrix} \right) = \tau _\beta - 3 \sigma _\beta , \end{aligned}$$

where \(\tau _\alpha \), \(\sigma _\alpha \), \(\tau _\beta \), \(\sigma _\beta \) are as defined in the statement of Theorem 2. Now the result follows by applying Theorem 1. \(\square \)