Logical reduction of relations:
from relational databases to Peirce’s reduction thesis
Sergiy Koshkin
Department of Mathematics and Statistics
University of Houston-Downtown
One Main Street
Houston, TX 77002
e-mail: koshkins@uhd.edu
Abstract
We study logical reduction (factorization) of relations into relations of lower arity by Boolean or relative products that come from applying conjunctions and existential quantifiers to predicates, i.e. by primitive positive formulas of predicate calculus. Our algebraic framework unifies natural joins and data dependencies of database theory and relational algebra of clone theory with the bond algebra of C.S. Peirce. We also offer new constructions of reductions, systematically study irreducible relations and reductions to them, and introduce a new characteristic of relations, ternarity, that measures their ‘complexity of relating’ and allows to refine reduction results. In particular, we refine Peirce’s controversial reduction thesis, and show that reducibility behavior is dramatically different on finite and infinite domains.
We study decomposition of relations into simpler relations by logical operations expressible in terms of conjunctions and existential quantifiers on predicates, i.e. by primitive positive formulas of predicate calculus [22]. Such analysis goes back to the work of C.S. Peirce at the dawn of algebraic logic, see [7, 9, 21] for modern accounts. However, while some aspects of it have been developed by Schröder, Löwenheim, Tarski, and others [10], they gradually shifted the focus to predicates in formal theories and questions of axiomatization. On the other hand, decomposition of relations in algebras of relational clones or co-clones is closely related to Peirce’s, but was developed independently of his work, from Post’s study of the dual decomposition of functions on finite sets, see [23, 33]. Peirce’s results were largely forgotten until modern formalizations of his bond algebra in [8, 17].
The original interest was linguistic and philosophical. A different stimulus came from the relational database model introduced by Codd [12], and developed by Fagin [16], Rissanen [34], and others. It featured weaker than Peirce’s, but closely related, notion of decomposition. Unfortunately, the two streams of literature remained largely disjoint. This paper is, in part, a unified survey of classical but little known (to logicians and mathematicians) results and their interconnections, and, in part, their extension by the author.
From the mathematical perspective, join decomposition of relations is somewhat analogous to factorization of polynomials. There is even a ready analog of polynomial’s degree that measures its ‘multiplicative complexity’ – relation’s arity (adicity, rank), the number of its attributes (places, positions). There is an even stronger analogy to the recent theory of factorization in highly non-cancellative monoids with degree-like height function [37]. Accordingly, we will call decomposition terms factors, and call decompositions reductions when all the factors have strictly lower arity than the relation itself.
A technical device of database theory that we will extensively use in this paper is the calculus of attributed relations (the term is due to [38], see also named perspective in [1, 3.2]). Those are collections of maps from a set of attributes, called the relation scheme, to the domain, rather than ordered lists of domain elements, as in ordinary set-theoretic relations. This allows us to identify positions in different relations through relation schemes, the same flexibility one gets by placing the same variable into different predicates in logical formulas, and removes much of combinatorial clutter that plagues definitions and calculus of operations on ordinary relations (compare to [8, 14]). Moreover, operations on attributed relations have better algebraic properties.
For example, the Cartesian product is commutative and associative on attributed relations, albeit only partially defined: relations that share attributes cannot be multiplied. What we get by extending it to all attributed relations is classically known as Boolean product, and it is still commutative and associative. In logical terms, it amounts to taking conjunctions of predicates with some variables identified instead of only free conjunctions. In predicate calculus, such expressions are called quantifier-free primitive positive formulas [22]. Its iteration, called the natural join, is the primary operation of the database theory. The reason is that join decompositions are closely associated with various data dependencies, and can be used to store, query and update the data more efficiently [2, 3, 16, 24, 28, 34].
We start by reviewing some known join reduction methods that rely on exploiting various dependencies among relation’s tuples. The simplest one is functional dependency, when there is an attribute, called key, whose value determines the rest of its tuple (ID columns play this role in database tables). However, despite the abundance of reduction methods, it turns out that join irreducible relations also abound. Not only are there ones of arbitrarily high arity, but also ‘almost all’ relations are join irreducible on large domains (Theorem 8). Although this fact must have been known to experts, the author did not encounter it stated in print.
Thus, join reduction is analogous to factorization of polynomials over the field of rationals, with irreducibles of arbitrarily high degrees. This prompts one to look for extensions with a more manageable set of irreducibles. However, in line with the literature on the subject, rather than enlarging the class of relations we opt for stronger algebra on the same class. The stronger operation is projective join (projoin for short) that combines join with projections. In logical terms, we allow to existentially quantify (‘project out’) some variables in predicate conjunctions, i.e. consider all primitive positive predicate formulas.
While some project-join algebras have been studied in the more theoretical database literature [15, 38], they appeared much more prominently in the theory of constraint satisfaction problems (CSP) that also dates back to 1970s. The constraints are expressed by relations on finite domains, and the problems are to decide whether relations from a given set can simultaneously hold on some elements of the domain (be satisfied). Computational complexity of CSP was actively studied in computer science, and in 1978 Schaefer discovered a deep connection between it and closure properties of sets of relations under projective joins on -element domains [35]. The work initiated by Feder-Vardi and Jeavons in 1990s extended this connection to all finite domains, giving rise to what is now called the algebraic approach to complexity of CSP [6]. In particular, it turned out that if constraints are projoin complete, i.e. generate all relations, then the CSP is NP-complete (assuming PNP). In general, projoin closures of relations are called relational clones or co-clones, and Schaefer characterized NP completeness in terms of them on -element domains. They are dual to the functional clones of Post and studied since 1960s [23, 33]. Join closures, called weak partial co-clones, also found applications to studying complexity of CSP, namely to refined complexity classification of NP-complete problems [20].
The projoin reduction problem on finite domains can be reformulated as asking whether the set of all unary and binary relations is projoin complete, i.e. whether they generate the co-clone of all relations. In hindsight, the affirmative answer to the same question on infinite domains goes back to Peirce. The proof device, introduced by Peirce under the quaint name of ‘hypostatic abstraction’, amounts, in database terms, to attaching key attribute(s) to the relation, and then projecting them out after join reducing the augmented relation (Theorem 9). Reducibility of all relations to unary and binary ones is more analogous to factorization of polynomials over the field of real numbers, where they reduce to linear and quadratic factors.
Counterintuitively, the situation is much more complex on finite domains, and we introduce some further devices that allow to projoin reduce some relations when hypostatic abstraction does not (Section 5). They exploit the connection between projections and unions (existential quantification and disjunction). In particular, we generalize to projoins Fagin’s characterization of certain joins in terms of multivalued dependencies (Theorem 11), and show how to convert complements (negations) of certain joins into projoins. However, we do not resort to a central device of clone theory, the Pol-Inv Galois connection [6, 23], as our approach is to develop the more elementary Peircean methods that construct reductions explicitly.
While projection and join can be conveniently folded into a single projoin operation, this operation is not an iteration of any binary operation, like Cartesian product and join were. However, one can iterate a particular binary projoin classically known as relative product [7] (composition of binary relations is its restriction to them). Relative product is associative only on a restricted class of factors, and generates only an (ostensibly) narrow subclass of projoins, which we call bonds following [17].
The bond algebra is, more or less, Peirce’s project-join algebra. In a surprise, he established that bond reducibility is almost equivalent to general projoin reducibility. All relations of arity and higher are projoin reducible if and only if they are bond reducible, and it is only on ternaries (ternary relations) that the two notions diverge (Theorem 13). There are some projoin reducible but bond irreducible ternaries, notably the teridentity relation that contains all and only identical triples of domain elements and plays a key role in converting projoins into bonds. Bond reducibility of all relations on infinite domains to unaries, binaries and ternaries is known as Peirce’s reduction thesis (see Theorem 19 for a precise formulation), and it is equivalent to the better known projoin reducibility to binaries alone, see e.g. [27]. The seeming discrepancy fueled a long historical controversy [9, 21].
Motivated by the thesis, we introduce the notion of ternarity of a relation as the minimal number of ternaries in its bond reductions to unaries, binaries and ternaries, and study its properties. The reason for singling out ternaries is that they do the main work of ‘relating’ different attributes in a relation as represented by reductions. We establish a close connection between complete bond reductions and subcubic graphs, and prove that ternarity of non-degenerate -ary relations is always on infinite domains (Theorem 16), one unit of ternarity per unit of arity over . This refines the original reduction thesis. The proof uses graph-theoretic methods, pioneered by Peirce and prominent in the recent work on reduction [13, 14]. A counterexample then shows that on finite domains this equality can fail already for , and we prove that it fails for ‘almost all’ relations on large finite domains.
The paper is organized as follows. Section 1 introduces our terminology and notation. In Sections 2-3 we review some standard results on Cartesian products and natural joins, stated in terms of attributed relations, and add results on join irreducibility. Sections 4-5 introduce projective joins (projoins) and associated reduction methods, old and new, including the hypostatic abstraction that settles the reduction problem on infinite domains. The irreducibility results are weaker for projoins, and only concern some restricted classes of them. We also explain why reduction behavior is so different in finite and infinite cases. In Section 6 we introduce Peirce’s bonds, and explain his algorithm for converting projoins into them that features teridentity. Peirce’s reduction thesis is then derived as a corollary of the results for projoins. Section 7 defines projoin graphs and bonding diagrams that allow us to apply graph-theoretic methods to bond reductions in Section 8, which studies complete reductions and introduces ternarity. In Section 9 we use ternarity to refine Peirce’s reduction thesis and give some counterexamples. In the last section, we summarize our conclusions and state some open problems.
1 Preliminaries
We use the standard set-theoretic notation and terminology for sets and relations [25]. Relations are defined on a set called the domain and are subsets of its Cartesian powers . When the number is called the relation’s arity and the relation is called -ary relation or simply -ary used as a noun. For we use the shorthands unary, binary, ternary, quaternary, respectively.
Elements of are called -tuples or just tuples, when is understood or immaterial. If it’s -th member is denoted . We adopt the usual convention of canonically identifying tuples of tuples with longer tuples, and hence of identifying with , and so on. It is often convenient to interpret tuples as maps from the set of relation’s positions to .
Some standard -aries that can be defined on any domain will be called and denoted as follows: the empty relations with no tuples; the universal relations that contain all possible -tuples; the identity relations that contain all and only -tuples with identical members; and the diversity relations that contain all and only -tuples with pairwise distinct members. Each of those can be relativized to proper subsets that we will indicate by the upper index, e.g. contains all and only -tuples with identical members from .
The set of all maps from to is denoted , the set of all subsets of is denoted , and its cardinality is denoted . As is well known, , , and .
Attributed relation is a subset [13, 15, 38], where is a set called the relation scheme, and its elements are called attributes. The arity of is defined to be , and its elements, which are now functions from to , are also called tuples. We only consider finitary relations, so is always finite, the ordinary relations correspond to . When is linearly ordered, e.g. , there is a canonical - correspondence between and obtained by listing elements of in order, which induces a canonical - correspondence between relations on the scheme and ordinary relations.
When we will denote the attributed subtuple of consisting of its members in the positions. When , and , with , we define their concatenation as the union of ordered pairs when they are taken as functions from to . The intersection condition is needed for the union to also be a function, and the concatenation is always defined when are disjoint. When the members of the concatenated tuple are listed according to the order of their attributes in . For example, assuming .
In the database model relations are visualized as rectangular tables with columns labeled by positions (attributes) and rows listing the tuple members. Database queries are then interpreted as operations on relations that extract relevant information and package it into simpler relations. Two operations inspired by this interpretation will be useful to us. The first is projection to a subset of positions :
that simply deletes all non- columns and removes duplicate tuples, if any, in the remaining columns.
When no confusion results, we write simply instead of .
The second operation is selection over a subset:
(1)
that leaves only rows with prescribed values in the columns (given by ), and then deletes those columns. Here is the complement of . Note that both and are attributed relations on the schemes , respectively.
Unless otherwise stated, all predicates will be interpreted on a domain, and relations will be identified with the predicates they interpret. In particular, the same letter will be used for a relation and its predicate, i.e. will mean the same as , and will denote the complement of in . This identification is convenient because attribution maps are naturally expressed in predicates by placing the same variables into multiple positions.
The same notational conventions apply to tuples of variables as to tuples of values, e.g. is the subtuple of variables with the indices from , is the concatenation of variable tuples, etc. The standard logical operations, conjunction , disjunction , etc., will be used with the usual meaning, and for the multiple quantification will be abbreviated as . With these conventions and in terms of predicates, the projection is expressed simply as , and the selection as . For example, , and .
2 Cartesian Products
The simplest way a relation decomposes into lower arity ones is when it is a Cartesian product of them. We need a slight generalization so that the relation does not cease to be a Cartesian product simply because its positions are permuted. This is taken care of when using attributed relations. We give the definition directly for any finite number of factors, but one can see that it comes from iterating the binary product. Recall that a partition of a set is its representation as a disjoint union of subsets.
Definition 1.
Given disjoint finite subsets and attributed relations , their Cartesian product is the set of concatenations of tuples from :
A relation is a Cartesian product over a partition when there exist such that , and are called its Cartesian factors. It is called degenerate when it is a Cartesian product over a partition with and all , and it is called -aric when all factors have the same arity .
We reiterate that, on this definition, Cartesian factors are attributed relations, and is not their Cartesian product in the ordinary sense, but rather some permutation of it. By definition, Cartesian factorization is a reduction because all have smaller arity , and when it exists, the factors are none other than the projections .
The definition is more straightforward in terms of predicates, it means that the predicate of is a free conjunction of lower arity predicates:
(2)
The following is a characteristic property of Cartesian products.
Theorem 1(Independence criterion).
A relation is a Cartesian product over a partition if and only if the values of its tuples on can be chosen independently, i.e. for any collection of there exists a common such that .
Proof.
Let be a Cartesian product over . If then holds for all , and hence holds. But by (2) this means that holds for the concatenation . Thus, and .
Conversely, suppose that satisfies the independence condition over . If then by definition of projection, so . On the other hand, if then , and, by the independence condition, there is a common with . Since form a partition we have . Thus, and they are equal.
∎
Note that if we assign equal probability to all tuples of degenerate over a partition then will be statistically independent random vectors on this sample space [29].
When testing for degeneracy it is sufficient to consider bipartitions only. Indeed, if can be split into several factors then we can always group them into just two non-trivial factors, say, the first one and the product of the rest.
Example 1.
The independence criterion can be used directly to establish degeneracy or non-degeneracy of some relations. Clearly, all unary relations are non-degenerate on any domain. On domains with the identity relations are non-degenerate for . Indeed, constant tuples for any . If were degenerate, we could, by independence, assign constant values to some and constant values to others. But if their concatenation will not be in , contradiction.
Similarly, for the diversity relations are non-degenerate ( for ). Indeed, any diverse (with no equal values) subtuple is in the projection of to any proper subset of positions. But subtuples over disjoint subsets of positions can share values, and their concatenation will not be in .
The following simple proposition gives two sufficient conditions of non-degeneracy that are easier to check in examples.
Theorem 2.
Suppose one of the following conditions holds for a relation .
(i) is not universal, but for any non-empty proper subset
we have .
(ii) is not empty, but for any we have .
Then is non-degenerate.
Proof.
(i) According to (2), is a conjunction of with proper subsets . Since each projection is universal, by assumption, so must be their conjunction, contradiction.
(ii) Let be arbitrary. If is a product negating (2) we obtain, by the de Morgan law:
Since is not empty so is one of the disjuncts, say . Pick some and some , which exists because is proper, and set , , then assign values for with arbitrarily. By construction, holds and hence so does because is a disjunction of . But was arbitrary, and so , contrary to the assumption.
∎
Example 2.
By Theorem 2 (i), the non-identity relations with any are non-degenerate (they trivially are for ) when . Indeed, is universal for any non-empty proper because any tuple constant over can be complemented by assigning a different value on , and non-constant tuples can be complemented arbitrarily, with the result in in both cases.
The above reasoning no longer applies to for a non-empty proper subset of . However, for any by assumption, and is non-degenerate by Theorem 2 (ii). In particular, by picking we see that is non-degenerate for any when .
The above examples already show that there are non-degenerate relations of arbitrarily high arity. Therefore, the situation with Cartesian factorization is similar to factorization of polynomials over with irreducible polynomials of arbitrarily high degrees. The next theorem shows, by a counting argument, that, as far as reductive power is concerned, the situation is even worse – ‘almost all’ relations are non-degenerate.
Theorem 3.
The share of degenerate -ary relations among all such relations on a domain asymptotically vanishes when and , or when and .
Proof.
The set of all -ary relations on is , so their total number is . For any degenerate relation there is a non-empty proper subset such that it is a Cartesian product over the bipartition , and every bipartition is counted twice by due to the symmetry between and . There are subsets of with , and we can assign and different relations to each of the Cartesian factors. Of course, some of the products obtained in this way may coincide, so we only get an upper bound for the total number of degenerate relations:
By calculus, the function on takes its maximal values at the endpoints when , so for all . Therefore,
(3)
because . The conclusions now follow by applying calculus to the fraction .
∎
3 Joins and dependencies
As far as analysis of relations is concerned, Cartesian products do not take us very far. Asymptotically, in either domain size or arity, almost all relations do not factor into them. A natural move is to consider more general decompositions. In terms of predicates, Cartesian products correspond to free conjunctions, so let us allow conjunctions that are not necessarily free, i.e. some variables in them are identified. This leads to the notion of natural join, or join for short, introduced by Codd in the context of relational databases [12]. Its binary version, Boolean product, goes back to the 19th century [7]. Our definition of join parallels the definition of Cartesian product, the only difference is that the relation schemes no longer have to form a partition of , only a cover.
Definition 2.
Given finite subsets and attributed relations , their (natural) join is defined as the set of concatenations of tuples from that match on overlaps of :
A relation is a (natural) join over a cover when there exist such that , and are called its join factors. It is called join reducible when .
As the notation indicates, join of multiple factors is obtained by iterating Boolean product . On attributed relations Boolean product is commutative and associative, just like Cartesian product, because ordering of positions does not get in the way.
In terms of predicates, joins are just conjunctions of predicates over subsets of variables with some variables shared among them:
(4)
This formula looks exactly like the free conjunction (2), except now may overlap, e.g. is a join. In mathematical logic, joins of predicates are called quantifier-free primitive positive formulas, and join closures are called weak partial co-clones in CSP literature [20, 22].
Note that (4) no longer implies that , as it did for Cartesian products. This is because some tuples in may not have companion tuples in other consistent with them on overlaps, and do not make it into the join. However, (4) remains valid if we replace by because all and only joinable tuples are present in the projections. In this weakened sense, joins share the constructive property of Cartesian products – their (minimized) factors can be recovered as projections of the join itself, as pointed out by Rissanen [34]. When the join factors contain only joinable tuples they are said to join completely [28, 2.4].
There is also an analog of the independence criterion for Cartesian products [24].
Theorem 4(Join criterion).
A relation is a join over a cover if and only if the values of its tuples on can be chosen independently up to consistency on overlaps, i.e. for any collection of with there is common such that .
The proof is analogous to the proof of Theorem 1 and we omit it.
Unfortunately, this criterion is not nearly as useful in detecting either join reducibility or irreducibility. More constructive reducibility conditions are usually formulated in terms of data dependencies [3, 16, 24, 28, 30], the simplest of which is functional.
Definition 3.
Let . We say that a relation has a functional dependency when its values determine its values, i.e. for any if then . When for some then K is called a key of , and more precisely a , where .
In databases, key column(s) are those whose entries determine the entire record, for example, the ID column. This situation was prototypical for choosing the terminology, the key column(s) code objects the relation is about, and the rest list their attributes. What matters to us is that availability of keys ensures join reducibility: instead of relating all attributes to their objects in a single relation we can relate them one at a time. The idea goes back to the work of Peirce and is in close affinity to his “hypostatic abstraction” (see [9, 21] and Section 4).
Theorem 5.
Any with a -key decomposes into a join of -aries as
(5)
where . In the predicate form,
(6)
In particular, is join reducible when , and join reducible to binaries when .
Proof.
Without loss of generality, we may rename the attributes into integers and assume , . Suppose , then for any the subtuple because it is the projection of to . Hence .
Now suppose , i.e. for all . By definition of , there must be tuples with for and . But the first positions are a key, and all coincide on them with , therefore, .
∎
Example 3.
In the identity relation every position is a -key. Taking and applying (6), we get the familiar reduction to binaries
Example 4.
The division with remainder quaternary ( with the dividend, the divisor, the quotient and the remainder) on has a -key consisting of the dividend and the divisor. Therefore, it reduces to the join of two ternaries: , where is the floor function, and .
Functional dependency is not necessary for join reducibility, not even by join decompositions of the special form (5)-(6). This is fortuitous because it is a rare occurrence, just like its polar opposite, Cartesian independence of values, and we could not join reduce many relations if it was required.
Example 5.
Consider the ternary on given by the table below.
=
=
=
Since is repeated in the first column the latter cannot be a key. Nonetheless, is a join of the form (6): , with the factors as shown above. This is because all possible combinations are present in in the second and third position after . As a result, is a Cartesian product of unaries, and so is over the same partition (trivially, as a singleton).
The above example illustrates a more general dependency introduced by Delobel, Fagin and Zaniolo around 1977 [28, 7.11], the multivalued dependency.
Definition 4.
Let be a partition. We say that an has a multivalued dependency when for all the selections are Cartesian products over the common partition . When are singletons for all then is called a multikey of , and, more precisely, a when .
Note that both functional dependency and Cartesian independence (with ) are special cases of multivalued dependency. It turns out that such dependency is both necessary and sufficient for join decompositions of the special form (7)-(8), when the same attributes are shared by all factors.
Let be a partition. An has a join decomposition of the form
(7)
where , or, equivalently,
(8)
if and only if is a multivalued dependency in .
Proof.
One direction is trivial, if is of the form (8) then substituting turns it into a free conjunction since are disjoint. For the other direction, let and note that for any we have
(9)
with some , by definition of Cartesian product over a partition. It remains to set
when and (false) otherwise to get (8).
∎
Multivalued dependency reductions are popular in database design due to their constructive nature, but they do not exhaust all possible join reductions. For example, the diversity relation can be join reduced even to binaries, but not in the form (8):
(10)
However, the more complex a dependency the harder it is to detect and use to produce reductions. The definition of join dependency, for example, amounts to just saying that the relation is a join (but see [30] for a somewhat more cogent characterization).
Be it as it may, we will now show that even taking all possible join reductions into account there are still irreducible relations of arbitrarily high arities. To this end, we observe that the proof of Theorem 2 did not use the fact that form a partition, and so goes through for join reductions without a change. Therefore, its conclusion can be strengthened.
Theorem 7.
Suppose one of the following conditions holds for .
(i) is not universal, but for any non-empty proper subset
we have .
(ii) is not empty, but for any we have .
Then is join irreducible.
The reasoning from Example 2 now shows that and for non-empty proper are join irreducible for any and . Worse yet, join reductions leave asymptotically ‘almost all’ relations irreducible, albeit not in as strong a sense as Cartesian factorizations.
Theorem 8.
The share of join reducible -ary relations among all such relations on a domain is for , and asymptotically vanishes when and .
Proof.
Suppose is join reducible to a conjunction (4). We can always interpret as having attributes from any superset by conjoining it with the universal relation on the scheme . Since all are proper subsets of each of them is contained in one of with . Therefore, after merging predicates with identical schemes if necessary, we can represent in the form (see [30])
There are such and choices for each . Some of them may be incompatible, so we get an upper bound on the number of join reducible relations: . The conclusions now follow by applying calculus to the fraction
(11)
∎
Note that if is fixed and the ratio in (11) goes to , not to , so we cannot conclude that increasing arity on a fixed domain also leads to a vanishing share of join reducible relations, as we could for degenerate ones in Theorem 3.
4 Projective joins and hypostatic abstraction
As noted by Rissanen [34], joins are the most general form of decomposition where the constituents can be recovered by taking projections. Yet they still admit irreducibles of arbitrarily high arity, and many of them. If we want a more manageable collection of irreducibles we need to relax the constructivism. There is also a more practical reason. When relations are entered into databases the expected data dependencies are often prescribed by design. What if potential entrants do not have them? They are then “pre-treated” before incorporation to mend that. For example, full names are expected to function as relation keys, but identical namesakes do occur sometimes. This is mended by attaching ID columns to the tables that restore uniqueness (and hence, functional dependency).
Such pre-treatment is often done “under the desk”, but it is of interest to develop its devices systematically. Attaching a key appears already in C.S. Peirce’s works on relations from 1890s under the name of “hypostatic abstraction” [8, 9]. Consider the ternary relation “ gives to ”. To reduce it to binaries, Peirce introduces (“hypostatizes”) new abstracted objects , the acts of giving, and treats , and as their attributes, the giver, the gift, and the recipient. If we denote their relations to the object by , and , respectively, then we can form a key-form join that carries all the information of . Except it also features the acts of giving that are not among the original attributes. What we really need to say is that there is such an act for given , and :
(12)
This is a reduction of sorts, but it is no longer a join, rather a projection of a join. Its factors cannot be recovered from even if we know their relation schemes because of the freedom in assignments. But it does fit well with the algebraic ideology of joins: first, we represent a given as a projection of a higher arity relation , and then factor into a join. While the factors are not projections of , they are projections of , as is itself.
Definition 5.
The projective join, or just projoin, of attributed relations with the set of projected attributes is , i.e. the projection of their (natural) join to .
A relation is a projoin over a cover with when there exist , called its projoin factors, such that
The join is called the augmented relation, and elements of T (projoin) parameters. is called projoin reducible when it is a projoin with .
The corresponding predicate formula for projoins is:
(13)
It is more typical to consider reductions in the algebra with two separate operations, join and projection, and project-join expressions are studied in [15, 38] and are part of a link between the relational model and Tarski’s cylindric algebras [10, 18]. In terms of predicates, passing from joins to projoins means that in reductions we allow existential quantification on top of conjunction and identification of variables, i.e. consider primitive positive expressions (assuming the binary identity is among the available predicates). Up to switching from attributed to ordinary relations, the projoin reduction is essentially equivalent to reduction in the relational (co-clone) algebra of clone theory [14, 23, 33]. As such, it plays a key role in characterizing complexity of constraint satisfaction problems (CSP), and the study of generating sets of small arity in connection with them can be applied to solving Peircian reduction problems on finite domains [5].
Just as join dependencies can be expressed using joins, generalized data dependencies can be expressed using project-join equations [38]. With projoins, one can use the flexibility of augmenting the relation to make the decomposition methods for joins more broadly applicable. The simplest method used a key, but whether a relation has a key is, in some ways, a bookkeeping matter. This is another reason for moving from joins to projoins.
Definition 6.
We say that a relation admits a key (multikey) when it is a projection of a relation with a key (multikey), i.e. .
Admitting a key is less of a bookkeeping matter than already having it. Note that T need not be the key in itself, the key may combine T with some attributes from the original relation. However, whether admits a key or not does not depend on which attributes are used in it.
Lemma 1.
A relation admits a -key if and only if .
Proof.
Suppose and is a key of with . Since there are at most distinct tuples in the K positions of , and they determine the remaining values, . But projection never increases the cardinality of a relation, so .
Conversely, suppose . Then we can pick any T of cardinality with unused attributes, and assign to every tuple in a unique label . We define as the set of augmented tuples . By construction, the first positions of are its key and .
∎
Recall from the previous section that relations with a -key are quite rare on finite domains. A striking consequence of this lemma is that on infinite domains, any relation admits a -key. Indeed, by the cardinal arithmetic, for any finite , so for any -ary relation on . The next theorem generalizes Peirce’s trick (12) for the relation of giving and connects it to relation keys, see also [8] for the general case.
Theorem 9(Hypostatic abstraction).
Any with decomposes into a projoin of -aries as
(14)
where for some with . In the predicate form,
(15)
In particular, is projoin reducible when , and projoin reducible to binaries when .
Proof.
The augmented relation is constructed in the proof of Lemma 1. Since the augmented attributes T are its -key, by construction, the decomposition formula (14) follows from Theorem 5. In (15) we specialized to for concreteness, and ordered so that the T positions go before the original ones.
∎
Hypostatic abstraction radically simplifies the picture of reducibility on infinite domains, and delivers a “small” set of irreducibles that eluded us with Cartesian products and joins. As we mentioned, this is similar to factorization of polynomials over , where the only irreducible ones are linear and quadratic.
Corollary 1.
Any -ary with on an infinite domain reduces to a projoin of binaries. The only projoin irreducible relations on such domains are all unaries and non-degenerate binaries.
Proof.
The first claim is a direct consequence of cardinal arithmetic for infinite and Theorem 9. Unaries have nothing to be reduced to. Binaries can only be reduced to unaries. But quantifying over a conjunction of unary predicates still produces a conjunction of unary predicates. Since unaries have only one variable each it is a free conjunction, i.e. an unaric Cartesian product. Thus, projoin reducible binaries must be degenerate.
∎
Löwenheim might have been the first to state and prove this result in a more formal manner in 1915 [27]. His proof used somewhat more cumbersome iterated pairing construction instead of hypostatic abstraction. In fact, the result is even stronger than stated. Recall that projoins are ranked by the number of parameters, with joins having none, -key hypostatic reductions like (12) having one, and so on. It follows from the proof that all higher arity relations are not only projoin reducible on infinite domains, but even projoin reducible with a single parameter. This is not the case on finite domains, as we will now demonstrate.
Example 6.
Consider on a finite domain . If it is projoin reducible then factors without augmented attributes can be dropped. Indeed, in the predicate representation (13) those factors can be taken out of the scope of quantifiers, and each carries a proper subset of ’s variables. But is universal on any proper subset of its positions, and hence so must be those factors since they enter conjunctively. Lower arity factors can be absorbed into those of arity , so for any projoin reduction with one parameter condenses to just this
(16)
We will now restrict to a two-element domain . Then can only take two values, and, recalling the interpretation of the existential quantifier, (16) represents as a disjunction of two unary conjunctions, i.e. a union of two unary Cartesian products. Possible cardinalities of such products on a two-element domain are and . But is impossible because , and comes from a product of two doublets and a singleton. But a product of two doublets will include both and , so multiplying it by any singleton will produce a constant tuple not in . So is also impossible. As for and , no pair of them can cover all tuples of .
Thus, on two-element domains is not projoin reducible with only one parameter. A similar counting argument works also for . For larger combinatorial considerations of this sort quickly become unmanageable. For even single parameter projoin reductions are no longer of the simple form (16), as free variables can be shared and need not be a union of Cartesian products, see Example 8.
A counting argument similar to that of Theorem 8 further shows that the reducibility behavior on finite domains is quite different.
Theorem 10.
The share of -ary, , relations projoin reducible with parameters among all such relations on a domain is for , and asymptotically vanishes when .
Proof.
As in the proof of Theorem 8, we transform the projoin into a form with factors of maximal possible arity in a reduction, . Only this time, due to the augmented positions, their total number is rather than (to which it reduces for ). The rest of the proof is analogous, and leads to as the upper bound for the share.
∎
What are we to make of such a striking discrepancy between reducibilities on finite and infinite domains? The universal applicability of hypostatic abstraction on infinite domains derives directly from non-constructive and ‘unnatural’ bijections between and its Cartesian powers. By a theorem of Tarski [19, 11.3], for all infinite is equivalent to the axiom of choice. Perhaps, it is of interest to consider reduction in models of set theory where availability of such bijections is restricted and the hierarchy does not collapse, such as ZF models with Dedekind finite sets, or to restrict maps allowed in definitions of reducing relations directly. These may model relations on large finite domains better than do all relations on infinite domains of ZFC.
5 Projections as unions
As the results of the previous section show, reductions more general than (14)-(15) are still of interest on finite domains. Indeed, they may be of interest even on infinite domains as analyses of relations alternative to hypostatic abstraction. In this section we build on the relationship between existential quantification (projection) and unions exploited in Example 6 to construct such reductions. It is more technical than the rest of the paper and can be skipped without loss of continuity. We start by giving a projective version of Fagin’s theorem.
Theorem 11.
An has a projoin decomposition of the form:
(17)
where for some partition , or, in the predicate form,
(18)
if and only if it is a union of Cartesian products over the common partition with no more than terms.
Proof.
Suppose with . Then, by Fagin’s theorem, there is a multivalued dependency in . But then, by definition, for all the selections are Cartesian products over , and
Since the number of terms in the union is no more than .
Conversely, suppose is a union of Cartesian products over with no more than terms. Select a distinct for each term and label its term . Then define
By construction, , and since are Cartesian products over we have . Now Fagin’s theorem gives the desired decomposition of .
∎
Theorem 11 underscores a close relationship between projection and union, in predicate terms, between existential quantification and disjunction. One can represent existentially quantified formula as a disjunction by moving quantified variables into an index, as in . For finite relations, existential quantification can be converted into disjunctions completely. However, there are two limitations on such disjunctions. First, the number of disjuncts is limited by , where is the number of bound variables used, and second, the arity of disjuncts is then increased by . As a result, if is needed to get the number of disjuncts under then the disjunction does not convert into a projoin reduction.
On the other hand, allowing disjunctions/unions without restrictions completely trivializes the reduction problem. Any relation is a union of its tuples, and each tuple is the unary Cartesian product of singletons containing its members, i.e. . Even if only finite unions are allowed every relation on a finite domain will ‘reduce’ to unary Cartesian products. However, in principle, it may be of interest to explore unions with restrictions other than those imposed by the existential quantifier, e.g. with bounds on the number of terms independent of the size of the domain.
Example 6 may suggest that non-identities are projoin irreducible on finite domains. Indeed, for and , so hypostatic abstraction cannot reduce them. We will now exploit the relationship between projections and unions to show that this is not the case when is sufficiently large. But that requires somewhat more general projoins than Fagin-type decompositions (17)-(18), namely, unions of joins that are not Cartesian products.
Example 7.
Recall the join reduction of from Example 3. Negating and applying de Morgan’s law, we get
We cannot convert this disjunction into an existentially quantified formula because the attribute sets in each disjunct are different, but we can combine all of them into a single cover for . Then we define
so that
and
This disjunction is already amenable to “existentialization”. Assign a distinct to each disjunct, which requires , and set
Then the disjunction converts into a one parameter projoin of ternaries:
(19)
Thus, for and the non--identity is projoin reducible with a single parameter. A similar construction works for non--diversity relation based on the join reduction (10), but the condition is instead .
Going back to , the required size of the domain can be traded for arity. If we use pairs of elements to index the disjuncts then only is required, and similarly if we use -tuples. But we must have so that it is still a reduction. Taking and noticing that for we conclude that is reducible for on any with (albeit not necessarily to ternaries).
The construction in the above example can be generalized to prove the following theorem.
Theorem 12.
Suppose an -ary is join reducible to factors of arity at most , and . Then is projoin reducible. In particular, if has a -key, with for and for , then is projoin reducible.
Proof.
As in Example (7), we present as a disjunction and then convert it into a projoin. To get enough tuples for disjuncts we need , where is the number of projoin parameters, and so that the converted factors still have lower arity than .
For the second claim, apply Theorem 5 to obtain a join reduction of with and , and note that becomes . By calculus, for and for when .
∎
The next example gives a taste of intricacies involved in ruling out general projoin reductions to prove unconditional projoin irreducibility.
Example 8.
Consider reducing on a domain of size with two parameters. As in Example 6, the ansatz reduces to
Replacing by indices we transform it into a disjunction
Since unaries represent subsets of , conjunctions with different their Cartesian products, and with the same their intersections we obtain a union of unary Cartesian products
where determines whether the term is included into the union. In contrast to Example 6, we can use up to terms in the union, but, as a tradeoff, the unary factors are not independent but must form a subset-valued rank Boolean matrix for each . Not only do we have to check whether splits into a union of up to unary Cartesian products, but also whether Boolean matrices of their factors simultaneously factorize into outer products of Boolean vectors.
The Boolean matrix factorization problem is quite involved even for - matrices [32], and with more parameters one would have to deal with simultaneous factorization of even more interdependent Boolean tensors. We can now observe the progression from a simple cardinality condition for key reductions (Theorem 9), to finding union decompositions with independent Cartesian factors for multikey reductions (Theorem 11), and to finding such decompositions with intricate tensor factorizations for general projoin reductions with many parameters. This should dispel the initial impression that with ‘enough’ parameters every relation ‘clearly should be’ projoin reducible. And it suggests a fruitful connection between reduction of relations and factorization of Boolean tensors, an active area of research in modern data science [31].
6 Bonds and teridentity
In this section we will connect the theory of projoin reductions motivated by the database theory to the older theory of C.S. Peirce that supported his once controversial reduction thesis. While the main ideas are scattered in Peirce’s writings, they did not gain currency until the formalizations by Herzberger [17] and Burch [8]. For a modern mathematical approach see [13, 14].
Unlike Cartesian products and joins, projoin is not a single operation on attributed relations. Its definition additionally depends on the set of projected attributes. One may feel that this is too permissive and/or clumsy. A natural way to specify projected attributes intrinsically is to choose all and only those that are not shared by the factors, i.e. to project out the shared attributes. If we think of joining as selecting tuples that match on shared attributes and splicing them together then leaving out the matched parts can give a meaningful response to a query.
Let us call such special projoins pure. Purity is a significant restriction on the operation: while the Fagin-type projoins (17)-(18) are pure, the reduction (19) we constructed for is not. In the case of two factors, the pure projoin is what Peirce called relative product (“relative” was his term for relation) [7]. For binary relations, functions in particular, it is simply their composition: . Peirce considered the relative product more basic than joins and projections through which we defined it, and preferred to reverse the order of definitions.
Like Cartesian and Boolean products, the relative product is a commutative binary operation on attributed relations. This is because the positions with the quantified variable are determined by the shared attribute, not by the order of factors, so commutativity reflects the commutativity of conjunction. However, unlike the other two, the relative product is not associative. Consider binary relations . Associating the first two first gives , but the last two first gives . And cannot be generated by relative products at all, so not even all pure projoins are generated. This is because identified variables (shared attributes) in joins remain free, and it does not matter whether we identify two of them at a time or more, we can repeat the exercise when iterating. But in the relative product identified variables are quantified over (projected out), and no new variable can be identified with them afterwards.
In other words, in iterated relative products no attribute can be shared by more than two factors, and relative product is associative when restricted to triples of relations satisfying this condition. This is a further restriction on admissible projoins that restricts even relation schemes of factors that can appear in them. We will adopt Herzberger’s term bond for this restricted class of projoins, although our bond is slightly more permissive than his along the lines adopted in [14].
Definition 7.
A collection of attributed relations is called bondable when no three of share an attribute. Their
bond is then the projective join with all the shared attributes projected out, i.e. the projected set is . A relation is a bond over a cover with when it is a bond of some , called its bond factors, with elements of T called its (bond) parameters. is called bond reducible when it is a bond with .
Note that we allow , and so, in contrast to Peirce and Herzberger, Cartesian products are bonds, with parameters. This makes bonds a generalization of Cartesian products alternative to joins, and simplifies some formulations. In terms of predicates, our definition means that the sets of free variables in different bond factors are disjoint, and every bound variable is present in exactly two factors. So the projoins , are not bonds, and neither are hypostatic abstractions like (12).
We will now show, following Peirce and Burch [8, 9], that, somewhat surprisingly, this severely restricted operation leads to essentially the same notion of reducibility as general projoins. Peirce’s first observation was that multiple variable identifications bond reduce to pairwise ones by using identity predicates, e.g.
(20)
And his second observation was that -identities for bond reduce to teridentities :
(21)
Projoins with quantification into a single position can also be reduced to bonds by replacing the factors with the quantified variables by factors of lower arity, as in . Applying the above identities converts any projoin into a bond of the original factors (up to renaming of attributes), their projections, and teridentities. Let us call this conversion bond explication. For example, the bond explication of is
(22)
Since projection does not increase arity, and explication can add only ternaries, we have the following theorem.
Theorem 13.
An -ary with is projoin reducible if and only if it is bond reducible. A ternary is projoin reducible if and only if it decomposes into a bond of unaries, binaries and teridentities.
Proof.
The only claim not covered by bond explication is that ternaries that are bonds of unaries, binaries and teridentities are projoin reducible. Given such a bond, assign a new variable to each teridentity and replace by it all occurrences of the original variables from the teridentity. Then remove the teridentity and the quantifiers over its variables. By (20), this produces an equivalent expression, and, since all teridentities are removed, it is a projoin of unaries and binaries only.
∎
In particular, the projoin reduction (19) of can be transformed not just into a pure one, but even into a bond reduction. Note that hypostatic abstraction (15) with , when it applies, decomposes any ternary into a bond of binaries and teridentities. This gives us a bond analog of Corollary 1.
Theorem 14(Peirce’s reduction thesis).
Any -ary with on an infinite domain reduces to a bond of unaries, binaries and teridentities. The only bond irreducible relations on such domains are all unaries, non-degenerate binaries, and non-degenerate ternaries.
The first, reducibility, clause of the thesis is a direct consequence of Corollary 1 and Theorem 13. Indeed, it is essentially equivalent to projoin reducibility to binaries alone. Ironically, Löwenheim’s result [27] to that effect once made it controversial due to the confusion between these closely related notions of reducibility [9, 21].
The second, irreducibility, clause, as applied to unaries and binaries, also follows trivially. Since bond is a special case of projoin, and they are projoin irreducible, they are all the more bond irreducible. However, the part concerning ternaries is non-trivial. It will follow from a graph-theoretic argument in Section 9 (Theorem 16).
While bond and projoin reducibilities are (almost) the same, bond reductions are much more special than general projoin reductions. Peirce felt that general projoin reductions conceal the complexity involved in attribute matching (variable identifications), and, as a result, do not provide “true” or “complete” analysis of a relation delivered by bonds [7, 21].
7 Bonding diagrams
In this section we introduce graphical representation of joins, projoins and bonds which pictures the structure of relations by analogy to diagrams of chemical decompositions of compounds into elements. It also allows to bring in graph-theoretic methods into analysis of reductions. The diagrams we describe are simplified versions of Peirce’s existential graphs [14] covering only a fragment of predicate logic (conjunction and existential quantifier) without the associated graphical calculus. We use some standard notation and terminology from graph theory [4] throughout this and the following sections.
Definition 8.
The projoin graph is a labeled bipartite graph with vertices for each factor and each attribute of the projoin. An edge joins them when the attribute is in the relation scheme of the factor. The vertices are labeled by relation and attribute names, and sorted into predicate vertices (for factors), free attribute vertices (for projected attributes) and bound attribute vertices (for projected out attributes). The valency of a vertex is its graph-theoretic degree (the number of incident edges) for predicate and bound attribute vertices, and the graph-theoretic degree increased by for free attribute vertices.
a) b)
Figure 1: Projoin graphs for a) ; b) .
In practice, we depict predicate vertices as predicate letters and attribute vertices as dots labeled by variables. This makes it easier to associate graphs to predicate formulas, and, since only matching of attributes matters in decompositions rather than their proper names, variable labels work well enough for our purposes. Free attribute vertices are additionally labeled by an extra stem (hanging edge) coming out of them, which explains the valency convention. Examples of projoin graphs and the corresponding predicate formulas are shown on Figure 1.
Projoin graphs can get quite cluttered and are made somewhat more readable by converting them into bonding diagrams defined below. These diagrams are also better equipped to depict bonds.
Definition 9.
The bonding diagram is obtained from the projoin graph by replacing each bivalent bound vertex by an edge connecting the corresponding predicate vertices, and replacing each bivalent free vertex by a hanging edge from the corresponding predicate vertex. The new edges carry the attribute labels of the removed vertices, and the labels of free attribute vertices are moved to their stems. We call the remaining attribute vertices of valency greater than branch points, and of valency dead ends. Hanging edges, incident to predicate vertices and branch points, are called loose ends. Bonding diagrams of bonds are called bond diagrams.
a) b)
Figure 2: Bonding diagrams of projoins from Figure 1.
Loose ends correspond to free variables, and dead ends to bound variables occurring in a single position. Branch points are the device for identifying variables in different predicates – all edges attached to a branch point carry the same variable. The variable is free when one of the attached edges is a loose end, as in the T-shaped link on Figure 2 a), otherwise it is existentially quantified, as on Figure 3 a). When a variable appears in only two predicates, no branch point is necessary, a simple edge connecting them suffices. Thus, bonding diagrams of bonds are graphically distinguished by having no branch points. When two or more variables appear in the same two predicates, the diagram displays a multiedge connecting their vertices, as in Figure 2 b).
Note that if a bonding diagram has disconnected subdiagrams then the relations they represent are Cartesian factors of the original, except for the case when they have no free attributes, i.e. are closed formulas. If they are true all predicates in them can be dropped without any loss, and if false the factored relation is itself empty. From now on we will only consider projoins without such redundant predicates and call them non-redundant.
Corollary 2.
If a non-redundant bonding diagram of a relation is disconnected then the relation is degenerate. The connected components are bonding diagrams of its Cartesian factors.
The converse is false for the trivial reason that one can use degenerate predicates in a reduction. But if a relation is degenerate it admits reductions with disconnected and non-redundant bonding diagrams.
We intentionally used a two-step definition instead of defining bonding diagrams directly to emphasize the singling out of bivalent vertices (pairwise attribute identifications), which highlights binary bonding, i.e. relative products. A bond diagram will have no attribute vertices, and all its attribute labels will attach to edges, including hanging edges.
Our next observation is that bond explication also has a simple graphical interpretation in terms of bonding diagrams.
a) b)
Figure 3: a) Bond explication of as (22), here ; b) bonding diagram of the reduction (21) of -identity to teridentities.
Corollary 3.
The bonding diagram of a bond explicated projoin is obtained from its original bonding diagram by absorbing dead ends into the adjacent predicate vertices, and replacing -valent branch points by the diagrams of bond reductions of -identities to teridentities (Figure 3).
It is particularly pronounced in the diagrams that attribute identifications (branch points) function like hidden factors in projoin reductions. Indeed, nothing substantive distinguishes them from predicate vertices in assembling the relation. Thus, one can see bond explication as analogous to adjoining “ideal elements” () to uniformize factorizations in ring algebra.
8 Complete reductions and ternarity
So far we considered only general reductions, not complete reductions down to irreducibles. In this section we will start looking at their structure of their complete reductions, but,
in the light of Peirce’s reduction thesis, we consider only relations reducible to unaries, binaries and ternaries. They form a bond subalgebra of all relations, which is of interest even if irreducible higher arity relations exist on finite domains.
One can see from bonding diagrams that much work at putting a relation together is done by branch points. Hypostatic abstraction, for example, has a single branch point that holds together an otherwise loose collection of binaries. Bond explication removes branch points, but at a price of adding ternaries to the reduction. This suggests that ternaries play the role of relays in information exchange among the attributes, and their number quantifies the ‘complexity of relating attributes’. Mutual information between attributes has been studied in the context of database theory [29], and, more recently, as a measure of information integration in biological systems [36]. Another potential application is to designing conceptual schemas of databases friendly to natural language and human representation of knowledge and reasoning, as in Sowa’s conceptual graphs that are based on bonding diagrams [11]. For more motivation and further discussion we refer to [21].
Thus, we will be interested in counting the number of ternaries in complete reductions of a relation, assuming that it is reducible to unaries, binaries and ternaries. Of course, this number may vary from one reduction to another, and what we really want is the minimal number over all possible reductions.
Definition 10.
A bond is called subternaric when all of its factors have arity at most . Ternarity of a relation, denoted , is the minimal number of ternaries in its subternaric bond reductions, and if no such reductions exist. Non-redundant bond reductions with ternaries will be called minimal bond reductions.
Ternarity of unaries and binaries is obviously , and of ternaries is at most . By the reducibility clause of Peirce’s reduction thesis (Theorem 14), all relations on infinite domains have subternaric bond reductions. Whether this holds on finite domains, i.e. whether for all , is an open problem, equivalent to projoin reducibility of all relations to binaries by Theorem 13.
The following lemma is a direct consequence of the definitions.
Lemma 2.
Ternarity is subadditive on relative products. For a projoin with factors , free attributes indexed by with the -th shared by factors, and bound attributes indexed by with the -th shared by factors,
(23)
Proof.
Subadditivity is obvious because bonding two bond diagrams does not add predicate vertices or branch points. In the projoin graph of , aside from vertices, we have free branch points of valencies , and bound branch points of valencies . According to (20)-(21), bond explication replaces the former with teridentities and the latter with teridentities, hence the sum in (23).
∎
Bounds on ternarity from above can be obtained from constructions of bond reductions. Recall that any projoin reduction can be explicated into bond reduction, and one can obtain projoin reductions by using keys (Theorem 9). However, only - or -keys produce subternaric reductions because for a -key the factors have arity .
Theorem 15.
If an -ary admits a -key then , if it admits a -key then , and if it already has a -key then .
Proof.
Hypostatic abstraction (15) with reduces to a projoin of binaries with a single shared attribute, which is bound and shared by all factors. Therefore, the first two terms in (23) vanish and the last one produces . In the case of we obtain a projoin of ternaries with two bound shared attributes, each by all factors. Therefore, the right hand side of (23) reduces to . When has a -key, there are only factors, and the shared attributes are now free, so the count changes to .
∎
It is interesting that there is no drop in ternarity bound when the relation already has a -key as opposed to just admitting one. There is a change from projoin to join, but all the ternaries come from the branch point that has valency in both cases. Other special constructions also provide upper bounds. For example, it follows from (19) that for and . Bounds from below are conceptually harder because we have to rule out all bonds with fewer ternaries as reductions. We will obtain such a bound for non-degenerate relations in the next section by exploiting graph-theoretic properties of bond diagrams.
Upon reflection, absence of reducible factors in a reduction is too weak a property. Not only can complete reductions have redundant predicates, as long as those are irreducible, but they may not be minimal. For example, four teridentities bonded in a square reduce to irreducibles, but hypostatic abstraction gives a minimal reduction with only two teridentities.
On the other hand, minimal reductions can be incomplete for only trivial reasons. And they can be converted into complete reductions by a trimming procedure that is reflected in diagrams by merging of predicate vertices. In algebraic terms, when two factors share bound attribute(s) we replace them in the bond by their relative product. Merging cannot be used on a pair of ternaries with a single shared attribute, because it creates a quaternary, but in all other cases the bond remains subternaric. For example, the bond on Figure 2 b) can be merged into a single binary. The next lemma uses merging to produce complete minimal reductions, and gives additional support to discounting unaries and binaries in ternarity counts.
Lemma 3.
Let be a subternarily reducible relation.
(i) In any minimal reduction of any two factors share at most one attribute, i.e. the bonding diagram has no multiedges.
(ii) If does not have an unary Cartesian factor then its minimal reductions have no unaries at all.
(iii) If does not have a binary Cartesian factor then there exist its minimal reductions with no binaries at all.
a) b) c)
Figure 4: Schematic bond diagrams, the dots stand for predicate vertices: a) subcubic multiedges; b) merging unaries; c) merging binaries.
Proof.
(i) Possible multiedge configurations are shown on Figure 4 a). Two of them have no loose ends and cannot occur because minimal reductions are non-redundant. In the other two merging would eliminate a ternary, so they cannot occur by minimality.
(ii) If the unary shares its attribute with another factor there are three cases. It is another unary and they form a redundant component, which is ruled out. It is a ternary and merging will turn it into a binary, which is also ruled out. Finally, if it is a binary then merging will reduce it to an unary, and we can repeat the process, Figure 4 b). By induction on the number of binaries, it must stop, and it can only stop when the unary’s attribute is free (we hit a loose end). But then has an unary Cartesian factor, contrary to the assumption.
(iii) By (i), a binary can share at most one attribute with another factor, and when it does, merging reduces the number of binaries, Figure 4 c). By induction, all binaries can be eliminated except for those with both attributes free, i.e. binary Cartesian factors.
∎
After applying the Lemma’s procedure, the only reducible factors left, if any, are degenerate binary Cartesian factors. Factoring them into pairs of unary factors produces a complete minimal reduction.
9 Ternarity and Peirce’s reduction thesis
In this section we will use ternarity and graph theory to refine Peirce’s reduction thesis on infinite domains, and show that its strengthened form fails dramatically on finite domains.
Definition 11.
The bond graph is obtained from the bond diagram by placing additional vertices at the loose ends and removing the labels.
The bond graph is just a multigraph of graph theory [4]. If the bond was subternaric then the multigraph will be subcubic (subtrivalent), i.e. have vertices of degree at most . Such graphs are widely studied, particularly due to applications in structural chemistry and knot theory. By Lemma 3, when the bond is a minimal reduction of a relation without unary Cartesian factors, the bond graph is a simple graph and its vertices of degree , called pendants in graph theory, are in - correspondence with the relation’s attributes.
To prove the next lemma, we will need a graph-theoretic formula originally due to Listing [26]. Let be the number of vertices, the number of edges, the number of fundamental cycles, and the number of connected components, then . This formula is often used in modern graph theory as the definition of , called the cyclomatic number, which is then proved to be equal to the number of fundamental cycles [4].
Lemma 4.
If denote the numbers of vertices of degrees , respectively, in a subcubic multigraph then . In particular, and have the same parity. If the graph is connected with at least pendants then .
Proof.
In a subcubic multigraph we have . And, by the handshaking theorem, the sum of all vertex valencies is twice the number of its edges, so . Therefore, . It remains to multiply both sides by and note that by the Listing’s formula. In a connected multigraph , so .
∎
It is instructive to give a direct intuitive argument for the case . Since the multigraph is connected there exist paths going from two of the pendants to the third. They must meet at some vertex, and then proceed jointly to the destination (of course, they may meet and diverge several times). That meeting vertex must have degree .
Corollary 4.
If does not have an unary Cartesian factor then its ternarity and arity have the same parity.
Proof.
We have in the bond graph of a minimal bond reduction of . By Lemma 3 (ii), it contains no unaries, so the only pendants come from loose ends, and is the arity of . The result now follows directly from Lemma 4.
∎
The no-unary-factor condition cannot be dropped, the quaternary with non-degenerate has arity but ternarity .
Peirce’s reduction thesis is essentially equivalent to for non-degenerate with . The next theorem gives us the exact number, on infinite domains, and the promised irreducibility of non-degenerate ternaries, on any domains.
Theorem 16.
Ternarity of any non-degenerate -ary with satisfies . In particular, any non-degenerate ternary is bond irreducible. If, moreover, then . In particular, for all relations on infinite domains.
Proof.
Consider a bond decomposition of . Since is non-degenerate its bond multigraph is connected, and has at least pendants coming from the loose ends, the free variables. Therefore, . The lower bound now follows directly from Lemma 4. For this means that any bond decomposition of a non-degenerate ternary must contain a ternary, i.e. such ternaries are bond irreducible.
If then, by Lemma 1, it admits a -key, and, by Theorem 15, , hence . On infinite domains holds for all relations.
∎
The next example shows that the inequality in the lower bound on can be strict on finite domains.
Example 9(Herzberger’s quaternary).
Consider the quaternary on introduced by Herzberger in [17] and given by the table below.
:=
=
=
One can check by cases that is non-degenerate. We have , and Herzberger shows by combinatorial search that is, indeed, not a relative product of two ternaries (actually, he only shows that for one partition of attributes, but the argument works analogously for others). Therefore, .
However, is not a counterexample to reducibility. One can see by inspection that it has a -key (in fact, any two of its columns are a -key). Therefore, by Theorem 5, it is a join of two ternaries, e.g. if we pick the first two columns as the -key. Bond explication (20) of the two shared attributes converts this join into a bond of four ternaries, its projections , , and two teridentities. Since must be even by Lemma 4 and we conclude that .
Herzberger’s observation can be strengthened by relating ternarity to the number of parameters in projoin reductions and applying Theorem 10. It turns out that linear bounds on ternarity in terms of arity, as in Theorem 15, are not typical for general relations. However, we cannot infer existence of relations of infinite ternarity, i.e. of irreducible -aries with , and hence refute Peirce’s original thesis.
Theorem 17.
The share of -ary relations with and among all such relations on a domain is for , and asymptotically vanishes when . In particular, there exist -ary relations of arbitrarily high ternarity.
Proof.
Suppose is non-degenerate with . By Lemma 3, there is a purely ternary minimal reduction of it. In its bond graph , , and by the handshaking theorem. Of the edges, are incident to pendants and correspond to free variables, while correspond to bond parameters. Therefore, our minimal reduction is a projoin reduction with parameters.
By Theorem 10, the share of relations projoin reducible with parameters is when and it goes to when . Since this inequality is satisfied for our . Degenerate relations are projoin reducible with even parameters, let alone , so there must be non-degenerate relations with on our domain. Moreover, their share approaches when .
∎
The estimate we used in the theorem is very rough. Indeed, is not the number of parameters in just any projoin reduction, but in a complete reduction down to ternaries. One could merge ternaries, as long as the merged factors still have arity , and reduce that number. To get a more accurate estimate one can count the number of subcubic graphs with pendants, cubic and no degree vertices, and bound the number of relations that have them as their bond graphs.
Finally, Peirce’s reduction thesis on infinite domains and bond explication show that of all ternaries only one is needed in reductions – teridentity. It is to unaries, binaries and teridentities that we should aim to reduce all relations. This suggests our next definition.
Definition 12.
-ternarity of a relation, denoted , is the minimal number of teridentities in its subternaric bond reductions where the only ternaries are teridentities, and if no such reductions exist.
Clearly, and on infinite domains because any ternary decomposes into binaries and teridentities by hypostatic abstraction. The next example shows that on finite domains, again, the inequality can be strict.
Example 10.
Suppose a non-degenerate ternary has a subternaric decomposition with a single teridentity. Since it has no unary factors unaries can be eliminated, and we are left with the teridentity with up to three chains of binaries attached to it in the graph. A chain of binaries can be merged into a single one by relative products, and represent our ternary as a teridentity directly bonded with three (or fewer) binaries. Turning the teridentity into a branch point we obtain a projoin of binaries with a single parameter.
However, we showed in Example 6 that on a domain with is not projoin reducible with one parameter. Therefore, while trivially, . Since must be odd we can conclude that , i.e. it takes at least teridentities to bond on small domains, if it is possible at all.
10 Conclusions and open problems
We studied reduction of relations to relations of smaller arity under three relational operations: join, projoin and bond. All three can be expressed by conjunctions and existential quantification on predicates, and are motivated by algebraic analogies and practical applications in the database theory. Aside from unifying and extending known reduction results and constructions, we described the sets of irreducible relations and the structure of complete reductions to them.
We also clarified the relationship between projoin and bond reducibility, and the import of Peirce’s reduction thesis. Finally, we introduced the notion of ternarity that, intuitively, measures complexity of ‘relating’ in a relation, and used it to sharpen reducibility results.
Aside from concrete results, a major takeaway from this work is the striking gap between reduction behavior on finite and infinite domains. As far as we know, the only author to notice the phenomenon before was Herzberger [17]. We showed that the gap gets wider as the size of the domain grows: the share of irreducible relations with bounded number of parameters (Theorem 10) or with bounded ternarity (Theorem 17), grows with it, even though it is at . The root cause of this discrepancy is the equality for infinite cardinalities, which is equivalent to the axiom of choice.
This raises a big question: to what extent does Peirce’s reduction thesis hold on finite domains? While non-degenerate ternaries are still irreducible there (even by stronger means than bonds and projoins [14]), reduction is obstructed by the lack of enough domain elements for classical constructions.
Problem 1: Are there irreducible -ary relations with ?
Such relations would have to have a lot of tuples, . Otherwise, they will have a -key with and hypostatic abstraction will reduce them (Theorem 9). Counting arguments we used would not settle the question alone, because general projoins and bonds do not have a finite combinatorial description like
Cartesian products, joins, projoins with bounded number of parameters, or bonds with bounded ternarity. On the other hand, general tests of irreducibility, like the ones for join irreducibility in Theorem 7, also seem to be elusive. A promising approach is provided by the clone theory, where one can dualize the problem into one about functional clones via the Pol-Inv Galois connection. Projoin bases of small arity for maximal sub-co-clones of the co-clone of all relations on -element domains are constructed in [5]. If one could construct bases containing only unaries, binaries and ternaries for the co-clone of all relations on any finite domain that would resolve the question negatively.
While we suspect a negative answer to the first problem, it is more likely to be affirmative for the next one. Although non-degenerate ternaries are trivially ‘reducible’ to themselves on any domains, there is a non-trivial reducibility question about them. To resolve it negatively, one would need a basis of the co-clone of all relations containing only unaries and binaries.
Problem 2: Are there ternary relations indecomposable into bonds of unaries, binaries and teridentities (equivalently, projoin irreducible to unaries and binaries)?
We already saw that the strongest form of the reduction thesis, that gives ternarity of non-degenerate -ary relations as , fails on finite domains. Even if reductions are always possible their complexity must be higher than that of their infinite counterparts. In particular, there can be no bound on ternarity in terms of arity alone. However, since there are finitely many -aric relations of finite ternarity on a finite domain ternarity must attain a maximum on them.
Problem 3: Find sharp upper bounds on ternarity in terms of arity and the size of the domain.
We did not address the question of uniqueness, but a relation can have purely ternaric minimal reductions whose bond graphs are not even isomorphic. Indeed, bonding teridentities on any cubic graph with hanging edges produces -identity, and it is easy to construct non-isomorphic tree graphs with equal numbers of cubic vertices. Perhaps, this diversity is due to overabundance of symmetry in .
Problem 4: Are the bond graphs of purely ternaric minimal reductions unique for ‘generic’ non-degenerate relations?
One can think of minimal reductions as revealing the structure of information processing within a relation, which suggests an affirmative answer. Attributes of a relation generalize inputs and outputs of a function, and functions are commonly interpreted as information processors [23, 1.5.4]. In [29] a measure of information exchange among relation’s attributes is introduced and studied, similar measures are studied in computational biology [36]. The intuition of ternarity as ‘complexity of relating attributes’ suggests a connection.
Problem 5: Is there an information-theoretic interpretation of ternarity, e.g. bounds on measures of information exchange in terms of it?
To summarize, logical factorization of relations poses many interesting challenges at the intersection of mathematical logic, combinatorics, graph theory and data science.
References
[1] S. Abiteboul, R. Hull, V. Vianu, Foundations of databases, Addison-Wesley, New York, 1995.
[2] A. Aho, C. Beeri, J. Ullman, Theory of joins in relational databases, ACM Transactions on Database Systems, 4 (1979) no. 3, 297-314.
[3] C. Beeri, R. Fagin, D. Maier, A. Mendelzon, J. Ullman, Properties of acyclic database schemes, in Proceedings of the 13th annual ACM Symposium on Theory of Computing, Milwaukee, May 11-13, 1981, 355-362.
[4] C. Berge, The theory of graphs, Dover, Mineola, NY, 2001.
[5] E. Böhler, S. Reith, H. Schnoor, H. Vollmer, Bases for Boolean co-clones, Information Processing Letters, 96 (2005) no. 2, 59-66.
[6] F. Börner, Basics of Galois connections, in Complexity of Constraints. Lecture Notes in Computer Science, v. 5250, Springer-Verlag, Berlin, 2008, 38-67.
[7] J. Brunning, C. S. Peirce’s relative product, Modern Logic, 2 (1991) no. 1, 33-49.
[8] R. Burch, A Peircean reduction thesis: the foundations of topological logic, Texas Tech University Press, Lubbock, TX, 1991.
[9] R. Burch, Peirce’s reduction thesis, in Studies in the Logic of Charles Sanders Peirce, ch. 16, Indiana University Press, 1997, 234-252.
[10] J. van den Bussche, Applications of Alfred Tarski’s ideas in database theory, in Computer Science Logic. Lecture Notes in Computer Science, v. 2142, Springer, Berlin, 2001, 20-37.
[11] T. Cao, Conceptual graphs and fuzzy Logic, Springer, Berlin, 2010.
[12] E. Codd, A relational model for large shared data banks, Communications of the ACM, 13 (1979) no. 6, 377-387.
[13] J. Hereth Correia, F. Dau, Two instances of Peirce’s reduction thesis, in Formal Concept Analysis. Lecture Notes in Computer Science, v. 3874, Springer, Berlin, 2006, 106-118.
[14] J. Hereth Correia, R. Pöschel, The power of Peircean Algebraic Logic (PAL), in Concept Lattices, Second International Conference on Formal Concept Analysis, Springer, Berlin, 2004, 337-351.
[15] I. Düntsch, Sz. Mikulas, Cylindric structures and dependencies in relational databases, Theoretical Computer Science, 269 (2001) no. 1-2, 451-468.
[16] R. Fagin, Multivalued dependencies and a new normal form for relational databases, ACM Transactions on Database Systems, 2 (1977) no. 3, 262-278.
[17] H. Herzberger, Peirce’s remarkable theorem, in Pragmatism and Purpose: Essays Presented to Thomas A. Goudge, University of Toronto Press, 1981, 41-58.
[18] T. Imielinski, W. Lipski, The relational model of data and cylindric algebras, Journal of Computer and System Sciences, 28 (1984) no. 1, 80-102.
[19] T. Jech, The axiom of choice, Elsevier, New York, 1973.
[20] P. Jonsson, V. Lagerkvist, G. Nordh, B. Zanuttini, Complexity of SAT problems, clone theory and the exponential time hypothesis, in Proceedings of the 24th Annual ACM-SIAM Symposium on Discrete Algorithms, 2013, 1264-1277.
[21] S. Koshkin, Is Peirce’s reduction thesis gerrymandered? Transactions of the Charles S. Peirce Society, 58 (2022) no. 4, 271-300.
[22] V. Lagerkvist, M. Wahlström, The power of primitive positive definitions with polynomially many variables, Journal of Logic and Computation, 27 (2017) no. 5, 1465-1488.
[23] D. Lau, Function algebras on finite sets, Springer-Verlag, Berlin, 2006.
[24] T. Lee, An algebraic theory of relational databases, Bell System Technical Journal, 62 (1983) no. 10, 3159-3204.
[25] S. Lipschutz, Set theory and related topics, McGraw Hill, New York, 1998.
[26] J. Listing, Der Census räumlicher Complexe, der Verallgemeinerung des Euler’schen Satzes von den Polyedern, Abhandlungen der Königlichen Gesellschaft der Wissenschaften in Göttingen, 10 (1862) 97-182.
[27] L. Löwenheim, Über Möglichkeiten im Relativkalkül, Mathematische Annalen 76 (1915) 447-470. English translation: On possibilities in the calculus of relatives, in From Frege to Gödel: a source book in mathematical logic 1879-1931, Harvard University Press, Cambridge, MS, 1967, 228-251.
[28] D. Maier, The theory of relational databases, Computer Science Press, Rockville, MD, 1983.
[29] F. Malvestuto, Statistical treatment of the information content of a database, Information Systems, 11 (1986) no. 3, 211-223.
[30] A. Mendelzon, D. Maier, Generalized mutual dependencies and the decomposition of database relations, in Fifth International Conference on Very Large Data Bases, IEEE, 1979, 75-82.
[31] P. Miettinen, Boolean tensor factorizations, in 11th International Conference on Data Mining, IEEE, New York, 2011, 447-456.
[32] P. Miettinen, Recent developments in Boolean matrix factorization, in Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, Yokohama, 2021, 4922-4928.
[33] D. Pöschel, L. Kaluz̆nin, Funktionen- und Relationenalgebren, Mathematische Monographien 15, Deutscher Verlag der Wissenschaften, Berlin, 1979.
[34] J. Rissanen, Independent components of relations, ACM Transactions on Database Systems, 2 (1977) no. 4, 317-325.
[35] T. Schaefer, The complexity of satisfiability problems, in Conference Record of the 10th Annual ACM Symposium on Theory of Computing, San Diego, 1978, 216-226.
[36] M. Tegmark, Improved measures of integrated information, PLoS Computational Biology, 12(11) (2016) e1005123.
[37] S. Tringali, An abstract factorization theorem and some applications, Journal of Algebra, 602 (2022) 352-380.
[38] M. Yannakakis, C. Papadimitriou, Algebraic dependencies, Journal of Computer and System Sciences, 25 (1982) no.1, 2-41.