Lukas' Notes

Chapter 3: First-Order Logic

  • Valid formulas and universal closure

    • For an -structure with universe , satisfaction without an indicated assignment means truth under every assignment:

Misplaced & \mathcal M\models\varphi \iff\forall b:\ \mathcal M\models\varphi[b]. <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- Consequently,

Misplaced & \mathcal M\models\varphi \quad\Longleftrightarrow\quad \mathcal M\models\forall x\,\varphi. <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	- From left to right: every modified assignment $b_{x\to a}$ is an assignment, so $\varphi$ holds under it.
	- From right to left: fix an arbitrary assignment $b$. The universal quantifier guarantees $\varphi[b_{x\to a}]$ for every $a\in M$. Choose $a=b(x)$, the value already assigned to $x$. Then $b_{x\to b(x)}=b$, so $\varphi[b]$ holds. Since $b$ was arbitrary, $\mathcal M\models\varphi$.
- The chosen object is $b(x)\in M$, not the assignment function $b:\operatorname{Var}\to M$ itself. Assigning $x$ its existing value leaves the entire function unchanged.
- Adding universal quantifiers for all free variables produces a [[Knowledge/Sentence (First-Order Logic)|sentence]] with the same truth in the sense of $\mathcal M\models$. This does not mean that $\varphi$ and $\forall x\,\varphi$ agree under each fixed assignment: in $\mathbb N$, $x=0$ holds when $b(x)=0$, whereas $\forall x\,(x=0)$ is false.
  • Tautologies and logical axioms
    • A first-order tautology is the image of a propositional tautology under a map that replaces propositional variables with first-order formulas and preserves Boolean connectives. For example,

Misplaced & h\bigl(p_1\to(p_1\lor p_2)\bigr) =h(p_1)\to\bigl(h(p_1)\lor h(p_2)\bigr). <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- $(\forall x\,P(x))\to(\forall x\,P(x))$ is a tautology: treating the quantified subformula as one propositional variable gives $p\to p$. By contrast, $\forall x\,(x=x)$ has propositional form $p$, which is not a tautology. Its validity depends on equality being identity and the meaning of the universal quantifier.
- Assigning this abstract $p$ the value $0$ is not a first-order countermodel to $\forall x\,(x=x)$. The propositional test deliberately ignores the internal meaning of the quantified formula.
- The pure logical axiom schemata comprise tautologies, equality and Leibniz axioms, distribution, existence, generalisation and substitution. A schema stands for its permitted instances, not just one displayed example.
- Leibniz axioms cover both relations and functions. For example,

Misplaced & \begin{aligned} x=y&\to\bigl(P(x)\to P(y)\bigr),\\ x=y&\to\bigl(u=v\to x+u=y+v\bigr). \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	Here $+$ is a binary function symbol; the second axiom does not require its interpretation to be ordinary addition.
- Universal closures of pure axioms are also logical axioms. This does not permit arbitrary universal quantification of assumptions. The generalisation axiom $\varphi\to\forall x\,\varphi$ requires $x$ not to occur free in $\varphi$.
  • Substitution in terms and formulas
    • For terms and a variable , write for the result of replacing with . This is the same substitution also written .
    • The term may itself contain . Substitution acts once on the original occurrences, not repeatedly on the inserted term:

Misplaced & (x+y)[x/(x+1)]=(x+1)+y. <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- In a [[Knowledge/Formula (First-Order Logic)|formula]], replace only [[Knowledge/Free Variable (First-Order Logic)|free occurrences]] of $x$. The operation follows the formula's construction:

Misplaced & \begin{aligned} R(s_1,\ldots,s_k)[x/t] &=R\bigl(s_1[x/t],\ldots,s_k[x/t]\bigr),\\ (s_1=s_2)[x/t]&=\bigl(s_1[x/t]=s_2[x/t]\bigr),\\ (\neg\psi)[x/t]&=\neg\bigl(\psi[x/t]\bigr),\\ (\psi_1\land\psi_2)[x/t]&=\psi_1[x/t]\land\psi_2[x/t],\\ (\forall y\,\psi)[x/t]&=\forall y\,(\psi[x/t])\quad(y\ne x),\\ (\forall x\,\psi)[x/t]&=\forall x\,\psi. \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	Other Boolean connectives are handled componentwise; the same quantifier cases apply to $\exists$. Truth constants remain unchanged.
- Under $\forall x$ or $\exists x$, occurrences of $x$ are [[Knowledge/Bound Variable (First-Order Logic)|bound]] and are not replaced. A different quantifier does not stop substitution, but may capture a variable of the inserted term. The syntactic definition above does not automatically rename bound variables.
  • Substitution and assignment changes
    • An assignment maps variables to objects. Its extension evaluates terms in , while evaluates formulas in .
    • Term substitution lemma: For every assignment ,

Misplaced & \bar b\bigl(s[x/t]\bigr) =\overline{b_{x\to\bar b(t)}}(s). <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	The left side changes the term and keeps $b$. The right side first evaluates $t$ under the original $b$, assigns that object to $x$, and evaluates the original $s$.
- The term lemma follows by induction on $s$: the variable and constant cases are immediate; the function-symbol case applies the same interpreted function to argument values that agree by induction.
- Assignment changes satisfy

Misplaced & \begin{aligned} (b_{x\to a})_{y\to c}&=(b_{y\to c})_{x\to a}\quad(x\ne y),\\ (b_{x\to a})_{x\to c}&=b_{x\to c}. \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	Changes at distinct variables commute; a later change at the same variable overwrites the earlier one.
  • Permitted substitutions and variable capture
    • A substitution in is permitted if no variable occurrence introduced from becomes bound by a quantifier surrounding its insertion point.
    • For a quantified subformula , where , the substitution is permitted if either:
      • does not occur free in , so nothing is inserted there; or
      • does not occur in , and is permitted in .
    • The condition concerns actual insertion points. For example, is permitted in when : there is no free to replace.
    • Counterexample: Let and . Naive substitution gives

Misplaced & \varphi[x/y]=\exists y\,(y\ne y). <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	In a structure with universe $M=\{0,1\}$, the original formula is true under every assignment: choose the other object as the witness. The substituted formula is always false. The inserted $y$ is now controlled by the existential quantifier rather than the outer assignment.
- Renaming the bound variable to a fresh $z$ before substitution avoids capture:

Misplaced & \exists y\,(x\ne y) \quad\rightsquigarrow\quad \exists z\,(x\ne z), \qquad (\exists z\,(x\ne z))[x/y]=\exists z\,(y\ne z). <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	The new $y$ remains free. Freshness can be ensured by choosing $z$ absent from both the formula and the inserted term.
  • Formula substitution lemma
    • Fix a structure , a formula , a variable and a term such that is permitted in . For every assignment , put and . Then

Misplaced & \hat b\bigl(\varphi[x/t]\bigr)=\widehat{b'}(\varphi), \qquad \mathcal M\models\varphi[x/t][b] \iff\mathcal M\models\varphi[b']. <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- **Proof:** Induct on the construction of $\varphi$, proving the claim for all assignments simultaneously. This permits using the induction hypothesis under the modified assignments introduced by quantifiers.
- **Equality case:** The term lemma gives

Misplaced & \begin{aligned} \hat b\bigl((s_1=s_2)[x/t]\bigr)=1 &\iff\bar b\bigl(s_1[x/t]\bigr)=\bar b\bigl(s_2[x/t]\bigr)\\ &\iff\overline{b'}(s_1)=\overline{b'}(s_2)\\ &\iff\widehat{b'}(s_1=s_2)=1. \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	Relations are handled similarly: the argument values agree, so the same relation is tested on the same tuple.
- **Conjunction case:** With multiplication of truth values $0,1$,

Misplaced & \begin{aligned} \hat b\bigl((\psi_1\land\psi_2)[x/t]\bigr) &=\hat b\bigl(\psi_1[x/t]\bigr)\cdot\hat b\bigl(\psi_2[x/t]\bigr)\\ &=\widehat{b'}(\psi_1)\cdot\widehat{b'}(\psi_2)\\ &=\widehat{b'}(\psi_1\land\psi_2). \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	The other Boolean connectives likewise depend only on their component truth values.
- **Vacuous case:** If $x$ is not free in $\varphi$, substitution changes nothing and the [[Knowledge/Coincidence Lemma (First-Order Logic)|coincidence lemma]] gives $\hat b(\varphi)=\widehat{b'}(\varphi)$. This includes $\varphi=\forall x\,\psi$ and $\varphi=\exists x\,\psi$.
  • The critical quantifier step
    • Consider with free in . Then . Permittedness ensures that does not occur in .
    • For each , the current assignment inside the quantifier is . The induction hypothesis must use this assignment, including when evaluating :

Misplaced & \widehat{\tilde b}\bigl(\psi[x/t]\bigr) =\widehat{\tilde b_{x\to\overline{\tilde b}(t)}}(\psi). <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- Replacing $\overline{\tilde b}(t)$ directly with $\bar b(t)$ would be the error. For instance, if $t=y$, $b(y)=0$ and $m=1$, these values are $1$ and $0$ respectively.
- Since $y$ does not occur in $t$, changing $y$ cannot change its value. Thus, with $a=\bar b(t)$ and $b'=b_{x\to a}$,

Misplaced & \overline{b_{y\to m}}(t)=\bar b(t)=a, \qquad (b_{y\to m})_{x\to a}=(b_{x\to a})_{y\to m}=b'_{y\to m}. <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- The complete calculation is therefore

Misplaced & \begin{aligned} \hat b\bigl((\forall y\,\psi)[x/t]\bigr) &=\min_{m\in M}\widehat{b_{y\to m}}\bigl(\psi[x/t]\bigr)\\ &=\min_{m\in M}\widehat{(b_{y\to m})_{x\to a}}(\psi)\\ &=\min_{m\in M}\widehat{b'_{y\to m}}(\psi)\\ &=\widehat{b'}(\forall y\,\psi). \end{aligned} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	For $\exists y$, replace the minimum with a maximum. These extrema exist even when $M$ is infinite: $M$ is non-empty and all values belong to $\{0,1\}$.
  • Validity of the substitution axiom
    • For every permitted substitution in ,

Misplaced & \models(\forall x\,\varphi)\to\varphi[x/t]. <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- Fix arbitrary $\mathcal M,b$ and suppose $\mathcal M\models\forall x\,\varphi[b]$. Choose the particular object $a:=\bar b(t)\in M$. Then

Misplaced & \underbrace{\mathcal M\models\forall x\,\varphi[b]}_{\text{every value for }x} \quad\Longrightarrow\quad \underbrace{\mathcal M\models\varphi[b_{x\to a}]}_{\text{choose }a=\bar b(t)} \quad\Longleftrightarrow\quad \underbrace{\mathcal M\models\varphi[x/t][b]}_{\text{substitution lemma}}. <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	If the antecedent is false, the implication is already true. Since $\mathcal M,b$ were arbitrary, the axiom is valid.
- Substitution acts on the inner $\varphi$, not the entire $\forall x\,\varphi$. In $\varphi$, $x$ may be free even though the outer quantifier binds it in $\forall x\,\varphi$.
- Without the permittedness condition, the two-element structure above would give a true antecedent and a false consequent:

Misplaced & \underbrace{\forall x\,\exists y\,(x\ne y)}_{\text{true}} \quad\to\quad \underbrace{\exists y\,(y\ne y)}_{\text{false}}. <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

  • A formal proof of an existential implication
    • Let be unary and a constant symbol. The goal is . No arithmetic interpretation of is needed.
    • Use the abbreviations

Misplaced & A:=\forall x\,\neg R(x),\qquad B:=R(0),\qquad E:=\exists x\,R(x). <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

	The substitution axiom gives $A\to\neg B$. A tautology turns this into $B\to\neg A$, and the existence axiom gives $\neg A\to E$.
- The complete formal proof uses only axioms and [[Knowledge/Modus Ponens|modus ponens]]:

Misplaced & \begin{array}{rll} 1.&A\to\neg B&\text{substitution: }x/0\text{ in }\neg R(x)\\ 2.&(A\to\neg B)\to(B\to\neg A)&\text{tautology}\\ 3.&B\to\neg A&\text{MP on 1, 2}\\ 4.&\neg A\to E&\text{existence axiom}\\ 5.&(B\to\neg A)\to((\neg A\to E)\to(B\to E))&\text{tautology}\\ 6.&(\neg A\to E)\to(B\to E)&\text{MP on 3, 5}\\ 7.&B\to E&\text{MP on 4, 6} \end{array} <span class="math-indent" aria-hidden="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

- Nested implications fit successive applications of modus ponens. From $P$, $Q$ and $P\to(Q\to S)$, first derive $Q\to S$, then $S$. The equivalent formula $(P\land Q)\to S$ would first require deriving the conjunction.
- $A\vdash B$ is read as “$B$ is derivable from $A$” (*aus $A$ ist $B$ herleitbar*). Here $A$ is an assumption; $\vdash A\to B$ instead states that the implication itself has a proof without additional assumptions.