Abstract 1 Introduction 2 Semiring Semantics 3 Separating Weak from Strong Compactness 4 Finite Semirings 5 Lattice Semirings 6 Compactness up to Powers 7 Summary and Conclusion References Appendix A Omitted Proofs Appendix B The Löwenheim–Skolem Theorems

Compactness in Semiring Semantics

Sophie Brinke ORCID RWTH Aachen University, Germany Anuj Dawar ORCID University of Cambridge, UK Erich Grädel ORCID RWTH Aachen University, Germany Lovro Mrkonjić ORCID RWTH Aachen University, Germany Matthias Naaf ORCID RWTH Aachen University, Germany
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, compactness
Copyright and License:
[Uncaptioned image] © Sophie Brinke, Anuj Dawar, Erich Grädel, Lovro Mrkonjić, and Matthias Naaf; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Logic
Editors:
Stefano Guerrini and Barbara König

1 Introduction

We assume familiarity with first-order logic (FO) and recall the classical compactness theorem.

Theorem 1 (Compactness).

For every class of sentences ΦFO and every sentence ψFO,

  1. 1.

    Φ is satisfiable if, and only if, every finite subset Φ0Φ is satisfiable;

  2. 2.

    Φψ if, and only if, there exists a finite subset Φ0Φ such that Φ0ψ.

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 n distinct elements, for all n1. 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 𝕋=(+,min,+,,0) 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 st:r(s+r=t), and the absorption law implies (and is in fact equivalent to) the property that sts for all s,t.

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 𝒮=(S,+,,0,1) with 01 such that (S,+,0) and (S,,1) are commutative monoids, distributes over +, and 0s=s0=0.

In the following, we implicitly assume that all semirings are commutative and naturally ordered, that is, st:r(s+r=t) 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 s+st=s for all s,tS or, equivalently, that multiplication is decreasing in 𝒮. In particular, addition in absorptive semirings is idempotent (i.e., s+s=s for each sS), 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) n-idempotent if sn+1=sn for each sS. Beyond the Boolean semiring 𝔹=({0,1},,,0,1), there are many other absorptive semirings that provide useful information about the evaluation of a formula.

  • A totally ordered set (S,) with least element s and greatest element t induces the min-max semiring (S,max,min,s,t). Specific important examples are the Boolean semiring, the fuzzy semiring 𝔽=([0,1],max,min,0,1), 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 (S,,,s,t) induced by a bounded distributive lattice (S,). In fact, every absorptive semiring with idempotent multiplication is a lattice semiring.

  • The tropical semiring 𝕋=(+,min,+,,0) is used for cost analysis.

  • To reason about confidence, we may use the Viterbi semiring 𝕍=([0,1],max,,0,1) or the Łukasiewicz semiring 𝕃=([0,1],max,,0,1) where stmax(s+t1,0).

  • The semiring 𝔻=([0,1],min,,1,0) with stmin(s+t,1) 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 [X], the semirings of polynomials over a finite set X of indeterminates and coefficients from . In the absorptive setting that is relevant here, the important examples are the semirings 𝕊(X) of generalised absorptive polynomials. The elements of 𝕊(X) are -antichains of monomials with exponents from {} where the absorption order is defined by m1m2:m(m1=mm2). Further absorptive provenance semirings arise as quotients from 𝕊(X). For instance, the lattice semirings PosBool(X) are the quotients induced by xxx or, more generally, the quotient semirings 𝕊n(X) are obtained via the congruence generated by xn+1xn. 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 0 represents falsity, every non-zero element provides an annotation of truth.

Definition 3.

Let A be a finite or infinite universe, let τ be a relational vocabulary, and let 𝒮 be a semiring. We denote by LitA(τ) the set of τ-literals of the form Ra¯ or ¬Ra¯ that are instantiated with tuples from A. An 𝒮-interpretation (for A and τ) is a function π:LitA(τ)𝒮. We say that π is model-defining if for every literal LLitA(τ) precisely one of the values π(L) and π(¬L) is 0.

We will only consider model-defining interpretations here. To define semiring semantics also for infinite universes A, 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 CS, the supremum C and the infimum C are compatible with addition and multiplication, i.e.

    sC=(sC) and sC=(sC),

    for every sS and {+,}, where (sC){sccC}.

As a consequence, we can define natural infinitary addition and multiplication operations in 𝒮 by taking suprema of finite subsums and infima of finite subproducts:

iIsiI0II0 finite(iI0si) and iIsiI0II0 finite(iI0si).
Definition 5.

Let 𝒮 and 𝒯 be infinitary absorptive semirings. An infinitary homomorphism (or -homomorphism) is a semiring homomorphism h:𝒮𝒯 such that for all sequences (si)iI in 𝒮, it holds that h(iIsi)=iIh(si) and h(iIsi)=iIh(si). We denote by Hom(𝒮,𝒯) the set of semiring homomorphisms h:𝒮𝒯 and by Hom(𝒮,𝒯) 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. iIsi=iIsi, 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 FOA(τ)𝒮 where FOA(τ) is the set of first-order formulae instantiated with elements from the universe A. 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 φFOA(τ), the semiring valuation πφ is inductively defined as follows. Equalities are interpreted by their truth value, that is, πa=a1 and πa=b0 for ab (and analogously for inequalities). Further, we set πφπ(φ) for literals LLitA(τ), π¬ψπnnf(¬ψ), and

πψϑ πψ+πϑ, πxψ(x) aAπψ(a)=aAπψ(a),
πψϑ πψπϑ, πxψ(x) aAπψ(a)=A0finA(aA0πψ(a)).

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 ΦFOA(τ) we set πΦφΦπφ=Φ0finΦ(φΦ0πφ).

Lemma 7 (Fundamental Property).

Let π:LitA(τ)𝒮 be an 𝒮-interpretation and h:𝒮𝒯 be an infinitary homomorphism. Then (hπ) is a 𝒯-interpretation and it holds that h(πφ)=(hπ)φ for all φFOA(τ).

Definition 8.

Let ΦFO be a set of first-order sentences, ψFO, and let 𝒮 be an infinitary absorptive semiring. We write

  1. (1)

    Φ𝒮0 if πΦ=0 for every model-defining 𝒮-interpretation π;

  2. (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 SS 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. (1)

    𝒮 has weak compactness if for every set ΦFO such that Φ𝒮0 there exists a finite subset Φ0Φ such that Φ0𝒮0.

  2. (2)

    𝒮 has strong compactness if for every set ΦFO and every ψFO such that Φ𝒮ψ there exists a finite subset Φ0Φ such that Φ0𝒮ψ.

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 Φ{¬ψ}𝒮0. The converse implication fails in general (see Example 12).

Lemma 11.

Φ𝒮ψ implies Φ{¬ψ}𝒮0.

Proof.

Let π be model-defining. If πΦπψ then

πΦ{¬ψ}=πΦπ¬ψ(1)πψπ¬ψ=(2)0,

where (1) is due to monotonicity and (2) follows inductively from the fact that π(L)π(¬L)=0 for all literals LLitA(τ) as π is model-defining.

Example 12.

The converse does not hold in general. For instance, consider φ=x(x=x) and ψ=x(Px¬Px). Since π¬ψ=πx(Px¬Px)=0 for all model-defining semiring interpretations π, we have φ{¬ψ}𝒮0.

Any infinitary absorptive semiring 𝒮 with |𝒮|3 has an element 0<ε<1. The 𝒮-interpretation π(Pa)=ε, π(¬Pa)=0 (for all aA, with arbitrary universe A) is a counterexample for φ𝒮ψ, since πφ=1 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 π:LitA(τ)𝒮 we associate its flattening π𝔹 such that for every literal LLitA(τ) we have that π𝔹(L)=0 if π(L)=0 and π𝔹(L)=1 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 1 is maximal in absorptive semirings, it follows that πψπ𝔹ψ for all ψFO.

Proposition 13.

Every infinitary absorptive semiring has weak compactness.

Proof.

Let Φ𝒮0. Then Φ𝔹0. 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 1+1=1), 𝔹 is a subsemiring of 𝒮, and we have π𝒮φ=πφ for all φFO. Hence π𝒮Φ=0 implies πΦ=0. By the classical compactness theorem, there exists a finite subset Φ0Φ such that Φ0𝔹0. But, then we have, for every 𝒮-interpretation π that

πΦ0=φΦ0πφφΦ0π𝔹φ=π𝔹Φ0=0.

However, for strong compactness, the situation is different.

Proposition 14.

Let 𝒮 be any infinitary absorptive semiring such that for every n there is some element sn𝒮 such that (sn){(sn)mm<ω}<(sn)n (i.e., that is not multiplicatively n-idempotent for any n). Then 𝒮 does not have strong compactness.

Proof.

Let P be a unary predicate and let ψxyPy. Further let Φ{φnn1} where φn is the n-fold conjunction of the same formula yPy.

We first claim that Φ𝒮ψ. Let π be an arbitrary 𝒮-interpretation over a universe A with rπyPy. It follows that πΦ={rnn>0}=r while πψ=rn if A is finite with n elements and πψ=r if A is infinite. In both cases πΦπψ.

For every finite subset Φ0Φ and every 𝒮-interpretation π over an infinite universe, we have that πψ=r, where r=πyPy, but πΦ0=rn for some n (that depends on Φ0). If we choose πn in such a way that πnyPy=sn we have πnΦ0=(sn)n>(sn)=πnψ so Φ0⊧̸𝒮ψ. Thus, strong compactness is violated.

Corollary 15.

The tropical semiring 𝕋, the Viterbi semiring 𝕍, the semirings of generalised absorptive polynomials 𝕊(X), the Łukasiewicz semiring 𝕃 and the semiring of doubt 𝔻 are not multiplicatively n-idempotent for any n 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 n>0 such that multiplication in 𝒮 is n-idempotent, that is, we have sn=sn+1==s.

With every 𝒮-interpretation π:LitA(τ)𝒮 we associate a classical structure (π) over the same universe A and with vocabulary τ𝒮{RsRτ,s𝒮}{Rs¬Rτ,s𝒮} such that a¯Rs if π(Ra¯)=s and a¯Rs¬ if π(¬Ra¯)=s. We can axiomatise structures of this form by the set of formulae

Θτ {αLL=R or L=R¬ for Rτ}{βRRτ}with
αL x¯(s𝒮Lsx¯st¬(Lsx¯Ltx¯)) and βRx¯(R0x¯R0¬x¯).
Lemma 16.

For every τ𝒮-structure 𝔅 we have that 𝔅Θτ if, and only if, 𝔅=(π) for some model-defining 𝒮-interpretation π.

Proposition 17.

For every formula ψ(x¯)FO(τ) there exists a family of formulae (ψ=s(x¯))sS in FO(τ𝒮) such that for every 𝒮-interpretation π:LitA(τ)𝒮, every tuple a¯, and every value sS we have that πψ(a¯)=s, if, and only if, (π)ψ=s(a¯).

Proof.

Literals Rx¯ and ¬Rx¯ are translated to Rsx¯ and Rs¬x¯, respectively. For {,}, choose {+,}, respectively, and translate ψ=φϑ to ψ=srt=sφ=rϑ=t, going through all combinations r,t of semiring values that yield s.

For ψ=yφ, the construction relies on the fact that multiplication in 𝒮 is n-idempotent for some n. For every s𝒮, let Fs be the set of those functions f:𝒮{0,,n} such that t𝒮tf(t)=s, that is, each fFs represents a factorisation of s. For any 𝒮-interpretation π:LitA(τ)𝒮, we have that

πyφ=aAπφ(a)=t𝒮t|{aπφ(a)=t}|,

with the convention that 00=1. Thus the formula

ψ=s fFst𝒮ϑf,t with ϑf,t={=f(t)yφ=t(y) if f(t)<n andf(t)yφ=t(y) if f(t)=n

expresses that for one of the functions fFs there are indeed precisely f(t) values a such that φ(a) evaluates to t in case that f(t) is smaller than n, and at least n such values if f(t)=n (so that t|{aπφ(a)=t}|=tn=tf(t)). This implies that (π)ψ=s if, and only if, πψ=s. For ψ=yφ, we can use an analogous construction with n1, 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 πΦ1,,πΦm with m>1. Let Φ(π)1imΦi. Then πΦ(π)πΦi for all 1im, in particular, πΦ(π) is the minimum value with respect to , a contradiction.

Moreover, πΦ(π)=πΦ, since we can write πΦ=s𝒮s|{φΦπφ=s}|, but since the multiplicative order of each s is finite, a finite subset of {φΦπφ=s} suffices. Thus πΦ=πΨ for some finite subset ΨΦ, which implies πΦ(π)πΦ.

For every finite subset Φ0Φ, let η(Φ0)st(Φ0)=sψ=tFO(τ𝒮). Clearly, we have (π)η(Φ0) if, and only if, πΦ0πψ.

Claim.

ΨΘτ{¬η(Φ0)Φ0 is a finite subset of Φ} is unsatisfiable.

Indeed, suppose that 𝔅Ψ. Since 𝔅Θτ we have that 𝔅=(π) for some model-defining 𝒮-interpretation π. Moreover, πΦ0πψ for every finite subset Φ0Φ, in particular for Φ0=Φ(π). But since πΦ(π)=πΦ this would imply that Φ⊧̸𝒮ψ, a contradiction.

It follows, by compactness, that there exists a finite unsatisfiable subset Ψ0Ψ. Let

Φ{Φ0¬η(Φ0)Ψ0}.

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 ¬η(Φ0)Ψ0 since otherwise πΦ0πψ. Thus, we would have that (π)Ψ0, contradicting the unsatisfiability of Ψ0.

5 Lattice Semirings

Based on a reduction to the 3-element min-max semiring 𝒮3=({0<ε<1},max,min,0,1), we show that every completely distributive lattice semiring =(L,,,0,1) has strong compactness. To this end, we make use of the lattice semiring =(L{0},,,0,1) which adds a new zero 0 to and prove for all ΦFO and φ,ψFO that

  1. (1)

    Φψ implies Φ𝒮3ψ,

  2. (2)

    {φ}𝒮3ψ implies {φ}ψ, and

  3. (3)

    {φ}ψ implies {φ}ψ.

Starting from Φψ we can then infer Φ𝒮3ψ and apply strong compactness of 𝒮3 due to its finiteness, which yields some finite Φ0Φ with {Φ0}Φ0𝒮3ψ and, in turn, implies Φ0ψ and thus Φ0ψ. The first implication follows immediately from the fact that 𝒮3 can be considered a sublattice of (see Lemma 9). To prove the third implication, we note that we obtain an -homomorphism h: by mapping every element to itself except for 0, which is mapped to 0.

Lemma 19.

If {φ}ψ, then also {φ}ψ.

Proof.

With each model-defining -interpretation π, we associate an -interpretation π with π(L)=0 if π(L)=0 and π(L)=π(L) otherwise. Clearly, π is also model-defining, and, by hypothesis, we have that πφπψ. Since h preserves the order on , this implies πφ=(hπ)φ=h(πφ)h(πψ)=(hπ)ψ=πψ.

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 st some h with h(s)h(t) 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 s and t should not introduce new inequalities between s and t, we can extend this reduction technique to the entailment relation.

Definition 20.

A set HHom(𝒮,𝒯) is -separating if for every st𝒮, there is some infinitary homomorphism hH such that h(s)h(t) and h1(0)={0}.

Proposition 21.

If there is a -separating set HHom(𝒮,𝒯) and Φ𝒯ψ, then we also have that Φ𝒮ψ.

Proof.

We prove the contraposition. Let π be a model-defining 𝒮-interpretation such that sπΦπψt and hH be a homomorphism which -separates s from t. Since h1(0)={0}, (hπ) is also model-defining. By the fundamental property, we conclude (hπ)Φ=h(πΦ)h(πψ)=(hπ)ψ. Hence, Φ⊧̸𝒯ψ.

Note that the additional condition h1(0)={0} is the reason why we reduce entailment in to 𝒮3 by taking a detour via . Homomorphisms into 𝒮3 with h1(0)={0} can only exist if 0 does not have non-trivial divisors s,t0, which is not necessarily true for , but always true in . Indeed, st=0 implies h(s)h(t)=h(st)=h(0)=0, i.e. h(s)=0 or h(t)=0.

It can be shown that -separating sets of finitary homomorphisms HHom(,𝒮3) exist for every lattice semiring [5], but in order to apply the fundamental property, we additionally need that the homomorphisms in H respect the infinitary operations. The existence of some -separating HHom(,𝒮3), 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 [s,t] with s<t is dense. For each homomorphism which -separates s from t there must be some threshold u[s,t] such that either h1(ε)=(0,u) or h1(ε)=(0,u]. In the first case, we observe that h([s,u))=1ε={h(v)sv<u} while in the second case h((u,t])=ε1={h(v)u<vt}, so h cannot be infinitary. As a consequence, we might have that h(πxRx)>(hπ)xRx or h(πxRx)<(hπ)xRx if {π(Ra)aA} converges to u, so the fundamental property fails.

Lemma 22.

There is a -separating set of -homomorphisms from to 𝒮3 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 h(πφ) and (hπ)φ. The main idea here is to exclude the suprema and infima that h might not commute with. In the special case discussed in the previous section where is a min-max semiring, the fact that h is not infinitary affects just one threshold value u in . Whenever πφu, we still have h(πφ)=(hπ)φ although h is not infinitary.

Proposition 24.

Let h:𝒮𝒯 be a homomorphism (which does not necessarily respect the infinitary operations) into a min-max semiring 𝒯, and let t𝒯.

  1. (1)

    If h(πφ(a¯))t and if for all X𝒮 with πφ(a¯)=X there is some xX such that h(x)t, then also (hπ)φ(a¯)t.

  2. (2)

    If h(πφ(a¯))t and if for all X𝒮 with πφ(a¯)=X there is some xX such that h(x)t, then also (hπ)φ(a¯)t.

Based on the idea that the homomorphism separating s from t need not be infinitary in general, but the parts where it is not should neither match s nor t, we can formulate a weaker condition which we want to use to infer {φ}ψ from {φ}𝒮3ψ.

Definition 25.

A set HHom(𝒮,𝒯) of homomorphisms (that are not necessarily infinitary) is weakly -separating if for each st, there is some hH with h1(0)={0} such that

  1. (1)

    h(s)h(t);

  2. (2)

    if s=X, then h(s)=h(x) for some xX;

  3. (3)

    if t=X, then h(t)=h(x) for some xX.

Proposition 26.

If there is a weakly -separating set HHom(𝒮,𝒯) where 𝒯 is a min-max semiring and {φ}𝒯ψ, then it also holds that {φ}𝒮ψ.

Proof.

Let π be an 𝒮-interpretation violating {φ}𝒮ψ and hH be a homomorphism which weakly -separates πφ from πψ. Making use of Proposition 24 we obtain that (hπ)φh(πφ)>h(πψ)(hπ)ψ, i.e. {φ}⊧̸𝒯ψ.

It remains to prove that there is a weakly -separating set of homomorphisms h:𝒮3 for every completely distributive lattice . For min-max semirings, this is straightforward: If there is some s>u>t, we can weakly -separate s from t via h with h1(ε)=(0,u], and if otherwise t is direct predecessor of s, we choose h1(ε)=(0,t]. For general lattices, on the contrary, this procedure does not necessarily yield a homomorphism as it might be the case that u 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 P which is downward-closed, closed under finite suprema, and satisfies xyP{x,y}P for x,y.

If P is a prime ideal of , it induces the homomorphism hP:𝒮3 with hP(0)=0, hP(u)=ε if uP and hP(u)=1 otherwise. While hP only violates the fundamental property at a single “boundary” element u if is a min-max semiring, multiple boundary elements may exist in the general case. Thus, we want to construct a prime ideal P such that neither s nor t lie on the boundary of P. More precisely, P has to satisfy the following conditions, which ensure that the induced homomorphism hP weakly -separates s from t.

  1. (1)

    tP and sP,

  2. (2)

    tX for all X𝒮P and

  3. (3)

    sX for all XP.

5.3 Construction of the Prime Ideals

In order to construct for each st 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 I. For s let K(s){II semi-ideal s.t. Is}.

Lemma 29 ([20]).

The following holds for all s,t and X:

  1. (1)

    If st, then K(s)K(t);

  2. (2)

    K(X)={K(x)xX};

  3. (3)

    K(s)=s;

  4. (4)

    sK(t) if, and only if, there is some u such that sK(u) and uK(t).

The idea now is to fix an appropriate chain C depending on the elements st we want to separate and track for each x which elements of C must be contained in every semi-ideal with supremum x. This induces a partial order on (that might be different from the lattice order), which we can use to construct a homomorphism h:𝔹 based on a threshold, analogously to the special case where the lattice order was linear.

For st we have that K(s)K(t) (since otherwise s=K(s)K(t)=t). In order to construct C, fix some uK(s)K(t) and choose v,w such that uK(v),vK(w), and wK(s), which exist by Lemma 29(4). While u and v will make sure that sP and tP, we use w to argue that s cannot be the supremum of elements inside P. To ensure the dual property w.r.t. t and that the induced homomorphism hP commutes with infima, we inductively extend {u,v,w} to C={ciiω}{v,w} by setting c0=u and choosing ci+1 arbitrarily such that ciK(ci+1) and ci+1K(v). Note that aK(b) implies ab as {ccb} is a semi-ideal with supremum b. Thus, C is a chain.

We claim that P{xK(x)CK(v)C}={xK(x)CK(v)C} has the desired properties w.r.t. s and t. First, we prove that P induces a homomorphism hP:𝔹 (and thus a homomorphism hP:𝒮3) which even commutes with arbitrary infima (while this is in general not true for suprema).

Figure 1: Construction of the prime ideal weakly -separating s from t, where xP in the case on the left and xP on the right.
Theorem 30.

P is a prime ideal and for each X with XP, it holds that XP.

Proof.

Let x0,x1P, i.e. K(xi)CK(v)C for i{0,1}. By downward-closedness, there must be an i{0,1} such that K(xi)CK(x1i)C. With Lemma 29(2) this yields K(x0x1)C=(K(x0)K(x1))C=(K(x0)C)(K(x1)C)=K(x1i)CK(v)C and thus x0x1P. Now let xyP. Since K(x)CK(y)CK(v)C, we also have that xP.

It remains to prove that XP implies XP. We prove the contraposition, so let X such that K(v)CK(x)C for each xX. We claim that K(v)CK(X)C. Let yK(v)C. By definition of C, there must be some z such that yK(z) and zK(v)C{K(x)CxX} (if y{v,w}, we can choose zv, and for y=ci, we pick zci+1). Hence, zx for each xX, implying zX. With yK(z) this yields yK(X) as required.

By choice of C, we can finally argue that the induced homomorphism hP:𝒮3 weakly -separates s from t.

Theorem 31.

We have that tP and sP while tX for all XP and sX for all XP.

Proof.

By definition, uK(v)C while uK(t). Hence, K(t)CK(v)C, i.e. tP. Further, sP as vK(s) and thus vs, which implies K(s)CK(v)C. For XP we have that XP by Theorem 30, hence XtP. Finally, let XP. Then K(X)C={K(x)xX}C={K(x)CxX}K(v)C. Now suppose that s=X, i.e. K(s)CK(v)C. By construction, wK(s) and thus ws, which implies K(w)CK(s)C and yields with vK(w) that vK(s)CK(v). But I={{yyx}xX} is a semi-ideal with I=X=sv. Further, we have that vI since vP while IP due to XP and downward-closure of P. This is a contradiction to vK(v).

Corollary 32.

There is a weakly -separating set HHom(,𝒮3) 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 x(x=x)𝔹x(Rx¬Rx) while x(x=x)⊧̸x(Rx¬Rx), 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 A. For φnx1xn(i<jnxixjinRai) and Φ={φnnω} we have that

πΦ=nωAA,|A|=naAπ(Ra)=AA,|A|=ω{π(Ra)aA}sπ

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 ψFO with πψ=sπ for each 𝔽-interpretation π. By definition, we have that Φ𝔽ψ and, since 𝔽 has strong compactness, there must be some n0ω such that {φnnn0}𝔽ψ. But for the 𝔽-interpretation π over universe A={aiiω} with π(Rai)=0.5i we have π{φnnn0}=0.5n0>0=sπ, a contradiction.

6 Compactness up to Powers

The counterexamples against strong compactness from Section 3 rely on the following idea: By using the n-fold conjunction of the same formula, Φ was constructed such that it must be evaluated to some infinite power while every finite Φ0Φ evaluates to a finite power. This raises the question whether this is the only reason why strong compactness fails for semirings such as 𝕍,𝕃, or 𝕊(X) 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 ΦFO and every ψFO such that Φ𝒮ψ there exists a finite subset Φ0Φ such that {φnφΦ0,nω}𝒮ψ where φn denotes the n-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 ψxyzExy on π yields πψ=aAbAπ(Eab)|A|, i.e. πψ=1 if for each aA there is some bA s.t. π(Eab)=1, and πψ=0 otherwise. Now assume that there is a Boolean linear order available on π (in 𝕍 we can even use xyz(x<yxy) to express that < is Boolean) and compare πψ to the relativised formula ϑxyz(zxExy). Analogously to the previous case, we can only have that πϑ>0 if for every aA with infinitely many <-predecessors, there is some bA s.t. π(Eab)=1 because πϑ=aAbAπ(Eab)|{cc<a}|. Based on this observation, we can construct a counterexample against strong compactness up to powers for 𝕍. By adding formulae φn for each n to ϑ which make sure that the n-th minimal element in π also has an outgoing edge valuated with 1, we obtain a set Φ with Φ𝕍ψ. However, a finite subset Φ0{ϑ}{φnn<n0} cannot make sure that the n0-th element an0 has an outgoing edge labelled 1. Instead, we might still have that πΦ0=πΦ0=1 if {π(Ean0b)bA} converges to 1. The main property we use here is that even if (si)iI𝕍 converges to 1, it might be that iIsi1=(iIsi) while iIsin=1 for each n or, more generally, that h:xx does not commute with suprema. We show in Appendix A that this condition causes strong compactness up to powers to fail.

Theorem 35.

If h:xx 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 h:xx commutes with suprema as this makes h an -homomorphism.

Theorem 36.

Let 𝒮 be an infinitary absorptive semiring in which the natural order is completely distributive and where h:xx commutes with suprema, i.e. h is an -homomorphism. Then 𝒮 has strong compactness up to powers.

Proof.

If h:xx is an -homomorphism, {ss𝒮} 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 {Φ0}𝒮Φ0𝒮ψ implies {φnφΦ0,nω}𝒮{(Φ0)nnω}𝒮ψ. So let {φ}𝒮ψ and π be a model-defining 𝒮-interpretation. For the distributive lattice 𝒮0 which extends 𝒮 by an additional zero denoted 0, we also have that {φ}𝒮0ψ, as shown in Section 5, because 𝒮 and 𝒮0 both are completely distributive lattices. Let h:𝒮𝒮0 with h:ss if s>0 and h:00. Because h is an -homomorphism, so is h. Note that, as opposed to hπ, hπ must be model-defining. For πφ>0 we can conclude

πφ=h(πφ)=(hπ)φ(hπ)ψ(hπ)ψ=h(πψ)=πψπψ,

where () uses that (hπ)(L)(hπ)(L) for each literal L if (hπ) is considered an 𝒮0-interpretation. Hence, {φnnω}𝒮ψ, which proves the claim.

Corollary 37.

If 𝒮 is strongly distributive (i.e., infinitary multiplication distributes over infinitary addition in 𝒮) or n-idempotent for some n, then 𝒮 has strong compactness up to powers. In particular, the semirings 𝕊(X) and 𝕊n(X) have strong compactness up to powers.

Notice that for n-idempotent 𝒮, Theorem 36 implies that for each Φ𝒮ψ, there must be some finite set Ψ with the property that Ψ𝒮ψ due to the logical equivalence {φmφΦ0,mω}𝒮{φnφΦ0}.

7 Summary and Conclusion

Figure 2: Relationship between variants of compactness and algebraic properties of the underlying semiring. While Xfin is a finite set of variables and Xinf an infinite set, X is of arbitrary cardinality.

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 n-idempotent for any n, that is, that do not admit logical equivalences of the form φnφnφ where φn denotes the n-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 Φ0Φ 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 n-idempotence and multiplicative idempotence (lattices). We conjecture that n-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 𝒮3 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 HHom(,𝔹) (recall that H is separating if for each st there is some hH such that h(s)h(t)). We show that this is equivalent to the existence of a -separating set HHom(,𝒮3). So suppose that there is some separating HHom(,𝔹). If t=0 we can -separate s and t by mapping 0 to 0𝒮3 and every other element in to 1. Otherwise, we have t,st and there must be some hH with h(st)h(t), i.e. h(st)=h(s)h(t)=1 and h(t)=0, which implies h(s)h(t). Hence, we can -separate s from t via h:𝒮3 with h(0)=0, h(u)=ε if h(u)=0 and h(u)=1 otherwise. To prove the converse, let HHom(,𝒮3) be -separating and st. As st or ts, there must be some hH with h(s)h(t) and (h)1(0)={0}, and we can separate s and t via h:𝒮𝒯 with h(u)=0 if h(u)ε and h(u)=1 otherwise.

Proposition 24. [Restated, see original statement.]

Let h:𝒮𝒯 be a homomorphism (which does not necessarily respect the infinitary operations) into a min-max semiring 𝒯, and let t𝒯.

  1. (1)

    If h(πφ(a¯))t and if for all X𝒮 with πφ(a¯)=X there is some xX such that h(x)t, then also (hπ)φ(a¯)t.

  2. (2)

    If h(πφ(a¯))t and if for all X𝒮 with πφ(a¯)=X there is some xX such that h(x)t, then also (hπ)φ(a¯)t.

Proof.

We proceed by induction on φ(a¯) and only prove the first implication as the reasoning for (2) is analogous. The base case, where φ(a¯) is a literal, is satisfied by definition.

Let φ=φ0φ1. If th(πφ)=min(h(πφ0),h(πφ1)), then th(πφi) is true for i{0,1}. Towards a contradiction, suppose that πφi=X with h(x)<t for each xX. Then πφ=πφ1iX={πφ1ixxX} violates the assumption on πφ as h(πφ1ix)h(x)<t. Hence, the induction hypothesis can be applied to φ0 and φ1 and we obtain (hπ)φ(a¯)=min((hπ)φ0,(hπ)φ1)t.

For φ=φ0φ1 we get tmax(h(πφ0),h(πφ1)), i.e. th(πφi) for some i{0,1}. Suppose that πφi=X with h(x)<t for each xX. We cannot have that h(πφ1i)<t as πφ=πφ1iX={πφ1i}X would yield a contradiction. If πφ1i=Y where h(y)<t for yY, we obtain a contradiction by πφ=XY=XY, so the IH must either be applicable to φ0 or to φ1. Both cases yield max((hπ)φ0,(hπ)φ1)t.

Now let φ(a¯)=xψ(a¯,x) and A{aAh(πψ(a¯,a))t}. By assumption, A. Suppose that for each aA, there is some Xa such that πψ(a¯,a))=Xa and h(x)<t for xXa. Then we would have πφ(a¯)=aAXa{πψ(a¯,a)aAA}, a contradiction. Hence there must be some aA the IH can be applied to and we obtain (hπ)φ(a¯)(hπ)ψ(a¯,a)t.

It remains to prove the claim for φ(a¯)=xψ(a¯,x). By monotonicity of h, we have that h(πψ(a¯,a))h(πφ(a¯))t for each aA. Suppose that there is some aA such that πψ(a¯,a)=X with h(x)<t for xX. To infer a contradiction, we observe that πφ(a¯)=XbA{a}πψ(a¯,b)={xbA{a}πψ(a¯,b)xX} with h(xbA{a}πψ(a¯,b))h(x)<t for xX. Hence we have that (hπ)ψ(a¯,a)t for each aA and thus (hπ)φ(a¯)=aA(hπ)ψ(a¯,a)t.

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 h:xx does not commute with suprema, then there is some X𝒮 with {xxX}<(X) while {xnxX}=(X)n for each nω.

Proof.

By monotonicity, we have {xxX}(X) for each X𝒮, so if h does not respect suprema, there must be some X0𝒮 such that {xxX0}<(X0). Note that X0 must be infinite as st=(st) is true for every s,t𝒮 (we obtain (st)2nsntn by observing that every term in (st)2n contains s or t at least n times). We construct a chain (Xi)iω according to Xi+1{xyx,yXi}. It follows by induction that {xxX0}={xxXi} for each iω as {xxXi+1}={(xy)x,yXi}={xyx,yXi}={xxXi}. We claim that X{Xiiω} has the desired properties. On the one hand, we have that {xxX}={{xxXi}iω}={xxX0}<(X0)(X). Moreover, {xnxX}(X)n for each nω due to monotonicity. By construction, X is closed under finite suprema and hence

(X)n ={x1xnx1,,xnX}
{(x1xn)nx1,,xnX}={xnxX}.

Theorem 35. [Restated, see original statement.]

If h:xx 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 Φ{φnnω}{ϑ,φLO}𝒮xyzExyψ where

φn x1xn(φpre(x1,,xn)inyExiy) with
φpre(x1,,xn) y(yx1i<nxi<xi+1(xiyyxi+1)),
ϑ xyz(zxExy)

and φLO states (in Boolean semantics) that < is a linear order. Let π be a model-defining 𝒮-interpretation with πΦ>0 and recall the flattening π𝔹 of π, where π𝔹(L)=1 if, and only if, π(L)>0. Since 1 is maximal in 𝒮, we have that π𝔹(L)π(L) for all LLitA(τ). By monotonicity, this inequality can be lifted to formulae, and for each φΦ, we get π𝔹φπφ>0, i.e. π𝔹φ=1. Due to π𝔹φLO=1, π𝔹 is linearly ordered by <. Moreover, π𝔹φpre(a1,,an)=1 if, and only if, a1,,an is a prefix of <. Hence, π𝔹φn=1 for each n implies there is an infinite discrete prefix (ai)iωA w.r.t. <.

For each n, (a1,,an) is the unique tuple such that π𝔹φpre(a1,,an)=1 and thus the unique tuple with πφpre(a1,,an)>0. Therefore, πφninbAπ(Eaib) and thus π{φnn}iωbAπ(Eaib)iωbAπ(Eaib). For every aA{aiiω}A it holds that

πyz(zaEay) =bAcA(π(ca)π(Eab))
bAiω(π(aia)=0π(Eab))
=bAπ(Eab).

Hence, πϑaAbAπ(Eab) and overall πΦaAbAπ(Eab)=πψ.

Now let Φ0Φ be finite and n0 be maximal such that φn0Φ0. By assumption, h does not commute with suprema, so we can fix a set X={sββOn,β<|X|} as in Lemma 38. In order to disprove {φnφΦ0,nω}𝒮ψ, we construct an 𝒮-interpretation π such that π{φnnn0}{ϑ,φLO}=(β<|X|sβ)>β<|X|sβ=πψ. The universe of π consists of elements {aββ<|X|} and we set π(aβ<aγ)=1 if, and only if, β<γ, implying πφLO=1. Further, we define π(Eaib)=1 for each iω{n0+1} and bA, which yields πφn=1 for nn0, while setting π(Ean0+1aβ)=sβ. Since πyz(zaEay)=1 for all aan0+1, we obtain πϑ=β<|X|sβn0=(β<|X|sβ)n0 and overall π{φnnn0}{ϑ,φLO}=(β<|X|sβ) as desired. On the other hand, πxyzExy=πyzEan0+1y=bAπ(Ean0+1b)=β<|X|sβ.

Corollary 37. [Restated, see original statement.]

If 𝒮 is strongly distributive (i.e., infinitary multiplication distributes over infinitary addition in 𝒮) or n-idempotent for some n, then 𝒮 has strong compactness up to powers. In particular, the semirings 𝕊(X) and 𝕊n(X) have strong compactness up to powers.

Proof.

By Theorem 36, it suffices to verify that (iIsi)iIsi whenever 𝒮 meets one of the above conditions. First suppose that 𝒮 is strongly distributive (such as 𝕊(X)). W.l.o.g. we can assume that I is infinite since the finite case holds in every infinitary absorptive semiring (see the proof of Lemma 38). Because every f:|I|+I must hit some iI infinitely often, we obtain (iIsi)=(iIsi)|I|+={α<|I|+sf(α)f:|I|+I}iIsi.

Now let 𝒮 be n-idempotent for some n, which, by finitary distributivity, implies that (iIsi)=(iIsi)n={insf(i)nf:[1,n]I}. We fix some f:[1,n]I and observe that

insf(i)(sf(1)sf(n))n=(sf(1)sf(n))nnsf(1)nsf(n)niIsi,

where () is due to the fact that each summand in (sf(1)sf(n))nn must contain some sf(i) at least n times. Hence, iIsi is an upper bound of {insf(i)nf:[1,n]I}, 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 ΦFO and ψFO, 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 Φ{ψ}FO.

  1. (1)

    If πΦπψ for arbitrarily large finite 𝒮-interpretations π, then πΦπψ also holds for some infinite π.

  2. (2)

    If πΦπψ for some infinite 𝒮-interpretation π, then there is some πκ for each κCn with |π|κ such that πκΦπκψ.

Example 40.

Let 𝒮 be a completely distributive lattice. We show there is no ΦFO such that πΦ={sπ(Ra)=s for infinitely many aA} for each 𝒮-interpretation π. Towards a contradiction, suppose that Φ exists. For finite π, we have that πΦ==1. Hence, we can find for each n some πn with |πn|=n such that πΦπxRx. For π with |π|>|𝒮|, however, we have that {π(Ra)π(Ra) occurs infinitely often in π}, which implies πΦπxRx, 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 (si)iI there exist countable subsequences indexed by J,KI such that iIsi=jJsj and iIsi=kKsk. A semiring is countably tame if its infinitary sum and product operations are.

Clearly, the min-max semiring over [0,1] is countably tame.

Definition 42.

Let πA:LitA(τ)𝒮 be a semiring interpretation. A subinterpretation πBπA is the restriction of πA to LitB(τ) for some subset BA. An elementary subinterpretation, denoted πBπA, satisfies in addition that πBφ(b¯)=πAφ(b¯) for every formula φ(x¯)FO(τ) and every tuple b¯ in B.

Theorem 43 (Downward Löwenheim–Skolem).

Every 𝒮-interpretation πA:LitA(τ)𝒮 with countable vocabulary τ into a countably tame semiring 𝒮 has a countable elementary subinterpretation πBπA.

Proof.

We construct a countable chain B0B1 of countable subsets BnA as follows. Let B0. Construct Bn+1 by adding to Bn, for every formula φ(x)FO(τBn), countable collections (bφ,i)i<ω and (cφ,i)i<ω of elements from A such that πAxφ(x)={πAφ(bφ,i)i<ω} and πAxφ(x)={πAφ(cφ,i)i<ω}, which is possible since the semiring is countably tame. Finally, let Bn<ωBn, which is clearly countable. We claim that B induces an elementary subinterpretation πBπA. Consider any formula ψ(y¯)FO(τ) and any tuple b¯ over B. We have to prove that πBψ(b¯)=πAψ(b¯). This is proved by induction on ψ. The only non-trivial cases are ψ(y¯)=xφ(x,y¯) and ψ(y¯)=xφ(x,y¯). Obviously there is some n<ω such that all components of b¯ are in Bn which means that φ(x,b¯)FO(τBn). The construction makes sure that Bn+1 and hence B, contains witnesses (bφ,i)i<ω and (cφ,i)i<ω to make sure that

πAxφ(x,b¯)={πAφ(bφ,i,b¯)i<ω}={πBφ(bφ,i,b¯)i<ω}=πBxφ(x,b¯),

and similarly for ψ(y¯)=xφ(x,y¯) using the witnesses (cφ,i)i<ω.