# CS 2603 Homework 7 — Induction

## Due Friday, Apr 1, 2011

NOTE: This assignment is due by 5:00 pm on Friday, April 1, 2011. As I will be in and out of my office before 5:00 pm that day, please turn in your assignment by giving it to me ahead of time during my office hours or by sliding it under my office door if I am not in my office when you turn it in. Do not send assignments to me through email or leave them in my departmental mail box.

## 1. Motivation

Induction is a fundamental process of formal logic. To understand this processes, it is import to gain experience with it.

## 2. Goal

The goal of this assignment is to give you experience with proofs using induction.

## 3. Assignment

1. Consider the big or operator that we learned about in class. We could create an analogous big times operator that we will write as times using the normal multiplication operator * that you have known about since grade school and the foldr operator. This times operator should be applicable to any sequence of numeric types and should deliver the value of multiplying all of the elements of the sequence by one another to come up with their product.

1. Give the type definition of (*).
2. Give the type definition of times.
3. Write the axiom for times.
4. Formally state a theorem for times that says that if the first element of the sequence is zero, then times applied to that sequence delivers zero.
5. Prove the theorem that you have just stated.
6. Formally state a theorem for times that says that if any element of the sequence is zero, then times applied to that sequence delivers zero.
7. Prove the theorem that you have just stated.

2. Consider the running-sum operator that we learned about in class. We could create an analogous running-times operator that we will write as timesr, again using the normal multiplication operator * that you have known about since grade school but without using the foldr operator. This times operator should be applicable to any numeric product and any sequence of numeric elements and should deliver the value of multiplying all of the elements of the sequence by one another to come up with their product.

1. Give the type definition of timesr.
2. Write the axioms for timesr, ensuring that timesr is tail recursive.
3. Consider both times and timesr.

1. Formally state a theorem regarding an equivalence between them, similar to the theorem stating an equivalence between sum and sumr from the lecture.
2. Prove the theorem that you have just stated.

4. Consider the following propositions where the Universe of discourse for n is 𝓝 = {0, 1, 2, …} and the Universe of discourse for a is numbers:

Proposition M0: ∀a.((m 0 a) = 0)
Proposition M1: ∀n.∀a.((m (n+1) a) = (a + (m n a)))

Assume that the propositions above are true. Prove that Proposition M is also true.

Proposition M: ∀n.M(n)
where M(n) ≡ ∀a.((m 2*n a) = (m n 2*a))

## 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. Modified Note: Recall that you can use as rules in your proofs equations other than those on your handout sheet, provided that those equations have already been proven (in class or in your homework) and that the proof of the equation does not cite, directly or indirectly, the equation you are proving. An equation is "indirectly cited" if it is cited, directly or indirectly, in the proof an equation you are citing.

3. Modified Note: Don’t forget that a metavariable (such as ‘a’ or ‘b’ in a rule, whether from Natural Deduction, Equational Reasoning, or Induction) can stand for any WFF, not just a single variable. For example, you know that you could use {∧ER} with ∀x.f(x) ∧ ∃y.g(y) to derive ∀x.f(x) by substituting ∀x.f(x) for ‘a’ and ∃y.g(x) for ‘b’ in the rule. However, don’t forget that you could use {∧ER} with ∀x.f(x) ∧ (∃y.g(y) ∧ (¬∃z.h(z) ∧ (¬∀w.i(w) ∨ (j(x) → k(y)) ∨ l(z)) ∧ m(a))) to derive ∀x.f(x) as well, simply by substituting ∀x.f(x) for ‘a’ and ∃y.g(y) ∧ (¬∃z.h(z) ∧ (¬∀w.i(w) ∨ (j(x) → k(y)) ∨ l(z)) ∧ m(a)) for ‘b’ in the rule.

## 5. What to Turn In

You will turn in a typed or neatly written hard copy of your homework that shows all the work specified above. You will not need to submit anything electronic for this homework.