Key idea of this section
Formulas are generated from atoms by the connectives; every formula is read in exactly one way.
A valuation v : At → {0, 1} extends uniquely to all formulas.
Γ ⊨ φ means: every valuation satisfying all of Γ satisfies φ.The language
Fix a set At of propositional atoms (or variables), usually At = {p₀, p₁, p₂, …}. The set Form of propositional formulas is the smallest set of finite strings over the alphabet At ∪ {¬, ∧, ∨, →, ↔, (, )} ∪ {⊤, ⊥} such that every atom, ⊤ and ⊥ belong to Form, and whenever φ, ψ ∈ Form, the strings ¬φ, (φ ∧ ψ), (φ ∨ ψ), (φ → ψ) and (φ ↔ ψ) belong to Form. Equivalently, Form is the union of the sets Form₀ ⊆ Form₁ ⊆ … where Form₀ consists of the atoms and constants and Formₙ₊₁ adds all strings obtained from members of Formₙ by one application of a connective. The second description shows that every formula has a finite construction sequence, and it justifies proof by induction on formulas: if a property holds of the atoms and constants and is preserved by each connective, it holds of every formula.
In practice we drop outermost brackets and adopt the conventions that ¬ binds most tightly, then ∧ and ∨, then → and ↔, and that → associates to the right. These are abbreviations only; the official objects are fully bracketed strings.
Unique readability
To define anything by recursion on formulas we need to know that a formula cannot be built in two different ways. This is the content of the unique readability theorem.
For a string s let b(s) be the number of left brackets in s minus the number of right brackets.
Lemma 1.1. (i) Every formula φ has b(φ) = 0 and every initial segment of φ has b ≥ 0. (ii) Every proper nonempty initial segment of a formula that begins with a left bracket has b ≥ 1. (iii) No formula is a proper initial segment of another formula.
Proof. (i) and (ii) are proved together by induction on φ. Atoms and constants contain no brackets. The initial segments of ¬φ are the empty string and ¬t with t an initial segment of φ, so the claims pass from φ to ¬φ. The proper nonempty initial segments of (φ ∗ ψ) are "(" t with t an initial segment of φ, and "(" φ ∗ t′ with t′ an initial segment of ψ (t′ may be all of ψ). By induction these have b = 1 + b(t) ≥ 1 and b = 1 + 0 + b(t′) ≥ 1, and the whole formula has b = 1 + 0 + 0 − 1 = 0. For (iii), suppose the formula ψ is a proper initial segment of the formula φ, and induct on φ. An atom or constant has no proper nonempty initial segment. If φ begins with a left bracket, so does ψ, and then b(ψ) = 0 by (i) but b(ψ) ≥ 1 by (ii), a contradiction. If φ = ¬φ′, then ψ = ¬ψ′ with ψ′ a formula that is a proper initial segment of φ′, contradicting the induction hypothesis. ∎
Theorem 1.2 (Unique readability). Every formula φ is exactly one of: an atom, a constant, ¬ψ for a unique ψ, or (ψ ∗ χ) for a unique binary connective ∗ and unique formulas ψ, χ.
Proof. The first symbol of φ determines which case occurs. If ¬ψ = ¬ψ′, then ψ = ψ′ trivially. Suppose (ψ ∗ χ) = (ψ′ ∗′ χ′). Then ψ and ψ′ are both initial segments of the same string, so one is an initial segment of the other, and by Lemma 1.1(iii) they are equal. Deleting them, the next symbol gives ∗ = ∗′, and what remains, minus the final bracket, gives χ = χ′. ∎
Semantics
A valuation is a function v : At → {0, 1}. By unique readability v extends to a unique function v̄ : Form → {0, 1} satisfying v̄(⊤) = 1, v̄(⊥) = 0, v̄(¬φ) = 1 − v̄(φ), and
v̄(φ ∧ ψ) = min(v̄(φ), v̄(ψ)) v̄(φ ∨ ψ) = max(v̄(φ), v̄(ψ)) v̄(φ → ψ) = max(1 − v̄(φ), v̄(ψ)) v̄(φ ↔ ψ) = 1 exactly when v̄(φ) = v̄(ψ)
We write v ⊨ φ when v̄(φ) = 1. A formula is a tautology (⊨ φ) if every valuation satisfies it, satisfiable if some valuation does, and a contradiction if none does. For a set Γ of formulas, Γ ⊨ φ (φ is a semantic consequence of Γ) means that every valuation satisfying every member of Γ also satisfies φ. Formulas φ and ψ are logically equivalent, φ ≡ ψ, if φ ⊨ ψ and ψ ⊨ φ, that is, if φ ↔ ψ is a tautology.
Lemma 1.3 (Coincidence). If v and w agree on the atoms occurring in φ, then v̄(φ) = w̄(φ).
Proof. Induction on φ; the inductive steps use only the values on immediate subformulas. ∎
The coincidence lemma means that a formula in n atoms has only 2ⁿ relevant valuations, which is why truth tables decide tautologyhood. Two elementary but constantly used facts follow directly from the definitions.
Proposition 1.4. (i) Γ ⊨ φ → ψ if and only if Γ ∪ {φ} ⊨ ψ (the semantic deduction theorem). (ii) Γ ⊨ φ if and only if Γ ∪ {¬φ} is unsatisfiable.
Proof. (i) If Γ ⊨ φ → ψ and v satisfies Γ ∪ {φ}, then v̄(φ → ψ) = 1 and v̄(φ) = 1 force v̄(ψ) = 1. Conversely, if Γ ∪ {φ} ⊨ ψ and v satisfies Γ, either v̄(φ) = 0, making φ → ψ true, or v̄(φ) = 1, so v̄(ψ) = 1. (ii) A valuation satisfying Γ ∪ {¬φ} is exactly a valuation satisfying Γ but not φ. ∎
Substitution
If φ is a formula in the atoms p₁, …, pₙ and ψ₁, …, ψₙ are formulas, write φ[ψ₁/p₁, …, ψₙ/pₙ] for the result of simultaneously replacing each pᵢ by ψᵢ. A straightforward induction proves the substitution lemma: v̄(φ[ψ⃗/p⃗]) = w̄(φ), where w is the valuation with w(pᵢ) = v̄(ψᵢ). Consequently every substitution instance of a tautology is a tautology, and replacing a subformula by a logically equivalent one preserves logical equivalence. These two facts license all the algebraic manipulation of formulas that follows.
Exercise
- (a)How many distinct formulas of length exactly 4 (counting every symbol, brackets included) can be built from the single atom p using only ¬ and the official bracketing?
- (b)Show that p → (q → p) is a tautology and that (p → q) → p is not.
- (c)Is {p ∨ q, ¬p ∨ r, ¬q ∨ r} ⊨ r true?
Show solution
Answers: (a) Only ¬¬¬p. With ¬ alone every formula is ¬ᵏp, of length k + 1, so length 4 forces k = 3. (b) p → (q → p) can only be false if p = 1 and q → p = 0, which needs p = 0, impossible. For (p → q) → p take p = 0: then p → q = 1 and the whole formula is 0. (c) Yes. If v satisfies all three and v(r) = 0, then ¬p ∨ r and ¬q ∨ r force v(p) = v(q) = 0, contradicting p ∨ q. This is the pattern of proof by cases, and also a single resolution step (Lesson 5).