Let $H$ be a multiplicatively written, commutative monoid with identity $1_H$, and let $\mathcal P(H)$ be the power set of $H$. If $X, Y \subseteq H$, we will set $$XY := \{xy: x \in X,\, y \in Y\}.$$
A *weak ideal system* on $H$ is a function $r: \mathcal P(H) \to \mathcal P(H)$ such that, for all $a \in H$ and $X, Y \subseteq H$, the following hold (given $V \subseteq H$, we will use $V_r$ in place of $r(V)$):

- $\emptyset = \emptyset_r$ and $X \subseteq X_r$.
- $X \subseteq Y_r$ implies $X_r \subseteq Y_r$.
- $aH \subseteq \{a\}_r$.
- $a X_r \subseteq (aX)_r$.

In particular, $r$ is named an *ideal system* if the last condition holds as an equality.

Weak ideal systems are reminiscent of closure operators, and have a rich and far-reaching theory, which grew up from intuitions and pioneering work of W. Krull and H. Prüfer, and is well documented by M.D. Larsen and P.J. McCarthy's book *Multiplicative Theory of Ideals* and R. Gilmer's *Multiplicative Ideal Theory*. If asked for a neat and lucid treatment of the subject, I would go for F. Halter-Koch's 1998 monograph *Ideal Systems: An Introduction to Multiplicative Ideal Theory*, with the caveat that weak ideal systems are defined therein in a "slightly" different way than we're doing: In Halter-Koch's book, the theory of [weak] ideal systems is developed by assuming that monoids have an absorbing element $0_H \ne 1_H$, and the first condition in the above list is replaced with $X \cup \{0_H\} \subseteq X_r$.

With this in mind, let $r$ be a weak ideal system on $H$. We say that a set $I \subseteq H$ is an *$r$-ideal* if $I = I_r$: If $H$ is the multiplicative monoid of a commutative unital ring $R$, then the function $$d: \mathcal P(H) \to \mathcal P(H): X \mapsto \{a_1 x_1 + \cdots + a_n x_n: a_1, \ldots, a_n \in H, \, x_1, \ldots, x_n \in X\}$$ is an ideal system on $H$, and the $d$-ideals of $H$ are nothing but the good, old, classical ideals of $R$.

We denote by $\mathcal I_r(H)$ the set of $r$-ideals of $H$, which is made into a commutative, reduced monoid (this is simple, but not obvious) by the binary operation $$\cdot_r: \mathcal I_r(H) \times \mathcal I_r(H) \to \mathcal I_r(H): (I, J) \mapsto (IJ)_r,$$
referred to as *$r$-multiplication*. Note that $H$ and $\emptyset$ are $r$-ideals, and they serve, respectively, as the identity and the absorbing element of $\mathcal I_r(H)$.
An $r$-ideal $I$ of $H$ is termed a *prime $r$-ideal* if $I \ne H$ and $H \setminus I$ is a subsemigroup of $H$. In particular, the set of all prime $r$-ideals of $H$ is denoted by $r\text{-spec}(H)$ and called the *$r$-spectrum* of $H$.

If $I \in \mathcal I_r(H)$, we take $\text{coht}_r(I)$ to be the supremum of all $n \in \mathbf N^+$ for which there exist $\mathfrak p_1, \ldots, \mathfrak p_n \in r\text{-spec}(H)$ such that $\mathfrak p_{i-1} \subsetneq \mathfrak p_i$ for each $i \in [\![1, n]\!]$, where $\mathfrak p_0 := I$ and $\sup \emptyset := 0$. We call $\text{coht}_r(I)$ the *$r$-coheight* of $I$. It is straightforward that $\text{coht}_r(H) = 0$ and $\text{coht}_r(I) \le \text{coht}_r(J)$ for all $I, J \in \mathcal I_r(H)$ with $J \subseteq I$, and my question is:

Q.Is there any (non-trivial) characterization of the pairs $(H, r)$ which verify the triangle inequality, i.e., such that $\text{coht}_r(I \cdot_r J) \le 1 + \text{coht}_r(I) + \text{coht}_r(J)$ for all $I, J \in \mathcal I_r(H) \setminus \{H\}$?

I don't know of a *single* example in which the inequality is *not* satisfied, but I must also confess that I've not tried too hard to find one. On a positive note, it's not too difficult to prove that the inequality holds (even without the "1 + " on the right-hand side) in the (very) extremal cases when:

- $H$ is arbitrary and $r$ is the
*discrete weak ideal system*on $H$ (that is, the unique weak ideal system for which $X_r = H$ for every non-empty $X \subseteq H$); - $H$ is a null monoid (i.e., there is a distinguished element $0_H \in H$ such that $xy = 0_H$ for all $x, y \in H \setminus \{1_H\}$) and $r$ is the fundamental ideal system determined by taking $X_r = XH$ for all $X \subseteq H$ (this is often called the
*$s$-system*, and the corresponding ideals are precisely the ideals of $H$ in the usual sense of semigroup theory).

In addition, I *suspect* that the inequality is true when $H$ is the multiplicative monoid of a PID (which is, in a way, another extremal case), and can prove it in some special instances.

*Edit 1.* After discussing the question with Paolo Leonetti, I changed my mind and added a "1 + " on the right-hand side of the triangular inequality. In hindsight, this has a "natural justification", as we'd like to have a function $\mathcal I_r(H) \to \mathbf N \cup \{\infty\}$ which "separates" $H$ (namely, the only unit of $\mathcal I_r(H)$) from the $r$-prime ideals. But that wouldn't be (always) the case with the $r$-coheight, as confirmed by the following example (due to Paolo): Consider the monoid $(\mathbf N, +)$ with the unique ideal system $r$ for which $X_r = \mathbf N_{\ge \min X}$ for every non-empty $X \subseteq \mathbf N$. Then observe that the $r$-ideals are all and only the subsets of $\mathbf N$ of the form $\mathbf N_{\ge \kappa}$ with $\kappa \in \mathbf N \cup \{\infty\}$, and the unique prime $r$-ideals are $\emptyset$ and $\mathbf N^+$. Accordingly, ${\rm coht}_r(\mathbf N^+) = 0$, and this implies that the inequality without the "1 + " is false, by taking $I = J = \mathbf N^+$.

*Edit 2.* Here is a more conceptual counterexample to the inequality without the "1 + ": Let $H$ be a non-trivial, Dedekind-finite, commutative, reduced monoid with a non-empty set of atoms (e.g., $H$ may be the multiplicative monoid of the integers), take $r$ to be the $s$-ideal system mentioned in the above (i.e., $X_r := XH$ for every $X \subseteq H$), and set $I := H \setminus \{1_H\}$. We claim that $I$ is a prime $r$-ideal of $H$: Indeed, $IH \subsetneq H$, otherwise there would exist $x, y \in I$ such that $xy = 1_H$, which is impossible by an observation of Benjamin Steinberg and the assumption that $H$ is reduced. It follows that $I$ is an $r$-ideal of $H$, and is actually a prime $r$-ideal, because its complement in $H$ is the trivial subgroup of $H$. So $\text{coht}_r(I) = 0$, while ${\rm coht}_r(I^2) \ge 1$, since $I^2 \subsetneq I$ by the fact that $H$ has no non-trivial unit and the set of atoms of $H$ is non-empty.

*Notes.* A monoid $H$ is *Dedekind-finite* if $xy=1_H$, for some $x, y \in H$, implies $yx=1_H$, and *reduced* if the only unit (or invertible element) of $H$ is the identity $1_H$. Finally, an *atom* of $H$ is a non-unit element $a \in H$ for which there don't exist two other non-unit elements $x, y \in H$ such that $a = xy$.