CS2013 Mathematics for Computing Science Adam Wyner University of Aberdeen Computing Science

1 / 30

# CS2013 Mathematics for Computing Science Adam Wyner University of Aberdeen Computing Science - PowerPoint PPT Presentation

CS2013 Mathematics for Computing Science Adam Wyner University of Aberdeen Computing Science. Slides adapted from Michael P. Frank ' s course based on the text Discrete Mathematics & Its Applications (5 th Edition) by Kenneth H. Rosen. Proof – Natural Deduction. Topics.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'CS2013 Mathematics for Computing Science Adam Wyner University of Aberdeen Computing Science' - anakin

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### CS2013Mathematics for Computing ScienceAdam WynerUniversity of AberdeenComputing Science

Michael P. Frank's course based on the textDiscrete Mathematics & Its Applications(5th Edition)by Kenneth H. Rosen

### Proof – Natural Deduction

Topics
• What is proofand why?
• How with rules and examples
• Proof strategies – direct, contrapositive, and contradiction.

Frank / van Deemter / Wyner

Nature of Proofs
• In mathematics and logic, a proof is:
• An argument (sequence of statements) that rigorously (systematically, formally) establishes the truth of a statement given premises and rules.

Frank / van Deemter / Wyner

Importance of Proofs
• Given a specification of some domain (facts and rule)
• What can be inferred?
• Are there undesirable inferences?
• Do we have all the consequences?

Frank / van Deemter / Wyner

Symbolic Reasoning
• Start with some logical formulas that you want to use in your proof (premises and rules)
• Identify what you want to prove (a conclusion)
• Use reasoning templates and equivalences to transform formulas from your start formulas till you get what you want to prove.
• Skill in knowing the templates and equivalences.

Frank / van Deemter / Wyner

Proofs in Programming
• Applies in program verification, computer security, automated reasoning systems, parsing, etc.
• Allows us to be confident about the correctness of a specification.
• Discovers flaws (e.g., a reason why the program is not correct or not accurate).
• Not doing proofs of programming (yet).
• Oracle Policy Modelling proves determinations from input information.

Frank / van Deemter / Wyner

Deductive Calculi
• There exist various precise calculi for proving theorems in logic. For example
• Natural Deduction
• Axiomatic approaches
• Semantic tableaus ("proof in trees")
• Look at Natural Deduction, which is characterised by the use of inference rules.
• Look at Axiomatic proof, which is characterised by the use of axioms to substitute expressions.

Frank / van Deemter / Wyner

Proof Terminology
• Premises
• statements that are often unproven and assumed.
• Conclusion
• a statement that follows from premises and an inference rule
• Rules of inference
• Patterns of reasoning from premises to conclusions.
• Theorem
• A statement that has been proven to be true.

Frank / van Deemter / Wyner

More Proof Terminology
• Lemma
• a minor theorem used as a stepping-stone to proving a major theorem.
• Corollary
• a minor theorem proved as an easy consequence of a major theorem.
• Conjecture
• a statement whose truth value has not been proven, but may be believed to be true.

Frank / van Deemter / Wyner

Inference Rules - General Form
• An Inference Rule is
• A reasoning pattern (template) such that if we know (accept, agree, believe) that a set of premises are all true, then we deduce (infer) that a certain conclusion statement must also be true.
• premise 1 premise 2 …

 conclusion “” means “therefore”

Different forms, names, etc to present this....

Frank / van Deemter / Wyner

Inference Rules 1
• Double negative elimination (DNE)
• From ¬ ¬ φ, we infer φ
• From "It is not the case that Bill is not happy", we infer "Bill is happy".
• Conjunction introduction (CI)
• From φand ψ, we infer ( φ∧ψ ).
• From "Bill is happy" and "Jill is happy", we infer "Bill is happy and Jill is happy".

order of conjunction and disjunction does not matter.

Frank / van Deemter / Wyner

Inference Rules 2
• Conjunction elimination (CE)
• From ( φ∧ψ ), we infer φ and ψ
• From "Bill is happy and Jill is happy", we infer "Bill is happy" (and also "Jill is happy").
• Disjunction introduction (DI)
• From φ, we infer (φ∨ψ).
• From "Bill is happy", we infer "Bill is happy or Jill is happy".

Frank / van Deemter / Wyner

Inference Rules 3
• Disjunction elimination (DE)
• From ¬ φ and (φ∨ψ), we infer ψ
• From "Bill is not happy" and "Bill is happy or Jill is happy", we infer "Jill is happy".
• Implication elimination (Modus ponens – MP)
• From φ and ( φψ ), we infer ψ.
• From "Bill is happy" and "If Bill is happy, then Jill is happy", we infer "Jill is happy".

Frank / van Deemter / Wyner

Inference Rules 4
• Implication elimination (Modus tollens- MT)
• From ¬ ψ and ( φψ ), we infer ¬ φ.
• From "Bill is not happy" and "If Bill is happy, then Jill is happy", we infer "Jill is not happy".
• Hypothetical syllogism (HS)
• ( φψ ) and (ψ β ), we infer (φ β )
• From "If Bill is happy, then Jill is happy" and "If Jill is happy, then Mary is happy", we infer "If Bill is happy, then Mary is happy".

Frank / van Deemter / Wyner

Inference Rules - Tautologies
• Each valid logical inference rule corresponds to an implication that is a tautology.
• From premise 1, premise 2 …, it follows conclusion
• Corresponding tautology:

((premise 1)  (premise 2)  …) conclusion

• Demonstrate with a T-table.

Frank / van Deemter / Wyner

Modus Ponens T-table

Proof that the reasoning template is a tautology.

Other reasoning templates can be demonstrated similarly.

Frank / van Deemter / Wyner

Validity and truth
• We say that a proof method is valid if it can never lead from true premises to a false conclusion.
• You see a valid proof, one of whose premises is false.  Conclusion may be true of false.
• You see an invalid proof.  Conclusion may be true of false.
• You see a valid proof, whose premises are true  Conclusion must be true

Frank / van Deemter / Wyner

Fallacies
• Afallacy is an inference rule or other proof method that may yield a false conclusion.
• Fallacy of affirming the conclusion:
• “pq is true, and q is true, so p must be true.” (No, because FT is true.)
• Fallacy of denying the hypothesis:
• “pq is true, and p is false, so q must be false.” (No, again because FT is true.)

Frank / van Deemter / Wyner

"Invalid" Reasoning Patterns
• Argumentation templates used in everyday reasoning:
• Bill is in a position to know whether or not Jill is happy.
• Bill asserts "Jill is happy".
• Therefore, Jill is happy.
• Problem is that being in a position to know something and asserting it is so does not make it so. Bill might be mistaken.

Frank / van Deemter / Wyner

Completeness of inference rules
• See handout for a complete set of rules that can prove all theorems.
• However, there may be different systems that are not complete. There are issues similar to the expressivity of the logical connectives and quantifiers.

Frank / van Deemter / Wyner

Formal Proofs
• A formal proof of a conclusion C, given premises p1, p2,…,pnconsists of a finite sequence of steps, each of which is either a premise or applies some inference rule to premises or previously-proven statements to yield a new statement (the conclusion).

Frank / van Deemter / Wyner

Method of Proof
• Write down premises.
• Write down what is to be shown.
• Use a proof strategy.
• Apply natural deduction rules.
• Write down the result of applying the rule to the premise(s). Make a note of what rule is applied and what premises are used.
• Reapply 2-5 until have shown the result.
• Record result on line 2.

Frank / van Deemter / Wyner

Super Simple Example

Problem: Prove that p implies p ∨ q

• p Premise.
• Show: p ∨ qDirect derivation, 3
• p ∨ q Disjunction introduction, 1

Frank / van Deemter / Wyner

Pretty Simple Example

Problem: Prove that p and (p ∨q)  s imply s

• p Premise
• (p ∨ q)  s Premise
• Show: s Direct derivation, 5
• p ∨ q Disjunction introduction, 1
• s Implication elimination, 2 and 3

Have to think ahead. Tricky with long chains of reasoning.

Frank / van Deemter / Wyner

Longer Example

1. (p ∧ q)  r Premise

2. Show: (p (q  r)) CD 3,4

3. p Assumption

4. Show: q  r CD 4,5

• q Assumption

6. Show: r ID 10

7. ¬ r Assumption

8 (p ∧ q) CI 3,5

9. r MP 1,8

10. ¬ r ∧ r ContraI 7,9

Frank / van Deemter / Wyner

A Direct Proof

1. ((A ∨ ¬ B) ∨ C)(D (E F))

2. (A ∨ ¬ B)((F G)H)

3. A  ((EF)(FG))

4. A

5. Show: D  H

6. A ∨ ¬ B

7. (A ∨ ¬ B) ∨ C

8. (D  (E F))

9. (E F) (F G)

10. D (F G)

11. (F G) H

12. DH

Frank / van Deemter / Wyner

A Conditional Proof

1. (A ∨ B)(C ∧ D)

2. (D ∨ E)F

3. Show: A  F

4. A

5. Show: F

6. A ∨ B

7. C ∧ D

8. D

9. (D ∨ E)

10. F

Frank / van Deemter / Wyner

An Indirect Proof

1. A (B ∧ C)

2. (B ∨ D)E

3. (D ∨ A)

3. Show: E

4. ¬ E

5. ¬ (B ∨ D)

6. ¬ B ∧¬ D

7. ¬ D

8. A

9. B ∧C

10. B

11. ¬ B

12. B ∧¬ B

Frank / van Deemter / Wyner

Next
• Proofs using logical equivalences
• Quantifier proof rules
• Other proof strategies
• contrapositive
• cases

Frank / van Deemter / Wyner