# Pythagorean triples, hierarchical classifications, geometric interpretations and hybrid systems

Daniel Parrochia

University of Lyon (France)

**Abstract.** In this article, we show that the Pythagorean theorem defined on triples of ultrametric matrices, and no longer integers, has applications in clustering (or theory of classifications), in the case of hierarchical classifications (i.e chains of partitions of a partition lattice), which are associated with such matrices. But as the Pythagorean theorem, via these matrices, also applies to surfaces, we show how Pythagorean ultrametric matrices have correspondences in discrete differential geometry. Finally, we suggest some new structures that we call "hybrid simple idempotent semidioids" and "hybrid simple idempotent quasi-semitrioids".

**Key words.** Pythagorean triples, clustering, classifications, chains of partitions, ultrametric matrices, Gondran's theorem, discrete differential geometry.

## 1 An extension of Pythagorean triples

As we know, a Pythagorean triple $(a, b, c)$ with $a, b, c \in \mathbb{N}$, is a triple satisfying the Diophantine Pythagorean equation: $x^2 + y^2 = z^2$, such that we get:

$$a^2 + b^2 = c^2. \tag{1}$$

We already wrote a historical and philosophical article on Pythagorean triples (see [Parrochia 20]), but we are concern here with one of their generalizations. Among the multiple extensions of equation (1), there is one that caught our attention. It concerns the case when the elements $x, y, z$ of the triple are no longer numbers $a, b, c \in \mathbb{N}$, but
matrices A, B, C of order n. Then we can get something like:

$$A^2 + B^2 = C^2, \qquad (2)$$

with A, B, C ∈ M_n, the set of matrices of order n.

We just want to see how this generalization can also concern these specific matrices that are ultrametric matrices, used in particular in classification theory.

# 2 Some words about the mathematics of classifications

When we practice clustering or want to construct classifications, we seek to bring order to a set of empirical data which is generally presented as a cross-tabulation of individuals and properties or attributes. A rational method is then to evaluate the proximity or similarity of individuals according to the properties they possess (or not) – which presupposes the choice of a notion of "distance" (mathematicians now sometimes prefer to speak of "dissimilarity"). This allows us to constitute classes of equivalences which, themselves, may give rise to a proximity or similarity assessment at different levels. At best, we will obtain an indexed hierarchical classification, which corresponds exactly to the existence of an ultrametric distance between elements of the set. Here we will start from this notion.

## 2.1 The notion of ultrametric distance

An *ultrametric distance* (we often say now *ultrametric dissimilarity*) or (in short) an *ultrametric* on a nonempty finite set E is a real-valued function:

$$d: E \times E \to \mathbb{R}.$$

(where $\mathbb{R}$ denote the reals), such that for all $x, y, z \in E$:

(1) $d(x, y) \geq 0$;

(2) $d(x, y) = d(y, x)$ (symmetry);

(3) $d(x, x) = 0$;

(4) $d(x, z) \leq \text{Max}(d(x, y), d(y, z))$ (strong triangle inequality or ultrametric inequality).
$(E, d)$ is said to be an *ultrametric space*.

It follows from these conditions that the distances between pairs of elements of the set $E \times E$ fall into a symmetric matrix with zero diagonal. For example, with $E = \{a, b, c\}$, $d$ ultrametric and all the values of $d$ in $\mathbb{N}$, we will have:

$$ M = \begin{array}{c|ccc} & a & b & c \\ \hline a & 0 & x & y \\ b & x & 0 & y \\ c & y & y & 0 \end{array} $$

with $x, y \in \{1, 2\}$. In the following, for short, we will sometimes omit mentioning the elements $(a, b, c, ...)$ of the set.

## 2.2 Taxonomy science results and Gondran's theorem

### 2.2.1 Partitions, lattices of partitions, chains and classifications

**Definition 2.1 (Partition).** A partition of a set $E$ is a set of nonempty subsets of $E$ such that every element $x$ in $E$ is in exactly one of these subsets (i.e., the subsets are nonempty mutually disjoint sets).

There is a one-to-one correspondence between partitions and equivalence relations. For any equivalence relation $\equiv$ (reflexive, symmetric, transitive) defined between the elements of a set $E$, the set of its equivalence classes is a partition of $E$. Conversely, from any partition $P$ of $E$, we can define an equivalence relation on $E$ by setting $x \equiv y$ precisely when $x$ and $y$ are in the same part in $P$. Thus the notions of equivalence relation and partition are essentially equivalent.

The axiom of choice guarantees for any partition of a set $E$ the existence of a subset of $E$ containing exactly one element from each part of the partition. This implies that given an equivalence relation on a set one can select a canonical representative element from every equivalence class.

**Definition 2.2 (Refinement of partitions).** A partition $P'$ of a set $E$ is a refinement of a partition $P$ of $E$ – and we say that $P'$ is finer than $P$ (or that $P$ is coarser than $P'$) – if every element of $P'$ is a subset of some element of $P$. Informally, this means that $P'$ is a further fragmentation of $P$. In that case, it is written that $P' \leq P$.

The inclusions of partitions may be represented by their associated graphs (subsets of $E \times E$). For example, in Fig.1, we can see that $Gr(P') \subset Gr(P)$, so $P'$ is clearly a refinement of $P$.
<figure><img src="image_1.png" /><figcaption>Figure 1: Partition graphs</figcaption></figure>

This "finer-than" relation on the set of partitions of E is a partial order (so the notation "≤" is appropriate). Each set of elements has a least upper bound (their "join") and a greatest lower bound (their "meet"), so that it forms a lattice.

For clarity, let's reason on a simple example. Let $E = \{a, b, c\}$ be a nonempty finite set. Let $\mathcal{P}(E) = \{(a, b, c), (ab, c), (ac, b), (bc, a), (abc)\}$, the set of partitions of E (see Fig. 2 (left)) where, as usual, $\{\{a\}, \{b\}\}$ is simplified in $(a, b)$, for short. Then we can also define the set $\mathcal{C}(E)$ of maximal chains of partitions, which includes:

$$C_0 = \{(abc), (a, b, c)\};$$

$$C_1 = \{(abc), (ab, c), (a, b, c)\};$$

$$C_2 = \{(abc), (ac, d), (a, b, c)\};$$

$$C_3 = \{(abc), (bc, d), (a, b, c)\}.$$

$\mathcal{P}(E)$ is a finite height semi-modular lattice for the "thiner than" relation which, moreover, verifies the so-called Jordan-Dedekind condition (that is, all the chains between any two elements have the same length). $\mathcal{C}(E)$ is only a semilattice for set intersection (see Fig. 2 (right)).

Let now $d_i, d_j$ be ultrametric distances between pairs of elements $(x, y)$ of E. There is obviously a total equivalence between a chain of partitions of the lattice of partitions $\mathcal{P}(E)$, the corresponding indexed hierarchical classification and its associated ultra-metric matrix of distances (see [Barbut-Monjardet 70]; [Lerman 70]; [Benzecri et al. 73]) (see Fig. 3). Recall that each integer indicates the least level in which two elements of a pair are in the same partition.
<figure><img src="image_2.png" /><figcaption>Figure 2: Lattice of partitions of a 3-element set and semilattice of chains</figcaption></figure>

## 2.3 The notion of cover and of minimal cover

A generalization of the notion of partition is the notion of cover.

**Definition 2.3.** A family $\mathcal{F}$ of nonempty subsets of a set $E$, whose union contains the given set $E$ (and which contains no duplicated subsets) is called a *cover* (or a covering) of $E$.

A particular kind of covers are the minimal covers:

**Definition 2.4.** A *minimal cover* is a cover for which the removal of one member destroys the covering property. In symbols, a minimal cover $R$ is a family $\gamma \in R(E)$, the set of all covers, such that for each $U \in \gamma$, there is an $x \in U$ such that $x \notin V$ for all $V \in \gamma$, with $V \neq U$.

Information about the number of covers (resp. of minimal covers) on a set, as well as the refinement relationship that can exist on them, such that they, like partitions, enter into partially ordered hierarchies can be found in ([Parrochia-Neuville 13], 148-156)<fnref n="1" />.

Just see that, in the case of minimal covers, the refinement relation can be represented, as for partitions, by some graphs included in $E \times E$. See, for example, Fig. 4.

<footnote n="1">¹Let us simply note here that, if the set of minimal covers is indeed a lattice, the set of all covers is only a preorder for the relation of refinement.</footnote>
<figure><img src="image_3.png" /><figcaption>Figure 3: Chain of partitions, indexed classification and ultrametric matrix</figcaption></figure>

### 2.3.1 Gondran's theorem

In ([Parrochia-Neuville 13], 72), I recall a very clever theorem from Michel Gondran (see [Gondran 76¹]; and see also [Gondran 76²]), useful to describe the algebra of hierarchical classifications when these ones are interpreted as chains of partitions of a partition lattice:

**Theorem 2.1 (Gondran).** *The matrix of ultrametric distances between the elements of a nonempty finite set E has a structure of semiring over $\mathbb{R} \cup \{+\infty\}$.*

*Proof.* There exists an associative law $\oplus$, which may be interpreted as "Min":

$$d_i \oplus d_j = \text{Min}(d_i, d_j) \qquad (3)$$

The unit element of $\oplus$ is $\{+\infty\}$, and we have:

$$d_i \oplus +\infty = +\infty \oplus d_i = d_i. \qquad (4)$$

There exists also an associative law $*$, which is distributive over $\oplus$. This law $*$ is interpreted as "Max", and we have:

$$d_i * d_j = \text{Max}(d_i, d_j). \qquad (5)$$
<figure><img src="image_4.png" /><figcaption>Figure 4: Graph of the minimal cover: {$a, b, c, d$}, {$d, e, f$}, {$f, g, h$}</figcaption></figure>

Its unit element is 0, since:

$$0 * d_i = d_i * 0 = \text{Max}(0, d_i) = d_i. \qquad (6)$$

<figure><img src="image_5.png" /></figure>

This structure may be extended to $M_n$, the set of all the matrices of the chains of $C(E)$, the set of chains defined on $P(E)$, the partition lattice of the nonempty finite set $E^2$. With this structure, Gondran (see [Gondran 76¹]) reveals a profound connection between some notions of order theory (chain, distributive lattice) and some notions of algebra (semiring). In a more recent book, he shows that a semiring whose laws $\oplus$ and $*$ have both a unit element is a "dioid". A dioid with idempotent laws is a double-idempotent dioid (see [Gondran-Minoux 01]).

Now we know, after Gondran, that the condition for a matrix $D$ to be an ultrametric matrix associated with a hierarchical classification is that $D = D * D = D^2$ (with $*$ interpreted, of course, as Max) (see [Gondran 76²]). We will speak informally, for short, of the Gondran's system Minplus.

<footnote n="2">²The literature on the mathematics of classifications is very vast, especially since the 1970s. We take stock of it in [Parrochia-Neuville 13] but you will find a summary of the essentials in our articles, especially the more recent ones (see [Parrochia 18] and [Parrochia 23]).</footnote>
## 3 Ultrametric matrices and Pythagorean theorem

Assume now that the two matrices $A$ and $B$ are ultrametric symmetric matrices associated to hierarchical classifications, so that $A = A^2$ and $B = B^2$ in the sense of Gondran, then we obtain a Pythagorean theorem in the domain of classifications, connecting two classifications to the same third via their associated ultrametric matrices (taken squared). If we interpret $\oplus$ as Min, which is Gondran's meaning, the theorem says nothing more than what is already contained in Gondran's semiring.

For example, suppose $d: E \times E \to N$ and the following matrices of classifications defined on a 3-element set $E = \{a, b, c\}$:

$$A = A^2 = \begin{vmatrix} 0 & 1 & 2 \\ 1 & 0 & 2 \\ 2 & 2 & 0 \end{vmatrix} \quad \text{and} \quad B = B^2 = \begin{vmatrix} 0 & 2 & 2 \\ 2 & 0 & 1 \\ 2 & 1 & 0 \end{vmatrix}$$

which correspond respectively to the classifications (A) and (B) of Fig. 5.

<figure><img src="image_6.png" /><figcaption>Figure 5: hierarchical classifications</figcaption></figure>

Pose now (extension of Pythagorean theorem defined on symmetric ultrametric matrices with zero diagonal):

$$A^2 \oplus B^2 = C^2. \qquad (7)$$

$C^2$ (or $C$) is the following symmetric ultrametric matrix:

$$C^2 = C = \begin{vmatrix} 0 & 1 & 2 \\ 1 & 0 & 1 \\ 2 & 1 & 0 \end{vmatrix}$$
and its associated classification is (C) (see Fig. 6), which is already an overlapping
one since the element *b* belongs to two different partitions.

<figure><img src="image_7.png" /><figcaption>Figure 6: Classification with overlapping classes (a)</figcaption></figure>

The structures of (A) and (B) are respected in this third classification (C), as it
was required in the book quoted above (see [Parrochia-Neuville 13], 102), the only
constraint here – but it is an undeniable restriction – being that the classifications
be defined on the same set and have exactly the same number of elements. This
kind of generalized classification is in fact a chaine of covers (in the case of Fig. 6, a
chain of minimal covers). The Pythagorean theorem – but it is not absolutely trivial
– just allows us to construct, from two classical classications, a third one which is an
overlapping classification.

# 4 Forms of surfaces in differential geometry

We will just recall here a few definitions (see, for example, [Chase 12]):

## 4.1 Some definitions

**Definition 4.1** (Smooth surface in $\mathbb{R}^3$). A smooth surface in $\mathbb{R}^3$ is a subset $X \subset \mathbb{R}^3$ such that each point has a neighborhood $U \subset X$ and a map $r : V \to \mathbb{R}^3$ from an open set $V \subset \mathbb{R}^2$ such that:

1. $r: V \to U$ is a homeomorphism. This means that $r$ is a bijection that continuously maps $V$ into $U$, and that the inverse function $r^{-1}$ exists and is continuous.

2. $r(u, v) = (x(u, v), y(u, v), z(u, v))$ has derivatives of all orders.
3. At all points, the first partial derivatives $ru = \partial r$ and $rv = \partial r$ are linearly $\partial u \partial v$ independent.

We must now recall what are the three fundamental forms associated to a surface, that describe, in differential geometry, some of its main properties.

### 4.1.1 First fundamental form

The first fundamental form of a surface is the inner product on the tangent space of this surface in the three-dimensional Euclidean space, which is induced canonically from the dot product of $\mathbb{R}^3$. It permits the calculation of curvature and metric properties of a surface such as length and area in a manner consistent with the ambient space. The first fundamental form is denoted by the Roman numeral I. We have:

$$I(x, y) = \langle x, y \rangle.$$

If $X(u, v)$ is a parametric surface, then the inner product of two tangent vectors is:

$$ \begin{aligned} I(aX_u + bX_v, cX_u + dX_v) &= ac\langle X_u, X_u \rangle + (ad + bc)\langle X_u, X_v \rangle + bd\langle X_v, X_v \rangle \\ &= Eac + F(ad + bc) + Gbd, \end{aligned} $$

where $E, F$, and $G$ are the coefficients of the first fundamental form.

The first fundamental form may then be represented as a symmetric matrix.

$$I(x, y) = x^T \begin{bmatrix} E & F \\ F & G \end{bmatrix} y.$$

When the first fundamental form is written with only one argument, it denotes the inner product of that vector with itself.

$$I(v) = \langle v, v \rangle = |v|^2.$$

The first fundamental form is often written in the modern notation of the metric tensor. The coefficients may then be written as $g_{ij}$:

$$(g_{ij}) = \begin{pmatrix} g_{11} & g_{12} \\ g_{21} & g_{22} \end{pmatrix} = \begin{pmatrix} E & F \\ F & G \end{pmatrix}.$$
### 4.1.2 Second fundamental form

The second fundamental form of a general parametric surface is defined as follows. Let $\mathbf{r} = \mathbf{r}(u, v)$ be a regular parametrization of a surface in $\mathbb{R}^3$, where $\mathbf{r}$ is a smooth vector-valued function of two variables. It is usual to denote the partial derivatives of $\mathbf{r}$ with respect to $u$ and $v$ by $\mathbf{r}_u$ and $\mathbf{r}_v$. Regularity of the parametrization means that $\mathbf{r}_u$ and $\mathbf{r}_v$ are linearly independent for any $(u,v)$ in the domain of $\mathbf{r}$, and hence span the tangent plane to $S$ at each point. Equivalently, the cross product $\mathbf{r}_u \times \mathbf{r}_v$ is a nonzero vector normal to the surface. The parametrization thus defines a field of unit normal vectors $\mathbf{n}$:

$$ \mathbf{n} = \frac{\mathbf{r}_u \times \mathbf{r}_v}{|\mathbf{r}_u \times \mathbf{r}_v|} $$

The second fundamental form is usually written as

$$ \mathbb{I} = L du^2 + 2M du dv + N dv^2, $$

its matrix in the basis $ru, rv$ of the tangent plane is

$$ \begin{pmatrix} L & M \\ M & N \end{pmatrix}. $$

The coefficients $L, M, N$ at a given point in the parametric uv-plane are given by the projections of the second partial derivatives of $\mathbf{r}$ at that point onto the normal line to $S$ and can be computed with the aid of the dot product as follows:

$$ L = \mathbf{r}_{uu} \cdot \mathbf{n}, \quad M = \mathbf{r}_{uv} \cdot \mathbf{n}, \quad N = \mathbf{r}_{vv} \cdot \mathbf{n}. $$

More simply, in Euclidean space, the second fundamental form is given by:

$$ \mathbb{I}(x, y) = \langle -d\nu(x), y \rangle \nu. $$

where $\nu$ is the Gauss map, and $d\nu$ the differential of $\nu$ regarded as a vector-valued differential form, and the brackets denote the metric tensor of Euclidean space.

### 4.1.3 Third fundamental form

Let $S$ be the shape operator and $M$ be a smooth surface. Also, let $\mathbf{u}_p$ and $\mathbf{v}_p$ be elements of the tangent space $T_p(M)$. The third fundamental form is then given by:

$$ \mathbb{III}(\mathbf{u}_p, \mathbf{v}_p) = S(\mathbf{u}_p) \cdot S(\mathbf{v}_p). $$
The third fundamental form is expressible entirely in terms of the first fundamental form and second fundamental form. If we let $H$ be the mean curvature of the surface and $K$ be the Gaussian curvature of the surface, we have:

$$ \mathbb{III} - 2H\mathbb{II} + KI = 0. $$

As the shape operator is self-adjoint, for $u, v \in T_p(M)$, we find

$$ \mathbb{III}(u, v) = \langle Su, Sv \rangle = \langle u, S^2v \rangle = \langle S^2u, v \rangle. $$

## 4.2 Pythagorean surfaces

In a very interesting article, the Iranian mathematician Ali Taghavi (see [Taghavi 24]) pointed out a remarkable connection between Pythagorean triples (PT for short) and Riemannian geometry. We take the liberty of quoting it in full here:

"There is a beautiful description and generalization of PT in terms of Riemannian Geometry. Let us generalize the equation $x^2 + y^2 = z^2$ to the matrix form $A^2 + B^2 = C^2$, where $A, B, C$ are matrix of order $n$. Let $M_3(c)$ be the standard complete simply connected Riemannian manifold with constant sectional curvature $c$, where $c \in \{-1, 0, 1\}$. Assume that $M_2$ is a two dimensional manifold which is isometrically immersed in $M_3(c)$. So it naturally generates the first, the second and the third fundamental form of the surface concerned, I, II and III".

Knowing that, one will say that $M_2$ is a Pythagorean surface if the 3 matrices associated to the forms mentioned above satisfy the Pythagorean relation:

$$ I^2 + \mathbb{II}^2 = \mathbb{III}^2 \quad \text{or} \quad I^2 + \mathbb{II}^2 - \mathbb{III}^2 = 0, \qquad (8) $$

a concept that can be generalized to arbitrary dimension.

As [Aydın et al. 22] show, an example of Pythagorean surface is the following: let $c = 0$ and $S^2(r)$ be the sphere of radius $r$ centered at origin. It is immediate that $I = \langle, \rangle$, $\mathbb{II} = (1/r)I$ and $\mathbb{III} = 1/r^2I$ (see [Gray 98]). By substituting the value of $\mathbb{II}$ and $\mathbb{III}$ into equation (8) we obtain:

$$ I^2 + \frac{1}{r^2}I^2 - \frac{1}{r^4}I^2 = 0. $$

After rearrangement, we get:

$$ I^2(\frac{r^4 + r^2 - 1}{r^4}) = 0, $$
and so, $S^2(r)$ is Pythagorean if and only if the algebraic equation of degree 4:

$$r^4 + r^2 - 1 = 0 \qquad (9)$$

holds.

If we pose now $x = r^2$, it means that we must have:

$$x^2 + x - 1 = 0. \qquad (10)$$

The solution of this well-known equation is the so-called "golden ratio" $\phi$, with:

$$\phi = \frac{1 + \sqrt{5}}{2},$$

the "conjugate golden ratio" being equal to:

$$\mathbf{\Phi} = \frac{-1 + \sqrt{5}}{2}.$$

In this setting, as the authors show, every Pythagorean hypersurface in $\mathbb{R}^{n+1}$ is isometric to the round sphere of radius $\mathbf{\Phi}$ where $\mathbf{\Phi}$ is the conjugate golden number just above. The Gaussian curvature of this Pythagorean sphere $S^2(\mathbf{\Phi}^{1/2})$ is $G = \phi^3$.

## 4.3 Pythagorean triples, classifications and non Euclidean geometry

Let us return now to taxonomy and clustering. In the case when $A, B$ and $C$ are ultrametric matrices associated to hierarchical classifications, the preceding approach makes it possible to establish a correspondence between hierarchical classifications and Riemannian differential discrete geometry (see [Crane 23], 16; [Romon 13], 17).

**Definition 4.2.** We call *Pythagorean matrices* any ultrametric matrices with zero second diagonal that satisfy the Pythagorean-like relation:

$$A^2 \oplus B^2 = C^2. \qquad (11)$$

<footnote n="3">³Ali Taghavi further reports that in [Xaiole et al. 22] a 2-comparison version of Pythagorean theorem is presented to judge the lower or upper bound of the curvature of Alexandrov spaces, and he also recalls that Pythagorean submanifolds isometrically immersed in Euclidean spaces are studied in [Aydın et al. 23].</footnote>
The classifications associated to these Pythagorean matrices will be called *Pythagorean classifications*.

**Remark 1:** We notice that the symmetric matrices associated with the first two forms of the parametric surfaces – for example, in the above simple case:

$$ \begin{pmatrix} E & F \\ F & G \end{pmatrix} \quad \text{and} \quad \begin{pmatrix} L & M \\ M & N \end{pmatrix}, $$

have identical coefficients on the first diagonal. On the contrary, the ultrametric matrices associated with the classifications have identical coefficients, and also identically zero, on the second diagonal. To establish a correspondence with the surfaces, we propose to consider the transposes of these matrices associated with the classifications (in the previous example, we will necessarily have $F = M = 0$).

**Remark 2:** Note again that we can perfectly represent a classification by the transpose of its associated matrix. Just make the necessary changes. For example, the classification associated with the matrix A in Fig. 3:

<table><thead><tr><th></th><th>a</th><th>b</th><th>c</th></tr></thead><tbody><tr><th>a</th><td>0</td><td>1</td><td>2</td></tr><tr><th>b</th><td>1</td><td>0</td><td>2</td></tr><tr><th>c</th><td>2</td><td>2</td><td>0</td></tr></tbody></table>

may just be represented as $^T A$:

<table><thead><tr><th></th><th>c</th><th>b</th><th>a</th></tr></thead><tbody><tr><th>a</th><td>2</td><td>1</td><td>0</td></tr><tr><th>b</th><td>2</td><td>0</td><td>1</td></tr><tr><th>c</th><td>0</td><td>2</td><td>2</td></tr></tbody></table>

the classification itself remaining invariant.

**Proposition 4.1.** If 3 ultrametric matrices with zero second diagonal and coefficient in $\mathbb{N}$ satisfy the Pythagorean-like relation (11), then the transposes of these matrices can be mapped to respectively the first, second and third fundamental form I, II and III of a Pythagorean discrete surface $M_n$, isometrically immersed in $M_{n+1}(c)$, the discrete complete simply connected Riemannian manifold with constant sectional curvature $c$ (where $c \in \{-1, 0, 1\}$).

*Proof.* This is just a trivial application, in the discrete case, of the theorem proved by Aydın and Mihai in [Aydın-Mihai 20]. As the fundamental forms of the discrete
surface are generated by the transposes of the ultrametric matrices, they are also, by definition, in one-to-one correspondence with the associated classifications. □

**Proposition 4.2.** In the Gondran's system Minplus, Pythagorean classifications, via the transposes of their associated ultrametric matrices, generate a Pythagorean surface isomorphic to a discrete round sphere of radius $r = 1$.

*Proof.* In the case of ultrametric matrices transposes within Gondran's system Minplus, equation (8) means:

$$I^2 \oplus \mathbb{I}^2 = \mathbb{III}^2, \qquad (12)$$

and we also have:

$$I^2 = I, \quad \mathbb{I}^2 = \mathbb{II}, \quad \mathbb{III}^2 = \mathbb{III}.$$

Suppose, as in section 4.2, that we have $I = \langle \cdot, \cdot \rangle$, $\mathbb{I} = (1/r)\mathbb{I}$ and $\mathbb{III} = 1/r^2\mathbb{I}$.

Satisfying $\mathbb{I}^2 = \mathbb{II}$ means $\frac{1}{r^2}\mathbb{I}^2 = \frac{1}{r}\mathbb{I}$, while satisfying $\mathbb{III}^2 = \mathbb{III}$ means $\frac{1}{r^4}\mathbb{I}^2 = \frac{1}{r^2}\mathbb{I}^2$;

This implies that the unique solution for $r$ is $r = 1$, which also means that the three forms $I, \mathbb{II}$ and $\mathbb{III}$ are identical.

In this context, equation (12), which means in fact $\mathrm{Min}(I, \mathbb{II}) = \mathbb{III}$, is absolutely trivial since $I = \mathbb{II} = \mathbb{III}$.

But what does it mean concretely? If we assume, more generally, that $\mathbb{II} = a\mathbb{I}$ where $a$ is a constant (and $a \neq 0$), we can show that the surface must be (a subset of) a sphere.

We have the first fundamental form $I(x, y)$ given by:

$$I(x, y) = \langle x, y \rangle.$$

And we also have the second fundamental form $\mathbb{II}(x, y)$ given by:

$$\mathbb{II}(x, y) = \langle -d\nu(x), y \rangle \nu.$$

But, from our hypothesis, we know that:

$$\mathbb{II} = a(x, y) = \langle ax, y \rangle.$$

And since this is valid for any vector $y$, then it must be that:

$$-d\nu(x) = ax.$$
So $x$ is an eigenvector of $-d\nu$ and $a$ is an eigenvalue. Since this is true for an arbitrary $x$ in the tangent plane to $S$ then we choose another $x'$ tangent to the surface and find that the same thing happens, i.e:

$$-d\nu(x) = ax'$$

So the two eigenvalues is just $a$ repeated. Which we can use to find that:

$$H = \frac{2a}{2} = a, \quad K = a^2,$$

gives respectively the constant mean and Gaussian curvature on $S$, and thus, $S$ must be a sphere. The value $a = 1$ is just a particular case<fnref n="4" />. □

# 5 Return to arithmetic meaning of "+" and "×"

Forget now Gondran's system Minplus. Let + keep its arithmetical classic sense and introduce further × as an external law of composition. We get the following theorem:

**Theorem 5.1.** The set of ultrametric matrices $(M_n, +, \times)$, with coefficients in $\mathbb{R}^+$, and + and × interpreted as the classical arithmetic operations, is a semi-vector space over $\mathbb{R}^+$.

*Proof.* $M_n$ is equipped with the operations $+ : M_n \times M_n \to M_n$ and $\times : \mathbb{R}^+ \times M_n \to M_n$ which fulfill the following properties, for each $\lambda, \mu \in \mathbb{R}^+$:

$$M, N, P \in \mathcal{M}_n,$$

$$M + (N + P) = (M + N) + P,$$

$$M + N = N + M.$$

So $M_n$ is a commutative semigroup<fnref n="5" />. Moreover, we have:

$$(\lambda\mu)M = \lambda(\mu M), 1M = M, \lambda(M + N) = \lambda M + \lambda N, (\lambda + \mu)M = \lambda M + \mu M.$$

□

<footnote n="4">⁴We can show more directly the same result : suppose $x$ a local parametrization and $N$ the unit normal vector. Consider now $y = x + 1aN$. Since $dy = dx + 1adN = dx + 1a(-adx) = 0$, $y = y_0$ is a constant vector. This will be the center of the sphere, as $\|x - y_0\| = 1/a$ is constant.</footnote>

<footnote n="5">⁵As $M_n$ does not possess an identity element (the null matrix is not an ultrametric one associated with a classification), so $M_n$ is not a monoid.</footnote>
Despite the fact that some authors (see [La Guardia et al. 21]; [Gähler et al. 99]) require that a semi-vector space has a zero vector, here we do not make such a general assumption, as moreover [Janyška et al. 07] authorize.

## 5.1 Construction of matrices

Forget now classification problems. The construction of non necessary symmetric (nor ultrametric) $n \times n$ matrices satisfying the Pythagorean relation – with + and × (as internal laws), interpreted in their arithmetic sense – are given in [Arnold et al. 19], who prove the following theorem:

**Theorem 5.2.** For any $n \times n$ matrix with rational entries $P \in M_n(Q)$, there exists an $n^2$-parametric family of matrices A and C from $M_n(Q)$ such that $P = C^2 - A^2$.

As the authors show, the proof of the theorem is based on the following auxiliary result. Notice that for any square matrices U and V the following identity holds:

$$ (U - V)^2 + 2UV + 2VU = (U + V)^2. $$

Thus, if it is possible to represent P as $2(UV + VU)$, then one could rewrite P as $(U + V)^2 - (U - V)^2$. It turns out that such representation for P is possible.

This construction gives rise to examples, such as the following, which – of course – do not concern classifications, and where matrices have their coefficient in $\mathbb{R}^*$.

$$ \begin{vmatrix} 30 & 13 \\ 3 & 0 \end{vmatrix}^2 + \begin{vmatrix} 4 & 8 \\ 12 & 16 \end{vmatrix}^2 = \begin{vmatrix} -26 & -25 \\ -15 & 4 \end{vmatrix}^2. $$

In the case of ultrametric matrices associated with classifications, this theorem is of no use. There is a good reason for that, which appears in the following proposition:

**Proposition 5.3.** The square of an ultrametric symmetric matrix with zero diagonal does never give a matrix with 0 diagonal, except in the case of the null matrix.

*Proof.* To prove this proposition, it is enough to perform the product of the ultrametric matrix by itself. By hypothesis,

$$ d_{ii} = d_{jj} = d_{kk} = \dots = 0, $$

$$ d_{ij}, d_{ik}, d_{kj}, \dots \neq 0. $$
The law × impose, for the first element a :

$$a = d_{11}^2 + d_{12}^2 + d_{13}^2 + \dots etc.$$

with $d_{11} = 0$, but $d_{12}^2, d_{13}^2, etc... \neq 0$. So one at least of the elements located on the diagonal is not zero and the product matrix is not an ultrametric one. □

## 5.2 Hybrid systems

Let $M_n$ be the set of ultrametric matrices associated to classifications. Consider now $(M_n, *, +)$, defined on $\mathbb{R}^+$. $(M_n, *)$ is a monoid with * having the sense of Max, and $(M_n, +)$ is a semigroup with + as the classic operation of addition. 0 is the unit element of *, but the null matrix is not an ultrametric matrix corresponding to a classification, and so, cannot be the unit element of + in $M_n$. We call this structure an *hybrid simple idempotent semidioid*.

Of course we would be happy to get the symmetric structure: the set $(M_n, \oplus, \times)$, defined on $\mathbb{R} \cup \{\infty\}$, is such that $(M_n, \oplus)$ is a monoid where $\oplus$ is interpreted as Min, and $(M_n, \times)$ is a semigroup where $\times$ is the classic operation of multiplication (the unit matrix is not an ultrametric matrix, and so, there is no unit element for $\times$ in $M_n$). We have just $+\infty$ as the unit element of $\oplus$. So we have again, here, an hybrid simple idempotent semidioid. But we can say a little more. The matrices multiplication involves also, in fact, ordinary addition, even if this operation has no unit element. As $(M_n, +, \times)$ defines a semi-vector space over $\mathbb{R}^+$, then the structure we end up with is not exactly $(M_n, \oplus, \times)$ but $(M_n, +, \oplus, \times)$. We propose to name this structure a quasi-semitrioid$^6$. It is, more precisely, an *hybrid simple idempotent quasi-semitrioid*.

The semidioid $(M_n, *, +)$ authorizes classic operations of addition between matrices whose squares are the product of idempotent operation *. So we can define operations as the following (Pythagorean theorem with + and *):

$$A^2 + B^2 = C^2,$$

where $A, B, C$ are ultrametric matrices.

This kind of operations has a useful interpretation in theory of classifications. Let us take, for example, the following matrices $A^2$ and $B^2$. By applying the operation + to them, with its ordinary arithmetic meaning, we obtain:

<footnote>$^6$We have already encountered a quasi-trioid (2 monoids, 1 semi-group) in ([Parrochia-Neuville 13], 124. Here, we have only a "quasi-semitrioid", because we get only 2 semigroups and 1 monoid.</footnote>
$$ \begin{vmatrix} 0 & 1 & 2 & 2 \\ 1 & 0 & 2 & 2 \\ 2 & 2 & 0 & 1 \\ 2 & 2 & 1 & 0 \end{vmatrix} + \begin{vmatrix} 0 & 3 & 3 & 3 \\ 3 & 0 & 1 & 2 \\ 3 & 1 & 0 & 2 \\ 3 & 2 & 2 & 0 \end{vmatrix} = \begin{vmatrix} 0 & 4 & 5 & 5 \\ 4 & 0 & 3 & 4 \\ 5 & 3 & 0 & 3 \\ 5 & 4 & 3 & 0 \end{vmatrix}. $$

Here, the right-hand matrix $C^2$ corresponds to the following overlapping hierarchical classification (which integrates the two previous ones while respecting their structures). And we have, at the level of the classifications themselves, the sequence $(A) + (B) \doteq (C)$, as shown in Fig. 11.

<figure><img src="image_8.png" /><figcaption>Figure 7: Classification with overlapping classes (c)</figcaption></figure>

The quasi-semitrioid $(\mathcal{M}_n, \oplus, +, \times)$ authorizes comparisons and ordering operations between matrices whose squares are the classical product defined by the ordinary operation $\times$. So we can introduce operations as the following (Pythagorean theorem with $\oplus$ and $\times$):

$$ A^2 \oplus B^2 = C^2. $$

But in this case $A, B, C$ cannot be ultrametric symmetric matrices, and the operation does not make sense in theory of classifications. What is more, it is not always possible to find a matrix which is the minimum of two given squared matrices, and which is itself a square.

Of course, we can always calculate the squares of two matrices and, by comparing them, construct a new matrix which is the minimum of the previous ones. But this minimum matrix is not necessarily the square of another one.

Take, for example, the matrices of section 7.1:
$$M_1^2 = \begin{vmatrix} 30 & 13 \\ 3 & 0 \end{vmatrix}^2 = \begin{vmatrix} 939 & 390 \\ 90 & 39 \end{vmatrix}, \quad M_2^2 = \begin{vmatrix} 4 & 8 \\ 12 & 16 \end{vmatrix}^2 = \begin{vmatrix} 112 & 160 \\ 240 & 352 \end{vmatrix}.$$

We get:

$$M_1^2 \oplus M_2^2 = \begin{vmatrix} 112 & 160 \\ 90 & 39 \end{vmatrix}.$$

If we form now the product of a square matrix by itself such that:

$$\begin{vmatrix} a & b \\ c & d \end{vmatrix} \times \begin{vmatrix} a & b \\ c & d \end{vmatrix} = \begin{vmatrix} a^2 + bc & ab + bd \\ ac + cd & bc + d^2 \end{vmatrix},$$

we then have to solve the nonlinear system:

$$a^2 + bc = 112, ab + bd = 160, ac + cd = 90, bc + d^2 = 39,$$

for which there are no solutions in $\mathbb{R}$.

Obviously, if one of the two given matrix is the matrix minimum, there is no problem:

$$\begin{vmatrix} 7 & 11 \\ 13 & 17 \end{vmatrix}^2 \oplus \begin{vmatrix} 4 & 8 \\ 12 & 16 \end{vmatrix}^2 = \begin{vmatrix} 4 & 8 \\ 12 & 16 \end{vmatrix}^2$$

But it also happens that we can find solutions – even if it is more difficult – in the case where $M_1 \neq M_2 \neq M_3$. For example, suppose we have to find $a, b, c, d$ in $\mathbb{R}$ such that:

$$\begin{vmatrix} 10 & 2 \\ 6 & 70 \end{vmatrix}^2 \oplus \begin{vmatrix} 104 & 48 \\ 2 & 16 \end{vmatrix}^2 = \begin{vmatrix} a & b \\ c & d \end{vmatrix}^2$$

An elementary computation shows we have 4 possibilities:

$$(1) \quad a = -4, b = -8, c = -12, d = -16; \qquad (13)$$

$$(2) \quad a = 4, b = 8, c = 12, d = 16; \qquad (14)$$

$$(3) \quad a = -12\sqrt{\frac{3}{11}}, b = \frac{-40}{\sqrt{33}}, c = -20\sqrt{\frac{3}{11}}, d = -32\sqrt{\frac{3}{11}}; \qquad (15)$$

$$(4) \quad a = 12\sqrt{\frac{3}{11}}, b = \frac{40}{\sqrt{33}}, c = 20\sqrt{\frac{3}{11}}, d = 32\sqrt{\frac{3}{11}}. \qquad (16)$$
Maybe we could find applications of all that in numerical nonlinear algebra, theoretical computer science or economics.

## References

[Arnold et al. 19] Arnold, M., Eydelzon A., "On matrix Pythagorean triples", The American Mathematical Monthly, 126, 158-160, 2019.

[Aydın-Mihai 20] Aydın, M. E., Mihai, A., "A Note on Surfaces in Space Forms with Pythagorean Fundamental Forms" *Mathematics*, 8, 444, 1-5, 2020.

[Aydın et al. 22] Aydın, M. E., Mihai, A., Özgür, C., "Pythagorean Isoparametric Hypersurfaces in Riemannian and Lorentzian Space Forms", *Axioms* 11, 59, 30 janvier 2022.

[Aydın et al. 23] Aydın, M. E., Mihai, A., Özgür, C., "Pythagorean submanifolds in Euclidean spaces", *Results in Mathematics*, Vol 78, Article number 211, 2023.

[Barbut-Monjardet 70] Barbut, M., Monjardet, B., *Ordre et Classification*, 2 tomes, Hachette-Université, Paris, 1970.

[Benzecri et al. 73] Benzecri, J.-P., (et al.), *L'Analyse des données*, tome 1 - La Taxinomie, tome 2 - L'Analyse des Correspondances, Paris, Dunod, 1973.

[Bridson et al. 99] Bridson, M. R. and Haefliger, A., *Metric spaces of non positive curvature*, Springer-Verlag, Berlin-Heidelberg-New York, 1999.

[Brodie 02] Brodie, S. E. "The Pythagorean Theorem Is Equivalent to the Parallel Postulate", http://www.cut-the-knot.org/triangle/pythpar/PTimpliesPP.shtml, 19-04-2002.

[Chase 12] Chase, H., "Fundamental forms of surfaces and the Gauss-Bonnet theorem", 1-12, pdf, math.uchicago.edu, August 19, 2012.

[Crane 23] Crane, K., *Discrete Differential Geometry: an applied introduction*, Last updated: April 16, 2023, CMU school of Computer Science, https://www.cs.cmu.edu/kmcrane/Projects/DDG, 2023.

[Gähler et al. 99] Gähler, W., Gähler, S, "Contributions to fuzzy analysis", *Fuzzy sets and systems*, 105, 201-224, 1999.

[Gondran 76¹] Gondran, M., "La structure algébrique des classifications hiérarchiques", *Ann. INSEE* 22,Äì23, 181-190, 1976.
[Gondran 76²] Gondran, M., "Valeurs propres et vecteurs propres en classification hiérarchique", *RAIRO Inform. Théor.* 10(3), 39-46, 1976.

[Gondran-Minoux 01] Gondran, M., Minoux, M., *Graphes, dioïdes et semi-anneaux*, nouveaux modèles et algorithmes, Technique & Documentation, Paris, 2001.

[Gray 98] Gray, A., *Modern Differential Geometry of Curves and Surfaces with Mathematica*, 2nd ed.; CRC Press, Boca Raton, FL, USA, 1998.

[Janyška et al. 07] Janyška, J., Modugno, M., Vittolo, R., "Semi-vector spaces and units of measurement", arXiv:0710.1313v1 [math.AC] 5 Oct. 2007.

[La Guardia et al. 21] La Guardia, G. G., de Q. Chagas, J., Lenzi, E. K., Pires, L., "On semi-vector spaces and semi-algebras", arXiv:2111.11206 [math.GM], 2021.

[Lee 97] Lee, J. M., *Riemannian Manifolds, An Introduction to Curvature*, Springer Verlag, New York, 1997.

[Lerman 70] Lerman, I. C., *Classification automatique et analyse des données*, Gauthier-Villars, Paris, 1970.

[Moler et al. 03] Moler, C., Van Loan, C., "Nineteen Dubious Ways to Compute the Exponential of a Matrix", *Society for Industrial and Applied Mathematics (SIAM Review)*, vol. 45, 1, 1-46, 2003.

[O'Neill 06] O'Neill, B., *Elementary Differential Geometry*, Academic Press, 2nd ed., Amsterdam, Boston, Heidelberg, 2006.

[Parrochia 20] Parrochia, D., *Mathematical physics vs Philosophy: Hegel, Pythagorean triples, Spinors and Clifford Algebras*, hal-02613438, 2020.

[Parrochia-Neuville 13] Parrochia, D., Neuville, P., *Towards a general theory of classifications*, Basel, Birkhäuser, 2013.

[Parrochia 18] *Mathematical Theory of Classification, Knowledge Organization*, 45 (2), 184-201, January 2018.

[Parrochia 23] Parrochia, D., "Mathematics of Classifications, Chu spaces and the Continuum", *WSEAS Transactions on Information Science and Applications*, Volume 20, 119-130, 2023.

[Romon 13] Romon, P., *Introduction à la géométrie différentielle discrète*, Ellipses, Paris, 2013.
[Stahl 93] Stahl, S., *The Poincaré Half-Plane, a Gateway to Modern Geometry*, John and Bartlett Publishers, Boston, Toronto, London, Singapore, 1993.

[Taghavi 24] Taghavi, A., "A review of Pythagorean triples from both classical and modern viewpoints", *arXiv*, 2403.17966 [math.HO], 2024.

[Xaiole et al. 22] Xiaole Su, Hongwei Sun Yusheng Wang, "Pythagorean Theorem and Curvature with Lower or Upper Bound", Volume 43, 16, 95-114, 2022.