    # Simple Laws about Nonprominent Properties of Binary Relations

We checked each binary relation on a 5-element set for a given set of properties, including usual ones like asymmetry and less known ones like Euclideanness. Using a poor man's Quine-McCluskey algorithm, we computed prime implicants of non-occurring property combinations, like "not irreflexive, but asymmetric". We considered the non-trivial laws obtained this way, and manually proved them true for binary relations on arbitrary sets, thus contributing to the encyclopedic knowledge about less known properties.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

In order to flesh out encyclopedic articles1 about less common properties (like e.g. anti-transitivity) of binary relations, we implemented a simple C program to iterate over all relations on a small finite set and to check each of them for given properties. We implemented checks for the properties given in Def. 1 below. Figure 1 shows the C source code to check a relation R for transitivity, where card is the universe size and elemT is the type encoding a universe element.

This way, we could, in a first stage, (attempt to) falsify intuitively found hypotheses about laws involving such properties, and search for illustrative counter-examples to known, or intuitively guessed, non-laws. For example, Fig. 2 shows the source code to search for right Euclidean non-transitive relations over a -element universe, where printRel prints its argument relation in a human-readable form. For a universe of elements, for loops are nested. In Sect. 6.1 we describe an improved way to iterate over all relations.

Relations on a set of up to elements could be dealt with in reasonable time on a 2.3 GHz CPU. Figure 3 gives an overview, where all times are wall clock times in seconds, and “trqt” indicates the task of validating that each transitive binary relation is also quasi-transitive. Note the considerable amount of compile time,222 We used gcc version 7.3.0 with the highest optimization level. presumably caused by excessive use of inlining, deeply nested loops, and abuse of array elements as loop variables.

In a second stage, we aimed at supporting the generation of law hypotheses, rather than their validation.

We used a 5-element universe set, and checked each binary relation for each of the properties.333 For this run, we hadn’t provided checks for left and right quasi-reflexivity (Def. 1.4+5), but only for the conjunction of both, viz. quasi-reflexivity (Def. 1.6). As additional properties, we provided a check for the empty relation () and for the universal relation (). The latter were encoded by bits of a 64-bit word. After that, we applied a poor-man’s Quine-McCluskey algorithm444 See Quine (1952) and McCluskey Jr. (1956) for the original algorithm. (denoted “QMc” in Fig. 3) to obtain a short description of property combinations that didn’t occur at all. For example, an output line “~Irrefl ASym” indicated that the program didn’t find any relation that was asymmetric but not irreflexive, i.e. that each asymmetric relation on a 5-element set is irreflexive. Section 3 shows the complete output on a 5-element universe.

We took each printed law as a suggestion to be proven for all binary relations (on arbitrary sets). Many of the considered laws were trivial, in particular those involving co-reflexivity, as this property applies only to a relatively small number of relations (32 on a 5-element set).

A couple of laws appeared to be interesting, and we could prove them fairly easily by hand for the general case555 We needed to require a minimum cardinality of the universe set in some lemmas, e.g. Lem. 51 and 42. . For those laws involving less usual properties (like anti-transitivity, quasi-transitivity, Euclideanness) there is good chance that they haven’t been stated in the literature before. However, while they may contribute to the completeness of an encyclopedia, it is not clear whether they may serve any other purpose.

Disregarding the particular area of binary relations, the method of computing law suggestions by the Quine-McCluskey algorithm might be used as a source of fresh exercises whose solutions are unlikely to be found on web pages.

Some of the laws, e.g. Lem. 40, appeared surprising, but turned out during the proof to be vacuously true. The proof attempt to some laws gave rise to the assertion of other lemmas that weren’t directly obtained from the computed output: Lemma 4 was needed for the proof of Lem. 19, and Lem. 52 was needed for Lem. 42.

Our Quine-McCluskey approach restricts law suggestions to formulas of the form , where the quantification is over all binary relations, and is one of the considered properties or a negation thereof.

For an approach to compute more general forms of law suggestions, see Burghardt (2002); however, due to its run-time complexity this approach is feasible only for even smaller universe sets. In order to handle all relations on a 3-element set, a regular tree grammar of 512 nonterminals, one for each relation, plus 2 nonterminals, one for each truth value, would be needed. Using the encoding scheme from Fig. 4, the original grammar would consist of rules as sketched666 For sake of simplicity, only one unary and one binary operation on relations is considered, viz. symmetric closure and union . Only two properties of relations are considered, viz. reflexivity and symmetry . It should be obvious how to incorporate more operators and predicates on relations. By additionally providing a sort for sets, operations like , , restriction, etc. could be considered also. in Fig. 5. However, this grammar grows very large, and its -fold product would be needed if all laws in variables were to be computed.

The rest of this paper is organized as follows. In Sect. 2, we formally define each considered property, and introduce some other notions. In Sect. 3, we show the annotated output for a run of our algorithm on a 5-element set, also indicating which law suggestions gave rise to which lemmas. The latter are stated and proven in Sect. 4, which is the main part of this paper. In addition, we state the proofs of some laws that weren’t of the form admitted by our approach; some of them were, however, obtained using the assistance of the counter-example search in our C program. In Sect. 5, we discuss those computed law suggestions that lead to single examples, rather than to general laws. In Sect. 6, we comment on some program details.

This paper is a follow-up version of https://arxiv.org/abs/1806.05036v1. Compared to the previous version, we considered more properties (see Def. 1), including being the empty and being the universal relation, to avoid circumscriptions like “IrreflCoReflASym” in favor of “EmptyASym”; in the new setting, we found a total of law suggestions, and proved or disproved all of them. I am thankful to all people who have helped with their comments and corrections.

## 2 Definitions

###### Definition 1

(Binary relation properties) Let be a set. A (homogeneous) binary relation on is a subset of . The relation is called

1. reflexive (“Refl”, “rf”)   if   ;

2. irreflexive (“Irrefl”, “ir”)   if   ;

3. co-reflexive (“CoRefl”, “cr”)   if   ;

4. left quasi-reflexive (“lq”)   if   ;

5. right quasi-reflexive (“rq”)   if   ;

6. quasi-reflexive (“QuasiRefl”)   if   it is both left and right quasi-reflexive;

7. symmetric (“Sym”, “sy”)   if   ;

8. asymmetric (“ASym”, “as”)   if   ;

9. anti-symmetric (“AntiSym”, “an”)   if   ;

10. semi-connex (“SemiConnex”, “sc”) if   ;

11. connex (“Connex”, “co”) if   ;

12. transitive (“Trans”, “tr”)   if   ;

13. anti-transitive (“AntiTrans”, “at”)   if   ;

14. quasi-transitive (“QuasiTrans”, “qt”)   if   ;

15. right Euclidean (“RgEucl”, “re”)   if   ;

16. left Euclidean (“LfEucl”, “le”)   if   ;

17. semi-order property 1 (“SemiOrd1”, “s1”)   if   ;

18. semi-order property 2 (“SemiOrd2”, “s2”)   if   .

19. right serial (“RgSerial”, “rs”)   if

20. left serial (“LfSerial”, “ls”)   if

21. dense (“Dense”, “de”)   if   .

22. incomparability-transitive (“IncTrans”, “it”)   if   .

23. left unique (“LfUnique”, “lu”)   if   .

24. right unique (“RgUnique”, “ru”)   if   .

The capitalized abbreviations in parentheses are used by our algorithm; the two-letter codes are used in tables and pictures when space is scarce.

The “left” and “right” properties are dual to each other. All other properties are self-dual. For example, a relation is left unique iff its converse, , is right unique; a relation is dense iff its converse is dense.

We say that are incomparable w.r.t. , if holds. ∎

###### Definition 2

(Kinds of binary relations) A binary relation on a set is called

1. an equivalence   if   it is reflexive, symmetric, and transitive;

2. a partial equivalence   if   it is symmetric and transitive;

3. a tolerance relation   if   it is reflexive and symmetric;

4. idempotent   if   it is dense and transitive;

5. trichotomous   if   it is irreflexive, asymmetric, and semi-connex;

6. a non-strict partial order   if   it is reflexive, anti-symmetric, and transitive;

7. a strict partial order   if   it is irreflexive, asymmetric, and transitive;

8. a semi-order   if   it is asymmetric and satisfies semi-order properties 1 and 2;

9. a preorder   if   it is reflexive and transitive;

10. a weak ordering   if   it is irreflexive, asymmetric, transitive, and incomparability-transitive;

11. a partial function   if   it is right unique;

12. a total function   if   it is right unique and right serial;

13. an injective function   if   it is left unique, right unique, and right serial;

14. a surjective function   if   it is right unique and and left and right serial;

15. a bijective function   if   it is left and right unique and left and right serial. ∎

###### Definition 3

(Operations on relations)

1. For a relation on a set and a subset , we write for the restriction of to . Formally, is the relation on defined by for each .

2. For an equivalence relation on a set , we write for the equivalence class of w.r.t. . Formally, .

3. For a relation on a set and , we write for the set of elements is related to, and for the set of elements that are related to . Formally, and . ∎

## 3 Reported law suggestions

In this section, we show the complete output produced by our Quine-McCluskey algorithm run.

In the Fig. 6 to 13, we list the computed prime implicants for missing relation property combinations on a 5-element universe set. We took each prime implicant as a suggested law about all binary relations. These suggestions are grouped by the number of their literals (“level”).

In the leftmost column, we provide a consecutive law number for referencing. In the middle column, the law is given in textual representation, “P” denoting the negation of P, and juxtaposition used for conjunction. The property names correspond to those used by the C program; they should be understandable without further explanation, but can also be looked up via Fig. 42, if necessary. In the rightmost column, we annotated a reference to the lemma (in Sect. 4) where the law has been formally proven or to the example (in Sect. 5) where it is discussed.

For example, line 039, in level 2 (Fig. 6 left), reports that no relation was found to be asymmetric (property 1.8) and non-irreflexive (negation of property 1.2); we show the formal proof that every asymmetric relation is irreflexive in Lem. 13.1.777 A warning about possible confusion appears advisable here: In the setting of the Quine-McCluskey algorithm, a prime implicant is a conjunction of negated and/or unnegated variables. However, its corresponding law suggestion is its complement, and hence a disjunction, as should be clear from the example. Where possible, we used the term “literal” in favor of “conjunct” or “disjunct”.

Laws that could be derived from others by purely propositional reasoning and without referring to the property definitions in Def. 1 are considered redundant; they are marked with a star “”.888 We marked all redundancies we became aware of; we don’t claim that no undetected ones exist. For example, law 044 (“no relation is asymmetric and reflexive”) is marked since it follows immediately from 046 (“no relation is irreflexive and reflexive”) and 039.

No laws were reported for level 1 and level 9 and beyond.   A text version of these tables is available in the ancillary file reportedLaws.txt at arxiv.org.

In Fig. 14 to 17, we summarize the found laws. We omitted suggestions that couldn’t be manually verified as laws, and suggestions marked as redundant.

Figure 14 and 15 shows the left and right half of an implication table, respectively. Every field lists all law numbers that can possibly be used to derive the column property from the row property.

For example, law 129 appears in line “tr” (transitive) and column “as” (asymmetric) in Fig. 14 because that law (well-known, and proven in Lem. 12.2) allows one to infer a relation’s asymmetry from its transitivity, provided that it is also known to be irreflexive.

Fields belonging to the table’s diagonal are marked by “X”. Law numbers are colored by number of literals, deeply-colored and pale-colored numbers indicating few and many literals, respectively.

Similarly, the table consisting of Fig. 16 and 17 shows below and above its diagonal laws about required disjunctions and impossible conjunctions, respectively.

For example, law 223 appears below the diagonal in line “co” (connex) and column “em” (empty) of Fig. 16, since the law (proven in Lem. 29) requires every relation to be connex or empty, provided it is quasi-reflexive and incomparability-transitive.

Law 145 appears above the diagonal in line “le” (left Euclidean) and column “lu” (left unique), since the law (proven in Lem. 45) ensures that no relation can be left Euclidean and left unique, provided it isn’t anti-symmetric.

Figure 18 shows all proper implications (black) and incompatibilities (red) from level 2, except for the empty and the universal relation. Vertex labels use the abbreviations from Fig. 14, edge labels refer to law numbers in Fig. 6.