Compactness in Semiring Semantics
Abstract
Semiring provenance was originally introduced in database theory with the aim of explaining why certain tuples are (not) contained in the answer of a query. To this end, logical statements are not just evaluated to true or false but to values in a commutative semiring. Depending on the underlying semiring, this allows us to track descriptions of the atomic facts that are responsible for the truth of a statement or practical information about the evaluation such as costs or confidence. Recently, this approach has been expanded to a systematic study of semiring semantics for first-order logic and other logical systems. This raises the question to what extent model-theoretic results can be generalised to semiring semantics and how this relates to the algebraic properties of the underlying semiring.
Here we investigate the availability of compactness in semiring semantics. The appropriate setting for this is based on absorptive semirings with well-defined infinitary products. Compactness can be stated either in terms of satisfiability or in terms of entailment, and these two variants are trivially equivalent in Boolean semantics. However, this is no longer the case in semiring semantics. Compactness in terms of satisfiability, defined as the existence of non-zero valuations, indeed generalises to every infinitary absorptive semiring. For compactness in terms of entailment the situation is different. The entailment relation naturally extends to semiring semantics (via the natural order on the semiring) but this yields a stronger variant of compactness, which fails for certain important semirings, including the tropical semiring and the Łukasiewicz semiring. Our main positive results show that strong compactness does indeed hold for all finite semirings and all lattice semirings.
Keywords and phrases:
Semiring semantics, compactnessCopyright and License:
2012 ACM Subject Classification:
Theory of computation LogicEditors:
Stefano Guerrini and Barbara KönigSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
We assume familiarity with first-order logic (FO) and recall the classical compactness theorem.
Theorem 1 (Compactness).
For every class of sentences and every sentence ,
-
1.
is satisfiable if, and only if, every finite subset is satisfiable;
-
2.
if, and only if, there exists a finite subset such that .
The compactness theorem is a direct consequence of Gödel’s completeness theorem, but it can also be established directly, actually by simpler arguments than those needed for the completeness theorem (see e.g. [21]). The compactness theorem is a fundamental tool for studying the expressive power and structural properties of first-order theories. Many model-theoretic methods directly rely on the compactness theorem, and fail in contexts where compactness is not available. In particular this is the case in finite model theory, where compactness obviously fails111Just take the axiom system for infinity, consisting of the sentences saying that there exist distinct elements, for all . While this axiom system is not satisfiable by finite models, each of its finite subsets is. and so do many of its classical consequences, such as most preservation theorems.
The objective of this paper is to explore the status of compactness in semiring semantics, which evaluates logical statements not just by true or false, but by values in some commutative semiring. This approach has its origins in the provenance analysis of database queries. Semiring provenance was introduced by Green, Karvounarakis, and Tannen in the seminal paper [16], based on the idea of annotating the atomic facts in a database by values of a commutative semiring, and propagating these values through a database query, keeping track whether information is used alternatively or jointly. Depending on the chosen semiring, provenance valuations give practical information about a query, for instance concerning the confidence that we may have in its truth, the cost of its evaluation, the required clearance level for the access to not freely available data, the number of successful evaluation strategies, and so on. Beyond such provenance evaluations in specific application semirings, more precise information is obtained by evaluations in provenance semirings of polynomials or formal power series, which permit us to track which atomic facts are used (and how often) to compute the answer to the query. This approach has been successfully applied to many variants of (positive) database queries, including conjunctive queries, positive relational algebra, datalog, nested relations, XML, SQL-aggregates, graph databases (see, e.g., the surveys [17, 9]).
Such detailed information, as provided by semiring provenance, is not only useful in databases, but may be of great interest in many other areas of logic in computer science. In particular, it has been used for the strategy analysis in various forms of finite and infinite games [14, 11, 18]. There thus is ample motivation to extend the approach of semiring provenance beyond (positive) database queries to a general semiring semantics for logical systems, in particular for full first-order logic, but also for modal and temporal logics, and for logics with least and greatest fixed points. This poses a number of mathematical challenges that have been addressed in recent research.
Negation.
While semiring provenance has for a long time been restricted to negation-free queries, a new approach for dealing with negation was proposed in 2017 by Grädel and Tannen [13], based on transformations into negation normal form, quotient semirings of polynomials with dual indeterminates, and a close relationship to semiring valuations of games. This led to a semiring provenance analysis for full first-order logic (over finite domains) and also permitted a reverse provenance analysis, i.e., finding models that satisfy various properties under given provenance tracking assumptions, with applications to explaining missing query answers or failures of integrity constraints and computing repairs. An updated exposition of this approach (with many examples) can be found in [15].
Infinitary operations.
A priori, semirings only provide addition and multiplication operations over finitely many arguments. For the evaluation of infinite collections of sentences (as needed in this paper), and also for the interpretation of quantifiers over infinite domains, semirings need to be expanded by operations over infinite sets of values, with suitable algebraic properties. In some cases this is completely straightforward and unproblematic, for instance for finite min-max semirings or, more generally, for semirings induced by a complete lattice (with suprema and infima as semiring operations). Further there are important semirings, such as the tropical semiring where the definition of the infinitary operations (here infimum and infinitary sum) is obvious, but it is not clear whether all relevant algebraic properties of the semiring operations also hold for their infinitary versions. A systematic study of the algebraic properties of such infinitary operations and, on this basis, a definition of infinitary semirings has recently been proposed in [6].
Logical properties of semiring semantics.
The development of semiring semantics raises the question to what extent classical logical results also hold in this more general context, and how this depends on algebraic properties of the underlying semiring. Research on such questions has included the study of elementary equivalence and the axiomatisability of finite semiring interpretations [12], of the equivalence of the relational calculus with relational algebra (Codd’s Theorem) [3], 0-1 laws [10], Ehrenfeucht–Fraïssé games [5], the locality theorems by Hanf and Gaifman [4], and the interplay between local consistency and global consistency for relations over semirings [1, 2].
The present paper expands this research by a study of compactness in semiring semantics. The appropriate setting for this is provided by infinitary absorptive semirings (see Definition 4 below). Indeed, compactness is concerned with the evaluation of infinite sets of formulae and the properties they entail, compared to the properties entailed by their finite subsets. It is natural to define the valuation of a set of sentences as the product of the valuations of its elements, so we need semirings where infinite products are well-defined. Further, a reasonable notion of entailment requires that we have a partial order on these valuations, with the property that disjunctions increase the values and conjunctions reduce them. This is the case precisely for absorptive semirings; they are naturally ordered by addition in the sense that , and the absorption law implies (and is in fact equivalent to) the property that for all .
Once this setting, and the semiring semantics of first-order logic, is well-defined, it is easy to see that a weak form of compactness, in terms of satisfiability understood as the existence of non-zero valuations, holds for all infinitary absorptive semirings. Yet, this result marks an essential difference to previous studies of compactness in the context of many-valued logics, where such notions of compactness fail due to different semantics of negation and universal quantification [7]. Beyond that, we study a more powerful variant of compactness in terms of entailment, interpreted via the natural order, which avoids fixing a set of “designated truth values” a priori. We shall prove that strong compactness fails in a number of important semirings, including the tropical semiring, the Łukasiewicz semiring, and the semirings of generalised absorptive polynomials. On the other side, we can prove that strong compactness does generalise to semiring semantics in at least two important cases. For finite semirings, we can encode the semiring interpretations via classical Boolean semantics over an expanded signature, and use this to lift compactness to the semiring setting. This also affects applications usually modeled by semirings for which strong compactness fails as they often have finite analogues that suffice for applications. For instance, instead of doing cost computations in the tropical semiring over the positive reals, we can take a variant with finitely many cost levels and have a cost scenario where compactness applies. A more sophisticated result is the generalisation of strong compactness to (possibly infinite) completely distributive lattice semirings. This requires refinements of the reduction technique based on separating homomorphisms, which were originally introduced in [12]. These take into account the natural order and cope with the lacking continuity of homomorphisms from lattices with dense intervals (such as the fuzzy semiring) into the Boolean semiring. In the appendix we briefly discuss Löwenheim–Skolem theorems (a classical consequence of compactness) in the semiring setting.
2 Semiring Semantics
We summarise the foundations of semiring semantics for first-order logic and refer to [15] for further details.
Definition 2.
A commutative semiring is a structure with such that and are commutative monoids, distributes over , and .
In the following, we implicitly assume that all semirings are commutative and naturally ordered, that is, defines a partial order. Addition and multiplication are monotone w.r.t. the natural order. For the questions that we study here, the natural scenario is provided by semirings that are absorptive, which means that for all or, equivalently, that multiplication is decreasing in . In particular, addition in absorptive semirings is idempotent (i.e., for each ), so sums coincide with suprema. Unless multiplication is also idempotent in , this need not be true for products and infima. We say that is (multiplicatively) -idempotent if for each . Beyond the Boolean semiring , there are many other absorptive semirings that provide useful information about the evaluation of a formula.
-
A totally ordered set with least element and greatest element induces the min-max semiring . Specific important examples are the Boolean semiring, the fuzzy semiring , and the access control semiring, also called the security semiring [8].
-
A more general class (than min-max semirings) is the class of lattice semirings induced by a bounded distributive lattice . In fact, every absorptive semiring with idempotent multiplication is a lattice semiring.
-
The tropical semiring is used for cost analysis.
-
To reason about confidence, we may use the Viterbi semiring or the Łukasiewicz semiring where .
-
The semiring with models levels of doubt.
-
Provenance semirings allow us to track the atomic facts that are responsible for the truth of a formula. In the non-absorptive case, the most general provenance semirings are , the semirings of polynomials over a finite set of indeterminates and coefficients from . In the absorptive setting that is relevant here, the important examples are the semirings of generalised absorptive polynomials. The elements of are -antichains of monomials with exponents from where the absorption order is defined by . Further absorptive provenance semirings arise as quotients from . For instance, the lattice semirings are the quotients induced by or, more generally, the quotient semirings are obtained via the congruence generated by . See [19] for more details.
To evaluate first-order formulae in these semirings, classical structures are generalised to semiring interpretations that map the atomic facts and their negations to semiring values. While represents falsity, every non-zero element provides an annotation of truth.
Definition 3.
Let be a finite or infinite universe, let be a relational vocabulary, and let be a semiring. We denote by the set of -literals of the form or that are instantiated with tuples from . An -interpretation (for and ) is a function . We say that is model-defining if for every literal precisely one of the values and is 0.
We will only consider model-defining interpretations here. To define semiring semantics also for infinite universes , and to extend it to valuations of infinite collections of first-order sentences, our semirings need to be equipped with infinitary summation and product operators. Algebraic foundations, mathematical properties and provenance valuations of such infinitary semirings have been studied in [6]. Here, only the absorptive case is relevant.
Definition 4.
An infinitary absorptive semiring is the expansion of an absorptive semiring which satisfies the additional properties that
-
the natural order is a complete lattice and
-
is (fully) continuous: for every non-empty chain , the supremum and the infimum are compatible with addition and multiplication, i.e.
for every and , where .
As a consequence, we can define natural infinitary addition and multiplication operations in by taking suprema of finite subsums and infima of finite subproducts:
Definition 5.
Let and be infinitary absorptive semirings. An infinitary homomorphism (or -homomorphism) is a semiring homomorphism such that for all sequences in , it holds that and . We denote by the set of semiring homomorphisms and by the set of infinitary homomorphisms from to .
All examples of practically relevant semirings we mentioned before are infinitary absorptive semirings, and the natural infinitary sums and products they admit correspond to this definition. Moreover, these operations have similar properties as the finitary ones: infinitary addition is the same as the supremum, i.e. , while infinitary multiplication is decreasing but need not coincide with infima.222Indeed, we note that there are infinitary absorptive semirings in which the natural order is a completely distributive lattice (i.e. infima and suprema satisfy a strong distributive law [6, definition 13] over infinite index sets), but strong distributivity does not hold for the infinitary semiring operations defined above. Two such examples are the Viterbi semiring and the tropical semiring , in which the natural order is linear and completely distributive, but the strong distributive law fails for uncountable index sets, as shown in [6].
Using the (infinitary) semiring operations, semiring semantics lifts each -interpretation to a mapping where is the set of first-order formulae instantiated with elements from the universe . Our treatment of negation is based on negation normal form (nnf). This has emerged as a standard approach in semiring semantics, and is explained in detail in [15].
Definition 6 (Semiring Semantics).
For every , the semiring valuation is inductively defined as follows. Equalities are interpreted by their truth value, that is, and for (and analogously for inequalities). Further, we set for literals , , and
Note that we can omit the finite subsums in the definition of the existential quantifier due to the fact that addition and suprema coincide. For finite or infinite sets we set .
Lemma 7 (Fundamental Property).
Let be an -interpretation and be an infinitary homomorphism. Then is a -interpretation and it holds that for all .
Definition 8.
Let be a set of first-order sentences, , and let be an infinitary absorptive semiring. We write
-
(1)
if for every model-defining -interpretation ;
-
(2)
if for every model-defining -interpretation .
We shall see that entailments that hold in the Boolean sense need not be preserved when moving to more complex semirings. Conversely, all entailments that hold in an infinitary absorptive semiring are preserved in subsemirings (i.e. in the restriction of to any subset that contains 0 and 1 and which is closed under finite and infinitary addition and multiplication). This is immediate from the fact that every -interpretation can also be considered as an -interpretation, which gives to every sentence, and every set of sentences, the same value in and .
Lemma 9.
If then also for every subsemiring .
We are now ready to define two notions of compactness in semiring semantics.
Definition 10.
Let be an infinitary absorptive semiring.
-
(1)
has weak compactness if for every set such that there exists a finite subset such that .
-
(2)
has strong compactness if for every set and every such that there exists a finite subset such that .
3 Separating Weak from Strong Compactness
Clearly, strong compactness implies weak compactness (we can choose an unsatisfiable formula for ). We shall see that the converse is in general not true. Notice that in the classical compactness theorem for Boolean semantics, the two statements imply each other due to the fact that if, and only if, is unsatisfiable. In semiring semantics we only have that implies that . The converse implication fails in general (see Example 12).
Lemma 11.
implies .
Proof.
Let be model-defining. If then
where is due to monotonicity and follows inductively from the fact that for all literals as is model-defining.
Example 12.
The converse does not hold in general. For instance, consider and . Since for all model-defining semiring interpretations , we have .
Any infinitary absorptive semiring with has an element . The -interpretation , (for all , with arbitrary universe ) is a counterexample for , since but .
By the classical compactness theorem, the Boolean semiring has strong compactness. The question we want to answer is which other semirings have strong (or just weak) compactness.
With every -interpretation we associate its flattening such that for every literal we have that if and otherwise. Notice that can be viewed as a -interpretation (i.e. a classical -structure) but also as an -interpretation that only takes the values 0 and 1. Further, by the monotonicity of (infinitary) addition and multiplication and the fact that is maximal in absorptive semirings, it follows that for all .
Proposition 13.
Every infinitary absorptive semiring has weak compactness.
Proof.
Let . Then . To see this, consider any model-defining -interpretation . We can view as an -interpretation, which we denote as (so that ). Since addition in is idempotent (we need ), is a subsemiring of , and we have for all . Hence implies . By the classical compactness theorem, there exists a finite subset such that . But, then we have, for every -interpretation that
However, for strong compactness, the situation is different.
Proposition 14.
Let be any infinitary absorptive semiring such that for every there is some element such that (i.e., that is not multiplicatively -idempotent for any ). Then does not have strong compactness.
Proof.
Let be a unary predicate and let . Further let where is the -fold conjunction of the same formula .
We first claim that . Let be an arbitrary -interpretation over a universe with . It follows that while if is finite with elements and if is infinite. In both cases .
For every finite subset and every -interpretation over an infinite universe, we have that , where , but for some (that depends on ). If we choose in such a way that we have so . Thus, strong compactness is violated.
Corollary 15.
The tropical semiring , the Viterbi semiring , the semirings of generalised absorptive polynomials , the Łukasiewicz semiring and the semiring of doubt are not multiplicatively -idempotent for any and therefore do not have strong compactness.
4 Finite Semirings
Let be a finite absorptive semiring with infinitary operations in the sense of Definition 4. Finiteness of trivially implies that there is some such that multiplication in is -idempotent, that is, we have .
With every -interpretation we associate a classical structure over the same universe and with vocabulary such that if and if . We can axiomatise structures of this form by the set of formulae
Lemma 16.
For every -structure we have that if, and only if, for some model-defining -interpretation .
Proposition 17.
For every formula there exists a family of formulae in such that for every -interpretation , every tuple , and every value we have that , if, and only if, .
Proof.
Literals and are translated to and , respectively. For , choose , respectively, and translate to , going through all combinations of semiring values that yield .
For , the construction relies on the fact that multiplication in is -idempotent for some . For every , let be the set of those functions such that , that is, each represents a factorisation of . For any -interpretation , we have that
with the convention that . Thus the formula
expresses that for one of the functions there are indeed precisely values such that evaluates to in case that is smaller than , and at least such values if (so that ). This implies that if, and only if, . For , we can use an analogous construction with , since addition in is idempotent.
Theorem 18.
Every finite absorptive semiring has strong compactness.
Proof.
Suppose that . We observe that for every -interpretation , there is a finite subset , such that for any finite . Suppose for a contradiction that this is not the case. Since is finite, there are only finitely many values for finite subsets . If there is no minimum value, then there must be finitely many incomparable minimal values with . Let . Then for all , in particular, is the minimum value with respect to , a contradiction.
Moreover, , since we can write , but since the multiplicative order of each is finite, a finite subset of suffices. Thus for some finite subset , which implies .
For every finite subset , let . Clearly, we have if, and only if, .
Claim.
is unsatisfiable.
Indeed, suppose that . Since we have that for some model-defining -interpretation . Moreover, for every finite subset , in particular for . But since this would imply that , a contradiction.
It follows, by compactness, that there exists a finite unsatisfiable subset . Let
Clearly, is a finite subset of . It remains to prove that . If not, then there exists an -interpretation with . The associated -structure would clearly satisfy as well as all formulae since otherwise . Thus, we would have that , contradicting the unsatisfiability of .
5 Lattice Semirings
Based on a reduction to the -element min-max semiring , we show that every completely distributive lattice semiring has strong compactness. To this end, we make use of the lattice semiring which adds a new zero to and prove for all and that
-
(1)
implies ,
-
(2)
implies , and
-
(3)
implies .
Starting from we can then infer and apply strong compactness of due to its finiteness, which yields some finite with and, in turn, implies and thus . The first implication follows immediately from the fact that can be considered a sublattice of (see Lemma 9). To prove the third implication, we note that we obtain an -homomorphism by mapping every element to itself except for , which is mapped to .
Lemma 19.
If , then also .
Proof.
With each model-defining -interpretation , we associate an -interpretation with if and otherwise. Clearly, is also model-defining, and, by hypothesis, we have that . Since preserves the order on , this implies .
Thus, it remains to prove the second implication, which, for lattices without dense intervals, can be proved using separating -homomorphisms and the fundamental property.
5.1 Reduction via Separating Homomorphisms
Separating sets of homomorphisms contain for each some with and were introduced in [12] for the purpose of reducing elementary equivalence from one semiring to another. The main idea behind this condition is to transfer counterexamples against elementary equivalence to the target semiring by applying one of the homomorphisms. By additionally demanding that the homomorphism for and should not introduce new inequalities between and , we can extend this reduction technique to the entailment relation.
Definition 20.
A set is -separating if for every , there is some infinitary homomorphism such that and .
Proposition 21.
If there is a -separating set and , then we also have that .
Proof.
We prove the contraposition. Let be a model-defining -interpretation such that and be a homomorphism which -separates from . Since , is also model-defining. By the fundamental property, we conclude . Hence, .
Note that the additional condition is the reason why we reduce entailment in to by taking a detour via . Homomorphisms into with can only exist if does not have non-trivial divisors , which is not necessarily true for , but always true in . Indeed, implies , i.e. or .
It can be shown that -separating sets of finitary homomorphisms exist for every lattice semiring [5], but in order to apply the fundamental property, we additionally need that the homomorphisms in respect the infinitary operations. The existence of some -separating , however, is not ensured, not even if is induced by a linear order, which is due to the possible presence of dense intervals. Suppose that is linearly ordered and with is dense. For each homomorphism which -separates from there must be some threshold such that either or . In the first case, we observe that while in the second case , so cannot be infinitary. As a consequence, we might have that or if converges to , so the fundamental property fails.
Lemma 22.
There is a -separating set of -homomorphisms from to if, and only if, is a completely distributive lattice without dense intervals.
Corollary 23.
Each completely distributive lattice without dense intervals has strong compactness.
5.2 Workaround for Dense Lattices
In order to generalise the reduction technique to lattices that contain dense intervals, we develop a weaker condition which relies on homomorphisms that are not necessarily infinitary. Without compatibility with the infinitary operations we cannot apply the fundamental property as before. However, making use of the fact that we consider homomorphisms into a min-max semiring, we can prove a weaker relationship between and . The main idea here is to exclude the suprema and infima that might not commute with. In the special case discussed in the previous section where is a min-max semiring, the fact that is not infinitary affects just one threshold value in . Whenever , we still have although is not infinitary.
Proposition 24.
Let be a homomorphism (which does not necessarily respect the infinitary operations) into a min-max semiring , and let .
-
(1)
If and if for all with there is some such that , then also .
-
(2)
If and if for all with there is some such that , then also .
Based on the idea that the homomorphism separating from need not be infinitary in general, but the parts where it is not should neither match nor , we can formulate a weaker condition which we want to use to infer from .
Definition 25.
A set of homomorphisms (that are not necessarily infinitary) is weakly -separating if for each , there is some with such that
-
(1)
;
-
(2)
if , then for some ;
-
(3)
if , then for some .
Proposition 26.
If there is a weakly -separating set where is a min-max semiring and , then it also holds that .
Proof.
Let be an -interpretation violating and be a homomorphism which weakly -separates from . Making use of Proposition 24 we obtain that , i.e. .
It remains to prove that there is a weakly -separating set of homomorphisms for every completely distributive lattice . For min-max semirings, this is straightforward: If there is some , we can weakly -separate from via with , and if otherwise is direct predecessor of , we choose . For general lattices, on the contrary, this procedure does not necessarily yield a homomorphism as it might be the case that is an infimum of greater elements. Instead, homomorphisms from to correspond to the prime ideals in .
Definition 27.
A prime ideal of is a non-empty proper subset which is downward-closed, closed under finite suprema, and satisfies for .
If is a prime ideal of , it induces the homomorphism with , if and otherwise. While only violates the fundamental property at a single “boundary” element if is a min-max semiring, multiple boundary elements may exist in the general case. Thus, we want to construct a prime ideal such that neither nor lie on the boundary of . More precisely, has to satisfy the following conditions, which ensure that the induced homomorphism weakly -separates from .
-
(1)
and ,
-
(2)
for all and
-
(3)
for all .
5.3 Construction of the Prime Ideals
In order to construct for each a prime ideal with the required properties, we make use of the lattice-theoretic notions from [20] and analyze the minimum semi-ideals with a particular supremum.
Definition 28.
A semi-ideal of is a downward-closed subset . For let .
Lemma 29 ([20]).
The following holds for all and :
-
(1)
If , then ;
-
(2)
;
-
(3)
;
-
(4)
if, and only if, there is some such that and .
The idea now is to fix an appropriate chain depending on the elements we want to separate and track for each which elements of must be contained in every semi-ideal with supremum . This induces a partial order on (that might be different from the lattice order), which we can use to construct a homomorphism based on a threshold, analogously to the special case where the lattice order was linear.
For we have that (since otherwise ). In order to construct , fix some and choose such that , and , which exist by Lemma 29(4). While and will make sure that and , we use to argue that cannot be the supremum of elements inside . To ensure the dual property w.r.t. and that the induced homomorphism commutes with infima, we inductively extend to by setting and choosing arbitrarily such that and . Note that implies as is a semi-ideal with supremum . Thus, is a chain.
We claim that has the desired properties w.r.t. and . First, we prove that induces a homomorphism (and thus a homomorphism ) which even commutes with arbitrary infima (while this is in general not true for suprema).
Theorem 30.
is a prime ideal and for each with , it holds that .
Proof.
Let , i.e. for . By downward-closedness, there must be an such that . With Lemma 29(2) this yields and thus . Now let . Since , we also have that .
It remains to prove that implies . We prove the contraposition, so let such that for each . We claim that . Let . By definition of , there must be some such that and (if , we can choose , and for , we pick ). Hence, for each , implying . With this yields as required.
By choice of , we can finally argue that the induced homomorphism weakly -separates from .
Theorem 31.
We have that and while for all and for all .
Proof.
By definition, while . Hence, , i.e. . Further, as and thus , which implies . For we have that by Theorem 30, hence . Finally, let . Then . Now suppose that , i.e. . By construction, and thus , which implies and yields with that . But is a semi-ideal with . Further, we have that since while due to and downward-closure of . This is a contradiction to .
Corollary 32.
There is a weakly -separating set for every completely distributive lattice . Hence, every completely distributive lattice has strong compactness.
Note that we lose implications when moving from the Boolean semiring to a lattice . For instance, we have that while , so even for lattices the entailment relation actually becomes more fine-grained. However, the proof of strong compactness for lattices implies that as soon as contains at least three elements, so is not isomorphic to , then the same implications will hold, no matter which specific lattice we consider.
Example 33.
Consider the fuzzy semiring and an -interpretation with universe . For and we have that
due to complete distributivity. However, we can use strong compactness to prove that cannot be collapsed to a single axiom with on . Towards a contradiction, suppose that there was some with for each -interpretation . By definition, we have that and, since has strong compactness, there must be some such that . But for the -interpretation over universe with we have , a contradiction.
6 Compactness up to Powers
The counterexamples against strong compactness from Section 3 rely on the following idea: By using the -fold conjunction of the same formula, was constructed such that it must be evaluated to some infinite power while every finite evaluates to a finite power. This raises the question whether this is the only reason why strong compactness fails for semirings such as , or and whether these semirings still satisfy a weaker variant of compactness which takes finite conjunctions of formulae into account.
Definition 34.
We say that an infinitary absorptive semiring has strong compactness up to powers if for every and every such that there exists a finite subset such that where denotes the -fold conjunction of .
We show that, even in this weakened variant, strong compactness does not generalise to the semiring setting. To see this, consider the Viterbi semiring and suppose that is an infinite -interpretation. Evaluating on yields , i.e. if for each there is some s.t. , and otherwise. Now assume that there is a Boolean linear order available on (in we can even use to express that is Boolean) and compare to the relativised formula . Analogously to the previous case, we can only have that if for every with infinitely many -predecessors, there is some s.t. because . Based on this observation, we can construct a counterexample against strong compactness up to powers for . By adding formulae for each to which make sure that the -th minimal element in also has an outgoing edge valuated with , we obtain a set with . However, a finite subset cannot make sure that the -th element has an outgoing edge labelled . Instead, we might still have that if converges to . The main property we use here is that even if converges to , it might be that while for each or, more generally, that does not commute with suprema. We show in Appendix A that this condition causes strong compactness up to powers to fail.
Theorem 35.
If does not commute with suprema, then does not have strong compactness up to powers. In particular, the semirings , and do not have strong compactness up to powers.
However, there are also semirings violating strong compactness that do satisfy strong compactness up to powers. We show that, under the assumption that the natural order of is completely distributive, it is not only necessary but also sufficient for strong compactness up to powers that commutes with suprema as this makes an -homomorphism.
Theorem 36.
Let be an infinitary absorptive semiring in which the natural order is completely distributive and where commutes with suprema, i.e. is an -homomorphism. Then has strong compactness up to powers.
Proof.
If is an -homomorphism, induces a subsemiring of , which we denote by . Clearly, is multiplicatively idempotent, so a distributive lattice. As we assume that the natural order in is completely distributive, so is , which is why has strong compactness. Because is a subsemiring of , clearly implies . Thus, it suffices to prove that implies . So let and be a model-defining -interpretation. For the distributive lattice which extends by an additional zero denoted , we also have that , as shown in Section 5, because and both are completely distributive lattices. Let with if and . Because is an -homomorphism, so is . Note that, as opposed to , must be model-defining. For we can conclude
where uses that for each literal if is considered an -interpretation. Hence, , which proves the claim.
Corollary 37.
If is strongly distributive (i.e., infinitary multiplication distributes over infinitary addition in ) or -idempotent for some , then has strong compactness up to powers. In particular, the semirings and have strong compactness up to powers.
Notice that for -idempotent , Theorem 36 implies that for each , there must be some finite set with the property that due to the logical equivalence .
7 Summary and Conclusion
In this paper, we have studied the relationship between compactness properties of semiring semantics with algebraic properties of the underlying (infinitary absorptive) semiring. This does not only provide a basis for the generalisation of further model-theoretic properties that rely on compactness, such as Löwenheim–Skolem or preservation theorems, but also yields insights into the logical equivalences which admit the transfer of classical compactness to more general settings. Within the semiring semantics framework, algebraic and model-theoretic properties are closely linked since algebraic equalities (such as multiplicative idempotence) correspond to logical equivalences (e.g. ), which might not be preserved when moving from the Boolean to a more complex semiring. Yet, it is not clear how this affects non-trivial model-theoretic results such as compactness.
While a weak form of compactness in terms of satisfiability holds for all infinitary absorptive semirings, this is not the case for stronger versions in terms of entailment. We proved that compactness generalises to finite semirings by simulating semiring semantics in classical Boolean semantics over an extended signature which allows the encoding of semiring valuations. Our main result, however, is the generalisation to (possibly infinite) completely distributive lattice semirings, from which we can infer that the logical equivalence ensures strong compactness. We expanded the reduction technique of separating homomorphisms introduced in [12], on the one hand, to take the natural order into account and, more interestingly, to cope with the failure of continuity of homomorphisms from lattices with dense intervals, such as the fuzzy semiring. We believe that this generalised proof technique has applications beyond compactness. Several other model-theoretic results for semiring semantics are based on separating homomorphism and are thus affected by missing continuity. Future work will include the application of weakly separating homomorphism sets to model-theoretic tools such as Ehrenfeucht–Fraïssé games, which, up to now, could only be applied to finite lattice semirings [5].
On the other hand, we discussed counterexamples against strong compactness in semirings that are not -idempotent for any , that is, that do not admit logical equivalences of the form where denotes the -fold conjunction of . In some cases, such as for the tropical or the Łukasiewicz semiring, strong compactness fails in an even stronger sense. We showed that in these semirings, the lack of idempotence cannot be circumvented by moving to strong compactness up to powers, where the entailment relation is no longer based on finite subsets but on their closures under finite conjunctions of the same formula. Figure 2 summarises the connection between algebraic properties of the semiring and variants of compactness established by our results. It remains open for future work to close the gap between multiplicative -idempotence and multiplicative idempotence (lattices). We conjecture that -idempotence might already suffice for strong compactness. Possible approaches for proving this include a two-sorted approach discussed in [18] or a generalisation of the homomorphism technique from Section 5. Towards the generalisation of further model-theoretic properties that rely on compactness, we formulate (in the appendix) a variant of the upward Löwenheim–Skolem theorem for semirings that have strong compactness. The analysis of further consequences of compactness, for instance concerning preservation theorems, will be studied in future work.
References
- [1] A. Atserias and P. Kolaitis. Consistency, acyclicity, and positive semirings. In A. Palmigiano and M. Sadrzadeh, editors, Samson Abramsky on Logic and Structure in Computer Science and Beyond, volume 25 of Outstanding Contributions to Logic, pages 623–668. Springer, Cham, 2023. doi:10.1007/978-3-031-24117-8_17.
- [2] A. Atserias and P. Kolaitis. Consistency of relations over monoids. J. ACM, 72(3), May 2025. doi:10.1145/3721855.
- [3] G. Badia, P. Kolaitis, and C. Noguera. Codd’s theorem for databases over semirings. Proc. ACM Manag. Data, 3(5), November 2025. doi:10.1145/3767713.
- [4] C. Bizière, E. Grädel, and M. Naaf. Locality theorems in semiring semantics. In Proceedings of MFCS 2023, 2023. doi:10.4230/LIPIcs.MFCS.2023.20.
- [5] S. Brinke, E. Grädel, and L. Mrkonjić. Ehrenfeucht–Fraïssé games in semiring semantics. In Proceedings of CSL 2024, 2024. doi:10.4230/LIPIcs.CSL.2024.19.
- [6] S. Brinke, E. Grädel, L. Mrkonjić, and M. Naaf. Semiring provenance in the infinite. In The Provenance of Elegance in Computation - Essays Dedicated to Val Tannen, volume 119 of Open Access Series in Informatics (OASIcs), pages 3:1–3:26, Dagstuhl, Germany, 2024. doi:10.4230/OASIcs.Tannen.3.
- [7] P. Cintula and M. Navara. Compactness of fuzzy logics. Fuzzy Sets Syst., 143(1):59–73, 2004. doi:10.1016/J.FSS.2003.06.002.
- [8] J. Foster, T. Green, and V. Tannen. Annotated XML: queries and provenance. In Proceedings of PODS 2008, pages 271–280, 2008. doi:10.1145/1376916.1376954.
- [9] B. Glavic. Data provenance. Foundations and Trends in Databases, 9(3-4):209–441, 2021. doi:10.1561/1900000068.
- [10] E. Grädel, H. Helal, M. Naaf, and R. Wilke. Zero-one laws and almost sure valuations of first-order logic in semiring semantics. In Proceedings of LICS 2022, pages 41:1–41:12. ACM, 2022. doi:10.1145/3531130.3533358.
- [11] E. Grädel, N. Lücking, and M. Naaf. Semiring provenance for Büchi games: Strategy analysis with absorptive polynomials. Logical Methods in Computer Science, 20(1), 2024. doi:10.46298/lmcs-20(1:21)2024.
- [12] E. Grädel and L. Mrkonjić. Elementary equivalence versus isomorphism in semiring semantics. In Proceedings of ICALP 2021, volume 198, pages 133:1–133:20, Dagstuhl, Germany, 2021. doi:10.4230/LIPIcs.ICALP.2021.133.
- [13] E. Grädel and V. Tannen. Semiring provenance for first-order model checking, 2017. arXiv:1712.01980.
- [14] E. Grädel and V. Tannen. Provenance analysis for logic and games. Moscow Journal of Combinatorics and Number Theory, 9(3):203–228, 2020. Preprint available at https://arxiv.org/abs/1907.08470. doi:10.2140/moscow.2020.9.203.
- [15] E. Grädel and V. Tannen. Provenance analysis and semiring semantics for first-order logic. In Model Theory, Computer Science and Graph Polynomials. Festschrift for Johann A. Makowsky. Birkhäuser, 2025. doi:10.1007/978-3-031-86319-6_21.
- [16] T. Green, G. Karvounarakis, and V. Tannen. Provenance semirings. In Proceedings of PODS 2007, pages 31–40. ACM, 2007. doi:10.1145/1265530.1265535.
- [17] T. Green and V. Tannen. The semiring framework for database provenance. In Proceedings of PODS 2017, pages 93–99. ACM, 2017. doi:10.1145/3034786.3056125.
- [18] L. Mrkonjić. Semiring Semantics: Algebraic Foundations, Model Theory, and Strategy Analysis. PhD thesis, RWTH Aachen University, 2025. doi:10.18154/RWTH-2025-03940.
- [19] M. Naaf. Logic, Semirings, and Fixed Points. PhD thesis, RWTH Aachen University, 2024. doi:10.18154/RWTH-2024-10804.
- [20] George N. Raney. A subdirect-union representation for completely distributive complete lattices. Proceedings of the American Mathematical Society, 4(4):518–522, 1953. doi:10.1090/S0002-9939-1953-0058568-4.
- [21] P. Rothmaler. Introduction to Model Theory. CRC Press, 2018. doi:10.1201/9781315273822.
Appendix A Omitted Proofs
The proofs of Lemma 22 and Proposition 24 from Section 5 are provided in the following.
Lemma 22. [Restated, see original statement.]
There is a -separating set of -homomorphisms from to if, and only if, is a completely distributive lattice without dense intervals.
Proof.
As shown in [18], is completely distributive and does not contain dense intervals if, and only if, there is a separating set (recall that is separating if for each there is some such that ). We show that this is equivalent to the existence of a -separating set . So suppose that there is some separating . If we can -separate and by mapping to and every other element in to . Otherwise, we have and there must be some with , i.e. and , which implies . Hence, we can -separate from via with , if and otherwise. To prove the converse, let be -separating and . As or , there must be some with and , and we can separate and via with if and otherwise.
Proposition 24. [Restated, see original statement.]
Let be a homomorphism (which does not necessarily respect the infinitary operations) into a min-max semiring , and let .
-
(1)
If and if for all with there is some such that , then also .
-
(2)
If and if for all with there is some such that , then also .
Proof.
We proceed by induction on and only prove the first implication as the reasoning for is analogous. The base case, where is a literal, is satisfied by definition.
Let . If , then is true for . Towards a contradiction, suppose that with for each . Then violates the assumption on as . Hence, the induction hypothesis can be applied to and and we obtain .
For we get , i.e. for some . Suppose that with for each . We cannot have that as would yield a contradiction. If where for , we obtain a contradiction by , so the IH must either be applicable to or to . Both cases yield .
Now let and . By assumption, . Suppose that for each , there is some such that and for . Then we would have , a contradiction. Hence there must be some the IH can be applied to and we obtain .
It remains to prove the claim for . By monotonicity of , we have that for each . Suppose that there is some such that with for . To infer a contradiction, we observe that with for . Hence we have that for each and thus .
We also provide proofs for Theorem 35 and Corollary 37 from Section 6. The following additional lemma is required to prove Theorem 35.
Lemma 38.
If does not commute with suprema, then there is some with while for each .
Proof.
By monotonicity, we have for each , so if does not respect suprema, there must be some such that . Note that must be infinite as is true for every (we obtain by observing that every term in contains or at least times). We construct a chain according to . It follows by induction that for each as . We claim that has the desired properties. On the one hand, we have that . Moreover, for each due to monotonicity. By construction, is closed under finite suprema and hence
Theorem 35. [Restated, see original statement.]
If does not commute with suprema, then does not have strong compactness up to powers. In particular, the semirings , and do not have strong compactness up to powers.
Proof.
We claim that where
and states (in Boolean semantics) that is a linear order. Let be a model-defining -interpretation with and recall the flattening of , where if, and only if, . Since is maximal in , we have that for all . By monotonicity, this inequality can be lifted to formulae, and for each , we get , i.e. . Due to , is linearly ordered by . Moreover, if, and only if, is a prefix of . Hence, for each implies there is an infinite discrete prefix w.r.t. .
For each , is the unique tuple such that and thus the unique tuple with . Therefore, and thus . For every it holds that
Hence, and overall .
Now let be finite and be maximal such that . By assumption, does not commute with suprema, so we can fix a set as in Lemma 38. In order to disprove , we construct an -interpretation such that . The universe of consists of elements and we set if, and only if, , implying . Further, we define for each and , which yields for , while setting . Since for all , we obtain and overall as desired. On the other hand, .
Corollary 37. [Restated, see original statement.]
If is strongly distributive (i.e., infinitary multiplication distributes over infinitary addition in ) or -idempotent for some , then has strong compactness up to powers. In particular, the semirings and have strong compactness up to powers.
Proof.
By Theorem 36, it suffices to verify that whenever meets one of the above conditions. First suppose that is strongly distributive (such as ). W.l.o.g. we can assume that is infinite since the finite case holds in every infinitary absorptive semiring (see the proof of Lemma 38). Because every must hit some infinitely often, we obtain .
Now let be -idempotent for some , which, by finitary distributivity, implies that . We fix some and observe that
where is due to the fact that each summand in must contain some at least times. Hence, is an upper bound of , which proves the claim.
Appendix B The Löwenheim–Skolem Theorems
As an immediate consequence of strong compactness, we obtain a generalisation of the upward Löwenheim–Skolem theorem, which classically implies that sets of first-order formulae with finite models of unbounded size also admit infinite models with unbounded transfinite cardinalities. We generalise this to the semiring setting via entailment: For and , if there are arbitrarily large finite witnesses that disprove , then there are witnesses of arbitrarily large transfinite sizes.
Theorem 39 (Upward Löwenheim–Skolem).
Let have strong compactness (e.g. let be finite or a completely distributive lattice) and .
-
(1)
If for arbitrarily large finite -interpretations , then also holds for some infinite .
-
(2)
If for some infinite -interpretation , then there is some for each with such that .
Example 40.
Let be a completely distributive lattice. We show there is no such that for each -interpretation . Towards a contradiction, suppose that exists. For finite , we have that . Hence, we can find for each some with such that . For with , however, we have that , which implies , a contradiction.
In an even stronger sense, the proof of the classical downward Löwenheim–Skolem Theorem can be adapted without major difficulties to semiring interpretations, with a rather liberal condition on the underlying semiring.
Definition 41.
We say that the infinitary sum and product operations on a semiring are countably tame if for every sequence there exist countable subsequences indexed by such that and . A semiring is countably tame if its infinitary sum and product operations are.
Clearly, the min-max semiring over is countably tame.
Definition 42.
Let be a semiring interpretation. A subinterpretation is the restriction of to for some subset . An elementary subinterpretation, denoted , satisfies in addition that for every formula and every tuple in .
Theorem 43 (Downward Löwenheim–Skolem).
Every -interpretation with countable vocabulary into a countably tame semiring has a countable elementary subinterpretation .
Proof.
We construct a countable chain of countable subsets as follows. Let . Construct by adding to , for every formula , countable collections and of elements from such that and , which is possible since the semiring is countably tame. Finally, let , which is clearly countable. We claim that induces an elementary subinterpretation . Consider any formula and any tuple over . We have to prove that . This is proved by induction on . The only non-trivial cases are and . Obviously there is some such that all components of are in which means that . The construction makes sure that and hence , contains witnesses and to make sure that
and similarly for using the witnesses .
