Title: Formal Methods in Computer Science CS1502 Proofs with Boolean Connectives
1Formal Methods in Computer ScienceCS1502Proofs
with Boolean Connectives
- Patchrawat Uthaisombut
- University of Pittsburgh
2Goals
- To learn 4 simple proof rules
- /\ Elim, /\ Intro, \/ Intro, Reit
- To learn about subproof.
- To learn the method of proof by cases
- \/ Elim
- To gain skills in constructing proofs using proof
by cases as well as simple proof rules.
3Rules learned so far
Line 1 says ab. In line 3, we replace the first
a in line 2 with a b.
If ab, anything that is true with a is also true
with b. We can replace a with b (but not vice
versa).
4Motivation
- Why do we need proofs? Truth table method
already works fine. - If there are many atomic sentences, a large truth
table is needed. - Truth table method does not work when we
introduce quantifiers ?, ?. Methods of proof can
be extended to accommodate this.
5Simple Rules (Cut-and-Paste Rules)
- /\ Elim /\ Intro \/ Intro
- P1 /\ P2 /\ P3 P1 Pi
- P2
- P3
- P1 P1 /\ P2 /\ P3 P1 \/ P2 \/ P3
(or P2 or P3)
6Reit(eration)
7Simple Rules (Cut-and-Paste Rules)
- /\ Elim
- Select the conjunct that you want
- /\ Intro
- Combine multiple sentences into one
- \/ Intro
- Add extra stuff to a sentence
8Example Cut and Paste Rules
9Exercise Cut and Paste Rules
- (A \/ B) /\ C (A \/ B) /\ C
- A /\ D A /\ D
- C /\ A B /\ D
- Is each of the arguments valid?
- Give a proof or a counterexample.
10Goals
- To learn 4 simple proof rules
- /\ Elim, /\ Intro, \/ Intro, Reit
- To learn about subproof.
- To learn the method of proof by cases
- \/ Elim
- To gain skills in constructing proofs using proof
by cases as well as simple proof rules.
11Example Proof by cases
- (Cube(a) /\ Small(a)) \/ (Cube(a) /\ Large(a))
- Cube(a)
- It is given that (Cube(a) /\ Small(a)) \/
(Cube(a) /\ Large(a)). - Well break it into 2 cases.
- First, assume that (Cube(a) /\ Small(a)) holds.
- Then it implies that Cube(a) holds.
- In the second case, we assume that Cube(a) /\
Large(a) holds. - Thus, it follows that Cube(a).
- In either case, we have Cube(a), as desired.
12Subproofs
- A subproof is a proof that occurs within the
context of a larger proof. - The assumption of a subproof can be used only in
the subproof. It cannot be used outside the
scope of the subproof. - This is similar to a local variable in a
subroutine.
13\/ Elim (Proof by cases)
P1 or P2 is true
S follows from P1
S follows from P2
Since P1 or P2 is true, then S is true.
PAUSE
14Example \/ Elim (Proof by cases)
- 1. (A /\ B) \/ (C /\ A)
- 2. A /\ B
- 3. A /\ Elim 2
- 4. C /\ A
- 5. A /\ Elim 4
- 6. A \/ Elim 1, 2-3, 4-5
15Example \/ Elim with \/ Intro
- 1. (A /\ B) \/ (C /\ D)
- 2. A /\ B
- 3. B /\ Elim 2
- 4. B \/ D \/ Intro 3
- 5. C /\ D
- 6. D /\ Elim 5
- 7. B \/ D \/ Intro 6
- 8. B \/ D \/ Elim 1, 2-4, 5-7
- Use \/ Intro to put conclusion in the right form
16Example \/ Elim with Reit
- 1. (A /\ B) \/ A
- 2. A /\ B
- 3. A /\ Elim 2
- 4. A
- 5. A Reit 4
- 6. A \/ Elim 1, 2-3, 4-5
- What if the conclusion is A \/ B?
17Exercises \/ Elim
- (A /\ B) \/ C
- A \/ B \/ C
- (A /\ B) \/ (B /\ C) \/ (C /\ A)
- B \/ C
18Exercise
- What can be concluded from this premise?
- What cannot?
- Prove or give counterexample.
- (A /\ (B \/ C)) \/ (C /\ (A \/ B))
- ???
19Exercise (more detail)
- Which of these are consequences of(A /\ (B \/
C)) \/ (C /\ (A \/ B))? - Prove or find a counterexample
- A
- B
- C
- A \/ B
- A \/ C
- B \/ C
- A \/ B \/ C
- At least 2 of the 3 variables are true.
- How do you express this in logic?