跳转到内容

离散数学 · 数理逻辑

Course handouts: Discrete Math, Qinxiang Cao — notes of Mar 30, Apr 13, Apr 20, Apr 22, Apr 27, May 6, May 9, May 11 (2026). Topics: translating natural language into logic, single-step proofs, interpreting informal proofs, a formal proof system for propositional logic, first-order quantifier rules and derived properties, and the syntax of first-order logic.

1 From Natural Language Propositions to Logic Expressions

跳转到:1 From Natural Language Propositions to Logic Expressions
  • Universal statement.

    • Natural language: In this class, every student in this class has already studied calculus.
    • Predicate symbols: S(t)S(t) = "tt is a student in this class"; C(t)C(t) = "tt has already studied calculus".
    • Logic expression: ∀x. S(x)→C(x)\forall x.\ S(x) \to C(x).
  • Existential statement.

    • Natural language: Some US students in this class have visited Mexico.
    • Predicate symbols: U(t)U(t) = "tt is a US student in this class"; M(t)M(t) = "tt has visited Mexico".
    • Logic expression: ∃x. U(x)∧M(x)\exists x.\ U(x) \land M(x).
  • Nested quantifiers.

    • Natural language: For every student in SAI, a research mentor will be assigned to him or her from his or her first year.
    • Predicate symbols: S(t)S(t) = "tt is a student in SAI"; M(t1,t2)M(t_1, t_2) = "t2t_2 is the research mentor of t1t_1".
    • Logic expression: ∀x. (S(x)→∃y. M(x,y))\forall x.\ (S(x) \to \exists y.\ M(x, y)).
  • Constant symbols (lions).

    • Natural language: Lions are fierce. Lions do not drink coffee. Some fierce creatures do not drink coffee.
    • Constant symbol cLc_L = "lions"; predicate symbols: F(t)F(t) = "tt is fierce"; D(t)D(t) = "tt drink coffee".
    • Logic expressions: F(cL)F(c_L); ¬D(cL)\neg D(c_L); ∃x. F(x)∧¬D(x)\exists x.\ F(x) \land \neg D(x).
  • Uniqueness.

    • Natural language: In this class, there is a unique student who got full marks in the final exam.
    • Predicate symbols: S(t)S(t) = "tt is a student in this class"; F(t)F(t) = "tt got full marks in the final exam".
    • Logic expression: ∃x. ((S(x)∧F(x))∧∀y. ((S(y)∧F(y))→y=x))\exists x.\ ((S(x) \land F(x)) \land \forall y.\ ((S(y) \land F(y)) \to y = x)).
  • Injectivity. The function ff is injective (function symbol f(t)f(t) = "the value of function ff at tt"): ∀x.∀y. (f(x)=f(y)→x=y)\forall x. \forall y.\ (f(x) = f(y) \to x = y).

  • Surjectivity. The function ff is surjective: ∀y.∃x. (f(x)=y)\forall y. \exists x.\ (f(x) = y).

  • Notation. If Φ\Phi is a set of propositions and ψ\psi is one single proposition, we write Φ⊢ψ\Phi \vdash \psi representing: we can derive ψ\psi from Φ\Phi.

Single-step proof patterns (the connective word driving each step is highlighted in red in the original):

AssumptionConclusionLogic
TT is a tree, i.e. connected and has no simple loopTT is connectedp∧q⊢pp \land q \vdash p
uu is vv's descendantuu is in the subtree at vv, i.e. uu is either vv itself or vv's descendantp⊢p∨qp \vdash p \lor q
(none)πe\pi^e is a rational number or a irrational number⊢p∨¬p\vdash p \lor \neg p
Every human being is mortalSocrates is mortal∀x. M(x)⊢M(c)\forall x.\ M(x) \vdash M(c)
Two is an even prime numberThere exists an even prime numberE(c)∧P(c)⊢∃x. (E(x)∧P(x))E(c) \land P(c) \vdash \exists x.\ (E(x) \land P(x))

3 Interpreting Informal Proofs

跳转到:3 Interpreting Informal Proofs

3.1 A limit proof and its logical anatomy

跳转到:3.1 A limit proof and its logical anatomy

Example. Proof of ∀ε>0,∃N,∀n>N,∣1n∣<ε\forall \varepsilon > 0, \exists N, \forall n > N, \left|\frac{1}{n}\right| < \varepsilon:

Given a fixed ε>0\varepsilon > 0 ⟨red⟩, let N=[1ε]+1N = \left[\frac{1}{\varepsilon}\right] + 1 ⟨blue⟩, then for any n>Nn > N,

∣1n∣=1n<1N<11ε=ε.\left|\frac{1}{n}\right| = \frac{1}{n} < \frac{1}{N} < \frac{1}{\frac{1}{\varepsilon}} = \varepsilon.

Qed. (In the original the first phrase is printed in red and the second in blue; the analyses below refer to these colors.)

Analysis A (the red phrase).

  • At the beginning, the proof target is:
    • Assumptions: all math theorems (we call it Φ\Phi).
    • Conclusion: ∀ε\forall \varepsilon, if ε>0\varepsilon > 0, then ∃N,∀n>N,∣1n∣<ε\exists N, \forall n > N, \left|\frac{1}{n}\right| < \varepsilon — which can be formulated by ∀x. (P(x)→Q(x))\forall x.\ (P(x) \to Q(x)).
  • After the red phrase, the proof target is:
    • Assumptions: all math theorems (we call it Φ\Phi) and ε>0\varepsilon > 0 (formulated as P(x)P(x)).
    • Conclusion: ∃N,∀n>N,∣1n∣<ε\exists N, \forall n > N, \left|\frac{1}{n}\right| < \varepsilon (formulated as Q(x)Q(x)).
  • Logic: If Φ,P(x)⊢Q(x)\Phi, P(x) \vdash Q(x) then Φ⊢∀x. (P(x)→Q(x))\Phi \vdash \forall x.\ (P(x) \to Q(x)).

Analysis B (the blue phrase).

  • Before the blue phrase, the proof target is:
    • Assumptions: all math theorems and ε>0\varepsilon > 0 (we call them Φ\Phi).
    • Conclusion: ∃N,∀n>N,∣1n∣<ε\exists N, \forall n > N, \left|\frac{1}{n}\right| < \varepsilon (formulated as ∃x.P(x)\exists x. P(x)).
  • After the blue phrase, the proof target is:
    • Assumptions: all math theorems and ε>0\varepsilon > 0 (we call them Φ\Phi).
    • Conclusion: ∀n>[1ε]+1,∣1n∣<ε\forall n > \left[\frac{1}{\varepsilon}\right] + 1, \left|\frac{1}{n}\right| < \varepsilon (formulated as P(t)P(t)).
  • Logic: If Φ⊢P(t)\Phi \vdash P(t) then Φ⊢∃x. P(x)\Phi \vdash \exists x.\ P(x).

3.2 A negated-existence proof and its logical anatomy

跳转到:3.2 A negated-existence proof and its logical anatomy

Example. Proof of:

¬ ∃x∈N. ∃y∈N. gcd⁡(x,y)=1 and x2=2y2.\neg\ \exists x \in \mathbb{N}.\ \exists y \in \mathbb{N}.\ \gcd(x, y) = 1 \text{ and } x^2 = 2y^2.

(The word "and" is printed as the English word in the source statement, not as ∧\land.)

Suppose there exists x∈Nx \in \mathbb{N} and y∈Ny \in \mathbb{N} s.t. x2=2y2x^2 = 2y^2 ⟨red⟩. Thus, xx must be an even number ⟨blue⟩ and we can assume x=2x0x = 2x_0 ⟨red⟩. Now, we have y2=2x02y^2 = 2x_0^2. Thus, yy must be an even number too and we can assume y=2y0y = 2y_0. Therefore, gcd⁡(x,y)≠1\gcd(x, y) \neq 1. Qed.

Step-by-step analysis (each proof step paired with the logic rule it instantiates; colors match the marked phrases):

  • Proof step ⟨red, the "Suppose" sentence⟩: In order to prove ¬ ∃x∈N. ∃y∈N. gcd⁡(x,y)=1\neg\ \exists x \in \mathbb{N}.\ \exists y \in \mathbb{N}.\ \gcd(x, y) = 1 and x2=2y2x^2 = 2y^2, it suffices to prove that if x∈Nx \in \mathbb{N}, y∈Ny \in \mathbb{N} and x2=2y2x^2 = 2y^2 then gcd⁡(x,y)≠1\gcd(x, y) \neq 1.
    • Logic: If Φ,P(x),P(y),Q(x,y)⊢¬R(x,y)\Phi, P(x), P(y), Q(x, y) \vdash \neg R(x, y), then Φ⊢¬∃x. (P(x)∧∃y.(P(y)∧Q(x,y)∧R(x,y)))\Phi \vdash \neg \exists x.\ (P(x) \land \exists y. (P(y) \land Q(x, y) \land R(x, y))).
  • Proof step ⟨blue⟩: If x2=2y2x^2 = 2y^2, then xx is an even number. The sentence itself is a math fact.
    • Logic (considering its role in the whole proof): If Φ⊢ψ\Phi \vdash \psi and Φ,ψ⊢χ\Phi, \psi \vdash \chi, then Φ⊢χ\Phi \vdash \chi.
  • Proof step ⟨red, "we can assume x=2x0x = 2x_0"⟩: Because there exists x0∈Nx_0 \in \mathbb{N} s.t. x=2x0x = 2x_0, we can use x0x_0 to represent this natural number in later proofs.
    • Logic: If Φ,P(x)⊢ψ\Phi, P(x) \vdash \psi, then Φ,∃x. P(x)⊢ψ\Phi, \exists x.\ P(x) \vdash \psi. (Printed with no explicit side condition.)

3.3 Quiz: a segment of Prim algorithm's correctness proof

跳转到:3.3 Quiz: a segment of Prim algorithm's correctness proof

Quiz. Here is an segment of Prim algorithm's correctness proof. Assuming there exists a minimum spanning tree T∗T^* such that TnT_n is a subgraph of T∗T^*, we need to show that there also exists a minimum spanning tree (maybe different from T∗T^*) such that Tn+1T_{n+1} is a subgraph of it.

  • Choose an arbitrary minimum spanning tree T∗T^* such that TnT_n is a subgraph of T∗T^*.
  • If Tn+1T_{n+1} is a subgraph of T∗T^*, then we are done. Otherwise, we can always change an edge in T∗T^* so that Tn+1T_{n+1} is a subgraph of T∗T^*. Here is how to change the edge.
    • Since Tn+1T_{n+1} is not a subgraph of T∗T^*, en+1e_{n+1} (which connects un+1u_{n+1} and vn+1v_{n+1}) is not an edge in T∗T^*. Because T∗T^* is a spanning tree, there is a path in T∗T^* between un+1u_{n+1} and vn+1v_{n+1}. On this path, there must be an edge e∗e^* leaving VnV_n.
    • w(e∗)=w(en+1)w(e^*) = w(e_{n+1}).
    • So, T∗∖{e∗}∪{en+1}T^* \setminus \{e^*\} \cup \{e_{n+1}\} is another minimum spanning tree.
    • Besides, Tn+1T_{n+1} is a subgraph of T∗∖{e∗}∪{en+1}T^* \setminus \{e^*\} \cup \{e_{n+1}\}.

Please describe the logic behind each step.

Answer (each proof step paired with the logic rule it instantiates):

  • Proof step: Choose an arbitrary minimum spanning tree T∗T^* such that TnT_n is a subgraph of T∗T^*.
    • Logic: If Φ,P(x)⊢ψ\Phi, P(x) \vdash \psi, then Φ,∃x. P(x)⊢ψ\Phi, \exists x.\ P(x) \vdash \psi.
  • Proof step: If Tn+1T_{n+1} is a subgraph of T∗T^*, then ... . Otherwise, ... .
    • Logic: If Φ,φ⊢ψ\Phi, \varphi \vdash \psi and Φ,¬φ⊢ψ\Phi, \neg\varphi \vdash \psi, then Φ⊢ψ\Phi \vdash \psi.
  • Proof step: We can always change an edge in T∗T^* so that Tn+1T_{n+1} is a subgraph of T∗T^*.
    • Describe the proof strategy afterwards.
  • Proof step: Since Tn+1T_{n+1} is not a subgraph of T∗T^*, en+1e_{n+1} (which connects un+1u_{n+1} and vn+1v_{n+1}) is not an edge in T∗T^*.
    • Logic: If Φ⊢ψ\Phi \vdash \psi and Φ,ψ⊢χ\Phi, \psi \vdash \chi, then Φ⊢χ\Phi \vdash \chi.
  • Proof step: Because T∗T^* is a spanning tree, there is a path in T∗T^* between un+1u_{n+1} and vn+1v_{n+1}.
    • Logic (1): If Φ⊢ψ\Phi \vdash \psi and Φ,ψ⊢χ\Phi, \psi \vdash \chi, then Φ⊢χ\Phi \vdash \chi.
    • Logic (2): If Φ,P(x)⊢ψ\Phi, P(x) \vdash \psi, then Φ,∃x. P(x)⊢ψ\Phi, \exists x.\ P(x) \vdash \psi.
  • Proof step: On this path, there must be an edge e∗e^* leaving VnV_n.
    • Logic (1): If Φ⊢ψ\Phi \vdash \psi and Φ,ψ⊢χ\Phi, \psi \vdash \chi, then Φ⊢χ\Phi \vdash \chi.
    • Logic (2): If Φ,P(x)⊢ψ\Phi, P(x) \vdash \psi, then Φ,∃x. P(x)⊢ψ\Phi, \exists x.\ P(x) \vdash \psi.
  • Proof step: w(e∗)=w(en+1)w(e^*) = w(e_{n+1}).
    • Logic: If Φ⊢ψ\Phi \vdash \psi and Φ,ψ⊢χ\Phi, \psi \vdash \chi, then Φ⊢χ\Phi \vdash \chi.
  • Notation (⊣⊢\dashv\vdash). We write φ⊣⊢ψ\varphi \dashv\vdash \psi if and only if both φ⊢ψ\varphi \vdash \psi and ψ⊢φ\psi \vdash \varphi.
  • ASSUMPTION: if φ∈Φ\varphi \in \Phi, then Φ⊢φ\Phi \vdash \varphi.
  • WEAKENING: if Φ⊆Φ′\Phi \subseteq \Phi' and Φ⊢ψ\Phi \vdash \psi, then Φ′⊢ψ\Phi' \vdash \psi.
  • SUBSTITUTION: if Φ⊢ψ\Phi \vdash \psi and Φ,ψ⊢χ\Phi, \psi \vdash \chi then Φ⊢χ\Phi \vdash \chi.

Example. Prove the following derivations using ASSUMPTION, WEAKENING and SUBSTITUTION.

  • φ⊢φ\varphi \vdash \varphi.
  • If φ⊢ψ\varphi \vdash \psi and ψ⊢χ\psi \vdash \chi, then φ⊢χ\varphi \vdash \chi.
  • If Φ,φ⊢ψ\Phi, \varphi \vdash \psi and Φ,ψ⊢χ\Phi, \psi \vdash \chi, then Φ,φ⊢χ\Phi, \varphi \vdash \chi.

Proof of φ⊢φ\varphi \vdash \varphi:

  • (1) φ⊢φ\varphi \vdash \varphi (by ASSUMPTION).

Proof of: if φ⊢ψ\varphi \vdash \psi and ψ⊢χ\psi \vdash \chi, then φ⊢χ\varphi \vdash \chi:

  • (1) φ⊢ψ\varphi \vdash \psi (hypothesis).
  • (2) ψ⊢χ\psi \vdash \chi (hypothesis).
  • (3) φ,ψ⊢χ\varphi, \psi \vdash \chi (WEAKENING and (2)).
  • (4) φ⊢χ\varphi \vdash \chi (SUBSTITUTION and (1) and (3)).

Proof of: if Φ,φ⊢ψ\Phi, \varphi \vdash \psi and Φ,ψ⊢χ\Phi, \psi \vdash \chi, then Φ,φ⊢χ\Phi, \varphi \vdash \chi:

  • (1) Φ,φ⊢ψ\Phi, \varphi \vdash \psi (hypothesis).
  • (2) Φ,ψ⊢χ\Phi, \psi \vdash \chi (hypothesis).
  • (3) Φ,φ,ψ⊢χ\Phi, \varphi, \psi \vdash \chi (WEAKENING and (2)).
  • (4) Φ,φ⊢χ\Phi, \varphi \vdash \chi (SUBSTITUTION and (1) and (3)).

Primitive rules:

  • AND-INTRO: φ,ψ⊢φ∧ψ\varphi, \psi \vdash \varphi \land \psi.
  • AND-ELIM1: φ∧ψ⊢φ\varphi \land \psi \vdash \varphi.
  • AND-ELIM2: φ∧ψ⊢ψ\varphi \land \psi \vdash \psi.

Example. Prove the following derivations.

  • AND-R: If Φ⊢ψ\Phi \vdash \psi and Φ⊢χ\Phi \vdash \chi, then Φ⊢ψ∧χ\Phi \vdash \psi \land \chi.
  • If Φ⊢ψ∧χ\Phi \vdash \psi \land \chi, then Φ⊢ψ\Phi \vdash \psi.
  • If Φ⊢ψ∧χ\Phi \vdash \psi \land \chi, then Φ⊢χ\Phi \vdash \chi.
  • If Φ,ψ1∧ψ2⊢χ\Phi, \psi_1 \land \psi_2 \vdash \chi, then Φ,ψ1,ψ2⊢χ\Phi, \psi_1, \psi_2 \vdash \chi.
  • If Φ,ψ1⊢χ\Phi, \psi_1 \vdash \chi, Φ,ψ1∧ψ2⊢χ\Phi, \psi_1 \land \psi_2 \vdash \chi.
  • If Φ,ψ2⊢χ\Phi, \psi_2 \vdash \chi, Φ,ψ1∧ψ2⊢χ\Phi, \psi_1 \land \psi_2 \vdash \chi. (The last two bullets are printed without the word "then".)

Proof of AND-R:

  • (1) ψ,χ⊢ψ∧χ\psi, \chi \vdash \psi \land \chi (AND-INTRO).
  • (2) Φ,ψ,χ⊢ψ∧χ\Phi, \psi, \chi \vdash \psi \land \chi (WEAKENING and (1)).
  • (3) Φ⊢χ\Phi \vdash \chi (hypothesis).
  • (4) Φ,ψ⊢χ\Phi, \psi \vdash \chi (WEAKENING and (3)).
  • (5) Φ,ψ⊢ψ∧χ\Phi, \psi \vdash \psi \land \chi (SUBSTITUTION and (2) and (4)).
  • (6) Φ⊢ψ\Phi \vdash \psi (hypothesis).
  • (7) Φ⊢ψ∧χ\Phi \vdash \psi \land \chi (SUBSTITUTION and (5) and (6)).

Proof of: if Φ⊢ψ∧χ\Phi \vdash \psi \land \chi, then Φ⊢ψ\Phi \vdash \psi:

  • (1) Φ⊢ψ∧χ\Phi \vdash \psi \land \chi (hypothesis).
  • (2) ψ∧χ⊢ψ\psi \land \chi \vdash \psi (AND-ELIM1).
  • (3) Φ,ψ∧χ⊢ψ\Phi, \psi \land \chi \vdash \psi (WEAKENING and (2)).
  • (4) Φ⊢ψ\Phi \vdash \psi (SUBSTITUTION and (1) and (3)).

For "If Φ⊢ψ∧χ\Phi \vdash \psi \land \chi, then Φ⊢χ\Phi \vdash \chi": Similar.

Proof of: if Φ,ψ1∧ψ2⊢χ\Phi, \psi_1 \land \psi_2 \vdash \chi, then Φ,ψ1,ψ2⊢χ\Phi, \psi_1, \psi_2 \vdash \chi:

  • (1) ψ1,ψ2⊢ψ1∧ψ2\psi_1, \psi_2 \vdash \psi_1 \land \psi_2 (AND-INTRO).
  • (2) Φ,ψ1,ψ2⊢ψ1∧ψ2\Phi, \psi_1, \psi_2 \vdash \psi_1 \land \psi_2 (WEAKENING and (1)).
  • (3) Φ,ψ1∧ψ2⊢χ\Phi, \psi_1 \land \psi_2 \vdash \chi (hypothesis).
  • (4) Φ,ψ1,ψ2,ψ1∧ψ2⊢χ\Phi, \psi_1, \psi_2, \psi_1 \land \psi_2 \vdash \chi (WEAKENING and (3)).
  • (5) Φ,ψ1,ψ2⊢χ\Phi, \psi_1, \psi_2 \vdash \chi (SUBSTITUTION and (2) and (4)). (No proofs are printed for the last two bullets of the example.)

Derived theorems (note: and-L is the converse direction of the fourth bullet above):

  • and-L: If Φ,ψ1,ψ2⊢χ\Phi, \psi_1, \psi_2 \vdash \chi, then Φ,ψ1∧ψ2⊢χ\Phi, \psi_1 \land \psi_2 \vdash \chi.
  • and-comm: φ∧ψ⊣⊢ψ∧φ\varphi \land \psi \dashv\vdash \psi \land \varphi.
  • and-assoc: (φ∧ψ)∧χ⊣⊢φ∧(ψ∧χ)(\varphi \land \psi) \land \chi \dashv\vdash \varphi \land (\psi \land \chi).

Proof of and-L:

  • (1) Φ,ψ1,ψ2⊢χ\Phi, \psi_1, \psi_2 \vdash \chi (hypothesis).
  • (2) ψ1∧ψ2⊢ψ1\psi_1 \land \psi_2 \vdash \psi_1 (and-elim1).
  • (3) Φ,ψ1∧ψ2⊢ψ1\Phi, \psi_1 \land \psi_2 \vdash \psi_1 (weakening and (2)).
  • (4) ψ1∧ψ2⊢ψ2\psi_1 \land \psi_2 \vdash \psi_2 (and-elim2).
  • (5) Φ,ψ1∧ψ2,ψ1⊢ψ2\Phi, \psi_1 \land \psi_2, \psi_1 \vdash \psi_2 (weakening and (4)).
  • (6) Φ,ψ1∧ψ2,ψ1,ψ2⊢χ\Phi, \psi_1 \land \psi_2, \psi_1, \psi_2 \vdash \chi (weakening and (1)).
  • (7) Φ,ψ1∧ψ2,ψ1⊢χ\Phi, \psi_1 \land \psi_2, \psi_1 \vdash \chi (substitution and (5) and (6)).
  • (8) Φ,ψ1∧ψ2⊢χ\Phi, \psi_1 \land \psi_2 \vdash \chi (substitution and (3) and (7)).

Proof of and-comm — it suffices to prove: φ∧ψ⊢ψ∧φ\varphi \land \psi \vdash \psi \land \varphi:

  • (1) φ∧ψ⊢ψ\varphi \land \psi \vdash \psi (and-elim2).
  • (2) φ∧ψ⊢φ\varphi \land \psi \vdash \varphi (and-elim1).
  • (3) φ∧ψ⊢ψ∧φ\varphi \land \psi \vdash \psi \land \varphi (and-R and (1) and (2)).

Proof of and-assoc, from left to right (only this direction is shown):

  • (1) φ,ψ,χ⊢φ\varphi, \psi, \chi \vdash \varphi (assumption).
  • (2) (φ∧ψ),χ⊢φ(\varphi \land \psi), \chi \vdash \varphi (and-L and (1)).
  • (3) (φ∧ψ)∧χ⊢φ(\varphi \land \psi) \land \chi \vdash \varphi (and-L and (2)).
  • (4) φ,ψ,χ⊢ψ\varphi, \psi, \chi \vdash \psi (assumption).
  • (5) (φ∧ψ),χ⊢ψ(\varphi \land \psi), \chi \vdash \psi (and-L and (4)).
  • (6) (φ∧ψ)∧χ⊢ψ(\varphi \land \psi) \land \chi \vdash \psi (and-L and (5)).
  • (7) (φ∧ψ)∧χ⊢χ(\varphi \land \psi) \land \chi \vdash \chi (and-elim2).
  • (8) (φ∧ψ)∧χ⊢(ψ∧χ)(\varphi \land \psi) \land \chi \vdash (\psi \land \chi) (and-R and (6) and (7)).
  • (9) (φ∧ψ)∧χ⊢φ∧(ψ∧χ)(\varphi \land \psi) \land \chi \vdash \varphi \land (\psi \land \chi) (and-R and (3) and (8)).

Congruence of ∧\land with respect to ⊢\vdash:

  • Example. If ψ1⊢ψ2\psi_1 \vdash \psi_2 and χ1⊢χ2\chi_1 \vdash \chi_2, then ψ1∧χ1⊢ψ2∧χ2\psi_1 \land \chi_1 \vdash \psi_2 \land \chi_2.

    Proof:

    • (1) ψ1⊢ψ2\psi_1 \vdash \psi_2 (hypothesis).
    • (2) ψ1,χ1⊢ψ2\psi_1, \chi_1 \vdash \psi_2 (weakening and (1)).
    • (3) χ1⊢χ2\chi_1 \vdash \chi_2 (hypothesis).
    • (4) ψ1,χ1⊢χ2\psi_1, \chi_1 \vdash \chi_2 (weakening and (3)).
    • (5) ψ1,χ1⊢ψ2∧χ2\psi_1, \chi_1 \vdash \psi_2 \land \chi_2 (and-R and (2) and (4)).
    • (6) ψ1∧χ1⊢ψ2∧χ2\psi_1 \land \chi_1 \vdash \psi_2 \land \chi_2 (and-L and (5)).
  • Theorem. If Φ,ψ1⊢ψ2\Phi, \psi_1 \vdash \psi_2 and Φ,χ1⊢χ2\Phi, \chi_1 \vdash \chi_2, then Φ,ψ1∧χ1⊢ψ2∧χ2\Phi, \psi_1 \land \chi_1 \vdash \psi_2 \land \chi_2.

    Proof:

    • (1) Φ,ψ1⊢ψ2\Phi, \psi_1 \vdash \psi_2 (hypothesis).
    • (2) Φ,ψ1,χ1⊢ψ2\Phi, \psi_1, \chi_1 \vdash \psi_2 (weakening and (1)).
    • (3) Φ,χ1⊢χ2\Phi, \chi_1 \vdash \chi_2 (hypothesis).
    • (4) Φ,ψ1,χ1⊢χ2\Phi, \psi_1, \chi_1 \vdash \chi_2 (weakening and (3)).
    • (5) Φ,ψ1,χ1⊢ψ2∧χ2\Phi, \psi_1, \chi_1 \vdash \psi_2 \land \chi_2 (and-R and (2) and (4)).
    • (6) Φ,ψ1∧χ1⊢ψ2∧χ2\Phi, \psi_1 \land \chi_1 \vdash \psi_2 \land \chi_2 (and-L and (5)).

    (In the printed proof every occurrence of Φ\Phi is typeset in red: this proof is the previous example's proof with the extra premise set Φ\Phi carried through every line.)

Primitive rules:

  • or-intro1: φ⊢φ∨ψ\varphi \vdash \varphi \lor \psi.
  • or-intro2: ψ⊢φ∨ψ\psi \vdash \varphi \lor \psi.
  • or-elim (or-L): if Φ,ψ1⊢χ\Phi, \psi_1 \vdash \chi and Φ,ψ2⊢χ\Phi, \psi_2 \vdash \chi, then Φ,ψ1∨ψ2⊢χ\Phi, \psi_1 \lor \psi_2 \vdash \chi.

Derived rules:

  • or-R1: If Φ⊢ψ\Phi \vdash \psi, then Φ⊢ψ∨χ\Phi \vdash \psi \lor \chi.
  • or-R2: If Φ⊢χ\Phi \vdash \chi, then Φ⊢ψ∨χ\Phi \vdash \psi \lor \chi.

Proof of or-R1 (no proof of or-R2 is shown):

  • (1) Φ⊢ψ\Phi \vdash \psi (hypothesis).
  • (2) ψ⊢ψ∨χ\psi \vdash \psi \lor \chi (or-intro1).
  • (3) Φ,ψ⊢ψ∨χ\Phi, \psi \vdash \psi \lor \chi (weakening and (2)).
  • (4) Φ⊢ψ∨χ\Phi \vdash \psi \lor \chi (substitution and (1) and (3)).

Derived theorems:

  • or-comm: φ∨ψ⊣⊢ψ∨φ\varphi \lor \psi \dashv\vdash \psi \lor \varphi.
  • or-assoc: (φ∨ψ)∨χ⊣⊢φ∨(ψ∨χ)(\varphi \lor \psi) \lor \chi \dashv\vdash \varphi \lor (\psi \lor \chi).

Proof of or-comm — it suffices to prove: φ∨ψ⊢ψ∨φ\varphi \lor \psi \vdash \psi \lor \varphi (no proof of or-assoc is shown):

  • (1) ψ⊢ψ∨φ\psi \vdash \psi \lor \varphi (or-intro1).
  • (2) φ⊢ψ∨φ\varphi \vdash \psi \lor \varphi (or-intro2).
  • (3) φ∨ψ⊢ψ∨φ\varphi \lor \psi \vdash \psi \lor \varphi (or-elim and (2) and (1)).

4.4 Distributivity, absorption, idempotence

跳转到:4.4 Distributivity, absorption, idempotence
  • Distributivity:
    • φ∧(ψ∨χ)⊣⊢(φ∧ψ)∨(φ∧χ)\varphi \land (\psi \lor \chi) \dashv\vdash (\varphi \land \psi) \lor (\varphi \land \chi).
    • φ∨(ψ∧χ)⊣⊢(φ∨ψ)∧(φ∨χ)\varphi \lor (\psi \land \chi) \dashv\vdash (\varphi \lor \psi) \land (\varphi \lor \chi).
  • Absorption:
    • φ∧(φ∨ψ)⊣⊢φ\varphi \land (\varphi \lor \psi) \dashv\vdash \varphi.
    • φ∨(φ∧ψ)⊣⊢φ\varphi \lor (\varphi \land \psi) \dashv\vdash \varphi.
  • Idempotence:
    • φ∧φ⊣⊢φ\varphi \land \varphi \dashv\vdash \varphi.
    • φ∨φ⊣⊢φ\varphi \lor \varphi \dashv\vdash \varphi.

Primitive rules:

  • CONTRADICTION: If Φ⊢ψ\Phi \vdash \psi and Φ⊢¬ψ\Phi \vdash \neg\psi, then Φ⊢χ\Phi \vdash \chi.
  • EXCLUDED-MIDDLE: ⊢φ∨¬φ\vdash \varphi \lor \neg\varphi.

Derived theorems:

  • CASE-ANALYSIS: If Φ,¬φ⊢ψ\Phi, \neg\varphi \vdash \psi and Φ,φ⊢ψ\Phi, \varphi \vdash \psi, then Φ⊢ψ\Phi \vdash \psi.
  • DOUBLE-NEGATION: φ⊣⊢¬¬φ\varphi \dashv\vdash \neg\neg\varphi.
  • CONTRAPOSITION (four forms):
    • If Φ,ψ⊢χ\Phi, \psi \vdash \chi, then Φ,¬χ⊢¬ψ\Phi, \neg\chi \vdash \neg\psi.
    • If Φ,¬ψ⊢χ\Phi, \neg\psi \vdash \chi, then Φ,¬χ⊢ψ\Phi, \neg\chi \vdash \psi.
    • If Φ,¬ψ⊢¬χ\Phi, \neg\psi \vdash \neg\chi, then Φ,χ⊢ψ\Phi, \chi \vdash \psi.
    • If Φ,ψ⊢¬χ\Phi, \psi \vdash \neg\chi, then Φ,χ⊢¬ψ\Phi, \chi \vdash \neg\psi.
  • DE-MORGAN:
    • ¬(φ∧ψ)⊣⊢¬φ∨¬ψ\neg(\varphi \land \psi) \dashv\vdash \neg\varphi \lor \neg\psi.
    • ¬(φ∨ψ)⊣⊢¬φ∧¬ψ\neg(\varphi \lor \psi) \dashv\vdash \neg\varphi \land \neg\psi.

Primitive rules (stated twice in the notes; the elimination rule is named "implies-elim (Modus Ponens)" the first time and "modus-ponens" the second time):

  • implies-intro: If Φ,φ⊢ψ\Phi, \varphi \vdash \psi, then Φ⊢φ→ψ\Phi \vdash \varphi \to \psi.
  • implies-elim (Modus Ponens): φ→ψ,φ⊢ψ\varphi \to \psi, \varphi \vdash \psi.

Example. Prove: ⊢φ→φ\vdash \varphi \to \varphi.

Formal proof:

  • (1) φ⊢φ\varphi \vdash \varphi (assumption).
  • (2) ⊢φ→φ\vdash \varphi \to \varphi (implies-intro on (1)).

Transitivity of implication — proof of φ→ψ,ψ→χ⊢φ→χ\varphi \to \psi, \psi \to \chi \vdash \varphi \to \chi:

  • (1) φ→ψ,φ⊢ψ\varphi \to \psi, \varphi \vdash \psi (modus-ponens).
  • (2) φ→ψ,ψ→χ,φ⊢ψ\varphi \to \psi, \psi \to \chi, \varphi \vdash \psi (weakening and (1)).
  • (3) ψ→χ,ψ⊢χ\psi \to \chi, \psi \vdash \chi (modus-ponens).
  • (4) φ→ψ,ψ→χ,φ,ψ⊢χ\varphi \to \psi, \psi \to \chi, \varphi, \psi \vdash \chi (weakening and (3)).
  • (5) φ→ψ,ψ→χ,φ⊢χ\varphi \to \psi, \psi \to \chi, \varphi \vdash \chi (substitution and (2) and (4)).
  • (6) φ→ψ,ψ→χ⊢φ→χ\varphi \to \psi, \psi \to \chi \vdash \varphi \to \chi (implies-intro and (5)).

Derived theorems (all two-way):

  • (φ∧ψ)→χ⊣⊢φ→(ψ→χ)(\varphi \land \psi) \to \chi \dashv\vdash \varphi \to (\psi \to \chi).
  • (φ∨ψ)→χ⊣⊢(φ→χ)∧(ψ→χ)(\varphi \lor \psi) \to \chi \dashv\vdash (\varphi \to \chi) \land (\psi \to \chi).
  • φ→ψ⊣⊢¬ψ→¬φ\varphi \to \psi \dashv\vdash \neg\psi \to \neg\varphi.

5 First-Order Logic: Quantifier Rules

跳转到:5 First-Order Logic: Quantifier Rules

5.1 Universal quantifier

跳转到:5.1 Universal quantifier
  • forall-intro: If Φ⊢ψ(x)\Phi \vdash \psi(x), then Φ⊢∀x. ψ(x)\Phi \vdash \forall x.\ \psi(x) (Φ\Phi is irrelevant with xx).
  • forall-elim: ∀x.φ(x)⊢φ(t)\forall x. \varphi(x) \vdash \varphi(t).

Example. Prove: ∀x.(φ(x)→ψ(x)),∀x.φ(x)⊢∀x.ψ(x)\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(x) \vdash \forall x.\psi(x).

Formal proof:

  • (1) ∀x.φ(x)⊢φ(x)\forall x.\varphi(x) \vdash \varphi(x) (forall-elim).
  • (2) ∀x.(φ(x)→ψ(x)),∀x.φ(x)⊢φ(x)\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(x) \vdash \varphi(x) (weakening and (1)).
  • (3) ∀x.(φ(x)→ψ(x))⊢φ(x)→ψ(x)\forall x.(\varphi(x) \to \psi(x)) \vdash \varphi(x) \to \psi(x) (forall-elim).
  • (4) ∀x.(φ(x)→ψ(x)),∀x.φ(x),φ(x)⊢φ(x)→ψ(x)\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(x), \varphi(x) \vdash \varphi(x) \to \psi(x) (weakening and (3)).
  • (5) φ(x)→ψ(x),φ(x)⊢ψ(x)\varphi(x) \to \psi(x), \varphi(x) \vdash \psi(x) (modus-ponens).
  • (6) ∀x.(φ(x)→ψ(x)),∀x.φ(x),φ(x)→ψ(x),φ(x)⊢ψ(x)\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(x), \varphi(x) \to \psi(x), \varphi(x) \vdash \psi(x) (weakening and (5)).
  • (7) ∀x.(φ(x)→ψ(x)),∀x.φ(x),φ(x)⊢ψ(x)\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(x), \varphi(x) \vdash \psi(x) (substitution and (4), (6)).
  • (8) ∀x.(φ(x)→ψ(x)),∀x.φ(x)⊢ψ(x)\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(x) \vdash \psi(x) (substitution and (2), (7)).
  • (9) ∀x.(φ(x)→ψ(x)),∀x.φ(x)⊢∀x.ψ(x)\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(x) \vdash \forall x.\psi(x) (forall-intro and (8)).

Example. Prove: ∀x.(φ(x)→ψ(x)),∀x.φ(f(x))⊢∀x.ψ(f(x))\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(f(x)) \vdash \forall x.\psi(f(x)).

Formal proof:

  • (1) ∀x.φ(f(x))⊢φ(f(x))\forall x.\varphi(f(x)) \vdash \varphi(f(x)) (forall-elim).
  • (2) ∀x.(φ(x)→ψ(x)),∀x.φ(f(x))⊢φ(f(x))\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(f(x)) \vdash \varphi(f(x)) (weakening and (1)).
  • (3) ∀x.(φ(x)→ψ(x))⊢φ(f(x))→ψ(f(x))\forall x.(\varphi(x) \to \psi(x)) \vdash \varphi(f(x)) \to \psi(f(x)) (forall-elim).
  • (4) ∀x.(φ(x)→ψ(x)),∀x.φ(f(x)),φ(f(x))⊢φ(f(x))→ψ(f(x))\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(f(x)), \varphi(f(x)) \vdash \varphi(f(x)) \to \psi(f(x)) (weakening and (3)).
  • (5) φ(f(x))→ψ(f(x)),φ(f(x))⊢ψ(f(x))\varphi(f(x)) \to \psi(f(x)), \varphi(f(x)) \vdash \psi(f(x)) (modus-ponens).
  • (6) ∀x.(φ(x)→ψ(x)),∀x.φ(f(x)),φ(f(x))→ψ(f(x)),φ(f(x))⊢ψ(f(x))\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(f(x)), \varphi(f(x)) \to \psi(f(x)), \varphi(f(x)) \vdash \psi(f(x)) (weakening and (5)).
  • (7) ∀x.(φ(x)→ψ(x)),∀x.φ(f(x)),φ(f(x))⊢ψ(f(x))\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(f(x)), \varphi(f(x)) \vdash \psi(f(x)) (substitution and (4), (6)).
  • (8) ∀x.(φ(x)→ψ(x)),∀x.φ(f(x))⊢ψ(f(x))\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(f(x)) \vdash \psi(f(x)) (substitution and (2), (7)).
  • (9) ∀x.(φ(x)→ψ(x)),∀x.φ(f(x))⊢∀x.ψ(f(x))\forall x.(\varphi(x) \to \psi(x)), \forall x.\varphi(f(x)) \vdash \forall x.\psi(f(x)) (forall-intro and (8)).

5.2 Existential quantifier

跳转到:5.2 Existential quantifier
  • exists-intro: φ(t)⊢∃x.φ(x)\varphi(t) \vdash \exists x.\varphi(x).
  • exists-elim: If Φ,ψ(x)⊢χ\Phi, \psi(x) \vdash \chi, then Φ,∃x.ψ(x)⊢χ\Phi, \exists x.\psi(x) \vdash \chi (Φ\Phi and χ\chi are irrelevant with xx).

Example. Prove: ∃x.φ(x),∀x.(φ(x)→ψ(x))⊢∃x.ψ(x)\exists x.\varphi(x), \forall x.(\varphi(x) \to \psi(x)) \vdash \exists x.\psi(x).

Formal proof:

  • (1) ∀x.(φ(x)→ψ(x))⊢φ(x)→ψ(x)\forall x.(\varphi(x) \to \psi(x)) \vdash \varphi(x) \to \psi(x) (forall-elim).
  • (2) φ(x),∀x.(φ(x)→ψ(x))⊢φ(x)→ψ(x)\varphi(x), \forall x.(\varphi(x) \to \psi(x)) \vdash \varphi(x) \to \psi(x) (weakening and (1)).
  • (3) φ(x)→ψ(x),φ(x)⊢ψ(x)\varphi(x) \to \psi(x), \varphi(x) \vdash \psi(x) (modus-ponens).
  • (4) φ(x),∀x.(φ(x)→ψ(x)),φ(x)→ψ(x)⊢ψ(x)\varphi(x), \forall x.(\varphi(x) \to \psi(x)), \varphi(x) \to \psi(x) \vdash \psi(x) (weakening and (3)).
  • (5) φ(x),∀x.(φ(x)→ψ(x))⊢ψ(x)\varphi(x), \forall x.(\varphi(x) \to \psi(x)) \vdash \psi(x) (substitution and (2), (4)).
  • (6) ψ(x)⊢∃x.ψ(x)\psi(x) \vdash \exists x.\psi(x) (exists-intro).
  • (7) φ(x),∀x.(φ(x)→ψ(x)),ψ(x)⊢∃x.ψ(x)\varphi(x), \forall x.(\varphi(x) \to \psi(x)), \psi(x) \vdash \exists x.\psi(x) (weakening and (6)).
  • (8) φ(x),∀x.(φ(x)→ψ(x))⊢∃x.ψ(x)\varphi(x), \forall x.(\varphi(x) \to \psi(x)) \vdash \exists x.\psi(x) (substitution and (5) and (7)).
  • (9) ∃x.φ(x),∀x.(φ(x)→ψ(x))⊢∃x.ψ(x)\exists x.\varphi(x), \forall x.(\varphi(x) \to \psi(x)) \vdash \exists x.\psi(x) (exists-elim and (8)).

5.3 Distribution of quantifiers over conjunction and disjunction

跳转到:5.3 Distribution of quantifiers over conjunction and disjunction
  • ∀x.φ(x)∧ψ(x)⊣⊢(∀x.φ(x))∧(∀x.ψ(x))\forall x.\varphi(x) \land \psi(x) \dashv\vdash (\forall x.\varphi(x)) \land (\forall x.\psi(x)) — two-way.
  • (∀x.φ(x))∨(∀x.ψ(x))⊢∀x.φ(x)∨ψ(x)(\forall x.\varphi(x)) \lor (\forall x.\psi(x)) \vdash \forall x.\varphi(x) \lor \psi(x) — one-way only.
  • (∃x.φ(x))∨(∃x.ψ(x))⊣⊢∃x.φ(x)∨ψ(x)(\exists x.\varphi(x)) \lor (\exists x.\psi(x)) \dashv\vdash \exists x.\varphi(x) \lor \psi(x) — two-way.
  • ∃x.φ(x)∧ψ(x)⊢(∃x.φ(x))∧(∃x.ψ(x))\exists x.\varphi(x) \land \psi(x) \vdash (\exists x.\varphi(x)) \land (\exists x.\psi(x)) — one-way only.
  • If Φ,φ(x)⊢ψ(x)\Phi, \varphi(x) \vdash \psi(x) and Φ\Phi is irrelevant with xx, then Φ,∀x.φ(x)⊢∀x.ψ(x)\Phi, \forall x.\varphi(x) \vdash \forall x.\psi(x).
  • If Φ,φ(x)⊢ψ(x)\Phi, \varphi(x) \vdash \psi(x) and Φ\Phi is irrelevant with xx, then Φ,∃x.φ(x)⊢∃x.ψ(x)\Phi, \exists x.\varphi(x) \vdash \exists x.\psi(x).
  • ∀x.∀y. φ(x,y)⊣⊢∀y. ∀x. φ(x,y)\forall x.\forall y.\ \varphi(x, y) \dashv\vdash \forall y.\ \forall x.\ \varphi(x, y).
  • ∃x.∃y. φ(x,y)⊣⊢∃y. ∃x. φ(x,y)\exists x.\exists y.\ \varphi(x, y) \dashv\vdash \exists y.\ \exists x.\ \varphi(x, y).
  • ∃x.∀y. φ(x,y)⊢∀y. ∃x. φ(x,y)\exists x.\forall y.\ \varphi(x, y) \vdash \forall y.\ \exists x.\ \varphi(x, y) — one-way only.
  • ¬∀x.φ(x)⊣⊢∃x.¬φ(x)\neg\forall x.\varphi(x) \dashv\vdash \exists x.\neg\varphi(x).
  • ¬∃x.φ(x)⊣⊢∀x.¬φ(x)\neg\exists x.\varphi(x) \dashv\vdash \forall x.\neg\varphi(x).

6.4 Quantifier with restricted domain

跳转到:6.4 Quantifier with restricted domain

Distribution over the restricted body (unparenthesized sides scope as ∀x.(φ(x)→(ψ(x)∧χ(x)))\forall x.(\varphi(x) \to (\psi(x) \land \chi(x))) etc.):

  • ∀x.φ(x)→ψ(x)∧χ(x)⊣⊢(∀x.φ(x)→ψ(x))∧(∀x.φ(x)→χ(x))\forall x.\varphi(x) \to \psi(x) \land \chi(x) \dashv\vdash (\forall x.\varphi(x) \to \psi(x)) \land (\forall x.\varphi(x) \to \chi(x)).
  • (∀x.φ(x)→ψ(x))∨(∀x.φ(x)→χ(x))⊢∀x.φ(x)→ψ(x)∨χ(x)(\forall x.\varphi(x) \to \psi(x)) \lor (\forall x.\varphi(x) \to \chi(x)) \vdash \forall x.\varphi(x) \to \psi(x) \lor \chi(x) — one-way only.
  • ∃x.φ(x)∧(ψ(x)∨χ(x))⊣⊢(∃x.φ(x)∧ψ(x))∨(∃x.φ(x)∧χ(x))\exists x.\varphi(x) \land (\psi(x) \lor \chi(x)) \dashv\vdash (\exists x.\varphi(x) \land \psi(x)) \lor (\exists x.\varphi(x) \land \chi(x)).
  • ∃x.φ(x)∧(ψ(x)∧χ(x))⊢(∃x.φ(x)∧ψ(x))∧(∃x.φ(x)∧χ(x))\exists x.\varphi(x) \land (\psi(x) \land \chi(x)) \vdash (\exists x.\varphi(x) \land \psi(x)) \land (\exists x.\varphi(x) \land \chi(x)) — one-way only.

Exchanging two restricted-domain quantifiers (the first two bullets appear in both handouts; the third only in the May 11 notes):

  • ∀x.φ(x)→(∀y.ψ(y)→χ(x,y))⊣⊢∀y.ψ(y)→(∀x.φ(x)→χ(x,y))\forall x.\varphi(x) \to (\forall y.\psi(y) \to \chi(x, y)) \dashv\vdash \forall y.\psi(y) \to (\forall x.\varphi(x) \to \chi(x, y)).
  • ∃x.φ(x)∧(∃y.ψ(y)∧χ(x,y))⊣⊢∃y.ψ(y)∧(∃x.φ(x)∧χ(x,y))\exists x.\varphi(x) \land (\exists y.\psi(y) \land \chi(x, y)) \dashv\vdash \exists y.\psi(y) \land (\exists x.\varphi(x) \land \chi(x, y)).
  • ∃x.φ(x)∧(∀y.ψ(y)→χ(x,y))⊢∀y.ψ(y)→(∃x.φ(x)∧χ(x,y))\exists x.\varphi(x) \land (\forall y.\psi(y) \to \chi(x, y)) \vdash \forall y.\psi(y) \to (\exists x.\varphi(x) \land \chi(x, y)) — one-way only.

Negated restricted-domain quantifiers:

  • ¬∀x. φ(x)→ψ(x)⊣⊢∃x. φ(x)∧¬ψ(x)\neg\forall x.\ \varphi(x) \to \psi(x) \dashv\vdash \exists x.\ \varphi(x) \land \neg\psi(x).
  • ¬∃x. φ(x)∧ψ(x)⊣⊢∀x.φ(x)→¬ψ(x)\neg\exists x.\ \varphi(x) \land \psi(x) \dashv\vdash \forall x.\varphi(x) \to \neg\psi(x).

6.5 Quantifier with unrelated proposition

跳转到:6.5 Quantifier with unrelated proposition

All four require the side condition that φ\varphi is irrelevant with xx:

  • φ∧∀x.ψ(x)⊣⊢∀x. φ∧ψ(x)\varphi \land \forall x.\psi(x) \dashv\vdash \forall x.\ \varphi \land \psi(x) (if φ\varphi is irrelevant with xx).
  • φ∨∀x.ψ(x)⊣⊢∀x. φ∨ψ(x)\varphi \lor \forall x.\psi(x) \dashv\vdash \forall x.\ \varphi \lor \psi(x) (if φ\varphi is irrelevant with xx).
  • φ∧∃x.ψ(x)⊣⊢∃x. φ∧ψ(x)\varphi \land \exists x.\psi(x) \dashv\vdash \exists x.\ \varphi \land \psi(x) (if φ\varphi is irrelevant with xx).
  • φ∨∃x.ψ(x)⊣⊢∃x. φ∨ψ(x)\varphi \lor \exists x.\psi(x) \dashv\vdash \exists x.\ \varphi \lor \psi(x) (if φ\varphi is irrelevant with xx).

Vacuous quantification:

  • If φ\varphi is irrelevant with xx, φ⊣⊢∀x.φ\varphi \dashv\vdash \forall x.\varphi.
  • If φ\varphi is irrelevant with xx, φ⊣⊢∃x.φ\varphi \dashv\vdash \exists x.\varphi.

Unrelated antecedent:

  • φ→∀x.ψ(x)⊣⊢∀x. φ→ψ(x)\varphi \to \forall x.\psi(x) \dashv\vdash \forall x.\ \varphi \to \psi(x) (if φ\varphi is irrelevant with xx).

6.6 Quantifier with special domain

跳转到:6.6 Quantifier with special domain

Empty-domain style entailments (all one-way ⊢\vdash):

  • ∀x.¬φ(x)⊢∀x.φ(x)→ψ(x)\forall x.\neg\varphi(x) \vdash \forall x.\varphi(x) \to \psi(x).
  • ∀x.¬φ(x)⊢¬∃x.φ(x)∧ψ(x)\forall x.\neg\varphi(x) \vdash \neg\exists x.\varphi(x) \land \psi(x).
  • ∀x.ψ(x)⊢∀x.φ(x)→ψ(x)\forall x.\psi(x) \vdash \forall x.\varphi(x) \to \psi(x).
  • ∀x.¬ψ(x),∃x.φ(x)⊢¬∀x.φ(x)→ψ(x)\forall x.\neg\psi(x), \exists x.\varphi(x) \vdash \neg\forall x.\varphi(x) \to \psi(x).
  • ∀x.ψ(x),∃x.φ(x)⊢∃x.φ(x)∧ψ(x)\forall x.\psi(x), \exists x.\varphi(x) \vdash \exists x.\varphi(x) \land \psi(x).
  • ∀x.¬ψ(x)⊢¬∃x.φ(x)∧ψ(x)\forall x.\neg\psi(x) \vdash \neg\exists x.\varphi(x) \land \psi(x).

7 Syntax of First-Order Logic

跳转到:7 Syntax of First-Order Logic

7.1 Symbols, terms and propositions

跳转到:7.1 Symbols, terms and propositions
  • Variables symbols: xx, yy, zz, ...
  • Constants symbols: c1c_1, c2c_2, ...
  • Function symbols: ff, gg, hh, ...
  • Predicate symbols: PP, QQ, RR, ...
  • Terms (tt): xx, yy, zz, ..., c1c_1, c2c_2, ..., f(t1,t2,...)f(t_1, t_2, ...), ...
  • Proposition (ϕ\phi): P(t)P(t), Q(t1,t2)Q(t_1, t_2), ϕ1∧ϕ2\phi_1 \land \phi_2, ¬ϕ\neg\phi, ∃x.ϕ\exists x.\phi, ∀y.ψ\forall y.\psi, ...

Quiz. If x,y,z,…x, y, z, \ldots are variable symbols, c0,c1,…c_0, c_1, \ldots are constant symbols, f,g,…f, g, \ldots are function symbols, and P,Q,R,…P, Q, R, \ldots are predicate symbols, then:

  • which of the following are first order logic terms?
    • x+1x+1, x+yx+y, f(x,y)f(x,y), f(x)+g(y)f(x)+g(y)
    • c1+c2c_1+c_2, f(g(c1))f(g(c_1)), h(f(x),g(c2))h(f(x), g(c_2))
  • which of the following are first order logic propositions?
    • P(x)P(x), Q(f(c0))Q(f(c_0)), f(x)<f(x+1)f(x) < f(x+1), R(x,y)∧R(y,x)R(x,y) \land R(y,x)
    • ∀x.∃y. (x<y)\forall x.\exists y.\,(x < y), ∀x.∀y. (R(x,y)∨R(y,x))\forall x.\forall y.\,(R(x,y) \lor R(y,x))

Answer: terms — f(x,y)f(x,y), f(g(c1))f(g(c_1)) and h(f(x),g(c2))h(f(x), g(c_2)); propositions — P(x)P(x), Q(f(c0))Q(f(c_0)), R(x,y)∧R(y,x)R(x,y) \land R(y,x) and ∀x.∀y. (R(x,y)∨R(y,x))\forall x.\forall y.\,(R(x,y) \lor R(y,x)).

7.2 Free and bound occurrences; open and closed propositions

跳转到:7.2 Free and bound occurrences; open and closed propositions
  • Free occurrence and bound occurrence. Assume xx is a variable symbol. In ∀x.ϕ\forall x.\phi and ∃x.ϕ\exists x.\phi, all occurrences of xx are called bound occurrences. All other occurrences of xx are free occurrences.
  • Open proposition and closed proposition. A FOL proposition ϕ\phi is open if it contains at least one free occurrence of variables. Otherwise, ϕ\phi is called a closed proposition.

Example. If LL is a binary predicate symbol and ff is a unary function symbol:

  • xx freely occurs in L(x,f(x))L(x, f(x));
  • xx and yy freely occur in L(x,y)L(x, y);
  • xx does not freely occur in ∀x.L(x,f(x))\forall x.L(x, f(x));
  • xx freely occurs in ∃y.L(x,y)\exists y.L(x, y);
  • yy does not freely occur in ∃y.L(x,y)\exists y.L(x, y);
  • neither xx nor yy does freely occur in ∀x.∃y.L(x,y)\forall x.\exists y.L(x,y);
  • L(x,f(x))L(x, f(x)) is open;
  • ∀x.L(x,f(x))\forall x.L(x, f(x)) is closed;
  • L(x,y)L(x, y) is open;
  • ∃y.L(x,y)\exists y.L(x, y) is open;
  • ∀x.∃y.L(x,y)\forall x.\exists y.L(x, y) is closed.

7.3 Syntactic replacement

跳转到:7.3 Syntactic replacement
  • (φ∧ψ)[x1↦t1,...,xn↦tn]=φ[x1↦t1,...,xn↦tn]∧ψ[x1↦t1,...,xn↦tn](\varphi \land \psi)[x_1 \mapsto t_1, ..., x_n \mapsto t_n] = \varphi[x_1 \mapsto t_1, ..., x_n \mapsto t_n] \land \psi[x_1 \mapsto t_1, ..., x_n \mapsto t_n].
  • (φ∨ψ)[x1↦t1,...,xn↦tn]=φ[x1↦t1,...,xn↦tn]∨ψ[x1↦t1,...,xn↦tn](\varphi \lor \psi)[x_1 \mapsto t_1, ..., x_n \mapsto t_n] = \varphi[x_1 \mapsto t_1, ..., x_n \mapsto t_n] \lor \psi[x_1 \mapsto t_1, ..., x_n \mapsto t_n].
  • (¬φ)[x1↦t1,...,xn↦tn]=¬φ[x1↦t1,...,xn↦tn](\neg\varphi)[x_1 \mapsto t_1, ..., x_n \mapsto t_n] = \neg\varphi[x_1 \mapsto t_1, ..., x_n \mapsto t_n].
  • (∀x.φ)[x1↦t1,...,xn↦tn]=...(\forall x.\varphi)[x_1 \mapsto t_1, ..., x_n \mapsto t_n] = ...
  • (∃x.φ)[x1↦t1,...,xn↦tn]=...(\exists x.\varphi)[x_1 \mapsto t_1, ..., x_n \mapsto t_n] = ...

(The two quantifier cases are literally left as "=...= ..." in the notes.)

7.4 Quantifier rules, restated with syntactic precision

跳转到:7.4 Quantifier rules, restated with syntactic precision
  • FORALL-INTRO: If Φ⊢ψ\Phi \vdash \psi and xx does not freely occur in Φ\Phi, then Φ⊢∀x. ψ\Phi \vdash \forall x.\ \psi.
  • FORALL-ELIM: ∀x.φ⊢φ[x↦t]\forall x.\varphi \vdash \varphi[x \mapsto t].
  • EXISTS-INTRO: φ[x↦t]⊢∃x.φ\varphi[x \mapsto t] \vdash \exists x.\varphi.
  • EXISTS-ELIM: If Φ,ψ⊢χ\Phi, \psi \vdash \chi and xx does not freely occur in Φ\Phi or χ\chi, then Φ,∃x.ψ⊢χ\Phi, \exists x.\psi \vdash \chi.

These restate the quantifier rules of Section 5 with the informal side condition "Φ\Phi is irrelevant with xx" made precise as "xx does not freely occur in Φ\Phi (or χ\chi)", and instantiation/generalization expressed via syntactic replacement φ[x↦t]\varphi[x \mapsto t].