1 Introduction

In relation to his work about embeddability of metric spaces in \({\mathbb {E}}^n\), Menger explored in [7] (among other articles) the notion of angle for a metric or semi-metric space \(({\mathcal {X}},d)\). Let us denote by \({\mathcal {X}}^{3*}=\{(A,B,C)\in {\mathcal {X}}^3: B\ne A,C\}\). He defined angle functions to be maps \(\angle :X^{3*}\rightarrow {[}0,\pi ]\), such that

$$\begin{aligned} \angle (A,B,C)=\angle (C,B,A)={\left\{ \begin{array}{ll}0 &{}\text {if }d(B,A)+d(A,C)=d(B,C) \text { or } \\ &{}\;\;\;d(B,C)+d(C,A)=d(B,A)\\ \pi &{} \text {if }d(A,C)=d(A,B)+d(B,C) \\ >0 &{} \text {in other case}. \end{array}\right. } \end{aligned}$$
(1)

For him, an angle space was a triple \(({\mathcal {X}},d,\angle )\), where X is a set, d a distance or semi-distance and \(\angle \) an angle function. He also stated the following two problems:

Problem 1

(Literal copy from page 750 in [7]). It would be desirable to know relations between the angles of an angle space, characteristic for those angle spaces which are conformal to a subset of the plane and to the plane itself.

Problem 2

(Literal copy from page 750 in [7]). In a metrical space (...), each three points are congruent to three points of the plane and, therefore, the definition of distances induces a definition of angles (viz., the angles in the corresponding plane triangles). A problem (connected, of course, with the first mentioned) is to find conditions which are necessary and sufficient in order that in an angle space, which at the same time is a metrical space, the angles are identical with the angles induced by the definition of distance.

Let us clarify that, for the author, in a metric space (Xd), the angles induced by the definition of distance are those satisfying

$$\begin{aligned} \forall A,B,C\in {\mathcal {X}},\; d(B,C)^2=d(A,C)^2+d(A,B)^2+2\cdot d(A,C)\cdot d(A,B)\cdot \cos \angle (B,A,C). \end{aligned}$$
(2)

After the work by Menger, other attempts have been done to provide a useful definition of angle space, always, as far as we know, in the setting of metric spaces. On the one hand, the more complicated the structure of the metric space is and the more axioms are required for the angle function, the more desirable properties are satisfied by the angle space. Therefore, some years after the article by Menger, Wilson [13] studied the concept of angle for convex complete metric spaces \({\mathcal {X}}\) satisfying what he called the “four point property”. In this setting, there is a notion of line, ray, and segment, and it is possible to define angles between them, not only for point triples. The authors of [12] decided to restrict themselves to the study of angles in linear normal spaces. On the other hand, in the recent articles [2, 8], again the notion of angle between three points for general metric spaces is discussed, with the intention of providing a definition that coincides with the usual angle between geodesics if the space is a Riemannian manifold.

In this paper, we provide a simple and general axiomatic definition of angle function for spaces \({\mathcal {X}}\) that are not necessary metric or semi-metric (Definition 4). This eliminates the hassle of discussing the relation between the distance and angle functions a priori. We defend that the minimum structure required for \({\mathcal {X}}\) to have a not artificial notion of angle is a relation of betweenness. More about these relations is said in Sect. 2. Once we have settled our framework, the rest of the article is devoted to solving the two problems proposed by Menger (Sects. 3 and 4). As it often happens with known results in the bibliography concerning embeddability of metric spaces in the Euclidean space \({\mathbb {E}}^n\), the characterization obtained in this article in response to Problem 2 may be impractical for spaces with an infinite number of points. However, it may be of great interest for finite spaces, and in relation to some problems in Applied Mathematics. In Sect. 5, we give a glimpse of how this simple concept of angle function may be of interest in many branches of Mathematics, from machine learning to the classic Inscribed Square Problem. To conclude this paper, a list of three open problems, that can be regarded as a continuation of this work, is provided.

2 Relation of Betweeness: A New Definition of Angle Space

There exist recent publications studying spaces with a notion of betweeness (see [1]). There are different options to define this concept. In [3], some axiomatic approaches for geometric use are discussed. Among all the possibilities, we are interested in the, not very restrictive, following one:

Definition 3

(Pseudometric betweenness). A relation of betweenness in a set \({\mathcal {X}}\) is a ternary relation \({\mathcal {B}}\). If \((A,B,C)\in {\mathcal {B}}\), we say that B is between A and C. And if either \((B,A,C)\in {\mathcal {B}}\), \((A,B,C)\in {\mathcal {B}}\) or \((A,C,B)\in {\mathcal {B}}\), then we say that ABC are collinear. We ask moreover that the relation \({\mathcal {B}}\) satisfies:

  1. (B1)

    If \((A,B,C)\in {\mathcal {B}}\), then ABC are distinct.

  2. (B2)

    If \((A,B,C)\in {\mathcal {B}}\), then \((C,B,A)\in {\mathcal {B}}\).

  3. (B3)

    If \((A,B,C)\in {\mathcal {B}}\), then \((B,A,C)\notin {\mathcal {B}}\).

  4. (B4)

    If \((P_1,P_2,P_3),(Q_1,Q_2,Q_3)\in {\mathcal {B}}\) and these two triples of points have two points in common, then any possible set of three different points in \(\{P_1,P_2,P_3\}\cup \{Q_1,Q_2,Q_3\}\) is collinear.

In [1], the concept of pseudometric betweenness is introduced and the choice of the name is explained. Their last axiom is slightly different to ours. The reason of this change is explained below. Also, in that article, lines and segments are defined. Here, we prefer not to introduce more notation than needed. Instead, (B4) gives us a notion of collinearity also for sets of four or more points: we say that such a set is collinear if any of its subset of three points is collinear.

Every semi-metric space has a natural relation \({\mathcal {B}}\) of betweenness. We say that B is between AC if and only if \(d(A,B)+d(B,C)=d(A,C)\). Therefore, we can appreciate that the notion of betweenness was already captured in the definition by Menger (1). Thus, for us, spaces with a relation of betweenness are the more natural and general framework to define angles, since, in some sense, collinearity is inseparably linked to angles.

Definition 4

Let \({\mathcal {X}}\) be a space with a notion of betweenness \({\mathcal {B}}\). \(\angle :{\mathcal {X}}^{3*}\rightarrow [0,\pi ]\) is an angle function if:

  1. (i)

    it is symmetric in the first and third coordinates \(\angle (A,B,C)=\angle (C,B,A)\),

  2. (ii)

    \(\displaystyle {\angle (A,B,C)={\left\{ \begin{array}{ll}0 &{}\text {if }A=C,\; (B,A,C)\in {\mathcal {B}} \text { or }(B,C,A)\in {\mathcal {B}}\\ \pi &{}\text {if } (A,B,C)\in {\mathcal {B}}\\ >0 &{} \text {in other case}\end{array}\right. }},\)

  3. (iii)

    (Axiom of Collinearity) if \((B,C,D)\in {\mathcal {B}}\), then for all \(A\ne B\), \(\angle (A,B,C)=\angle (A,B,D)\).

As the reader may have noticed, we have added one more requirement with respect to (1). This Axiom of Collinearity seems to us to be basic. We think that a possible reason for Menger to discard it is that he was mainly interested in angle functions defined in metric spaces with a compatible distance, where it is implicitly required.

For us, angle spaces are triples \(({\mathcal {X}},{\mathcal {B}},\angle )\) where \({\mathcal {X}}\) is a set, \({\mathcal {B}}\) is a relation of betweenness and \(\angle \) is an angle function. If such an angle space admits a distance function d, such that \(\angle \) is induced by d as explained in the definition (see Eq. (2)), we say that d and \(\angle \) are Euclidean-compatible. As usual, we say that a function between two angle spaces is conformal if it preserves angles and the betweenness relation and that it is a conformal equivalence if, in addition, it is bijective.

3 Solution to Problem 2

An angle space \({\mathcal {X}}\) is called trivial if it has two points or every three points in \({\mathcal {X}}\) are collinear. Trivial angle spaces obviously admit infinitely many Euclidean-compatible distance functions. Therefore, we focus our study on the rest of the cases. In the following, for a given space \({\mathcal {X}}\), we use the terms trigon, tetragon, pentagon, and hexagon to refer to subsets of of 3, 4, 5, and 6 different points in \({\mathcal {X}}\), respectively.

Let us begin with the following:

Lemma 5

Let \(({\mathcal {X}},{\mathcal {B}},\angle )\) be an angle space. If this angle space admits a Euclidean-compatible distance function d, then for every trigon \(\{A,B,C\}\) in \({\mathcal {X}}\):

  1. (EC1)

    The sum of the angles equals \(\pi \), that is

    $$\begin{aligned} \angle (B,A,C)+\angle (A,B,C)+\angle (A,C,B)=\pi . \end{aligned}$$

Moreover, if the angle space admits a Euclidean-compatible distance function d, then for every non-trivial trigon \(\{A,B,C\}\) in \({\mathcal {X}}\), the Law of Sines holds

$$\begin{aligned} \frac{d(B,C)}{\sin \angle (B,A,C)}=\frac{d(A,C)}{\sin \angle (A,B,C)}=\frac{d(A,B)}{\sin \angle (A,C,B)}. \end{aligned}$$

Proof

If \(({\mathcal {X}},{\mathcal {B}},\angle )\) admits a Euclidean-compatible distance function d, then for every trigon \(\{A,B,C\}\subset {\mathcal {X}}\), the following system needs to have a solution in the indeterminates abc:

$$\begin{aligned} {\left\{ \begin{array}{ll}a^2=b^2+c^2-2bc\cos \alpha \\ b^2=a^2+c^2-2ac\cos \beta \\ c^2=a^2+b^2-2ab\cos \gamma , \end{array}\right. } \end{aligned}$$
(3)

where \(a=d(B,C)\), \(b=d(A,C)\), \(c=d(A,B)\), \( \alpha =\angle (C,A,B)\), \(\beta =\angle (A,B,C)\), and \(\gamma =\angle (B,C,A)\). In the following, let us assume that \(\gamma \ge \alpha ,\beta \).

From the last equation, we obtain, since \(c>0\), that \(c=\sqrt{a^2+b^2-2ab\cos \gamma }\). Let us substitute this value in the other two equations

$$\begin{aligned} {\left\{ \begin{array}{ll}b^2-ab\cos \gamma =b\cos \alpha \sqrt{a^2+b^2-2ab\cos \gamma }\\ a^2-ab\cos \gamma =a\cos \beta \sqrt{a^2+b^2-2ab\cos \gamma }\\ c=\sqrt{a^2+b^2-2ab\cos \gamma }.\end{array}\right. } \end{aligned}$$

Since ABC are different, \(a,b\ne 0\). Also, since the points are not collinear, \(\sin \alpha ,\sin \beta \ne 0\). Therefore, we can divide the first two equations by ab and the third one by a obtaining

$$\begin{aligned} {\left\{ \begin{array}{ll}\frac{b}{a}-\cos \gamma =\cos \alpha \sqrt{(\frac{b}{a}-\cos \gamma )^2+\sin ^2\gamma }\\ \frac{a}{b}-\cos \gamma =\cos \beta \sqrt{(\frac{a}{b}-\cos \gamma )^2+\sin ^2\gamma }\\ \frac{c}{a}=\sqrt{(\frac{b}{a}-\cos \gamma )^2+\sin ^2\gamma }. \end{array}\right. } \end{aligned}$$
(4)

From the first two equations, we obtain, respectively, that \(\frac{b}{a}-\cos \gamma =\sin ^2\gamma \cot ^2\alpha \), \(\frac{a}{b}-\cos \gamma =\sin ^2\gamma \cot ^2\beta \), and then get

$$\begin{aligned} {\left\{ \begin{array}{ll}\frac{b}{a}=\frac{\sin (\alpha \pm \gamma )}{\sin \alpha }\\ \frac{a}{b}=\frac{\sin (\beta \pm \gamma )}{\sin \beta } \\ \frac{c}{a}=\frac{\sin \gamma }{\sin \alpha }. \end{array}\right. } \end{aligned}$$

Note that, in each of the two first equations, we have introduced an incorrect solution. Since \(\gamma \) is the biggest angle and all of them are in \([0,\pi ]\), the sign must be “\(+\)” in the first two equations in the previous system. Therefore, we have already shown that the system in Eq. (3) has a solution if and only if the following system does:

$$\begin{aligned} {\left\{ \begin{array}{ll}\frac{b}{a}=\frac{\sin (\alpha +\gamma )}{\sin \alpha }\\ \frac{a}{b}=\frac{\sin (\beta +\gamma )}{\sin \beta } \\ \frac{c}{a}=\frac{\sin \gamma }{\sin \alpha }. \end{array}\right. } \end{aligned}$$
(5)

To prove (EC1), see that the system above has a solution if and only if \(\sin (\alpha +\gamma )\sin (\beta +\gamma )=\sin \alpha \sin \beta \) and then \(\cos (\alpha +\beta + 2\gamma )=\cos (\alpha +\beta )\). Taking into account that \(\alpha ,\beta ,\gamma \in [0,\pi ]\), this implies \( \pi =\alpha +\beta +\gamma \).

As a consequence of (EC1), we can see from the system in Eq. (5) that the Law of Sines must hold. \(\square \)

We are finally ready to prove the following theorem, which is a solution for Problem 2:

Theorem 6

Let \(({\mathcal {X}},{\mathcal {B}},\angle )\) be a non-trivial angle space with four or more points. Then, it admits a Euclidean-compatible distance function d if and only if every subspace of four points does. This Euclidean-compatible distance function d is unique up to multiplication by a constant.

Proof

Let \(({\mathcal {X}},{\mathcal {B}},\angle )\) be a non-trivial angle space with four or more points, such that every subspace of four points admits a Euclidean-compatible distance. Let \(A,B\in {\mathcal {X}}\), and let \(\lambda \in {\mathbb {R}}_{\ge 0}\). Let us construct a function \(d_{A,B,\lambda }:{\mathcal {X}}^2\rightarrow {\mathbb {R}}_{\ge 0}\), such that it is a distance, it is Euclidean-compatible to the angle space structure, such that \(d_{A,B,\lambda }(A,B)=\lambda \).

First, let us prove that this distance function \(d_{A,B,\lambda }\), if it exists, is unique. This is an immediate consequence of the Law of Sines. In the following, we explain how this function is determined in each case:

  • Case 1. If C is not collinear to AB, we can use the Law of Sines in the trigon \(\{A,B,C\}\) to obtain that

    $$\begin{aligned} d_{A,B,\lambda }(A,C)=\frac{\sin \angle (A,B,C)}{\sin \angle (A,C,B)} \lambda . \end{aligned}$$
    (6)

    With a similar argument, we can also compute \(d_{A,B,\lambda }(B,C)\).

  • Case 2. If C is collinear to AB, let us choose a point E not collinear to ABC. Then, we can compute \(d_{A,B,\lambda }(A,E)\) (using the Law of Sines in the trigon \(\{A,B,E\}\)) and finally obtain (using the Law of Sines in the trigon \(\{A,C,E\}\)) that

    $$\begin{aligned} d_{A,B,\lambda }(A,C)= \frac{\sin \angle (A,E,C)}{\sin \angle (A,C,E)}\frac{\sin (A,B,E)}{\sin (A,E,B)}\lambda . \end{aligned}$$
    (7)

    With a similar argument, we can also compute \(d_{A,B,\lambda }(B,C)\).

  • Case 3. Suppose that D is not collinear to AB. Use the Law of Sines in \(\{A,B,D\}\) and after this in \(\{A,C,D\}\), we obtain that

    $$\begin{aligned} d_{A,B,\lambda }(C,D)=\frac{\sin \angle (C,A,D)}{\sin \angle (A,C,D)}\frac{\sin \angle (A,B,D)}{\sin \angle (A,D,B)}\lambda . \end{aligned}$$
    (8)

    If D is collinear to AB but C is not, a similar formula is derived exchanging the role of C and D.

  • Case 4. If ABCD are collinear, choose an element E neither collinear to \(\{A,B\}\), nor to \(\{C,D\}\). Then, using again the Law of Sines (in the trigon \(\{A,B,E\}\)), we can compute \(d_{A,B,\lambda }(A,E)\) and then compute \(d_{A,B,\lambda }(C,D)\) from this value as in the previous case

    $$\begin{aligned} d_{A,B,\lambda }(C,D)=\frac{\sin \angle (C,A,D)}{\sin \angle (A,C,D)}\frac{\sin \angle (A,E,D)}{\sin \angle (A,D,E)}\frac{\sin \angle (A,B,E)}{\sin \angle (A,E,B)}\lambda . \end{aligned}$$
    (9)

Now, let us complete the argument for existence of such function \(d_{A,B,\lambda }\).

Claim 1. Let \(\{A,B,C,D,E\}\) be a pentagon in \({\mathcal {X}}\). In this pentagon, there exists a distance function \(d_{A,B,\lambda }\) which is Euclidean-compatible to the angle space structure, such that \(d_{A,B,\lambda }(A,B)=\lambda \).

This statement holds automatically if all the points in the pentagon are collinear. Suppose that E is not collinear to AB.

Using the hypothesis in the theorem, the tetragon \(\{A,B,C,D\}\) admits a Euclidean-compatible distance. Taking into account that if a given distance is Euclidean-compatible so are its multiples by a constant, we can see that for every choice of \(\lambda \in {\mathbb {R}}_{>0}\), there is a Euclidean-compatible distance, denoted by \(d_{A,B,\lambda }\), satisfying \(d_{A,B,\lambda }(A,B)=\lambda \).

We only have to check that the distances between E and any of the points in \(\{A,B,C,D\}\) are well defined.

Using, again, the hypothesis in the theorem, the distance function is well defined on \(\{A,B,C,E\}\) and \(\{A,B,D,E\}\). This gives a consistent definition of \(d_{A,B,\lambda }(A,E)\), \(d_{A,B,\lambda }(B,E)\), and \(d_{A,B,\lambda }(C,E)\) in \(\{A,B,C,E\}\) and of \(d_{A,B,\lambda }(A,E)\), \(d_{A,B,\lambda }(B,E)\) and \(d_{A,B,\lambda }(D,E)\) in \(\{A,B,D,E\}\).

The only thing that could spoil the coherence of the definition of the function \(d_{A,B,\lambda }\) is that the values of \(d_{A,B,\lambda }(A,E)\) and \(d_{A,B,\lambda }(B,E)\) obtained for the tetragons \(\{A,B,C,E\}\) and \(\{A,B,D,E\}\) were different. However, this cannot happen, since both can be inferred from the non-trivial trigon \(\{A,B,E\}\) which is contained in both tetragons.

Claim 2. Let \(\{A,B,C,D,E,F\}\) be a hexagon in \({\mathcal {X}}\). In this hexagon, there exists a distance function \(d_{A,B,\lambda }\) which is Euclidean-compatible to the angle space structure, such that \(d_{A,B,\lambda }(A,B)=\lambda \).

Again, the statement is immediate if the hexagon is trivial, so we may assume that F is not collinear to AB. Using the previous claim, the pentagon \(\{A,B,C,D,E\}\) admits a Euclidean-compatible distance function, such that \(d_{A,B,\lambda }(A,B)=\lambda \).

Therefore, we only need to check that the distances from F to any other of the points in the pentagon \(\{A,B,C,D,E\}\) are well defined. Each of the distances \(d_{A,B,\lambda }(C,F),d_{A,B,\lambda }(D,F),d_{A,B,\lambda }(E,F)\) appears in, at most, two of the pentagons containing AB: \(\{A,B,C,D,F\}\), \(\{A,B,C,E,F\}\), \(\{A,B,D,E,F\}\).

As in the previous case, the distances \(d_{A,B,\lambda }(A,F)\) and \(d_{A,B,\lambda }(B,F)\) are obtained from the trigon \(\{A,B,F\}\), which belongs to the three pentagons listed above, and so they are well defined.

To see that \(d_{A,B,\lambda }(C,F)\) is well defined, we need to check that the values obtained from the pentagons \(\{A,B,C,D,F\}\) and \(\{A,B,C,E,F\}\) coincide. To see this, note that it is determined by the tetragon \(\{A,B,C,F\}\) which is common to both of them. A similar argument shows that \(d_{A,B,\lambda }(D,F)\), \(d_{A,B,\lambda }(E,F)\) are well defined too.

Claim 3. For every \(\lambda >0\), there exists a Euclidean-compatible distance function defined in \({\mathcal {X}}\), such that \(d_{A,B,\lambda }=\lambda \).

First, we need to check that the function \(d_{A,B,\lambda }\), as defined in Eqs. (6), (7),(8), and (9), is well defined.

The definition does not depend upon the choice of E for Case 2. This is a consequence of the fact that the distance is well defined in every pentagon containing AB (Claim 1). The definition does not depend upon the choice of E for Case 4, either. This is a consequence of the fact that the distance is well defined in every hexagon containing AB (Claim 2).

Finally, we only need to prove that the function \(d_{A,B,\lambda }\) is a Euclidean-compatible distance. The Identity of Indiscernibles is easy to check from the definition of \(d_{A,B,\lambda }\). To prove the symmetry in the two variables, we need to check that the choice of trigons taken in Cases 2, 3, and 4 does not affect the result. This is ensured by the fact that \(d_{A,B,\lambda }\) is a well-defined distance function for every tetragon and pentagon in \({\mathcal {X}}\). This function \(d_{A,B,\lambda }\) satisfies the condition of Euclidean-compatibility. We have this guaranteed by construction, since \(d_{A,B,\lambda }\) is a Euclidean-compatible distance for every tetragon (and thus for every trigon) in \({\mathcal {X}}\). This also implies the Triangle Inequality. \(\square \)

Finally, for completeness, we include the following characterization of non-trivial angle spaces with three or four points admitting a Euclidean-compatible distance:

Proposition 7

Let \(({\mathcal {X}},{\mathcal {B}}, \angle )\) be a non-trivial angle space.

  1. (a)

    If \({\mathcal {X}}\) consists of three points ABC, then it admits a Euclidean-compatible distance function if and only if it satisfies (EC1).

  2. (b)

    If \({\mathcal {X}}\) consists of 4 points, such that three of them are collinear and the other one is not collinear to the rest, then it admits a Euclidean-compatible distance function if and only if every trigon \(\{A,B,C\}\subset {\mathcal {X}}\) satisfies (EC1) and

    1. (EC2)

      If \((X_1,X_2,X_3)\in {\mathcal {B}}\) and \(X_4\) is not collinear to \(\{X_1,X_2,X_3\}\) then:

      $$\begin{aligned} {\left\{ \begin{array}{ll} \angle (X_1,X_2,X_4)+\angle (X_3,X_2,X_4)=\pi \\ \angle (X_1,X_4,X_2)+\angle (X_2,X_4,X_3)=\angle (X_1,X_4,X_3).\end{array}\right. }. \end{aligned}$$
  3. (c)

    If \({\mathcal {X}}\) does not contain collinear points, it admits a Euclidean-compatible distance function if and only if every trigon \(\{A,B,C\}\subset {\mathcal {X}}\) satisfies (EC1) and

    1. (EC3)

      The following identity holds, as well as any other obtained from a permutation of the subindices:

      $$\begin{aligned}&\sin \angle (X_1,X_2,X_3)\cdot \sin \angle (X_1,X_3,X_4)\cdot \sin \angle (X_1,X_4,X_2)\\&\quad =\sin \angle (X_1,X_2,X_4)\cdot \sin \angle (X_1,X_4,X_3)\cdot \sin \angle (X_1,X_3,X_2). \end{aligned}$$
    2. (EC4)

      The following identity holds, as well as any other obtained from a permutation of the subindices:

      $$\begin{aligned}&\frac{\sin \angle (X_1,X_2,X_3)}{\sin \angle (X_1,X_3,X_2)}\frac{\sin \angle (X_3,X_1,X_4)}{\sin \angle (X_3,X_4,X_1)}\\&\quad =\frac{\sin \angle (X_1,X_2,X_4)}{\sin \angle (X_1,X_4,X_2)}\frac{\sin \angle (X_4,X_1,X_3)}{\sin \angle (X_4,X_3,X_1)}\\&\quad =\frac{\sin \angle (X_2,X_1,X_3)}{\sin \angle (X_2,X_3,X_1)}\frac{\sin \angle (X_3,X_2,X_4)}{\sin \angle (X_3,X_4,X_2)}\\&\quad =\frac{\sin \angle (X_2,X_1,X_4)}{\sin \angle (X_2,X_4,X_1)}\frac{\sin \angle (X_4,X_2,X_3)}{\sin \angle (X_4,X_3,X_2)}. \end{aligned}$$

Proof

Part (a) is a consequence of Lemma 5.

To prove (b), if such a distance function d exists, let us use the following notation for the distance between points in \({\mathcal {X}}\):

$$\begin{aligned} x=d(X_1,X_2), x'=d(X_2,X_3), a=d(X_1,X_4), a'=d(X_3,X_4), h=d(X_2,X_4), \end{aligned}$$

and let us denote the angles as

$$\begin{aligned}&\alpha =\angle (X_1,X_2,X_4), \alpha '=\angle (X_3,X_2,X_4), \beta =\angle (X_2,X_1,X_4)=\angle (X_3,X_1,X_4),\\&\beta '=\angle (X_2,X_3,X_4)=\angle (X_1,X_3,X_4),\;\gamma =\angle (X_1,X_4,X_2),\;\gamma '=\angle (X_2,X_4,X_3),\\&\delta =\angle (X_1,X_4,X_3). \end{aligned}$$

Note that \(d(X_1,X_3)=x+x'\), since \((X_1,X_2,X_3)\in {\mathcal {B}}\). If we apply the Law of Sines simultaneously to the trigons \(\{X_1,X_2,X_4\}\), \(\{X_1,X_3,X_4\}\) and \(\{X_2,X_3,X_4\}\), we get

$$\begin{aligned} {\left\{ \begin{array}{ll}\frac{a}{\sin \alpha }=\frac{h}{\sin \beta }=\frac{x}{\sin \gamma } \\ \frac{a'}{\sin \alpha '}=\frac{h}{\sin \beta '}=\frac{x'}{\sin \gamma '}\\ \frac{x+x'}{\sin \delta }=\frac{a}{\sin \beta '}=\frac{a'}{\sin \beta }.\end{array}\right. }. \end{aligned}$$
(10)

Let us prove the necessity of Condition (EC2). From the system above, we get the following one:

$$\begin{aligned} {\left\{ \begin{array}{ll}\frac{\sin \gamma }{\sin \alpha }a+\frac{\sin \gamma '}{\sin \alpha '}a'=\frac{\sin \delta }{\sin \beta }a' \\ \frac{\sin \gamma }{\sin \alpha }a+\frac{\sin \gamma '}{\sin \alpha '}a'=\frac{\sin \delta }{\sin \beta '}a \end{array}\right. }, \end{aligned}$$

which should have a non-zero solution. Therefore, the determinant of the matrix of coefficients (once the equations are suitably fixed) must be zero. This yields

$$\begin{aligned} \frac{\sin \gamma '}{\sin \alpha '\sin \beta '}+\frac{\sin \gamma }{\sin \alpha \sin \beta } =\frac{\sin \delta }{\sin \beta \sin \beta '}, \end{aligned}$$

and then, since \(\sin \gamma =\sin (\alpha +\beta )\), \(\sin \gamma '=\sin (\alpha '+\beta ')\), we get

$$\begin{aligned} \sin \beta \sin \beta '(\cot \alpha +\cot \alpha ')+\sin (\beta +\beta ')=\sin \delta . \end{aligned}$$

As \(\delta +\beta +\beta '=\pi \), we have that \(\sin (\beta +\beta ')=\sin \delta \), and so, \(\cot \alpha =-\cot \alpha '\) and \(\alpha =\pi -\alpha '\). Now, since

$$\begin{aligned} {\left\{ \begin{array}{ll}\alpha +\beta +\gamma =\pi \\ \alpha '+\beta '+\gamma '=\pi \\ \beta +\beta '+\delta =\pi , \end{array}\right. } \end{aligned}$$

we can conclude that \(\delta =\gamma +\gamma '\) (which is Condition (EC2)).

Finally, assuming that (EC2) holds, we have that (10) is equivalent to

$$\begin{aligned} {\left\{ \begin{array}{ll}\frac{a}{\sin \alpha }=\frac{h}{\sin \beta }=\frac{x}{\sin \gamma } \\ \frac{a'}{\sin \alpha '}=\frac{h}{\sin \beta '}=\frac{x'}{\sin \gamma '}\\ \frac{a}{\sin \beta '}=\frac{a'}{\sin \beta },\end{array}\right. } \end{aligned}$$

which has a unique solution up to multiples in the variables \(a,a',x,x',h\).

To prove (c), let us construct a Euclidean-compatible distance d. Set \(d(X_1,X_2)=\lambda \), for some \(\lambda \in {\mathbb {R}}_{>0}\). Use the Law of Sines in the trigons \(\{X_1,X_2,X_3\}\), \(\{X_1,X_2,X_4\}\) to determine the values

$$\begin{aligned} d(X_1,X_3)=\frac{\sin \angle (X_1,X_2,X_3)}{\sin \angle (X_1,X_3,X_2)}\lambda ,\qquad d(X_2,X_3)=\frac{\sin \angle (X_2,X_1,X_3)}{\sin \angle (X_1,X_3,X_2)}\lambda \\ d(X_1,X_4)=\frac{\sin \angle (X_1,X_2,X_4)}{\sin \angle (X_1,X_4,X_2)}\lambda ,\qquad d(X_2,X_4)=\frac{\sin \angle (X_2,X_1,X_4)}{\sin \angle (X_1,X_4,X_2)}\lambda . \end{aligned}$$

We need to check that the trigons \(\{X_1,X_3,X_4\}\), \(\{X_2,X_3,X_4\}\) satisfy the Law of Sines. We have that

$$\begin{aligned} \frac{d(X_1,X_3)}{\sin \angle (X_1,X_4,X_3)}=\frac{d(X_1,X_4)}{\sin \angle (X_1,X_3,X_4)}\\ \frac{d(X_2,X_3)}{\sin \angle (X_2,X_4,X_3)}=\frac{d(X_2,X_4)}{\sin \angle (X_2,X_3,X_4)} \end{aligned}$$

if and only if the equation in (EC3) holds (and one of its permutations).

From the trigons \(\{X_1,X_3,X_4\}\), \(\{X_2,X_3,X_4\}\) and the Law of Sines, we can obtain the value of \(d(X_3,X_4)\) in different ways

$$\begin{aligned} d(X_3,X_4)= & {} \frac{\sin \angle (X_3,X_1,X_4)}{\sin \angle (X_1,X_4,X_3)}d(X_1,X_3)=\frac{\sin \angle (X_3,X_1,X_4)}{\sin \angle (X_1,X_3,X_4)}d(X_1,X_4)\\= & {} \frac{\sin \angle (X_3,X_2,X_4)}{\sin \angle (X_2,X_4,X_3)}d(X_2,X_3)=\frac{\sin \angle (X_3,X_2,X_4)}{\sin \angle (X_2,X_3,X_4)}d(X_2,X_4). \end{aligned}$$

All those values coincide if and only if the equation in (EC4) holds.

The role played by \(X_1,X_2\) has been chosen arbitrarily, so the identities obtained permuting the subindices are also necessary. \(\square \)

In the study of the trigonometry of the tetrahedron, the identities appearing in (EC3) are sometimes referred as Alternating Sines Theorem and the identities appearing in (EC4) already appeared in the classic compendium of results by G. Richardson [10].

4 Solution to Problem 1

Menger [6] and some years later Morgan [9] provided characterizations of the metric spaces \(({\mathcal {X}},d)\) that can be embedded in \({\mathbb {E}}^n\). Define for every \(A,B,C\in {\mathcal {X}}\) the quantity \(\langle A,B,C\rangle =\frac{1}{2}\left( d(A,C)^2+d(B,C)^2-d(A,B)^2\right) \). For each n-simplex \(\{X_0,\ldots ,X_n\}\subset {\mathcal {X}}\), define

$$\begin{aligned} \text {Vol}_n(\{X_0,\ldots ,X_n\})=\frac{1}{n!}\sqrt{D_n(X_0,\ldots ,X_n)}, \end{aligned}$$

where \(D_n(X_0,\ldots ,X_n)\) is the determinant of the \(n\times n\) matrix whose (ij) entry equals \(\langle X_i,X_j,X_0\rangle \). As explained in [9], under some hypothesis, this value is, in fact, the volume of the simplex. We say that a space \(({\mathcal {X}},d)\) is n-flat if for every n-simplex \(\text {Vol}_n(\{X_0,\ldots ,X_n\})\) is a real number. In this case, its dimension is the largest integer (if it exists) for which there is an n-simplex for which \(\text {Vol}_n(\{X_0,\ldots ,X_n\})>0\). We have that:

Theorem 8

(Proved by Morgan [9])

A metric space \(({\mathcal {X}},d)\) can be embedded in \({\mathbb {E}}^n\) if and only if it is k-flat for every \(1\le k\le n\), and of dimension less than or equal to n.

In relation to our setting, if the metric space \(({\mathcal {X}},d)\) has also an angle function that is Euclidean-compatible with d, then \(\langle A,B,C\rangle =d(A,C)\cdot d(B,C)\cdot \cos (\angle (A,C,B))\) and so

$$\begin{aligned} D_n(X_0,\ldots ,X_n)=(\Pi _{j=1}^n d(X_0,X_j)^2)\begin{array}{| c c c |} \cos \angle (X_1,X_0,X_1) &{} \ldots &{} \cos \angle (X_1,X_0,X_n)\\ \vdots &{} &{} \vdots \\ \cos \angle (X_n,X_0,X_1) &{} \ldots &{} \cos \angle (X_n,X_0,X_n). \end{array}\nonumber \\ \end{aligned}$$
(11)

As a consequence of this and of Theorem 6, we can prove the following theorem answering Problem 1:

Theorem 9

Let \(({\mathcal {X}},{\mathcal {B}},\angle )\) be an angle space. It can be conformally embedded in \({\mathbb {E}}^2\) if and only if every tetragon \(\{X_0,X_1,X_2,X_3\}\subset {\mathcal {X}}\) admits an Euclidean-compatible distance function and satisfies:

(Adjacent Angles Property) Among the three angles \(\angle (X_1,X_0,X_2)\), \(\angle (X_1,X_0,X_3)\), \(\angle (X_2,X_0,X_3)\), one of them must be the sum of the other two or \(2\pi \) minus this sum (we have defined angles to be in the interval \([0,\pi ]\)).

Proof

\(({\mathcal {X}},{\mathcal {B}},\angle )\) can be endowed with a unique Euclidean-compatible distance d, up to multiplication by a constant. It can be conformally embedded in \({\mathbb {E}}^2\) if and only if \(({\mathcal {X}},d)\) can be isometrically embedded in \({\mathbb {E}}^2\). We can see that for all \(\{X_0,X_1,X_2\}\subset {\mathcal {X}}\), the determinant appearing in (11) for \(n=2\) is \(1-\cos ^2\angle (X_1,X_0,X_2)\) which is obviously greater or equal to 0. On the other hand, the same determinant for \(n=3\) equals 0 if and only if

$$\begin{aligned}&\cos ^2\angle (X_1,X_0,X_2)+\cos ^2\angle (X_1,X_0,X_3)+\cos ^2\angle (X_2,X_0,X_3)\\&\quad -2\cos \angle (X_1,X_0,X_2)\cdot \cos \angle (X_1,X_0,X_3)\cdot \cos \angle (X_2,X_0,X_3)-1=0, \end{aligned}$$

which is equivalent to

$$\begin{aligned}&\big [\cos (\angle (X_1,X_0,X_2)+\angle (X_2,X_0,X_3))-\cos \angle (X_1,X_0,X_3)\big ]\\&\quad \cdot \big [\cos (\angle (X_1,X_0,X_2)-\angle (X_2,X_0,X_3))-\cos \angle (X_1,X_0,X_3)\big ]=0 \end{aligned}$$

and, in turn, to the Adjacent Angles Property, since we must be in one of the following cases:

$$\begin{aligned} \begin{array}{l}\angle (X_1,X_0,X_2)+\angle (X_2,X_0,X_3)=\angle (X_1,X_2,X_3)\\ \angle (X_1,X_0,X_2)+\angle (X_2,X_0,X_3)=2\pi -\angle (X_1,X_2,X_3)\\ | \angle (X_1,X_0,X_2)-\angle (X_2,X_0,X_3)|=\angle (X_1,X_2,X_3).\end{array} \end{aligned}$$

\(\square \)

Note that, together, the Axiom of Collinearity in Definition 4 and Condition (EC2) in Theorem 6 form a stronger version of the Adjacent Angle Property for the restricted cases in which three of the points in \(\{X_0,X_1,X_2,X_3\}\) are imposed to be collinear.

5 Final Comments

Given a metric space \(({\mathcal {X}},d)\), Eq. (2) gives a unique candidate \(\angle \) for a Euclidean-compatible angle function. However, this function may fail to satisfy the Axiom of Collinearity. It can be proved straightforwardly that this \(\angle \) is an angle function if and only if for every tetragon \(\{A,B,C,D\}\subset {\mathcal {X}}\), such that C is between BD and AB and C are not collinear (with the relation of betweenness induced by d), the relation of Stewart’s Theorem holds, that is

$$\begin{aligned} d(A,C)^2\cdot d(B,D)+d(A,B)^2\cdot d(C,D) =d(B,C)\cdot (d(A,D)^2+d(B,D)\cdot d(C,D)). \end{aligned}$$

It would be desirable to find alternative characterizations of angle spaces conformally embeddable in \({\mathbb {E}}^2\) (and in \({\mathbb {E}}^n\)) for specific families of angles spaces of interest. One of those families could be, for instance, the class \({\mathcal {T}}\) of angle spaces \(({\mathcal {X}},{\mathcal {B}}, \angle )\), such that \({\mathcal {X}}\) is additionally a topological space homeomorphic to the unit circle \(S^1\). There is a correspondence between plane Jordan curves and elements in \({\mathcal {T}}\) and between knots and elements in \({\mathcal {T}}\). Understanding the angle space structure of these spaces may be very important. Note, for example, that a well-known old and unsolved conjecture, the Inscribed Square Problem (see [4, 11]), can be stated in the following terms:

Conjecture 10

Let \(({\mathcal {X}},{\mathcal {B}}, \angle )\) be an angle space, such that \({\mathcal {X}}\) is a topological space which is homeomorphic and conformally equivalent to a plane Jordan curve. Then, there exists a tetragon \(\{A,B,C,D\}\), such that \(\angle (A,B,C)=\angle (B,C,D)=\angle (C,D,A)=\angle (D,A,B)=\pi /2\) and \(\angle (B,A,C)=\angle (C,A,D)=\pi /4\).

Problems of isometric embeddability of finite spaces in Euclidean and hyperbolic spaces have recently received a lot of attention due to their importance in machine learning (see [5]). The concept of angle function may contribute to this class of problems. Using the characterization by Menger and Morgan appearing in the previous section for the metric spaces that can be embedded in \({\mathbb {E}}^n\), it may be possible to find a generalization of Theorem 9 characterizing those angle spaces that can be conformally embedded in \({\mathbb {E}}^n\). It is also possible to consider problems of conformal embeddability in other ambient spaces with a notion of angle, such as hyperbolic spaces or other manifolds.

In view of this and to finish this article, we propose three problems for the future:

Problem 11

Let \({\mathcal {X}}\) be a topological space homeomorphic to \(S^1\). Find necessary and sufficient conditions for the angle space \(({\mathcal {X}},{\mathcal {B}},\angle )\) to be conformally equivalent to a plane Jordan curve, easier to verify than the ones in Theorem 9.

Problem 12

Characterize those angle spaces that can be conformally embedded in a sphere in \({\mathbb {E}}^3\).

Problem 13

Characterize those angle spaces that can be conformally embedded in the hyperbolic plane.