1 Introduction

Comparative thinking plays a key role in our assessment of reality. This has been recognized for a long time. Making comparison is closely related to similarity judgment [14] and analogy making [4]. Analogical proportions, i.e., statements of the form a is to b as c is to d provides a well-known way for expressing a comparative judgment between the two pairs (ab) and (cd) by suggesting that the comparison between the elements of each pair yields the same kind of result in terms of dissimilarity [12].

The interest of analogical proportions has been recently pointed out in classification in machine learning [1, 2, 8] and in visual multiple-class categorization tasks for handling pieces of knowledge about semantic relationships between classes. More precisely in this latter case, analogical proportions are used for expressing analogies between pairs of concrete objects in the same semantic universe and with similar abstraction level, and then this gives birth to constraints that serve regularization purposes [5]. Interestingly enough, constraints of the same kind but issued from pieces of knowledge stating relative comparisons between quadruplets of images, feature by feature, have been recently experienced with success [6, 7]. These relative comparisons are inequalities between differences inside pairs rather than equalities. Moreover these comparisons involving quadruplets have been shown to be more useful in categorization tasks than comparisons involving only triplets, or pairs, of images.

Besides, it has been also recently noticed that similar relations in terms of comparison of pairs were also present in multiple criteria analysis for expressing, for instance, that the “difference” between two evaluation vectors on a criterion is smaller than (i.e., does not compensate) the “difference” between the vectors on the rest of the criteria [10].

This recent emergence of the interest for inequality constraints between pairs of items motivates this first formal study of “analogical inequalities”, in relation with the Boolean and the multiple-valued modeling of analogical proportions. The paper first restates the necessary background on these proportions, before extending it in order to represent “analogical inequalities”, both in the Boolean and in the multiple-valued settings.

2 Background on Analogical Proportions

We start with a reminder on analogical proportions, first in the case of binary attributes.

2.1 Boolean Case

Let us assume that four items abcd are represented by sets of binary features belonging to a universe U (i.e., an item is then viewed as the set of the binary features in U that it satisfies). Then, the dissimilarity between a and b can be appreciated in terms of \(a \cap \overline{b}\) and/or \( \overline{a} \cap b\), where \(\overline{a}\) denotes the complement of a in U, while the similarity is estimated by means of \(a \cap b\) and/or of \( \overline{a} \cap \overline{b}\). Then, an analogical proportion between subsets is formally defined by the two conditions [9]:

$$\begin{aligned} a \cap \overline{b}= c \cap \overline{d} \text { and } \overline{a} \cap b = \overline{c} \cap d \end{aligned}$$
(1)

This expresses that “a differs from b as c differs from d” and that “b differs from a as d differs from c”. It can be viewed as the expression of a co-variation. Analogical proportion has an easy counterpart in Boolean logic, where it is denoted by \(a: b\,{::}\,c : d\), abcd being now Boolean variables (supposed to refer to the value of the same attribute for 4 different items). In this logical setting, “equality” translates into “equivalence” (\(\equiv \)), \(\overline{a}\) into the negation of a (i.e., \(\lnot a\)), and \(\cap \) is changed into a conjunction (\(\wedge \)), and we get the logical condition expressing that 4 Boolean variables make an analogical proportion [9]:

$$\begin{aligned} a:b{::}c:d=(a \wedge \lnot b \equiv c \wedge \lnot d) \wedge (\lnot a \wedge b \equiv \lnot c \wedge d) \end{aligned}$$
(2)

An analogical proportion is then a Boolean formula. The expression a : b :  : c : d takes the truth value “1" only for the 6 following patterns for abcd: 1111, 0000, 1100,  0011, 1010, 0101. For the 10 other patterns of its truth table, it is false (i.e., equal to 0).

A worth noticing property, beyond reflexivity (a : b :  : a : b), symmetry (if a : b :  : c : d then c : d :  : a : b), and central permutation (if a : b :  : c : d then a : c :  : b : d) is the fact that the analogical proportion remains true for the negation of the Boolean variables [11]. It expresses that the result does not depend on a positive or a negative encoding of the features:

$$\begin{aligned} \text {if } a:b{::}c:d \text { then } \lnot a: \lnot b{::} \lnot c: \lnot d\quad \quad \text { (code independency}). \end{aligned}$$
(3)

2.2 Multiple-Valued Case

Attributes or features are not necessarily Boolean, and a graded extension of analogical expression is needed. We assume that attributes are now valued in [0, 1] (possibly after renormalization). The extension is obtained by replacing (i) the central \(\wedge \) in (2) by \(\min \), (ii) the two \(\equiv \) symbols by \(\min (s\rightarrow _{\L }t, t\rightarrow _{\L }s) = 1- \mid s-t\mid \), where \(s \rightarrow _{\L } t\) \(=\min (1, 1- s + t)\) is Łukasiewicz implication, (iii) the four expressions of the form \(s \wedge \lnot t\) by the bounded difference \(\max (0, s - t)= 1 - (s \rightarrow _{\L } t)\), which is associated to Łukasiewicz implication, using \(1 - (\cdot )\) as negation. The resulting expression [3] is then

$$\begin{aligned} a : b\,{::}_{\L } c : d = {\left\{ \begin{array}{ll} 1- \mid (a - b) - (c-d)\mid , \\ \quad \text { if }a \ge b \text { and } c \ge d, \text { or } a \le b \text { and } c \le d\\ 1- \max (\!\mid \!a - b\!\mid , \!\mid \!c - d\!\mid ), \\ \quad \text { if } a \le b \text { and } c \!\ge d, \text { or } a \ge b \text { and } c \le d \end{array}\right. } \end{aligned}$$
(4)

It coincides with a : b :  : c : d on \(\{0, 1\}\). As can be seen, this expression is equal to 1 if and only if \((a - b) = (c-d)\), while \(a : b\, {::}_{\L } c : d =0\) if and only if (i) \(a-b = 1\) and \(c \le d\), or if (ii) \(b-a = 1\) and \(d \le c\), or if (iii) \(a \le b\) and \(c - d = 1\), or if iv) \(b \le a\) and \(d - c = 1\). Thus, \(a : b\,{::}_{\L } c : d =0\) when the change inside one of the pairs (ab) or (cd) is maximal, while the other pair shows either no change or a change in the opposite direction. It can be also checked that code independency continue to hold under the form \( a : b\,{::}_{\L } c : d = 1-a : 1-b\,{::}_{\L } 1-c : 1-d\).

Note that the algebraic difference between a and b equated with the difference between c and d, namely \(a-b = c-d\), provides a constraint that is satisfied by the 6 patterns making true the analogical proportion a : b :  : c : d in the Boolean case, and by none of the 10 others. However, \(a-b\) may not belong to \(\{0,1\}\) when \(a, b \in \{0,1\}\). While \(\mid a-b\mid \in \{0,1\}\), the constraint \(\mid a-b\mid = \mid c-d\mid \) validates 8 patterns including 0110 and 1001. When considering the graded case, \(a-b\) is not close in [0, 1]; moreover, the modeling of the analogical proportion by the constraint \(a-b = c-d\) does not provide a graded evaluation of how far we are from satisfying it.

3 Inequalities

In the following, we propose a logical modeling for expressions of the form “a is to b at least as much as c to d”, first in the Boolean case, and then in the multiple-valued case. We denote this expression by \(a : b<\!\!\!< c : d\).

3.1 Boolean Case

Starting from the Boolean expression (2) of the analogical proportion, we replace the two symbols \(\equiv \) expressing sameness by two material implications \(\rightarrow \) for modeling the fact that the result of the comparison of c and d is larger or equal to the result of the comparison of a and b. Namely, we obtain

$$\begin{aligned} a : b<\!\!\!< c : d = ((a \wedge \lnot b) \rightarrow (c \wedge \lnot d)) \wedge ((\lnot a \wedge b)\rightarrow (\lnot c \wedge d)) \end{aligned}$$
(5)

It can be checked from this definition that the following expected properties hold:

  • \(a : b<\!\!\!< a : b\)

  • \(a : b\,{::}\,c : d \rightarrow a : b<\!\!\!< c : d\)

  • \(a : b\,{::}\,c : d\equiv ((a : b<\!\!\!< c : d)\wedge (c : d<\!\!\!< a : b))\)

  • \((a : b<\!\!\!< c : d) \equiv (\lnot a : \lnot b<\!\!\!< \lnot c : \lnot d)\)

Namely, \(a : b<\!\!\!< c : d\) is weaker than \(a : b\,{::}\,c : d\), while \(a : b\,{::}\,c : d\) holds if and only if both \(a : b<\!\!\!< c : d\) and \(c : d<\!\!\!< a : b\) hold; moreover, code independency is preserved.

The truth table of \(a:b<\!\!\!<c:d\) is given in Table 1. As can be seen \(a:b<\!\!\!<c:d\) holds true for the 6 patterns that makes analogical proportion true, plus the 4 patterns 0001, 0010, 1110, 1101. These latter patterns correspond to the 4 situations where \(a \equiv b\) and \(c \not \equiv d\). In these 4 situations a and b are indeed strictly closer than c and d, and these are the only cases in \(\{0,1\}\). Since the 4 situations where \(a \equiv b\) and \(c \equiv d\) are among the patterns making true \(a : b\,{::}\,c : d\), we have

$$\begin{aligned} a : b<\!\!\!< c : d\equiv (a : b\,{::}\,c : d) \vee (a \equiv b) \end{aligned}$$
(6)

It is also worth noticing that the central permutation property of analogical proportion now fails since 0010 and 1101 are true while 0100 and 1011 are false. This may be unexpected at first glance since the arithmetic proportion inequality, \(a-b \le c-d\), still satisfies central permutation in the numerical case; however it is made possible since \(a-b \in \{-1, 0,1\}\) and indeed \(0< 1 \Leftrightarrow -1 <0\).

Table 1. Boolean valuations for \(a:b<\!\!\!<c:d\)

Note that the quaternary relation \(a:b<\!\!\!<c:d\) induces a ternary relation (just as a continuous analogical proportion of the form \(a : b\,{::}\,b : c\) is a particular case of analogical proportion [13]). It can be seen that \(a : b<\!\!\!< b : c \) is true only for the four patterns 0000, 0001, 1110 and 1111, and false for the four other patterns. It expresses that the difference between b and c is greater or equal to the one between a and b.

3.2 Graded Case

The expression (5) can be extended to the multiple valued case, still keeping \(\min \) for extending the central \(\wedge \), \(1- \mid s-t\mid \) for the \(\equiv \) symbols, and the four expressions of the form \(s \wedge \lnot t\) as the bounded difference \(\max (0, s - t)\). The resulting expression is then

$$\begin{aligned} a : b<\!\!\!<_{\L } c : d = {\left\{ \begin{array}{ll} \min (1, 1- ((b - a) - (d-c)) \quad \text { if } a \le b \text { and } c \le d\\ \min (1, 1- ((a - b) - (c-d)) \quad \text { if }a \ge b \text { and } c \ge d\\ 1- (b-a) \quad \text { if } a \le b \text { and } c \ge d\\ 1-(a -b) \quad \text { if } a \ge b \text { and } c \le d \end{array}\right. } \end{aligned}$$
(7)

Thus \(a : b<\!\!\!<_{\L } c : d\) can be read “c is more different from d than a is from b”. It can be checked that the following expected properties still hold

  • \(a : b<\!\!\!<_{\L } c : d=a : b<\!\!\!< c : d\) when \(a,b,c,d \in \{0, 1\}\);

  • \(a : b<\!\!\!<_{\L } a : b=1\);

  • \(a : b\,{::}_{\L } c : d \le a : b<\!\!\!<_{\L } c : d\);

  • \(a : b\,{::}_{\L } c : d= \min ((a : b<\!\!\!<_{\L } c : d), (c : d<\!\!\!<_{\L } a : b))\);

  • \((a : b<\!\!\!<_{\L } c : d) = ((1-a) : (1- b)<\!\!\!<_{\L } (1- c) : (1 - d))\).

In particular, \( a : b<\!\!\!<_{\L } c : d =1\) if and only if

  • \(a=b\), or

  • \(\mid b - a\mid \ \le \ \mid d-c\mid \text { if } a \le b \text { and } c \le d\), or \(\text { if } b \le a \text { and } d \le c\).

Moreover \( a : b<\!\!\!<_{\L } c : d =0\) if and only if

  • \(\mid b - a\mid =1\) and \(\mid d-c\mid =0\), or

  • \(b-a =1\text { and } c \ge d\), or

  • \(a -b=1 \text { and } c \le d\).

It is worth noticing that \(a : b<\!\!\!<_{\L } c : d\) does not exactly amount at comparing absolute value distances, as in the constraint \(\mid a-b\mid \le \mid c-d\mid \). Indeed it can be checked that we may have \(a : b<\!\!\!<_{\L } c : d = 0\), while \(\mid a-b\mid \le \mid c-d\mid \) holds (taking \(a = d= 0\) and \(b=c=1\)). Moreover \(a : b<\!\!\!<_{\L } c : d\) provides a graded estimate of the extent to which the numerical constraint \(a-b \le c-d\) is satisfied.

Continuous analogical inequalities define the following graded comparative ternary relation:

$$\begin{aligned} a : b<\!\!\!<_{\L } b : c = {\left\{ \begin{array}{ll} \min (1, 1+(a +c) - 2b) \quad \text { if } a \le b \le c\\ \min (1, 1+ 2b - (a+c)) \quad \text { if }a \ge b \ge c\\ 1- (b-a) \quad \text { if } a \le b \text { and } b \ge c\\ 1-(a -b) \quad \text { if } a \ge b \text { and } b \le c \end{array}\right. } \end{aligned}$$
(8)

Note that \(a : b<\!\!\!<_{\L } b : c =1\) if and only if \(a=b\), or if \(b\le (a+c)/2\) (resp. \(b\ge (a+c)/2\)) if \(a \le b \le c\) (resp. \(a \ge b \ge c\)), i.e., if and only if b is closer (in the broad sense) to a than to c. It means that the difference between b and c is greater or equal to the one between a and b and the differences are oriented in the same way (when non zero).

Lastly, all the definitions considered in this paper apply to a single attribute. Just as in the case of the analogical proportion, the definitions straightforwardly extend to multiple attribute descriptions by applying them in a component-wise manner, attribute per attribute. If necessary, a global evaluation may be obtained by taking the average of the estimates obtained for each considered attribute.

4 Conclusion

The paper has provided a preliminary investigation of the idea of analogical inequality as a relaxation of the notion of analogical proportion, both in the Boolean case and in the multiple-valued case. It appears that this proper extension does not just amount at comparing differences (or distances) between the elements of two pairs, but, as in the case of the analogical proportion, it also takes into account the orientation of the variations when going from a to b, and from c to d. Moreover, it also provides a graded estimate of the extent to which “c is more different from d than a is from b”. This enables us to turn such a statement into a soft constraint, where the threshold corresponding to the minimal amount to which the constraint should hold might be a matter of learning in practice.