# Proofs

## Introduction

A **proof** is a **set of logical deductions** that can be used to show how something is true. This is powerful because proofs can often be very **general,** allowing a truth to be used in a whole bunch of cases that don't individually need to be re-proven.

There are a number of common proof techniques (although these certainly aren't exhaustive!) outlined below.

## Direct Proofs

In direct proofs, we can use the **definitions** directly to show that something is true. No trickery here, just straightforward navigation from point A to point B.

**Direct Proof Form:**

**Assume P.**Do a bunch of steps using the definitions and assumptions created by the values and operators used.

**Therefore Q.**

**Example:**

First, let's make sure this makes sense. Let's try some examples:

Next, let's write this in propositional logic:

\forall n \in D_3, (11 \mid \mbox{alt sum of digits of n}) \implies 11 \mid n

We know that

**this must be true**because each individual term is multiplied by a number divisible by 11. Therefore, the entire number must also be divisible by 11.

## Proof by Contraposition

**Contraposition Form:**

Do a bunch of steps using another type of proof.

**Example:**

For every n \in \mathbb{N}, n^2 \mbox{even} \implies n \mbox {even}

If we try proving using a direct proof, we'll have to deal with the squared term (and square roots)! This might get nasty; we'd rather deal with the nicer right side.

First, let's find the

**contrapositive of Q.**Q is "n is even", so the contrapositive is "n is odd".Then, let's find the contrapositive of P. P is "n squared is even", so the contrapositive is "n squared is odd".

## Proof by Contradiction

Contradiction is a great choice for proving things that have **infinitely many cases** (since you can just prove the opposite, which is finite!).

**Contradiction Form:**

Do some steps here.

**Example:**

Show that there are infinitely many prime numbers.

## Proof by Cases

Sometimes, we can break a statement down into smaller **cases** and prove each one individually. These cases could be something like "a is odd" and "a is even", where it is impossible for any other case to be true. If all possible cases are proven, then the entire statement is then proven.

**Example:**

## Proof by Induction

Induction is great for proving that something is true for everything in a set (often the natural numbers). If we prove the first value, then prove that the next value is true, then the value after that is *also* true, and so on.

This can be likened to the **domino effect.** If the first one's true, then it knocks down the domino for the next value. If that's true, then it knocks out the next one, and so on until every possible value is covered.

**Induction Form**

**Prove P(0).**(Base case)**Assume P(k).**(Induction Hypothesis)**Prove P(k+1).**(Induction Step)When proving the induction step, we can treat the induction hypothesis as a true statement!

**Example: The Two Color Theorem**

Here's a visually intuitive example of induction in action!

The Two Color Theorem states that for any collection of intersecting line segments, the regions that they divide can be assigned one of two colors such that a line never has the same color on both sides.

In order to prove this, let's start at the **base case**, where there is only one line:

Here, it's pretty clear that it is indeed possible to put a different color on each side of the line, in this case let's just choose blue and red.

Now, let's see what happens when we add a new line:

Looks like we have a conflict now! The blues on the top and reds on the bottom are touching. However, it's not too hard to fix this. Let's just flip the blue and red on one of the sides:

It turns out that this process: drawing a new line and flipping all of the colors on one side, works in any configuration of lines! This is because of the fact that flipping the colors on one side of a line doesn't affect whether or not those colors are alternating.

### Stronger Induction

Sometimes, an inductive proof can be rather elusive. It might be easier to **make the statement stronger** and prove that instead! (It should make sense that a stronger argument means that a weaker argument is also true.)

For example, take the statement "The sum of the first *n* odd numbers is the square of a natural number."

As we try to figure out a pattern, we might notice something:

### Proof of the Induction Principle

The **Well Ordering Principle** states that for all subsets of natural numbers, there exists a smallest number in that subset.

## More Resources

Note 2: https://www.eecs70.org/assets/pdf/notes/n2.pdf

Note 3: https://www.eecs70.org/assets/pdf/notes/n3.pdf

Lecture 2 Slides: https://www.eecs70.org/assets/pdf/lec-2-handout.pdf

Last updated