Predicate Logic
Predicate logic
Definitions
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.
Given a subject value, becomes a proposition and returns a truth value.
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 =
Recall given . Quantifiers are used to generalize the truth value of a predicate over a domain, converting the propositional function to a proposition.
Symbol | Name | Meaning |
---|---|---|
Universal quantifier | For all | |
Existential quantifier | There exists | |
Unique quantifier | There exists exactly one |
The scope of a quantifier is the part of the statement that the quantifier applies to.
Example universal
Consider . We convert to proposition / statement using quantifiers:
Notice the at the end means that for the previous quantifier, the result is true (recall = true, = false). We can also write as:
Where is the predicate, interchangable with .
Example exists and unique
Consider . The statement can be written as
Methods
Name | Law | Example |
---|---|---|
De Morgan's (universal negation) | Negation of "everyone loves math" is "someone doesn't love math" | |
De Morgan's (existential negation) | Negation of "someone loves math" is "everyone doesn't love math" | |
Distribution (universal conjunction) | "Everyone loves math and physics" is "everyone loves math and everyone loves physics" | |
Distribution (existential disjunction) | "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)
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 can open . Domain of is the set of keys, the set of doors.
Statements | Expressions |
---|---|
There exists a key that can open all doors | |
For all doors, there exists a key that opens it | |
Any key can open any door | |
At least one door can be open by a key | |
No door can be opened by any key |
We can also write the final statement as: