Lukas' Notes

Chapter 2: Propositional Logic

  • Recursive definitions and unique readability

    • A recursive definition evaluates an expression from its components. If an expression has several possible decompositions, the definition must give the same result for each of them.
    • Every natural number is either or uniquely of the form . For example, parity can be defined by

Misplaced & \operatorname{par}(0)=0,\qquad \operatorname{par}(n+1)=1-\operatorname{par}(n). <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- Unique readability similarly permits recursive definitions on the structure of terms and formulas.
  • Compactness theorem
    • A formula set is finitely satisfiable if every finite subset of is satisfiable. Different finite subsets may initially require different assignments.
    • Theorem: is satisfiable if and only if every finite subset of is satisfiable.
      • One direction is immediate: an assignment satisfying also satisfies each subset.
      • For the other direction, replace every formula by an equivalent conjunctive normal form and then collect its clauses in a set . A finite subset of comes from finitely many original formulas; an assignment satisfying those formulas also satisfies the selected clauses.
  • Resolution and finite ancestors
    • For a clause set , define its resolution closure by

Misplaced & \begin{aligned} M_0&:=M,\\ M_{n+1}&:=M_n\cup\{\operatorname{Res}_p(C_1,C_2)\mid C_1,C_2\in M_n,\ \operatorname{Res}_p(C_1,C_2)\text{ defined}\},\\ M_\infty&:=\bigcup_{n\in\mathbb N}M_n. \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- Every $C\in M_\infty$ belongs to some $M_n$. Fix one derivation of $C$ from clauses in earlier stages and define its **ancestors** recursively:

Misplaced & \operatorname{Anc}(C):= \begin{cases} \{C\}, & C\in M_0,\\ \operatorname{Anc}(X)\cup\operatorname{Anc}(Y), & C=\operatorname{Res}_p(X,Y)\text{ in the chosen derivation}. \end{cases} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- $\operatorname{Anc}(C)$ is a finite subset of $M$ from which $C$ can be derived. The chosen derivation matters: a clause can have more than one derivation.
- If $M$ is unsatisfiable, refutation completeness gives $\emptyset\in M_\infty$. The finite set $\operatorname{Anc}(\emptyset)$ is unsatisfiable by the soundness of resolution. This gives the compactness theorem for clause sets.
	- The argument assumes refutation completeness for infinite clause sets. If that result was itself proved using compactness, this is not an independent proof of compactness.
  • Why clauses are finite
    • If an infinite disjunction were allowed as a clause, the following set would be unsatisfiable but every finite subset would be satisfiable:

Misplaced & M=\bigl\{\{p_1,p_2,p_3,\ldots\},\{\neg p_1\},\{\neg p_2\},\{\neg p_3\},\ldots\bigr\}. <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- The infinite clause requires some $p_i$ to be true, while the unit clauses exclude every $p_i$. A finite subset excludes only finitely many of them.
- Each finite resolution derivation can remove only finitely many literals from the infinite clause. Thus the empty clause does not appear in the ordinary closure. Allowing infinite clauses would require reconsidering completeness and the inference rules.

Chapter 3: First-Order Logic

  • Language and symbols
    • Logical symbols include , equality, parentheses and object variables .
    • The non-logical symbols depend on the language: constant symbols, function symbols and relation symbols. Each function or relation symbol has a fixed arity.
    • Equality is treated as logical. Function and relation symbols have positive arity; constants play the role of nullary functions.
    • For arithmetic, a language may contain , the unary successor symbol , binary function symbols and , and a binary relation symbol . A constant could instead be represented by the term .
    • A finite language here has finitely many non-logical symbols; it still has infinitely many variables and formulas.
  • Terms
    1. Every object variable is a term.
    2. Every constant symbol is a term.
    3. If is a -ary function symbol and are terms, then is a term.
    4. These are all terms: every term is obtained by finitely many applications of the preceding rules.
    • The terms also form the smallest set containing the variables and constants and closed under the function-symbol constructions.
    • Infix notation is an abbreviation: represents . A variable is a term, not a formula, so is not a conjunction of terms.
  • Formulas
    • Atomic formulas are , , equalities , and for a -ary relation symbol and terms .
    • From formulas and a variable , form Boolean combinations and quantified formulas, including , , , and . Only expressions produced by finitely many such steps are formulas.
    • This inductive construction supports structural induction: prove a property for atomic formulas and show that each formation rule preserves it.
    • Example: In the natural numbers with the usual interpretations,

Misplaced & \forall x\,\exists y\,\bigl(y+y=x\lor S(y+y)=x\bigr) <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	states that every number is even or odd. Without the second disjunct the formula is false over $\mathbb N$, but true over $\mathbb Q$ with ordinary addition.
- Vacuous and repeated quantification is syntactically allowed: for example, $\forall x\,(0=0)$ and $\forall x\,\forall x\,\varphi$. An inner quantifier for $x$ overrides the outer assignment to $x$ within its scope.
  • Structures
    • An -structure consists of a non-empty universe and an interpretation of the non-logical symbols:

Misplaced & \begin{aligned} c^{\mathcal M}=I(c)&\in M &&\text{for a constant symbol }c,\\ f^{\mathcal M}=I(f)&:M^k\to M &&\text{for a }k\text{-ary function symbol }f,\\ R^{\mathcal M}=I(R)&\subseteq M^k &&\text{for a }k\text{-ary relation symbol }R. \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- $M^k$ is the set of $k$-tuples over $M$. A relation can equivalently be described by its characteristic function $M^k\to\{0,1\}$. A function symbol, in contrast, is interpreted as a function whose values are in $M$.
- A symbol is distinct from its interpretation. On $\mathbb N$, the symbol $+$ may be interpreted as addition or as multiplication. With $0$ interpreted as zero, $\forall x\,(x+0=x)$ is true in the first interpretation and false in the second.
- A [[Knowledge/Model (First-Order Logic)|model]] of a formula is a structure in which the formula holds; not every structure is a model of a given formula.
  • Variable assignments and term evaluation
    • For a structure , an -assignment gives every variable a value in the universe. The structure interprets non-logical symbols; the assignment can vary while the structure remains fixed.
    • Lemma: There is exactly one extension satisfying

Misplaced & \begin{aligned} \bar b(x)&=b(x),\\ \bar b(c)&=c^{\mathcal M},\\ \bar b\bigl(f(t_1,\ldots,t_k)\bigr)&=f^{\mathcal M}\bigl(\bar b(t_1),\ldots,\bar b(t_k)\bigr). \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- **Example:** If $b(x_1)=5$ and $+$ is ordinary addition on $\mathbb N$, then $\bar b(x_1+x_1)=10$. If $+$ is interpreted as multiplication instead, the same term has value $25$.
- $\bar b$ preserves the operations: it is a homomorphism from the term structure to $\mathcal M$.
  • Formula evaluation
    • For and , define the assignment by

Misplaced & b_{x\mapsto m}(y):=\begin{cases}m,&y=x,\\b(y),&y\neq x.\end{cases} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- **Lemma:** Each assignment $b$ determines a unique truth-value function $\hat b:\operatorname{Formel}_{\mathcal L}\to\{0,1\}$. For atomic formulas,

Misplaced & \begin{aligned} \hat b(\top)&=1,&\hat b(\bot)&=0,\\ \hat b(t_1=t_2)=1&\iff\bar b(t_1)=\bar b(t_2),\\ \hat b(R(t_1,\ldots,t_k))=1&\iff(\bar b(t_1),\ldots,\bar b(t_k))\in R^{\mathcal M}. \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- Boolean connectives are evaluated by their truth functions. For example, $\hat b(\varphi\land\psi)=\min\{\hat b(\varphi),\hat b(\psi)\}$. The connective in the formula is distinct from the Boolean operation on truth values.
- For quantifiers, vary the assignment before evaluating the inner formula:

Misplaced & \begin{aligned} \hat b(\forall x\,\varphi)=1&\iff\forall m\in M:\ \widehat{b_{x\mapsto m}}(\varphi)=1,\\ \hat b(\exists x\,\varphi)=1&\iff\exists m\in M:\ \widehat{b_{x\mapsto m}}(\varphi)=1. \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- Since $M$ is non-empty, $\hat b(\forall x\,\varphi)=\min\{\widehat{b_{x\mapsto m}}(\varphi)\mid m\in M\}$. We modify $b$, not $\hat b$: the latter is a function on formulas, not variables.
- **Example:** In $\mathbb N$ with the usual order, $\forall y\,(x\leq y)$ is true under $b$ exactly when $b(x)=0$. The original value of $b(y)$ does not matter because the quantifier considers every value of $y$.
  • A language of set theory
    • A minimal language may have just the binary membership relation symbol as its non-logical vocabulary: no constant or function symbols. In particular, , and are not terms in this language.
    • The intended statements can nevertheless be expressed by formulas, with the quantified variables distinct from the indicated free variables:

Misplaced & \begin{aligned} \text{“}x\text{ is empty”}\quad&\rightsquigarrow\quad\forall y\,\neg(y\mathbin{\varepsilon}x),\\ \text{“}x=\{y\}\text{”}\quad&\rightsquigarrow\quad\forall z\,(z\mathbin{\varepsilon}x\leftrightarrow z=y),\\ \text{“}x=y\cup z\text{”}\quad&\rightsquigarrow\quad\forall w\,(w\mathbin{\varepsilon}x\leftrightarrow(w\mathbin{\varepsilon}y\lor w\mathbin{\varepsilon}z)). \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- The expressions on the left are informal descriptions, not formulas of the chosen language. In the singleton formula, $y$ remains free: it refers to the given element rather than a newly quantified one. The usual set-theoretic reading assumes the corresponding interpretation of $\varepsilon$.