A brief review of Lecture 07.
Two rules per binary connective: to eliminate and introduce it.
Intro $\wedge$ $\rule{A; B}{A \wedge B}$
Elim $\wedge$ $\rule{A\wedge B}{A,B}$
Intro $\vee$ $\rule{A}{A\vee B, B\vee A}$
Elim $\vee$ $\rule{A\vee B; \neg A}{B}$
Direct Proof Rule $\rule{A\implies B}{A\rightarrow B}$
Modus Ponens $\rule{A ; A\rightarrow B}{B}$
Excluded Middle$\rule{}{A\vee\neg A}$
Direct Proof Rule is special: not like the other rules.
Direct Proof Rule $\rule{A\implies B}{A\rightarrow B}$
The premise $A\implies B$ means “Given $A$, we can prove $B$.”
So the direct proof rule says that if we have such a proof, then we can conclude that $A\rightarrow B$ is true.
Example: prove $(p\wedge q) \rightarrow (p \vee q)$.
1.1. | $p\wedge q$ | Assumption |
1.2. | $p$ | Elim $\wedge$: 1.1 |
1.3. | $p\vee q$ | Intro $\vee$: 1.2 |
2. | $(p\wedge q) \rightarrow (p \vee q)$ | Direct Proof Rule |
Inference rules let us derive facts that are implied by the existing facts.
So, for every rule $\rule{P}{Q}$, $P \rightarrow Q$ is a tautology ($P \rightarrow Q \equiv \T$).
The proof $P\implies Q$ shows that $P \rightarrow Q$ is a tautology ($P \rightarrow Q\equiv \T$), since it just a series of implications that we know are tautologies.
So the Direct Proof Rule $\small{\rule{A\implies B}{A\rightarrow B}}$ says that we can add $A\rightarrow B$ to our set of facts, if we can show that $A\rightarrow B$ is a tautology.
One way to show that $A \rightarrow B\equiv \T$ is by writing a subproof, using all the facts we have inferred up to that point.
Prove $((p\rightarrow q)\wedge(q\rightarrow r))\rightarrow(p\rightarrow r)$.
1.1. | $(p\rightarrow q)\wedge(q\rightarrow r)$ | Assumption |
1.2. | $p\rightarrow q$ | Elim $\wedge$: 1.1 |
1.3. | $q\rightarrow r$ | Elim $\wedge$: 1.1 |
1.4.1. | $p$ | Assumption |
1.4.2. | $q$ | MP: 1.2, 1.4.1 |
1.4.3. | $r$ | MP: 1.3, 1.4.2 |
1.5. | $p\rightarrow r$ | Direct Proof Rule |
2. | $((p\rightarrow q)\wedge(q\rightarrow r))\rightarrow(p\rightarrow r)$ | Direct Proof Rule |
1.1. | $(p\rightarrow q)\wedge(q\rightarrow r)$ | Assumption |
1.2. | $p\rightarrow q$ | Elim $\wedge$: 1.1 |
1.3. | $q\rightarrow r$ | Elim $\wedge$: 1.1 |
1.4.1. | $p$ | Assumption |
1.4.2. | $q$ | MP: 1.2, 1.4.1 |
1.4.3. | $r$ | MP: 1.3, 1.4.2 |
1.5. | $p\rightarrow r$ | Direct Proof Rule |
2. | $((p\rightarrow q)\wedge(q\rightarrow r))\rightarrow(p\rightarrow r)$ | Direct Proof Rule |
{
{
1.1. | $(p\rightarrow q)\wedge(q\rightarrow r)$ | Assumption |
1.2. | $p\rightarrow q$ | Elim $\wedge$: 1.1 |
1.3. | $q\rightarrow r$ | Elim $\wedge$: 1.1 |
{
1.4.1. | $p$ | Assumption |
1.4.2. | $q$ | MP: 1.2, 1.4.1 |
1.4.3. | $r$ | MP: 1.3, 1.4.2 |
}
1.5. | $p\rightarrow r$ | Direct Proof Rule |
}
2. | $((p\rightarrow q)\wedge(q\rightarrow r))\rightarrow(p\rightarrow r)$ | Direct Proof Rule |
}
This is just like Java’s scoping rules.
Look at the rules for introducing connectives to see how you would build up the formula you want to prove from pieces of what is given.
Use the rules for eliminating connectives to break down the given formulas so that you get the pieces need for 1
Write the proof beginning with what you figured out for 2 followed by 1.
Intro $\wedge$ $\rule{A; B}{A \wedge B}$
Elim $\wedge$ $\rule{A\wedge B}{A,B}$
Intro $\vee$ $\rule{A}{A\vee B, B\vee A}$
Elim $\vee$ $\rule{A\vee B; \neg A}{B}$
Direct Proof Rule $\rule{A\implies B}{A\rightarrow B}$
Modus Ponens $\rule{A ; A\rightarrow B}{B}$
Excluded Middle$\rule{}{A\vee\neg A}$
Inference rules for quantifiers and a “hello” world example.
Elim $\forall$ $\rule{\forall x. P(x)}{P(a) \text{ for any } a}$
Intro $\forall$ $\rule{P(a); a \text{ is } \color{MediumVioletRed}{\text{arbitrary}}}{\forall x. P(x)}$
The name $a$ stands for an arbitrary value in the domain. No other name in $P$ depends on $a$.
Intro $\exists$ $\rule{P(c) \text{ for some } c}{\exists x. P(x)}$
Elim $\exists$ $\rule{\exists x. P(x)}{P(c) \text{ for a } \color{MediumVioletRed}{\text{specific }} c }$
The name $c$ is fresh and stands for a value in the domain where $P(c)$ is true. List all dependencies for $c$.
Prove $(\forall x. P(x)) \rightarrow (\exists x. P(x))$.
1.1. | $\forall x. P(x)$ | Assumption |
1.2. | $P(c)$ | Elim $\forall$: 1.1 |
1.3. | $\exists x. P(x)$ | Intro $\exists$: 1.2 |
2. | $(\forall x. P(x)) \rightarrow (\exists x. P(x))$ | Direct Proof Rule |
Elim $\forall$ $\rule{\forall x. P(x)}{P(a) \text{ for any } a}$
Intro $\forall$ $\rule{P(a); a \text{ is } \color{MediumVioletRed}{\text{arbitrary}}}{\forall x. P(x)}$
Intro $\exists$ $\rule{P(c) \text{ for some } c}{\exists x. P(x)}$
Elim $\exists$ $\rule{\exists x. P(x)}{P(c) \text{ for a } \color{MediumVioletRed}{\text{specific }} c }$
Understanding rules for quantifiers through more advanced examples.
So far, we have treated the predicate definitions as black boxes, and the domain of discourse as a set of objects with no additional properties.
In practice, we want to prove theorems for specific domains, and use the properties of those domains in our proofs.
For example, the set of integers is equipped with the operators $+,\cdot,=$.
We can use these operators in our predicates (below) and proofs (next):
Prove that there is an even number: $\exists x. \text{Even}(x)$.
1. | $\specific{2} = \specific{2}\cdot \hilite{SteelBlue}{1}$ | Arithmetic |
2. | $\exists \hilite{SteelBlue}{y}. \specific{2} = \specific{2}\cdot \hilite{SteelBlue}{y}$ | Intro $\exists$: 1 |
3. | $\text{Even}(\specific{2})$ | Definition of Even: 2 |
4. | $\exists \specific{x}. \text{Even}(\specific{x})$ | Intro $\exists$: 3 |
Elim $\forall$ $\rule{\forall x. P(x)}{P(a) \text{ for any } a}$
Intro $\forall$ $\rule{P(a); a \text{ is } \color{MediumVioletRed}{\text{arbitrary}}}{\forall x. P(x)}$
Intro $\exists$ $\rule{P(c) \text{ for some } c}{\exists x. P(x)}$
Elim $\exists$ $\rule{\exists x. P(x)}{P(c) \text{ for a } \color{MediumVioletRed}{\text{specific }} c }$
Prove that there is an even prime number: $\exists x. \text{Even}(x) \wedge \text{Prime}(x)$.
1. | $\specific{2} = \specific{2}\cdot \hilite{SteelBlue}{1}$ | Arithmetic |
2. | $\exists \hilite{SteelBlue}{y}. \specific{2} = \specific{2}\cdot \hilite{SteelBlue}{y}$ | Intro $\exists$: 1 |
3. | $\text{Even}(\specific{2})$ | Definition of Even: 2 |
4. | $\text{Prime}(\specific{2})$ | Property of integer 2 |
5. | $\text{Even}(\specific{2}) \wedge \text{Prime}(\specific{2})$ | Intro $\wedge$: 3, 4 |
6. | $\exists \specific{x}. \text{Even}(\specific{x}) \wedge \text{Prime}(\specific{x})$ | Intro $\exists$: 5 |
Elim $\forall$ $\rule{\forall x. P(x)}{P(a) \text{ for any } a}$
Intro $\forall$ $\rule{P(a); a \text{ is } \color{MediumVioletRed}{\text{arbitrary}}}{\forall x. P(x)}$
Intro $\exists$ $\rule{P(c) \text{ for some } c}{\exists x. P(x)}$
Elim $\exists$ $\rule{\exists x. P(x)}{P(c) \text{ for a } \color{MediumVioletRed}{\text{specific }} c }$
We use a black-box definition of Prime because the proof won’t need to break it down further.
Prove that $\forall y. \exists z. y = z$ follows from $\forall x. x = x$.
1. | $\forall x. x = x$ | Given |
2. | $\arbitrary{a}=\arbitrary{a}$ | Elim $\forall$: 1, $\arbitrary{a}$ is arbitrary |
3. | $\exists z. \arbitrary{a}=z$ | Intro $\exists$: 2 |
4. | $\forall y. \exists z. y=z$ | Intro $\forall$: 3 |
Elim $\forall$ $\rule{\forall x. P(x)}{P(a) \text{ for any } a}$
Intro $\forall$ $\rule{P(a); a \text{ is } \color{MediumVioletRed}{\text{arbitrary}}}{\forall x. P(x)}$
Intro $\exists$ $\rule{P(c) \text{ for some } c}{\exists x. P(x)}$
Elim $\exists$ $\rule{\exists x. P(x)}{P(c) \text{ for a } \color{MediumVioletRed}{\text{specific }} c }$
Prove that the square of every even number is even: $\forall x. \text{Even}(x) \rightarrow \text{Even}(x^2)$.
1. | Let $\arbitrary{a}$ be an arbitrary integer. |
2.1. | $\text{Even}(\arbitrary{a})$ | Assumption |
2.2. | $\exists \specific{y}. \arbitrary{a} = 2\specific{y}$ | Definition of Even: 2.1 |
2.3. | $\arbitrary{a} = 2\specific{b}$ | Elim $\exists$: 2.2, $\specific{b}$ depends on $\arbitrary{a}$ |
2.4. | $\arbitrary{a}^2 = 4\specific{b}^2 = 2(2\specific{b}^2)$ | Algebra |
2.5. | $\exists y. \arbitrary{a}^2 = 2y$ | Intro $\exists$: 2.4 |
2.6. | $\text{Even}(\arbitrary{a}^2)$ | Definition of Even: 2.5 |
3. | $\text{Even}(\arbitrary{a}) \rightarrow \text{Even}(\arbitrary{a}^2)$ | Direct Proof Rule |
4. | $\forall x. \text{Even}(x) \rightarrow \text{Even}(x^2)$ | Intro $\forall$: 1, 3 |
Elim $\forall$ $\rule{\forall x. P(x)}{P(a) \text{ for any } a}$
Intro $\forall$ $\rule{P(a); a \text{ is } \color{MediumVioletRed}{\text{arbitrary}}}{\forall x. P(x)}$
Intro $\exists$ $\rule{P(c) \text{ for some } c}{\exists x. P(x)}$
Elim $\exists$ $\rule{\exists x. P(x)}{P(c) \text{ for a } \color{MediumVioletRed}{\text{specific }} c }$
Over the integer domain: $\forall x. \exists y. y\geq x$ is True but $\exists y. \forall x. y\geq x$ is False.
1. | $\forall x. \exists y. y\geq x$ | Given |
2. | Let $\arbitrary{a}$ be an arbitrary integer. | |
3. | $\exists \specific{y}. \specific{y}\geq \arbitrary{a}$ | Elim $\forall$: 1 |
4. | $\specific{b}\geq \arbitrary{a}$ | Elim $\exists$: 3, $\specific{b}$ depends on $\arbitrary{a}$ |
5. | $\forall x. \specific{b}\geq x$ | Intro $\forall$: 2, 4 |
6. | $\exists y. \forall x. y\geq x$ | Intro $\exists$: 5 |
Example: an incorrect proof.
Can’t get rid of $\arbitrary{a}$ since another name, $\specific{b}$, in the same formula depends on it!
Elim $\forall$ $\rule{\forall x. P(x)}{P(a) \text{ for any } a}$
Intro $\forall$ $\rule{P(a); a \text{ is } \color{MediumVioletRed}{\text{arbitrary}}}{\forall x. P(x)}$
The name $a$ stands for an arbitrary value in the domain. No other name in $P$ depends on $a$.
Intro $\exists$ $\rule{P(c) \text{ for some } c}{\exists x. P(x)}$
Elim $\exists$ $\rule{\exists x. P(x)}{P(c) \text{ for a } \color{MediumVioletRed}{\text{specific }} c }$
The name $c$ is fresh and stands for a value in the domain where $P(c)$ is true. List all dependencies for $c$.