CS 2603 Homework 4 — Natural Deduction and Equational Reasoning

Due Tuesday, Feb 10, 2015

NOTE: This assignment is due at the start of class (9:00 am) on Tuesday. There is a late penalty of 20% per day after that time. If you are worried about potentially being late, turn in your assignments ahead of time. Do this by submitting them to me during office hours or by sliding them under my office door. Do not send assignments to me through email or leave them in my departmental mail box.

1. Motivation

Proving statements is a fundamental process of formal logic, the proof checker is an important tool for verifying these proofs, and circuit diagrams are fundamental tools of electrical engineering. To understand these tools and their relationship to one another, it is import to gain experience with them.

Likewise, equational reasoning is a fundamental process of formal logic and the proof checker is an important tool for verifying these kinds of proofs as well. To understand these tools and their relationship to one another, it is import to gain experience with them.

2. Goal

The goal of this assignment is to give you experience with proofs using natural deduction and equational reasoning, the proof checker, circuit diagrams, and their relationship to one another.

3. Assignment

  1. Natural Deduction

    1. Consider the following partial partial proof.

      Proof:    A Partially Completed Proof

      1. Fill in the missing parts the proof.
      2. Mark any discharges in the proof.
      3. State the theorem proven by this proof.
      4. Convert the proof to proof-checker notation.
    2. Prove the "Never Both" theorem using Natural Deduction.

    3. Consider the following (incorrect) "proof."

      "Proof:"    An Incorrect Proof

      1. Explain the error in the "proof."
      2. Give a correct proof for p ∨ ¬(¬q) ⊢ p ∨ q.
    4. Prove the "Conjunctive Syllogism" theorem using Natural Deduction. (That is, prove ¬(a ∧ b), a ⊢ ¬b using Natural Deduction.)

    5. Convert your proof of Conjunctive Syllogism to proof-checker notation.
    6. Prove the following statement using Natural Deduction: ¬(a ∨ b), (a ∨ c), (b ∨ d) ⊢ c ∧ d

    7. Prove the following statement (currying) using Natural Deduction and give a circuit diagram for it: (A ∧ B) → C ⊢ A → (B → C)

  2. Equational Reasoning

    1. Convert the proof of "∨ Absorption" (from the lecture) to equational proof-checker notation and check it using Hugs.

    2. Prove the "∧ Absorption" equation using equational reasoning.

    3. Convert your proof of "∧ Absorption" to equational proof-checker notation and check it using Hugs.

    4. Prove the Contrapositive equation using equational reasoning and give a circuit diagram for it.

    5. Convert your proof of the Contrapositive equation to equational proof-checker notation and check it using Hugs.

4. Important Notes on this Assignment

  1. Warnings and Cautions

    The following words of advice come directly from Prof Page who has taught this course many times. Please pay them great heed!

    Warning! For almost all people, the most effective way to work on proofs is to distribute the work over several days. Work a couple hours a day, every day, on the problems. When you’ve worked a good while on one of the problems and find yourself stuck, try another problem. Eventually, problem by problem, you will discover a key that leads to a solution. It may seem that key comes to you suddenly, but somehow the hard work invested before the epiphany gradually builds the picture in your mind until the solution pops out. If you start working on this homework assignment the day before it’s due, you probably won’t finish it. That means you will have missed one of your only real opportunities to prepare for the examinations in this course.

    Importance of Finding Your Own Keys. Each problem that you fail to invest enough time in to find the key yourself reduces, substantially, your chances of passing the exams in this course. I advise you not to discuss a problem with someone else until you have found the key. If you have questions about the material, ask the instructor or the assistant. Email should work well for this. I don’t regard discussing the problems with others as cheating, as long as can explain to me whatever you turn in, but I want you to know that the more you rely on such discussions, the less likely it is that you will succeed on the exams.

    Important Alert! Homework problems provide your only real opportunity to study for exams. Studying the night before the exam will be of almost no use at all. If you have difficulties, come to see the Instructor or Teaching Assistant during office hours.

    How Much Time Will This Homework Take? Some of the problems may take hours to complete. Others, only a few minutes. Some problems may seem difficult to you that seem easy to others, and vice versa. There is no way to predict when or how the insights you will need to solve these problems will come to you. Also, expect some frustration in the process of using the proof checker. Just as in programming, you have to get all the required characters in the right order. All the commas, parentheses, case-sensitive names, etc have to be right. It can easily take an hour to get an already correct proof pushed through the proof checker.

  2. Adding parentheses around an entire statement creates a new statement with the same truth value as the original statement. Likewise, removing parentheses from around an entire statement creates a new statement with the same truth value as the original statement. Therefore, you may add parentheses to or remove parentheses from entire statements within your proofs as you see fit. However, inserting or removing parentheses within a larger statement may change its truth value and is, therefore, not allowed within these proofs. (We will talk later about when we can insert or remove parentheses within statements.)

    For example, if you find yourself at some point in your proof with the statement "X ∧ Y ∨ Z," but you need "(X ∧ Y ∨ Z)" instead, it would be fine to add the parentheses and proceed. Similarly, if you have "(X ∧ Y ∨ Z)," but you need "X ∧ Y ∨ Z" instead, you may remove the parentheses and proceed. However, if you have "X ∧ Y ∨ Z," but you need "X ∧ (Y ∨ Z)" or "(X ∧ Y) ∨ Z" instead, you are not allowed to add the parentheses. Similarly, if you have X ∧ (Y ∨ Z)" or "(X ∧ Y) ∨ Z" but need "X ∧ Y ∨ Z" instead, you are not allowed to remove the parentheses.

  3. Recall that "¬a" is, by definition, the same as "a → False." Therefore, you may substitute one for the other (either direction) in your proofs, as long as you cite this definition.

  4. Recall that you can use theorems as rules in your proofs, provided that those theorems have already been proven (in class or in your homework) and that the proof of the theorem does not cite, directly or indirectly, the theorem you are proving. A theorem is "indirectly cited" if it is cited, directly or indirectly, in the proof a theorem you are citing.

  5. You may also use already proven theorems as rules in the proof checker. To do so, you need to tell the proof checker to use the theorem as a rule. For example "impChainRule = Use impChainThm" would tell the proof checker to use an already existing theorem named "impChainThm" as a rule and the name of the new rule would be "impChainRule." Note that the syntax of these news rules is slightly different than the syntax of rules that the proof checker already knows. Since each theorem on which a new rule is based uses a sequence to represent the premises, the corresponding rule needs to use a square brackets [] around its arguments, rather than parentheses ().

    Note the phrase "already proven" in this description. Before you tell the proof checker to use impChainThm as a rule, you are required to enter a proof of impChainThm into the proof checker and run the proof checker on this proof.

  6. To express a theorem as a circuit diagram, construct a circuit for each premise first, then treat each comma in the premises as an ∧ of the individual premises, then treat the ⊢ as an →, then verify that the output of the circuit is always 1.

    The reason this is the correct way to express a theorem as a circuit diagram is that a theorem verifies that a certain WFF is a tautology. The WFF in question is an implication formula in which the lefthand operand is the "and" of all the assumptions of the theorem, and the righthand operand is the conclusion of the theorem. For example, consider the theorem "a, a→ b, b→c, c→d ⊢ d." Since this is a theorem, the formula in the conclusion is true whenever all the formulas in the assumptions are true. That means that "((a) ∧ (a → b) ∧ (b → c) ∧ (c → d)) → d" is a tautology. If you draw the circuit diagram for this WFF, you can be sure it’s output is a 1, always, regardless of the values of its inputs.

  7. NEW NOTE: Don’t forget that a metavariable (such as ‘a’ or ‘b’ in a rule, whether from Natural Deduction or from Equational Reasoning) can stand for any WFF, not just a single variable. For example, you know that you could use ∧ER with (A ∧ B) to derive A by substituting A for ‘a’ and B for ‘b’ in the rule. However, don’t forget that you could use ∧ER with (A ∧ (B ∧ C ∧ (D ∨ (E → F) ∨ G) ∧ H)) to derive A as well, simply by substituting A for ‘a’ and (B ∧ C ∧ (D ∨ (E → F) ∨ G) ∧ H) for ‘b’ in the rule.

  8. NEW NOTE: For Natural Deduction, don’t forget the power of rules such as RAA, which allow you to make temporary assumptions (in the proper place in the proof tree).

5. What to Turn In

You will turn in a typed or neatly written hard copy of your homework that shows all the proofs above in Natural Deduction or Equational Reasoning format (as appropriate), all of the requested proofs in proof checker notation, plus all of the requested circuit diagrams. You will also need to submit an electronic copy of all of the requested proofs in proof checker notation.