Polynomial ring calculus for modal : a new semantics and proof method for modalities

Juan C. Agudelo∗ Walter Carnielli†

Abstract A new (sound and complete) adequate semantics for the modal S5 is defined from the polynomial ring calculus (PRC), which permit to perform modal deductions through polynomial handling. This paper also investigates relationships among the PRC here defined, the algebraic semantics for modal logics, equational logics and the Dijkstra-Scholten equational-proof style. The method proposed can be easily extended to other modal logics.

Yet another semantics for modal logic?

Besides its indisputable success, there may be reasons to doubt about the uni- versal acceptability of the possible worlds semantics (often called relational se- mantics or Kripke semantics) for modal logics, basically because they reduce (or equate) meaning with extensions of worlds. Indeed, criticisms against possible-worlds semantics abound. For instance, [16] intends to show that the very assumptions of possible-worlds semantics lead to the absurd conclusion that all propositions are necessarily true. Even if this critique would be perhaps circumscribed to uses of possible-worlds semantics in quantified modal logic, it is not easy to rebut to the well-known Quine’s criticisms about the difficulties in separating the notion of possibility within a world from the notion of consistency of the world’s description (cf. Section 1 of [19]). But there are other issues with regard to the possible-worlds account of modal notions. As argued in [12], the mathematics associated with such seman- tics may be quite complicated, besides the inappropriateness of the possible- worlds to formalizing knowledge, belief and other non-alethic modal concepts. Other interesting semantical approaches like algebraic semantics, neighbor- hood semantics, and topological semantics have been employed in the charac- terization of modal logics (see [3] and [13]), what by itself suggests that the

∗Ph.D. Program in Philosophy, area of Logic, IFCH and Group for Applied and Theoretical Logic- CLE, State University of Campinas - UNICAMP, Brazil. Logic and Computation Research Group, Eafit University, Colombia. †IFCH and Group for Applied and Theoretical Logic- CLE, State University of Campinas - UNICAMP, Brazil. SQIG - IT, Portugal.

1 issue of finding a satisfactory semantics for modal notions is far from closed. The internal semantics proposed in [12] is indeed quite simple, but we intro- duce here a still much simpler semantics. What we propose is a new adequate semantic for modal logics, which is based in the polynomial ring calculus (PRC) introduced in [6] (see also [7] for a further development). Our proposal has the technical advantage of providing an easy mechanical procedure to perform modal deductions, and the philosophical benefit of shedding some light on the indeterministic character of modal reasoning. This approach offers, we believe, a new insight for the investigation of modal logics, since it radically separates possibility and necessity from the possible-worlds standpoint. The PRC basically consists in translating logic formulas into polynomials over finite (Galois) fields, and into performing deductions by accomplishing polynomial operations. Elements of the field represent truth-values, and poly- nomials represent possible truth-values that formulas can take. This makes that truth conditions on formulas can be determined by reducing polynomials through PRC rules. PRC can be regarded as an algebraic semantics, in which the structure of polynomials reflects the structure of truth-value conditions for logic formulas; it can also be seen as a proof method (as much as a tableau calculus can be viewed as a proof-theoretical or as a model-theoretical device). In [6], PRC is described in detail and is applied to the classical (CPL), many-valued logics and paraconsistent logics. Here we show that this method can be successfully applied to modal logics as well. The structure of the paper is the following: in Section 1 the PRC for S5 is defined and some examples of deductions with the calculus are treated. Section 2 proves the soundness and completeness of PRC for S5. In Section 3 a strong relationship between modal algebras and the structure of polynomials in the PRC is discussed. Relationships with equational logic are presented in Section 4. In Section 5 it is explained how an equational-proof system (`ala Dijkstra- Scholten) can be defined via the PRC for S5, and the remarks at Section 6 explain how the methods here proposed can be extended to other modal logics. If, as picturesquely put in [3, p. 5], modal formulas talk about Kripke models from the inside, our method shows that modal formulas also talk about the invisible side of truth-values, and indeed, modal formulas do this by talking about the values that hidden variables display.

1 Defining the polynomial ring calculus for S5

As mentioned above, the PRC consists in translating logic formulas into polyno- mials with coefficients in Galois fields, and performing deductions by reducing polynomials. The values in the Galois field represent truth-values and polyno- mials establish the conditions of truth-values of formulas. Taking into account that Galois fields are denoted by GF (pn) (where p is a prime number, the field characteristic, and n is a natural number), the polynomial operations to perform deductions in PRC are governed by the following rules: A first group of rules, the ring rules, corresponding to the ring properties of addition and multiplica-

2 tion (addition is associative and commutative, there is a ‘zero’ element and all elements have ‘addition inverse’; multiplication is associative, there is a ‘one’ ele- ment and multiplication distributes over addition). A second group of rules, the polynomial rules, establishes that the addition of an element x exactly p times can be reduced to the constant polynomial 0 and, in general, that elements of the form xi · xj can be reduced to xk(mod q(x)), for k ≡ i + j(mod (pn − 1)) and q(x) a convenient primitive polynomial (i.e. and irreducible polynomial of degree n with coefficients in Zp). There are also two inference metarules, the uniform substitution, which allows us to substitute variables in a polynomial by polynomials (in all occurrences of the variable), and the Leibniz rule, which allows us to perform substitutions by ‘equivalent’ polynomials.1 Thus, defining a PRC for an specific logic consists into selecting a field F to represent truth- values (choosing a subset of designated values), and thus defining a translation function from formulas to polynomials over such field (and also, in some cases, into defining polynomial constraints, which consist in new polynomial reduc- tion rules). In such a way, polynomial operations allows us to perform valid deductions. As a motivation, we will first present PRC for the Classical Propositional Calculus (CPL), and then extend it to the modal system S5. In both cases, formulas are translated into polynomials over the field Z2 (the integers module 2) and the only designated value is 1. In this case, elements of the form x + x reduce to 0 and elements of the form x · x reduce to x. Definition 1 (PRC for CPL). Let F orCP L be the set of well-formed formulas of CPL, and let X = {xp1 , xp2 ,...} be a set of algebraic variables. The PRC for CPL is determined by the translation function ∗: F orCP L → Z2[X] recursively defined by:2

∗ (pi) = xpi if pi is a propositional variable, (¬α)∗ = α∗ + 1, (α → β)∗ = α∗(β∗ + 1) + 1.

By means of defining α ∨ β def= ¬α → β and α ∧ β def= ¬(α → ¬β), we have that (α ∨ β)∗ = α∗β∗ + α∗ + β∗ and that (α ∧ β)∗ = α∗β∗. Now, it is natural to define the notions of valuation and consequence relation in the context of PRC. The notions of satisfaction and validity are the same than the ones for valuation semantics, but taking into account the definition of valuation for the PRC. The definition of valuation will be slightly modified below for the logic S5, in order to deal with polynomial constraints. Definition 2 (L-PRC-valuation). Let F be the field and X be the set of algebraic variables used in a PRC for a logic L, an L-PRC-valuation is a function v: X → F . i.e. a L-PRC-valuation is an assignment of values to algebraic variables.

1PRC reduction rules correspond to the usual operations performed in the proof of poly- nomial equations over a finite field, thus we do not present such rules here in detail. For a detailed presentation see [6]. 2Products will be denoted by concatenation (avoiding the · symbol) as usual.

3 In order to simplify notation, the assignment of values by a valuation v to −→ variables in a set X will be denoted by X , and the value of a polynomial P v−→ under the valuation v will be denoted by P [X v]. Definition 3 (L-PRC-consequence-relation). Let F be the field and X be the set of algebraic variables used in a PRC for a logic L, and let ∗ be the translation function mapping formulas of L into polynomials in F [X]. Consider D ⊂ F (D 6= ∅) as being the set of designated values. A formula α of L is an L-PRC- ∗ −→ consequence of a set of formulas Γ of L (denoted by Γ |≈L α) if α [X v] ∈ D ∗ −→ whenever γ [X v] ∈ D, for every formula γ ∈ Γ and any L-PRC-valuation v.

In cases where D is a singleton (D = {d}), we have that |≈L α if and only if α∗ reduces, by polynomial operations, to the constant polynomial d (see [6]). It is easy to prove that the PRC for CPL in Definition 1 is sound and com- plete. Indeed, the translation function ∗ can be considered as defining classical valuations (for each assignment of values to variables in X we have a classical valuation), and thus the soundness and completeness of classical valuations for the CPL implies at once the soundness and completeness for PRC for CPL. The following example shows how deductions are accomplished in the PRC for CPL (symbol ≈ will be used to denote polynomial reductions):

Example 1. |≈CPL p ∨ ¬p:

(p ∨ ¬p)∗ = p∗(¬p)∗ + p∗ + (¬p)∗

= xp(xp + 1) + xp + xp + 1

≈ xpxp + xp + 1

≈ xp + xp + 1 ≈ 1.

We now proceed to extend to S5 the previously defined PRC for CPL. S5 is usually defined by extending CPL by introducing a unary necessitation operator  and a unary possibility operator ♦, and adding the following axioms and rule:

(α → β) → (α → β), (K) α → α, (T) α → ♦α, (B) α → α, (4) ` α implies ` α. (Nec)

Here we will consider the connectives ¬, →, as well as the operator , as primitive in the language, while ∨, ∧ and ♦ will be considered to be defined in def terms of them (definitions of ∨ and ∧ are above, and ♦α = ¬¬α). In [6], hidden variables are introduced in the PRC for logics which are not characterizable by means of finite matrices. In this way, the indeterminism of

4 non-truth-functional bi-valued semantics is captured by the indeterminism of hidden variables. Hidden variables are extra algebraic variables, different to those associated with propositional variables, and they are supposed to take values in the field in a random way. The presence of hidden variables, in the polynomial corresponding to a specific formula, indicates that the truth-values of that formula does not functionally depend on the truth-values of its propo- sitional variables. By following this strategy and introducing polynomial con- straints as additional rules governing the indeterminism, we define the PRC for S5: Definition 4 (PRC for S5). Let F orS5 be the set of well-formed formulas of S5, and let X = {x , x ,...} and X0 = {x , x ,...} be disjoint sets of p1 p2 α1 α2 algebraic variables. The PRC for S5 is determined by the translation function 0 ∗: F orS5 → Z2[X ∪ X ] recursively defined by:

∗ (pi) = xpi if pi is a propositional variable, (¬α)∗ = α∗ + 1, (α → β)∗ = α∗(β∗ + 1) + 1, ( α)∗ = x .  α Additionally, the variables in X0 (the hidden variables) are subject to the fol- lowing polynomial constraints:

x (x (x + 1)) ≈ 0, (cK) (α→β) α β x (α∗ + 1) ≈ 0, (cT) α α∗(x + 1) ≈ 0, (cB) ¬¬α x (x + 1) ≈ 0, (c4) α α α∗ ≈ 1 implies x ≈ 1. (cNec) α From the definition of , we immediately obtain that ( α)∗ = x + 1. ♦ ♦ ¬α In order to facilitate the application of polynomial constraints, the following lemma establishes some properties of hidden variables: Lemma 1.

x ≈ 0, (a) ⊥ x x ≈ 0, (b) α ¬α x ≈ x , (c) ¬¬α α x ≈ x , (d) ¬¬¬α ¬α x ≈ 1 or x ≈ 1 implies x ≈ 1, (e) α β (α∨β) x ≈ x x , (f) (α∧β) α β x ≈ x , (g) α α x ≈ x , (h) ¬α ¬α x + 1 ≈ x . (i) ¬α α

5 Proof. (a) ⊥ can be defined as ⊥ def= α ∧ ¬α. Then, ⊥∗ = (α ∧ ¬α)∗ = α∗(¬α)∗ = α∗(α∗ + 1) ≈ 0, and polynomial constraint (cT) implies that x ≈ 0. ⊥ (b) ¬α can be defined by ¬α def= α → ⊥. Then, x = x and poly- ¬α (α→⊥) nomial constraint (cK) implies that x (x (x + 1)) ≈ 0. Conse- (α→⊥) α ⊥ quently, by item (a) we have that x x ≈ 0 (i.e. x x ≈ 0). (α→⊥) α ¬α α (c) We have that (α → ¬¬α)∗ ≈ 1. Then, by polynomial constraint (cNec) it follows that x ≈ 1. On the other hand, by polynomial (α→¬¬α) constraint (cK), we have that x (x (x + 1)) ≈ 0, thus (α→¬¬α) α ¬¬α x (x + 1) ≈ 0, i.e. x x ≈ x . In a similar way, start- α ¬¬α α ¬¬α α ing from (¬¬α → α)∗ ≈ 1, it can be proved that x x ≈ x . α ¬¬α ¬¬α Consequently x ≈ x . ¬¬α α (d) By property (c) and polynomial constraint (cNec). (e) We have that (α → (α ∨ β))∗ ≈ 1, and by polynomial constraint (cNec) it follows that x ≈ 1. On the other hand, by polynomial con- (α→(α∨β)) straint (cK) we have that x (x (x + 1)) ≈ 0. Thus, if (α→(α∨β)) α (α∨β) x ≈ 1 then x ≈ 1. For the case in which x ≈ 1 the proof is α (α∨β) β similar. (f) We have that ((α∧β) → α)∗ ≈ 1, and polynomial constraint (cNec) implies that x ≈ 1. Moreover, by polynomial constraint (cK) we have ((α∧β)→α) that x (x (x + 1)) ≈ 0, then (x (x + 1)) ≈ 0, ((α∧β)→α) (α∧β) α (α∧β) α i.e. x x = x . In a similar way it can be obtained that (α∧β) α (α∧β) x x = x . (α∧β) β (α∧β) We also have that (α → (β → (α ∧ β)))∗ ≈ 1 and, by polynomial constraint (cK), x (x (x + 1)) ≈ 0. Then, (α→(β→(α∧β))) α (β→(α∧β)) x x ≈ x . In a similar way it can be proved that α (β→(α∧β)) α x x ≈ x . β (α→(α∧β)) β By polynomial constraint (cK), we have that x (x (x + (α→(α∧β)) α (α∧β) 1)) ≈ 0, i.e. x x x ≈ x x . In a similar (α→(α∧β)) α (α∧β) (α→(α∧β)) α way it can be obtained that x x x ≈ x x . (β→(α∧β)) β (α∧β) (β→(α∧β)) β Finally, by multiplying both sides of the last two reductions obtained and using the reductions proved before, it is obtained that x ≈ x x . (α∧β) α β (g) By polynomial constraint (c4), it follows that x x ≈ x . On the α α α other hand, polynomial constraint (cT) leads to x x ≈ x . There- α α α fore, x ≈ x . α α (h) By property (g) and polynomial constraint (cNec). (i) By polynomial constraint (cT) we have that x ((¬ α)∗ + 1) ≈ 1, ¬α  which implies that x (x + 1) ≈ x . On the other hand, by poly- α ¬α α nomial constraint (cB), we have that (¬ α)∗(x + 1) ≈ 0. By  ¬¬¬α x ≈ x , x ≈ x and the polynomial constraint (cNec), we ¬¬α α α α

6 also have that x ≈ x and that x ≈ x . Thus, ¬¬¬α ¬α ¬α ¬α (x + 1)(x + 1) ≈ 0, i.e. x (x + 1) ≈ x + 1. Conse- α ¬α α ¬α ¬α quently, x + 1 ≈ x . ¬α α

The following examples show how the PRC for S5 can be used to check validity and non-validity of S5 formulas.

Example 2. |≈S5 (♦p → p) ∨ (♦p → ♦p): ∗ ((♦p → p) ∨ (♦p → ♦p)) ∗ ∗ ∗ ∗ = (♦p → p) (♦p → ♦p) + (♦p → p) + (♦p → ♦p) ∗ ∗ ∗ ≈ (♦p → ♦p) ((♦p → p) + 1) + (♦p → p) ∗ ∗ ∗ ∗ ∗ ∗ ≈ ((♦p) ((♦p) + 1) + 1)((♦p) (p + 1)) + (♦p) (p + 1) + 1 ≈ ((x + 1)(x + 1) + 1)((x + 1)(x + 1)) + (x + 1)(x + 1) + 1 ¬p ¬¬p ¬p p ¬p p ≈ ((x + 1)(x ) + 1)((x + 1)(x + 1)) + (x + 1)(x + 1) + 1 ¬p ¬p ¬p p ¬p p ≈ (x + 1)(x + 1) + (x + 1)(x + 1) + 1 ¬p p ¬p p ≈ 1.

Example 3. |≈S5 ((p → p) → p) → (♦p → p): ∗ (((p → p) → p) → (♦p → p)) ∗ ∗ = (((p → p) → p)) (((♦p → p)) + 1) + 1 = x (x + 1) + 1. ((p→p)→p) (♦p→p) But we also have that:

∗ ∗ ∗ (♦p → p) = (♦p) (p + 1) + 1 = (x + 1)(p∗ + 1) + 1 ¬p ≈ 1 (by property (d) and polynomial constraint (cB)).

Then, by polynomial constraint (cNec) we obtain x ≈ 1. Consequently, (♦p→p) ∗ (((p → p) → p) → (♦p → p)) ≈ 1.

Example 4. |≈/ S5((p → p) → p): ( ( (p → p) → p))∗ = x .    ((p→p)→p) But we also have that:

∗ ∗ ∗ ((p → p) → p) = ((p → p)) (p + 1) + 1 = x (p∗ + 1) + 1, (p→p) and:

∗ ∗ ∗ (p → p) = p ((p) + 1) + 1 = x (x + 1) + 1. p p

7 At this point, we cannot appeal to any further polynomial constraints. This shows that the hidden variable x has no determined value (it takes ((p→p)→p) ∗ truth-values in a randomic way). Then (((p → p) → p)) ≈/ 1. Note that properties (a) and (b) in Lemma 1 permit the elimination of some occurrences of hidden variables in polynomials, and the other properties (except property (e)) permit to reduce the complexity of formulas that index hidden variables, but those are not all the admissible reductions. The following lemma establishes other two conditions for eliminations of hidden variables, as well as other properties that allow reductions in the complexity of indexing formulas. Such properties, together with the previous ones, permit the reduction of hidden variables x to cases in which α is a literal (i.e. a propositional variable or α the negation of a propositional variable) or a sequence of disjunctions of non- contradictory literals (i.e. disjunctions of literals without occurrences of both pi and ¬pi, for some propositional variable pi). Lemma 2.

x x ≈ x , x ≈ 1, α (α∨β) α (α∨¬α) x ≈ x , x ≈ x , (α∨α) α (α∨β) (β∨α) x ≈ x , x ≈ x , (α∨(β∨δ)) ((α∨β)∨δ) (α∨¬¬β) (α∨β) x ≈ x , x ≈ x x , (α∨(β∨¬β)) (β∨¬β) (α∨(β∧δ)) (α∨β) (α∨δ) x ≈ x x + x + x , x ≈ x x + x + 1. (α∨β) α β α β (α∨♦β) α ¬β ¬β Proof. It is left to the reader. By definition of → in terms of ¬ and ∨, x = x and (α→β) (¬α∨β) x = x . (α∨(β→δ)) (α∨(¬β∨δ)) Polynomial α∗ never reduces to 1 for cases in which α is a literal or a se- quence of disjunctions of non-contradictory literals; then, by using properties in Lemma 1 (without considering property (e)) and properties in Lemma 2, it is possible to avoid the polynomial constraint (cNec), permiting a simpler and totally equational reduction of polynomials. This also shows that S5 can be formulated without the rule of necessitation (Nec) (but at the cost of adding extra axioms).

2 Soundness and completeness

It is well-known, by a clever argument due to James Dugundji (see for in- stance [5]) that S5 and other modal logics cannot be characterized by means of truth-functional finite-valued matrices–and until now no non-truth-functional bi-valued semantics for this modal logic had been proposed. And indeed, prov- ing soundness and completeness of the PRC for S5 cannot be expected to be so easy as in the case of CPL. Moreover, there is not a direct connection between

8 the PRC for S5 and other appropriate semantics for this logic, and therefore soundness and completeness will be proved directly.3

Theorem 1 (Weak soundness). If `S5 α then |≈S5 α. Proof. Note that polynomial constraints (cK)-(c4) just establish the validity of, respectively, axioms (K), (T), (B) and (4), and that the polynomial constraint (cNec) establishes validity preservation under the necessitation rule (Nec). This, in conjunction with the fact that all CPL formulas are valid (because the PRC for S5 is an extension of the PRC for CPL), leads to the weak soundness.

Theorem 2 (Strong soundness). If Γ `S5 α then Γ |≈S5 α. Proof. The result is a consequence of the the finiteness of proofs, the validity of the metatheorem of deduction for S5 and the weak soundness above. The strong completeness theorem is proven by adapting the familiar Lindenbaum-Asser argument for the CPL. Before establishing the theorem, some definitions and lemmas are in order. Definition 5 (Valid S5-PRC-valuation). A S5-PRC-valuation is a valid S5- PRC-valuation if the values assigned to variables in X0 satisfy the polynomial constraints (cK)-(cNec). Definition 6 (ϕ-S5-saturated set). Let Γ be a set of S5-formulas and let ϕ and α be S5-formulas. Γ is a ϕ-S5-saturated set if satisfies the following two conditions:

1. Γ 0S5 ϕ,

2. if α∈ / Γ then Γ, α `S5 ϕ.

Lemma 3. Let Γ be a set of S5-formulas and let ϕ and S5-formula. If Γ 0S5 ϕ then there exists a set ∆ such that Γ ⊆ ∆ and ∆ is ϕ-S5-saturated. Proof. The proof is the same as for the classical case.

Lemma 4. Let Γ be an ϕ-S5-saturated set and let Y = {xα1 , xα2 ,...} be a set of algebraic variables indexed by S5-formulas. We define the function v: Y →

{0, 1} by v(xαi ) = CΓ(αi) (where CΓ is the characteristic function of Γ, i.e. CΓ(αi) = 1 if αi ∈ Γ, and CΓ(αi) = 0 otherwise). Thus, for any S5-formulas α and β, Γ and v satisfy the following properties:

1. α ∈ Γ if and only if Γ `S5 α, 2. ¬α ∈ Γ if and only if α∈ / Γ,

3As shown in Section 3, the structure of polynomials in the PRC for S5 correspond to a modal algebra in the class of modal algebras characterizing S5, but this does not directly entail the completeness for the PRC. Completeness results for modal algebras refer to a class of algebras, not to a specific algebra.

9 3. (α → β) ∈ Γ if and only if α∈ / Γ or β ∈ Γ,

4. if `S5 α then α ∈ Γ, 5. the restriction of v to variables in X ∪ X0 is a valid S5-PRC-valuation. Proof. Items 1, 2 and 3 are proved as in the classical case, other items are proved ∗ −−−−→0 below. In some places of the proof we will use the fact that v(xα) = α [X ∪ X v]; this fact can be easily proved by induction.

4. Suppose that `S5 α, by (Nec) it is obtained that `S5 α. Then, by monotonicity and item 1 we have that α ∈ Γ. 5. We will prove that v validates, respectively, polynomial constraints (cK)- (cNec): (i) If (α → β) ∈/ Γ, by definition of v, v(x ) = 0. Then,  (α→β) independently of the values of v(x ) and v(x ), we have that α α v(x )(v(x )(v(x ) + 1)) = 0. (α→β) α β If (α → β) ∈ Γ by item 1 it follows that Γ `S5 (α → β). Moreover, (α → β) `S5 α → β, then Γ `S5 α → β. Then, by item 1 we have that (α → β) ∈ Γ, and by item 3 it follows that α∈ / Γ or β ∈ Γ. Consequently, by definition of v, v(x ) = 0 or v(x ) = 1,  α β and in both cases v(x )(v(x )(v(x ) + 1)) = 0. (α→β) α β (ii) If α∈ / Γ, by definition of v, v(x ) = 0. Then, independently  α of the value of v(x ), we have that v(x )(v(x ) + 1) = 0 (i.e. −−−−→ α α α v(x )(α∗[X ∪ X0 ] + 1) = 0). α v If α ∈ Γ by item 1 it follows that Γ `S5 α. Moreover, we have that α `S5 α, then Γ `S5 α and item 1 imply that α ∈ Γ. Therefore, by item 1, v(x ) = 1. Consequently, v(x )(v(x ) + 1) = 0 (i.e. −−−−→α α α v(x )(α∗[X ∪ X0 ] + 1) = 0). α v (iii) If α∈ / Γ, by definition of v, v(xα) = 0. Then, independently of the value of v(x ), we have that v(x )(v(x ) + 1) = 0 (i.e. −−−−→ ♦α α ♦α α∗[X ∪ X0 ](v(x ) + 1) = 0). v ♦α If α ∈ Γ, by item 1 Γ `S5 α. Moreover, we have that α `S5 ♦α, then Γ `S5 ♦α and by item 1 it follows that ♦α ∈ Γ. Therefore, by item 1 it we conclude v(x ) = 1. Consequently, v(x )(v(x )+1) = 0 −−−−→ ♦α α ♦α (i.e. α∗[X ∪ X0 ](v(x ) + 1) = 0). v ♦α (iv) If α∈ / Γ, by definition of v, v(x ) = 0. Then, independently of  α the value of v(x ), we have that v(x )(v(x ) + 1) = 0. α α α If α ∈ Γ, item 1 implies that Γ `S5 α. Moreover, as α `S5 α, then Γ `S5 α and, by item 1, α ∈ Γ. Therefore, by item 1 it follows that v(x ) = 1. Consequently, v(x )(v(x ) + 1) = 0. α α α (v) If α ∈ Γ, by definition of v, v(xα) = 1. Moreover, by item 2 it follows that ¬α∈ / Γ, and by definition of v we have that v(x¬α) = 0. Thus v(x¬α) = v(xα) + 1. The case where α∈ / Γ is similar.

10 (vi) Suppose that v(x ) = 0, then by definition of v, α∈ / Γ; and α  therefore, by item 4, 0S5 α. This, in conjunction with Lemma 3 implies the existence of a ϕ-S5-saturated set ∆ such that α∈ / ∆ (∆ could be just Γ, if α∈ / Γ). Let the function v0 be defined as v, but considering the set ∆ instead of Γ. Then, v0(α∗) = 0 and ∗ −−−−→0 ∗ consequently α [X ∪ X v0 ] = 0, i.e. α ≈/ 1.

Theorem 3 (Strong completeness). If Γ |≈S5 α then Γ `S5 α.

Proof. Suppose that Γ 0S5 α. By Lemma 3 there exists a ϕ-S5-saturated set ∆ such that Γ ⊆ ∆. Then, by Lemma 4, the function v: Y → {0, 1} (where

Y = {xα1 , xα2 ,...}) defined by v(xαi ) = C∆(αi), when restricted to variables in X ∪ X0, is a valid S5-valuation. Therefore, by definition of v and by the fact ∗ −−−−→0 ∗ −−−−→0 that v(xα) = α [X ∪ X v], we have that γ [X ∪ X v] = 1 for all γ ∈ Γ and that ∗ −−−−→0 α [X ∪ X v] = 0. Then, Γ|≈/ S5α.

3 The relationship with modal algebras

In [17] and [18], Edward J. Lemmon defines a series of modal algebras (also called boolean algebras with operators in other contexts) characterizing different modal logics, where the strongest system is S5. We show here how the polynomials in the PRC for S5 can be regarded as a modal algebra (in the class of modal algebras characterizing S5). Before that, we will present the required definitions and a theorem from [17] and [18]:4 Definition 7. A structure M = hM, t, u, −, ni is a modal algebra if M is a set of elements closed under operations t, u, − and n such that: 1. hM, t, u, −i is a , and 2. n(x u y) = n(x) u n(y), for all x, y ∈ M. A modal algebra is normal if n(1) = 1. A normal modal algebra is epistemic if n(x) ≤ x, symmetric if x ≤ n(p(x)) and transitive if n(n(x)) = n(x), for all x ∈ M.

Theorem 4. `S5 α if and only if α is satisfied by all (finite) normal epistemic symmetric and transitive modal algebras. Proof. Cf. in [18].

4Definitions are adapted to consider the operator n (for necessity) as primitive, instead of def p (for possibility). The operator n is used to interpret  and p is defined by p(x) = − n(− x), so as to interpret ♦.

11 0 In order to regard the structure of polynomials in Z2[X ∪X ] as an (infinite) normal-epistemic-symmetric-transitive modal algebra, we first define a function relating polynomials with S5-formulas:

0 Definition 8. Let P , Q and R be polynomials in Z2[X ∪ X ], we recursively 0 define the function f: Z2[X ∪ X ] → F orS5 by:  α ∨ ¬α if P = 1 (the constant polynomial 1),  α ∧ ¬α if P = 0 (the constant polynomial 0),  f(P ) = α if P = xα, (1)  f(Q) ∧ f(R) if P = QR,  f(Q) Y f(R) if P = Q + R.

def where the connective Y represents the exclusive or (i.e. αYβ = (α∨β)∧¬(α∧β)). 0 The following operations on Z2[X ∪ X ] are thus defined: 0 Definition 9. Let P and Q be polynomials in Z2[X ∪ X ], operations t, u, − and n are defined by: • P t Q = PQ + P + Q, • P u Q = PQ, • − P = P + 1, • n(P ) = x . f(P ) The following relations are also defined:

0 Definition 10. Let P and Q be polynomials in Z2[X ∪ X ]; then, relations . and =∼ are defined by:

−−−−→0 −−−−→0 • P . Q if Q[X ∪ X v] = 0 implies P [X ∪ X v] = 0, for all valid S5-PRC- valuations. ∼ • P = Q if P . Q and Q . P . ∼ It is easy to show that . is a preorder relation and that = is an equivalence ∼ 0 0 ∼ relation. Then = partitions Z2[X ∪ X ] in the quotient set Z2[X ∪ X ]/ == 0 0 ∼ {[P ]: P ∈ Z2[X ∪ X ]}, where [P ] = {Q ∈ Z2[X ∪ X ]: Q = P } denotes the equivalence class of P . Moreover, =∼ is a congruence with respect to the operations in Definition 9. The following operations can thus be defined on 0 ∼ Z2[X ∪ X ]/ =: 0 ∼ Definition 11. Let [P ] and [Q] be equivalence classes in Z2[X ∪ X ]/ =, oper- ations t0, u0, −0 and n0 are defined by: • [P ] t0 [Q] = [PQ + P + Q],

12 • [P ] u0 [Q] = [PQ], • −0 [P ] = [P + 1], • n0([P ]) = [x ]. f(P ) 0 0 ∼ 0 The order relation . on Z2[X ∪ X ]/ = is defined by [P ] . [Q] if P . Q. Now, the following theorem can be proven: 0 ∼ 0 0 0 0 Theorem 5. The structure Z = hZ2[X ∪ X ]/ =, t , u , − , n i, with the order 0 . , is an (infinite) normal-epistemic-symmetric-transitive modal algebra. Proof. • Z is a modal algebra: 0 ∼ 0 0 0 – It is easy to prove that hZ2[X∪X ]/ =, t , u , − i is a boolean algebra, with [0] and [1] (the classes of the constant polynomials 0 and 1) being respectively the elements 0 and 1 of the algebra. 0 ∼ – Let [P ] and [Q] equivalence classes in Z2[X ∪ X ]/ =; we have then: n0([P ] u0 [Q]) = n0([PQ]) (by definition of u0) = [x ] (by definition of n0) f(PQ) = [x ] (by definition of f) (f(P )∧f(Q)) = [x x ] (by property (f) in Lemma 1) f(P ) f(Q) = [x ] u0 [x ] (by definition of u0) f(P ) f(Q) = n0([P ]) u0 n0([Q]) (by definition of n0).

• Z is normal, epistemic, symmetric and transitive are direct consequences of, respectively, the polynomial constraints (cNec), (cT), (cB) and (c4).

The previous result shows that the structure Z defined on the algebra of 0 polynomial classes in Z2[X∪X ] is a particular modal algebra, so the PRC makes a very natural bridge between semantics and algebra. From this point of view, PRC is an almost organic extension of the ‘boolean setting’, so characteristic of classical logic, to modal domains.

4 Polynomial reductions as an equational the- ory

As it is defined by Tarski in [20, p. 276], equational logic is “The part of predicate logic in which equations are the only admitted formulas”. In such a logic, equations are treated as if all variables were universally quantified; the only axiom is x = x and the deduction rules are uniform substitution and the replacing of equals by equals. Thus, by using equational logic, from a set of equations (in a given language) it is possible to deduce other equations. An

13 equational theory is defined as a set θ containing all equations derivable from a set of equations Σ; such a set Σ is called a basis for θ. The equational theory of an algebra A is the set of all equations satisfied by A and the equational theory of a class of algebras K is the set of equations satisfied by all the algebras in K. Moreover, a class of algebras K is equationally defined if there exists a set of equations Σ such that K = Mod Σ, where Mod Σ is the class of models for the theory Σ.5 The ring rules and the polynomial rules defined in the PRC, if treated as equations, can be viewed as defining a basis for an equational theory (where the uniform substitution and the Leibniz rule correspond, respectively, to the uniform substitution and the replacing of equals by equals in the equational logic). In the case of CPL, the polynomials operations in the PRC equationally define the class of boolean rings. It is well-known that boolean rings and boolean algebras are term-definitional equivalents, and that the boolean algebra of two elements is a generic algebra for that class. These facts, in conjunction with the fact that boolean algebras are an adequate semantic for CPL, imply the completeness of the PRC for CPL. The polynomial reductions of the PRC for S5, on the light of the properties in Lemma 1 (with exception of property (e)) and using Lemma 2 instead of the polynomial constraint (cNec), can be viewed as an equational extension of the equational theory for boolean rings. In spite of boolean rings and boolean algebras being term-definitional equiv- alents, there are substantial distinctions between them. Indeed, as pointed out in [10], “The Boolean-ring formalism differs from Boolean algebra in that it defines a unique normal form (up to associativity and commutativity of the two operators) for every Boolean formula, called a Boolean polynomial (also known as a Zhegalkin polynomial or Reed-Muller normal form).” Such prop- erty is useful for the definition of proof methods for propositional logic and to test satisfiability (see [15] and [10]). Another fundamental distinction between boolean rings and boolean algebras is that boolean rings directly generalize to- wards many-valued logics (by means of polynomials over finite Galois fields, see e.g. [6]) while boolean algebras do not. The PRC reduction rules extend the boolean polynomials preserving their good properties, which permit to perform deductions in non-classical logics. Not only that: the PRC also establishes a relationship between syntactic deductions in propositional calculus and poly- nomial handling, in some cases showing how the ‘indeterminism’ of logics non characterizable by finite matrices can be expressed by means of hidden variables.

5 Defining equational proof systems from PRC

In [11], Edsger W. Dijkstra and Carel S. Scholten introduce a proof format in which the replacement of logically equivalent formulas is emphasized (instead of using modus ponens), in such a way that deductions are realized in an equa- tional fashion. The Dijkstra-Scholten equational proof style is formalized for the

5For a good survey of equational logic see [21].

14 propositional logic in [14] (where some advantages of that method over the tra- ditional Hilbert style of proofs are also pointed) and for the intuitionistic logic in [4]. Defining an equational proof system (`ala Dijkstra-Scholten) for a spe- cific logic basically consists in determining a complete set of logical equivalences from which all theorems of the logic can be deduced (by replacement of equiv- alent formulas and uniform substitution). As it was described in the previous section, the polynomial reductions of the PRC for S5 can be viewed as equa- tions. Such algebraic equations have a direct correspondence with equivalences between formulas in S5 which, by theorems 2 and 3, are adequate to axiomatize S5. Following such guidelines, equational proof systems can be defined for other logics, provided they are characterized by a PRC.

6 Assessing the new semanics

The definition of PRC for S5 defined above can be easily adapted to other modal logics: for the systems K, T , B and S4 it is only necessary to disregard the polynomial constraints corresponding to axioms not in the respective system. For other modal logics which extend the CPL the translation function can be the same, and polynomial constraints can be defined by translating axioms to polynomials, equaling them to the constant polynomial 1, and defining impli- cations between polynomials in order to validate deduction rules. This can be done without much ado by considering the well-known Lemmon-Scott axioms k l m n α → α and adding the constraint x k l (x m n + 1) ≈ 0 (with x ♦   ♦ ♦   ♦ ♦α meaning x + 1) to the polynomial constraints (cK) and (cNec). In this way, ¬α soundness and completeness theorems obtained for S5 can be adapted to other PRCs. Moreover, a relationship with their respective modal algebras can also be obtained: new polynomial constraints will correspond to algebraic conditions over the operator n. A PRC for S4 has an extra feature, since intuitionistic logic could in prin- ciple be also treated in polynomial terms having in sight the well-known corre- spondence between S4 and the propositional intuitionistic calculus. Issues on decidability of modal logics can also be treated through polynomials: this is, for instance, immediate for the above defined PRC for S5, although for other calculi connections with the finite-model property would have to be established. The PRC for modal logic is also related the non-deterministic matrices (cf. [1]), a generalization of ordinary multi-valued matrices, in which the truth-value of a formula can be non-deterministically assigned: actually, our method is the first example of non-deterministic semantics for modal logics. It constitutes also a particular case of possible-translations semantics (cf. [9]) − not by accident, since the latter are more expressive than the former, as argued in [8] (Theorem 38 and the following discussion). Our PRC for modal logics can be also seen as a simple system of equational logic. It is little surprise that the quotient equational logic constitutes a modal algebra (cf. Section 3): as a slogan in [2, p. xiv] defends, from the point of view of modal logic is essentially the study of certain varieties of

15 equational logic. What is surprising is how elementary it is, and how easy it is to handle the resulting high-school-fashion polynomial calculus.

Acknowledgements. This research was supported by FAPESP- Funda¸c˜aode Amparo `aPesquisa do Estado de S˜aoPaulo, Brazil, Thematic Research Project grant 2004/14107-2. The first author has been also supported by a FAPESP scholarship grant 05/04123-3, and the second by a CNPq (Brazil) Research Grant 300702/2005-1 and by the Fonds National de la Recherche Luxembourg. We would also like to thank several people who have heard about these ideas on several occasions, and have contributed with suggestions and criticisms: Roy Dickhoff, Justus Diller, J. Michael Dunn, Josep Font, Graham Priest, Jørgen Villadsen and Heinrich Wansing.

References

[1] Arnon Avron and Anna Zamansky. Generalized non-deterministic matrices and (n,k)-ary quantifiers. In S. Artemov and A. Nerode, editors, Proceed- ings of the Symposium on Logical Foundations of Computer Science, LNCS 4514, pages 26–40. Springer Berlin/Heidelberg, 2007. [2] Patrick Blackburn, Maarten de Rijke, and Yde Venema. Modal Logic. Cambridge University Press, Cambridge, 2002. [3] Patrick Blackburn and Johan van Benthem. Modal logic: A semantic per- spective. In Patrick Blackburn, Johan van Benthem, and Frank Wolter, ed- itors, Handbook of Modal Logic, pages 1–82. Elsevier North-Holland, 2006. [4] Jaime A. Boh´orquez. Intuitionistic logic according to dijkstra’s calculus of equational deduction. Notre Dame Journal of Formal Logic, 49(4):361–384, 2008. [5] Walter Carnielli and Claudio Pizzi. Modalities and Multimodalities. Springer, 2008. [6] Walter A. Carnielli. Polynomial ring calculus for many-valued logics. In B. Werner, editor, Proceedings of the 35th International Symposium on Multiple-Valued Logic, pages 20–25. IEEE Computer Society, 2005. Preprint available at CLE e-Prints vol 5, n. 3, 2005: http://www.cle.unicamp. br/e-prints/vol 5,n 3,2005.html. [7] Walter A. Carnielli. Polynomizing: Logic inference in polynomial format and the legacy of Boole. In L. Magnani and P. Li, editors, Model-Based Reasoning in Science, Technology, and Medicine, volume 64 of Studies in Computational Intelligence, pages 349–364. Springer, 2007. [8] Walter A. Carnielli and Marcelo E. Coniglio. We Will Show Them! Essays in Honour of Dov Gabbay, chapter Splitting Logics, pages 389–414. College Publications, 2005.

16 [9] Walter A. Carnielli, Marcelo E. Coniglio, and Jo˜aoMarcos. Logics of formal inconsistency. In D. Gabbay and F. Guenthner, editors, Hand- book of Philosophical Logic, volume 14, pages 15–107. Springer, 2nd edi- tion, 2007. Preprint available at CLE e-Prints vol 5, n. 1, 2005. http: //www.cle.unicamp.br/e-prints/vol 5,n 1,2005.html. [10] Nachum Dershowitz, Jieh Hsiang, Guan S. Huang, and Daher Kaiss. Boolean ring satisfiability. In Proc. 7th Intl. Conf. on Theory and Ap- plications of Satisfiability Testing (SAT 2004), pages 281–286, 2004. [11] Edsger W. Dijkstra and Carel. S. Scholten. Predicate Calculus and Program Semantics. Springer-Verlag, New York, 1990. [12] Ronald Fagin and Moshe Y. Vardi. An internal semantics for modal logic. In Proceedings of the Seventeenth Annual ACM Symposium on Theory of Computing, pages 305–315. Association for Computing Machinery, 1985. [13] Robert Goldblatt. Mathematical modal logic: a view of its evolution. In Dov M. Gabbay and John Woods, editors, Handbook of the History of Logic, volume 6. Elsevier, 2005. [14] David Gries and Fred B. Schneider. Equational propositional logic. Infor- mation Processing Letters, 53:145–152, 1995. [15] Jieh Hsiang and Guan S. Huang. Some fundamental properties of boolean ring normal forms. In Dingzhu Du, Jun Gu, and Panos M. Pardalos, edi- tors, DIMACS Series in Discrete Mathematics and Theoretical Computer Science, volume 35. 1997. [16] John-Michael Kuczynski. Does possible world semantics turn all proposi- tions into necessary ones? Journal of Pragmatics, 39(5):872–916, 2007. [17] Edward J. Lemmon. Algebraic semantics for modal logics I. Journal of Symbolic Logic, 31(1):46–65, 1966. [18] Edward J. Lemmon. Algebraic semantics for modal logics II. Journal of Symbolic Logic, 31(2):191–218, 1966. [19] Willard V. O. Quine. Two dogmas of empiricism, chapter From a Logical Point of View: Nine Logico-Philosophical Essays, pages 20–46. Harvard University Press (2nd, edition), 2006. [20] Alfred Tarski. Equational logic and equational theories of algebra. In H. A. Schmidt et. al., editor, Contributions to Mathematical Logic, pages 275–288. North Holland, Amsterdam, 1968. [21] Walter Taylor. Equational logic. Houston Journal of Mathematics, Survey 1979, 1979.

17