Notes@HKU by Jax

Predicate Logic

Predicate logic

Definitions

Predications

Recall propositions are statements that are either true of false. Predicates implements the statements to become functions, which accepts input to produce a truth value. Assigning the predicate to a variable function we get a propositional function.

P(x):f(xsubject)predicatepropositional function\underbrace{P(x): \overbrace{f(\overbrace{x}^{\text{subject}})}^\text{predicate}}_{\text{propositional function}}

Given a subject value, P(x)P(x) becomes a proposition and returns a truth value.

The Domain

The domain of a predicate is the set of all possible values that the variables in the predicate can take.

Example

The domain for predicate x>0x > 0 = R\mathbb{R}

Quantifiers

Recall P(x){T,F}P(x)\rightarrow \{T, F\} given xx. Quantifiers are used to generalize the truth value of a predicate over a domain, converting the propositional function to a proposition.

SymbolNameMeaning
\forallUniversal quantifierFor all
\existsExistential quantifierThere exists
!\exists!Unique quantifierThere exists exactly one

The scope of a quantifier is the part of the statement that the quantifier applies to.

Example universal

Consider P(x):x2>xP(x): x^2 > x. We convert to proposition / statement using quantifiers:

xZ{0,1},P(x)\forall x \in \mathbb{Z}\setminus\{0,1\}, P(x)

Notice the P(x)P(x) at the end means that for the previous quantifier, the result is true (recall pp = true, ¬p\neg p = false). We can also write as:

x(xZ{0,1}x2>x)\forall x (x \in \mathbb{Z}\setminus\{0,1\} \rightarrow x^2 > x)

Where x2>xx^2 > x is the predicate, interchangable with P(x)P(x).

Example exists and unique

Consider P(x):x=1P(x): x = 1. The statement can be written as

x ! x,P(x)orx{1},P(x)\forall x\ \exists!\ x, P(x)\quad\text{or}\quad\forall x\in\{1\}, P(x)

Methods

Laws

NameLawExample
De Morgan's (universal negation)¬xP(x)x¬P(x)\neg \forall x P(x) \equiv \exists x \neg P(x)Negation of "everyone loves math" is "someone doesn't love math"
De Morgan's (existential negation)¬xP(x)x¬P(x)\neg \exists x P(x) \equiv \forall x \neg P(x)Negation of "someone loves math" is "everyone doesn't love math"
Distribution (universal conjunction)x(P(x)Q(x))xP(x)xQ(x)\forall x (P(x) \land Q(x)) \equiv \forall x P(x) \land \forall x Q(x)"Everyone loves math and physics" is "everyone loves math and everyone loves physics"
Distribution (existential disjunction)x(P(x)Q(x))xP(x)xQ(x)\exists x (P(x) \lor Q(x)) \equiv \exists x P(x) \lor \exists x Q(x)"Someone loves math or physics" is "someone loves math or someone loves physics"

Note that we cannot distrubte existential quantifiers over conjunctions, or universal quantifiers over disjunctions. (logical fallacy)

Nested quantifier rules

Quantifiers are nested when one quanitifier is within the scope of another.

We can negate propositions with nested quantifiers by successively applying De Morgan's laws.

Example

Consider scenario of keys and doors. Consider proposition function P(x,y):xP(x,y): x can open yy. Domain of xx is the set of keys, yy the set of doors.

StatementsExpressions
There exists a key that can open all doorsxy,P(x,y)\exists x\forall y, P(x,y)
For all doors, there exists a key that opens ityx,P(x,y)\forall y\exists x, P(x,y)
Any key can open any doorxy,P(x,y)\forall x\forall y, P(x,y)
At least one door can be open by a keyyx,P(x,y)\exists y\exists x, P(x,y)
No door can be opened by any key¬yx,P(x,y)\neg\exists y\forall x, P(x,y)

We can also write the final statement as:

¬yx,P(x,y)=y¬x,P(x,y)=yx,¬P(x,y)\begin{align*} \neg\exists y\forall x, P(x,y) &= \forall y\neg\forall x, P(x,y) \\ &= \forall y\exists x, \neg P(x,y) \end{align*}

On this page