跳转到内容

离散数学 · 数理逻辑 · 速览

Condensed recall index for the full notes in DM_C2.md.

1 Translating natural language into logic

跳转到:1 Translating natural language into logic
PatternLogic shape
"Every AA is BB"∀x. A(x)→B(x)\forall x.\ A(x) \to B(x)
"Some AA is BB"∃x. A(x)∧B(x)\exists x.\ A(x) \land B(x)
"For every AA there is some related BB"∀x. (S(x)→∃y. M(x,y))\forall x.\ (S(x) \to \exists y.\ M(x, y))
Named individual (e.g. "lions")constant symbol cLc_L: F(cL)F(c_L), ¬D(cL)\neg D(c_L)
"There is a unique xx with property FF"∃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))
"ff is injective"∀x.∀y. (f(x)=f(y)→x=y)\forall x. \forall y.\ (f(x) = f(y) \to x = y)
"ff is surjective"∀y.∃x. (f(x)=y)\forall y. \exists x.\ (f(x) = y)
  • Φ⊢ψ\Phi \vdash \psi: we can derive the single proposition ψ\psi from the proposition set Φ\Phi.
  • φ⊣⊢ψ\varphi \dashv\vdash \psi if and only if both φ⊢ψ\varphi \vdash \psi and ψ⊢φ\psi \vdash \varphi.

3 Propositional proof rules

跳转到:3 Propositional proof rules
  • Structural: 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).
  • Conjunction: AND-INTRO φ,ψ⊢φ∧ψ\varphi, \psi \vdash \varphi \land \psi; AND-ELIM1 φ∧ψ⊢φ\varphi \land \psi \vdash \varphi; AND-ELIM2 φ∧ψ⊢ψ\varphi \land \psi \vdash \psi. Derived: AND-R (if Φ⊢ψ\Phi \vdash \psi and Φ⊢χ\Phi \vdash \chi then Φ⊢ψ∧χ\Phi \vdash \psi \land \chi); and-L (if Φ,ψ1,ψ2⊢χ\Phi, \psi_1, \psi_2 \vdash \chi then Φ,ψ1∧ψ2⊢χ\Phi, \psi_1 \land \psi_2 \vdash \chi, and conversely); and-comm; and-assoc.
  • Congruence of ∧\land: 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.
  • Disjunction: 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: or-R1, or-R2; or-comm; or-assoc.
  • Laws: distributivity φ∧(ψ∨χ)⊣⊢(φ∧ψ)∨(φ∧χ)\varphi \land (\psi \lor \chi) \dashv\vdash (\varphi \land \psi) \lor (\varphi \land \chi) and φ∨(ψ∧χ)⊣⊢(φ∨ψ)∧(φ∨χ)\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.
  • Negation: CONTRADICTION (if Φ⊢ψ\Phi \vdash \psi and Φ⊢¬ψ\Phi \vdash \neg\psi then Φ⊢χ\Phi \vdash \chi — any χ\chi); EXCLUDED-MIDDLE ⊢φ∨¬φ\vdash \varphi \lor \neg\varphi; 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; DE-MORGAN ¬(φ∧ψ)⊣⊢¬φ∨¬ψ\neg(\varphi \land \psi) \dashv\vdash \neg\varphi \lor \neg\psi, ¬(φ∨ψ)⊣⊢¬φ∧¬ψ\neg(\varphi \lor \psi) \dashv\vdash \neg\varphi \land \neg\psi.
  • CONTRAPOSITION (all four sign variants): 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.
  • Implication: implies-intro (if Φ,φ⊢ψ\Phi, \varphi \vdash \psi then Φ⊢φ→ψ\Phi \vdash \varphi \to \psi); modus-ponens φ→ψ,φ⊢ψ\varphi \to \psi, \varphi \vdash \psi; transitivity φ→ψ,ψ→χ⊢φ→χ\varphi \to \psi, \psi \to \chi \vdash \varphi \to \chi. Two-way laws: (φ∧ψ)→χ⊣⊢φ→(ψ→χ)(\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.

4 Quantifier rules — watch the side conditions

跳转到:4 Quantifier rules — watch the side conditions
  • forall-intro: if Φ⊢ψ(x)\Phi \vdash \psi(x), then Φ⊢∀x. ψ(x)\Phi \vdash \forall x.\ \psi(x) — requires Φ\Phi irrelevant with xx.
  • forall-elim: ∀x.φ(x)⊢φ(t)\forall x. \varphi(x) \vdash \varphi(t) — no side condition.
  • exists-intro: φ(t)⊢∃x.φ(x)\varphi(t) \vdash \exists x.\varphi(x) — no side condition.
  • exists-elim: if Φ,ψ(x)⊢χ\Phi, \psi(x) \vdash \chi, then Φ,∃x.ψ(x)⊢χ\Phi, \exists x.\psi(x) \vdash \chi — requires both Φ\Phi and χ\chi irrelevant with xx.
  • Syntactically precise restatement: "irrelevant with xx" = "xx does not freely occur in"; elimination/introduction use syntactic replacement: 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.
  • Monotonicity under a quantifier: 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) and Φ,∃x.φ(x)⊢∃x.ψ(x)\Phi, \exists x.\varphi(x) \vdash \exists x.\psi(x).

5 Quantifier facts: two-way vs one-way

跳转到:5 Quantifier facts: two-way vs one-way

Two-way (⊣⊢\dashv\vdash):

  • ∀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)).
  • ∃x.φ(x)∨ψ(x)⊣⊢(∃x.φ(x))∨(∃x.ψ(x))\exists x.\varphi(x) \lor \psi(x) \dashv\vdash (\exists x.\varphi(x)) \lor (\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.φ(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).
  • Restricted domain: ∀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))\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)).
  • Negated restricted domain: ¬∀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).
  • Exchanging restricted quantifiers (same kind): ∀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)).
  • Unrelated proposition (all require φ\varphi irrelevant with xx): φ∧∀x.ψ(x)⊣⊢∀x. φ∧ψ(x)\varphi \land \forall x.\psi(x) \dashv\vdash \forall x.\ \varphi \land \psi(x); φ∨∀x.ψ(x)⊣⊢∀x. φ∨ψ(x)\varphi \lor \forall x.\psi(x) \dashv\vdash \forall x.\ \varphi \lor \psi(x); φ∧∃x.ψ(x)⊣⊢∃x. φ∧ψ(x)\varphi \land \exists x.\psi(x) \dashv\vdash \exists x.\ \varphi \land \psi(x); φ∨∃x.ψ(x)⊣⊢∃x. φ∨ψ(x)\varphi \lor \exists x.\psi(x) \dashv\vdash \exists x.\ \varphi \lor \psi(x); φ→∀x.ψ(x)⊣⊢∀x. φ→ψ(x)\varphi \to \forall x.\psi(x) \dashv\vdash \forall x.\ \varphi \to \psi(x); vacuous: φ⊣⊢∀x.φ\varphi \dashv\vdash \forall x.\varphi and φ⊣⊢∃x.φ\varphi \dashv\vdash \exists x.\varphi.

One-way only (⊢\vdash):

  • (∀x.φ(x))∨(∀x.ψ(x))⊢∀x.φ(x)∨ψ(x)(\forall x.\varphi(x)) \lor (\forall x.\psi(x)) \vdash \forall x.\varphi(x) \lor \psi(x).
  • ∃x.φ(x)∧ψ(x)⊢(∃x.φ(x))∧(∃x.ψ(x))\exists x.\varphi(x) \land \psi(x) \vdash (\exists x.\varphi(x)) \land (\exists x.\psi(x)).
  • ∃x.∀y. φ(x,y)⊢∀y.∃x. φ(x,y)\exists x.\forall y.\ \varphi(x, y) \vdash \forall y.\exists x.\ \varphi(x, y).
  • (∀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).
  • ∃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)).
  • ∃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)).
  • Special domain: ∀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).

6 Reading informal proofs: recurring step-to-rule correspondences

跳转到:6 Reading informal proofs: recurring step-to-rule correspondences
  • "Given a fixed ε>0\varepsilon > 0" (proving a universal implication): 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)).
  • "Let N=tN = t" (providing a witness): if Φ⊢P(t)\Phi \vdash P(t) then Φ⊢∃x. P(x)\Phi \vdash \exists x.\ P(x).
  • "Choose an arbitrary ... such that ..." / "we can assume x=2x0x = 2x_0" (using an existential): if Φ,P(x)⊢ψ\Phi, P(x) \vdash \psi, then Φ,∃x. P(x)⊢ψ\Phi, \exists x.\ P(x) \vdash \psi.
  • "Because AA, BB" / citing a math fact mid-proof (chaining a lemma): if Φ⊢ψ\Phi \vdash \psi and Φ,ψ⊢χ\Phi, \psi \vdash \chi, then Φ⊢χ\Phi \vdash \chi.
  • "If ..., then we are done. Otherwise ..." (case split): if Φ,φ⊢ψ\Phi, \varphi \vdash \psi and Φ,¬φ⊢ψ\Phi, \neg\varphi \vdash \psi, then Φ⊢ψ\Phi \vdash \psi.
  • Proving ¬∃\neg\exists: to prove ¬∃x. (P(x)∧∃y.(P(y)∧Q(x,y)∧R(x,y)))\neg \exists x.\ (P(x) \land \exists y. (P(y) \land Q(x, y) \land R(x, y))), it suffices to derive ¬R(x,y)\neg R(x, y) from Φ,P(x),P(y),Q(x,y)\Phi, P(x), P(y), Q(x, y).
  • Terms tt: variables, constants, f(t1,t2,...)f(t_1, t_2, ...) — only the listed symbol kinds; e.g. x+1x+1, f(x)+g(y)f(x)+g(y), c1+c2c_1+c_2 are not terms, while f(x,y)f(x,y), f(g(c1))f(g(c_1)), h(f(x),g(c2))h(f(x), g(c_2)) are.
  • Propositions ϕ\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, ...; e.g. f(x)<f(x+1)f(x) < f(x+1) and ∀x.∃y. (x<y)\forall x.\exists y.\,(x < y) are not FOL propositions (<< is not a listed predicate symbol).
  • In ∀x.ϕ\forall x.\phi and ∃x.ϕ\exists x.\phi all occurrences of xx are bound; all other occurrences are free. ϕ\phi is open if it has at least one free variable occurrence, otherwise closed. E.g. ∃y.L(x,y)\exists y.L(x, y) is open (xx free), ∀x.∃y.L(x,y)\forall x.\exists y.L(x, y) is closed.
  • Syntactic replacement [x1↦t1,...,xn↦tn][x_1 \mapsto t_1, ..., x_n \mapsto t_n] distributes over ∧\land, ∨\lor, ¬\neg (the quantifier cases are left elided in the notes).
  • The two quantifier side conditions are the easiest thing to drop: forall-intro needs Φ\Phi irrelevant with xx; exists-elim needs both Φ\Phi and χ\chi irrelevant with xx.
  • Memorize which distribution/swap facts are one-way only (Section 5 above): ∃∀⊢∀∃\exists\forall \vdash \forall\exists, ∀\forall over ∨\lor, ∃\exists over ∧\land, and the mixed restricted-quantifier exchange.
  • Several printed proofs and one theorem bullet in the source contain anomalies (e.g. a proof line citing itself, a proof using the wrong target formula, a justification reading "weakening" where the cited lines form a substitution step, and the fourth restricted-domain bullet of the May 9 Theorem 4); DM_C2.md corrects the visible statements and preserves the original anomalies in hidden source-conflict comments.