1 / 16

How to Write Proofs

How to Write Proofs. Reference: how to read and do proofs, D. Solow, ed. Wiley ISBN: 0-471-51004-1. Motivations : do we really need to write proofs in computer science? Group work : identify fields of computer science, where

enan
Download Presentation

How to Write Proofs

An Image/Link below is provided (as is) to download presentation 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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to Write Proofs • Reference: how to read and do proofs, D. Solow, ed. Wiley • ISBN: 0-471-51004-1

  2. Motivations: do we really need to write proofs in computer science? Group work: identify fields of computer science, where proofs are needed and identify fields of computer science where proofs are not needed. 5'

  3. the obvious ones... -computability theory -complexity theory -fuzzy logic - *.theory the non-obvious ones... -all the rest...somehow hidden. Justification: Rice's theorem states that all non-trivial, extensional Properties of programs are non-decidable Consequence: unnecessary code elimination is undecidable

  4. In short: as soon as there is an algorithm, there are proofs needed. -One to prove the algorithm is doing what it is supposed to do -One to test the complexity of the algorithm Because we cannot have a metaalgorithm that does it for us. It does not mean, you have to write a proof for every piece of code. But it means, you should have an understanding of how proofs work and how to read them.

  5. What is a proof? Definition: a (mathematical) proof is a convincing argument Expressed in the language of mathematics, that presents no ambiguity. The idea is to prove the truth about certain facts without any doubts If the proof is properly presented, there should not be any doubt that the facts are true (provided you can "speak" the language used) Unfortunately, many proofs are not well presented Key remark: the proofs you read in the books, and the proofs that are initially written are NEVER the same.

  6. The Axioms Of course, to prove some statements, we have to refer to facts we assume to be true. Axioms of Euclidean Geometry: 1. through one point goes a unique line, parallel to an other given line 2. through two points goes a unique line 3. every segment can be extended as a line 4. for two distinct points a, b there is a unique circle of center a going through b 5. all the right angles are equal From these axioms, we can derive for example pythagore theorem However, they have limits.

  7. Axiomatization of mathematics Hilbert: algebra and geometry Kolmogorov: probability Cantor: set theory However, even in mathematics, based on some rational axioms, we get surprising facts. Question: if I have an sequence of sets, is there an algorithm that will pick an element in each set to construct a new set which is not empty? I can add this property to set theory or not add it, and still the theory is coherent Question: is there a set with a cardinal between N and R?

  8. These undecidability properties induce (in some way) the undecidability encountered in computer science. It is crucial to understand these properties, as they give us the limits of What we can do and can't do with a computer If we can do it, good (as long as the complexity is not too high) If we can't do it, then we need to find a way to do "the best we can"

  9. Techniques for Writing Proofs Techniques does not mean algorithm to write proofs! Writing a proof is not a linear process. You do not start at A, write a sequence of lines and get to B However, we can present guidelines to write proofs...

  10. 1. The forward-backward method We start at A, want to prove B, and do it by going through A2, A3,... The sequence is not random forward: how can I show that if A then B? Backward: when is B true? Somehow, the forward-backward process is always used

  11. 2. The construction method Usually, you will use this approach when there is a "there exists" quantifier in the result you want to prove "There is an object with a certain property, such that something happens" Example: There exists a language which is not recursively enumerable How to prove this: construct one! Exercise: there exists an integer x such that x^2 - 5/2x + 3/2 = 0 Object? Property? Something happens?

  12. 3. The Choose method Usually, you will use this method when there is the for all quantifier in the statement to prove "For all objects with a certain property, something happens" Example: for all context-free languages, there exists an N, such that for all string z in the language, such that |z| => N, then, z = uvwxy etc... How to prove this? Give an automatic construction of N for a language with the context-free property Exercise: for every angle a, cos^2(a)+sin^2(a) = 1 Object? Certain property? Something happens?

  13. 4. The induction method Should be considered when there is a statement of the form: For every integer n larger or equal to some value, a statement P(n) is true Step 1: show it for the first value Step 2: Show that for any n, P(n) implies P(n+1) Example: if A is a set with n elements, then P(A) has 2^n elements

  14. 5. The contradiction method Based on the fact that A --> B is equivalent to not B --> not A Beware of quantifiers, they can mask the contradiction Example: use of the pumping lemma to show that a language is not regular or CFL. Example: show that the set of subsets of N is not countable 6. Uniqueness method You may have to show that there exists a unique object with a certain property such that something happens. Exercise: what method do you use to show the existence? What method do you use to show unicity?

  15. 7. Either/or methods If something happens either A or B. Strategy: assume something happens, and not A and show that you have B (or not B and show you have A). Example: if m and n are integers, then either 4 divides mn or 4 does not divide n 8. Max/Min methods Show that an element is the smallest or largest in a set. Requires you to rewrite the statements with quantifiers. Then use choose or construction method to prove the result.

  16. Comments on reading proofs: 1. Always read a proof with a pen and paper 2. Do not read the proof linearly, it was not written this way anyway 3. Identify the key steps in the proof, use them as milestones 4. Make sure you know all the definitions, objects, properties 5. Make sure you understand the axioms, and the result 6. if possible (definitely the best way) try to write the proof yourself!!!

More Related