DeMorgan’s Laws for Qualifiers
Outlines:
- The intuition of De Morgan’s Laws
- De Morgan’s Laws
- Negating nested quantifiers
Intuition of De Morgan’s Laws
Example:
- S: “All the University’s computers are connected to the network”
- P: “There is at least one computer in the university operating on Linux”
Both of these are quantifiers, one being the universal quantifier and one being the existential quantifier.
Now intuitively we know that the negation of S would be that there is at least one university computer not connected to the network, and the negation of P would be that all of the computers at the university are not operating on linux.
So you can clearly see that the universal and existential quantifier lead out to being the negation of one another
Rules for De Morgan and Quantifiers
- Universal Quantifier Negation:
¬∀x, P(x) = ∃x, ¬P(x) - Existential Quantifier Negation:
¬∃x, P(x) = ∀x, ¬P(x)
So you basically inverse the quantifier to whatever the opposing one is, and then you proceed to negate the predicate that came along with it, so with the example from before, you get this:
Nested Quantifiers
In the case of nested quantifiers, De Morgan’s Laws are applied successively from the left to the right. So imagine the predicate: ∀x, ∃y, ∀z P(x, y, z)
- So negating:
¬(∀x, ∃y, ∀z P(x, y, z))would end up being:∃x, ∀y, ∃z ¬P(x, y, z)
Rules of Inference
Outlines:
- Valid Arguments
- Rules of Inference:
- Modus ponens
- Modus tollens
- Conjunction
- Simplification
- Addition
- Hypothetical syllogism
- Disjunctive syllogism
- Resolution
- Building Valid arguments
- Fallacies
Valid Arguments
Valid Argument- in propositional logic at the very least, is a sequence of propositions. The finial proposition is called the conclusion and the other propositions in the argument are called premises (or hypotheses). The argument is valid if the truth of all it’s premises implies the truth of the conclusion, so imagine kind of like a proof.
Examples
So in the above example the two premises / hypotheses are the fact that you have access to the internet and if you have access to the internet you can order a book on machine learning.
Then, the conclusion is the idea denoted by those three dots, and it states that therefore, if these two premises are true, you can order a book on machine learning.
The argument is then valid because if the two given premises are in fact true, then they imply by simple inference that the conclusion must be true as well
Now then consider this argument, the ideas stay similar and the parts are the same blah blah blah right, but this argument is logically actually not valid for the fact that the premises do not actually prove the conclusion.
While it is possible that if you have access to the internet you can order a book on machine learning, there are other ways of ordering a book on machine learning. The thing is that there are two premises that build on each other, the second one does not directly support the first like it did in the previous argument and so you cannot directly say that the argument is valid.
Rules of Inference
Rules of Inference can be seen as building blocs in constructing incrementally complex valid arguments
You can do something like use a truth table to determine whether an argument is True or False, but this can be a LOT of work, imagine an argument with 8 different variables, that is then 2^8 rows or about 256 rows total. So instead, the much better option is the rules of inference where you can have much simpler ways of proving the validity of an argument
In tandem, each rule of inference can be proved use a tautology
Modus Ponens:
- Tautology:
(p ^ (p→q)) → q
So basically, because of the fact that if P is ever false, then that means that the whole thing is true for one, and then in the case that P is true, then if the inner p -> q is only true if q is also true, and so you end up with true -> true, and then in the case that the q is false, you end up with the idea that goes back to false -> true because the and statement is false, so you end up with the tautology.
This is good because you end up with the idea of if something then something else as a premise, and then you give it that concrete value of evaluating the something, which means the something else must be true. So basically assuming if is P true then Q, and P is true, we can then say that Q is true
Modus Tollens
- Tautology:
(¬q ^ (p→q)) → ¬p
So this one is kind of like applying the idea of a contrapositive onto a given propositional function’s Modus ponens right, so instead of prove that hey, assuming if is P true then Q, and P is true, we can then say that Q is true, we sort of do the contrapositive. So you instead would say hey, assuming if P is true then Q is true, if Q is not true, then P is not true either.
Conjunction
- Tautology:
((p) ∧ (q)) → (p ∧ q)
This one is a bit silly but understandable, it is basically saying that hey, if one of these items is true, and another one of these items is true, then both item 1 and item 2 when stated together must also be true. This also makes sense from a pure math standpoint because p ∧ q will always have the same value as the two sides of the implication, so you end up with something that is always true by default
Simplification:
- Tautology:
(p ∧ q) → p
This one once again feels a little bit silly but I mean it makes sense, if you can say that you are going to do something and you will also go do something else, then you can say you are going to do either thing as your conclusion. This makes sense from a math standpoint because if p is ever false, the whole proposition is true, and then if all is true then the proposition is also true and then if p is true but q is false then you end up with 0 → 1 which is just true, so we have a tautology
You literally simplify one of the the given values based on the value
Addition
- Tautology:
p → (p ∨ q)
So basically if you have a prerequisite item out of a given two, and you say that you will only guarantee do one of those two items, then you can conclude that you will do either one item or the other, logically this makes sense because the or would evaluate to true every single time, a bit strange all things considered, and very true on a technical basis, but still, valid
Hypothetical syllogism
- Tautology:
((p→q) ∧ (q→r)) → (p→r)
So this one is basically a chain reaction of the assumption, if I know that case A would always lead to case B, and then getting to case B will always lead to a case C, then I know that if case A ends up happening, that means that I will eventually arrive at case C. This is also in fact a tautology because you have to imagine the truth table:
| p | q | r | p → q | q → r | (p → q) ∧ (q → r) | p → r | (p → q) ∧ (q → r) → p → r |
|---|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 |
| 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 |
So boom, given the truth table you can see that we end up actually proving that this is a tautology no matter the given input for either of the three conditions, logically it makes sense of cause because one implication then implies another so if one happens the other one does two so the first action leads to the last
Disjunctive Syllogism
- Tautology:
((p ∨ q) ∧ ¬p) → q
So basically you say hey, I will either do thing a or I will do thing b, but you know what, I will NOT be doing thing a. This obviously means, that if you are not a stinky dirty liar, then that means that you must do things b in order to have your original statement be true assuming your secondary statement is true.
Resolution
- Tautology:
((p ∨ q) ∧ (¬p ∨ r)) → (q ∨ r)
Once again pretty just logical in terms of making an inference. You basically say hey thing one or thing two is true. But then you also say, hey thing one is not true, or thing three is true. Well then obviously thing one cannot be both true and not true, so that means that either thing two is true or thing three is true.
Building a Valid Argument
To build a good and valid argument, there are a few things that you need to do to make sure that it is all good:
- You need to make sure that if the argument is originally written in English, you want to see if you can break it up into a simple variable form for each of the propositions in the argument
- You then start with the hypothesis of the argument, this being basically the left hand side of whatever proposition they just tried to build, so assuming this and this and then this and this
- You then build a sequence of steps and break it down and see where you can do things like simplify out each of the given propositions by applying the rules of inference or the laws of logic
- This lets you then see if your argument is a tautology and therefore is always valid
Example
Build a valid argument from the following:
- “It is not cold tonight”
- “We will go to the theater only if it is cold”
- “If we do not go to the theatre, we will watch a move at home.”
- “If we watch a movie at home, we will need to make popcorn”
First break each of the given statements into propositions:
- “It is not cold tonight” =
¬pwherep = it is cold tonight - “We will go to the theater only if it is cold”
q → pwhereq = go to the theatre - “If we do not go to the theatre, we will watch a movie at home.”
¬q → rwherer = watch a movie at home - “If we watch a movie at home, we will need to make popcorn”
r → swheres = need to make popcorn
Now logically we can obviously drawn the conclusion hey, because it is not cold, they they will not go to a movie theatre, and so they will have to watch a movie at home, and since they are watching a movie at home then they must make popcorn. Gives real hypothetical Syllogism vibes:
Identifying the hypothesis:
q→p¬p- therefore:
¬qby Modus ponens on the contrapositive of 1 and because of 2 ¬q → r- therefore,
rvia the Modus ponens of 3 and 4 - So
r → s - Therefore:
sbecause of the Modus ponens of 5 and 6
Fallacies:
Rules of Inference with quantifiers
Outline:
- Rules of inference with quantifiers:
- universal instantiation
- universal generalization
- existential generalization
- universal modus ponens
- universal modus tollens
- Expressing complex Statements
The rules of inference for a involving quantifiers either remove or reintroduce quantifiers within of a given statement
Universal Instantiation (UI)
∀x P(x) ∴ P(c)where c is a particular member of the domain.
Basically, if this rule applies to all members within a given domain, then this rule applies to a single member as long as they are within of that domain. This removes the universal quantifier from the actual expression as you can see.
Universal Generalization (UG)
P(c) for an arbitrary element of the domain ∴ ∀x P(x)
So this one is kind of like the universal instantiation but just like in reverse. So basically if you have a domain, and if you pick anyone arbitrarily, it does not matter who, from this domain, and a rule applies to them, then we can in turn say that this rule applies to all member within of this domain. This basically reintroduces the concept of every single person in the domain having this rule apply to them.
Existential Instantiation (EI)
∃x P(x) ∴ P(c) for some element of the domain
This one kind of just feels like the definition of the existential quantifier, it basically seems to say that they if we assume that there exists at least one person who does a thing in this domain, then there must exist at least one person in this domain who this element applies too, a bit silly in my eyes by whatever. It removes the existential quantifier basically.
Existential Generalization (EG)
P(c) for some element of the domain ∴ ∃x P(x)
So this one seems once again to just be pretty much the definition for the existential quantifier, it just seems that this time this just is in reverse. Basically if there exists a person with attribute a in a given domain, then there is at least one person in that given domain with attribute a. This basically just tacks on the existential quantifier on there.
Universal Modus Ponens
∀x P(x) → Q(x) and P(a) for some element of the domain, then Q(a)
This is basically just the idea of the modus ponens applied to all values through the existential quantifier. It just says that hey, if every single person in this domain is going to do a, then given this person who belongs to this domain, will also in that case do a.
Universal Modus Tollens
∀x P(x) → Q(x) and ¬Q(a) for some element of the domain ∴ ¬P(a)
So basically just the inverse right, if all the people in this given domain are all going to do something and therefore do something else, then if someone is not doing something else, then they must obviously not be doing the something.
How to Express Complex Statements
Given a statement in natural language, we can then formalize it using the following steps as appropriate:
- Determine the universe of discourse of variables, so figure out your domain
- Reformulate the statement by making “for all” and “there exists” explicit, so identify the quantifiers
- Reformulate the statement by introducing variables and defining predicates
- Reformulate the statement by introducing quantifiers and logical operations
Example:
- Express the statement:
S:“There exists a real number between any two not equal numbers”
- The Universe of discourse is the set of all real numbers
ℝ - This is basically saying that there exists at least one real number between two not equal numbers for all real numbers
- So you can say: “For all real numbers x, y, there exists a z between x and y”
- Finally you get:
∀x ∀y ∈ R, if x < y, then ∃z where x < z < y
Predicate Logic Problem Sheet:
Book Reading:
Read the following pages to consolidate your knowledge of the following topics: De Morgan’s laws; rules of inference; rules of inference with quantifiers.
- Rosen, pp.46–47 and pp.69–79.
Once you’ve finished the readings, please attempt the following exercises from Rosen (2012):
- pp.55 exercises 32, 33 and 34
- pp.79 exercises 2, 3, 12, 13 and 16
- pp.80 exercises 23, 29 and 30.
Koshy, pp.43–44.
Levin, pp.6, 202–203 and 205–209.
(This work is licensed under the Creative Commons Attribution-Share Alike 4.0 International License.)
Please also complete the following exercises from Levin (2019):
- pp.209–211, exercises 9, 12, 13, 14 and 15.
Book Notes:
Most of the notes from the first section have been taken in Fundamental’s of Computer Science: Week 2























