What is a Proof?

A proof is a sequence of connected logical statements that explains why a statement is true. They are needed even though a computer is able to do math a lot faster than we as people can, it cannot tell us why the things that we are doing works.

It will simply do exactly what you tell it to, and so you need to have the given proof as to why things work in the way that they do. It cannot speculate or conjecture the existence of a pattern. It cannot tell us if something is true for all numbers because it simply cannot logic it out.

You need to be able to prove that your computer algorithm works for all possible different inputs, especially if you claim that it does, here is a cool question:

  • Imagine you have 27 marbles, all but one weighing the same, using a traditional scale, and using it only 3 times, can you find the lighter marble

My approach here would be some form of a binary search, you basically weigh half the marbles against each other, and then whichever side is lighter is the one you throw out. This would essentially cut down your number of marbles in half 3 times, so you go from 27-> 13/14 -> 6/7 -> 3/4 at which point you have a decent-ish chance of figuring out what marble is the lighter one.

Ah I see, so I was being a bit silly, in general the actual answer is still pretty similar to that of what I said, I just had too much of a binary approach. You actually split the marbles into 3 groups each time, and then based on the outcome you can find the group with the lower marble. You place two groups on the scale, one on the table, if one goes up then it has the lighter marble, if it stays the same, then you know the group of marbles on the table has the lighter marble. This way you go 27->9->3->1

Direct Proof

A direct proof is one that takes advantage of already defined ideas and other proofs in order to prove something else. Using logical steps it is then used to derive whatever thing it is that you want to actually prove.

Facts about Direct Proof

  • Easy because there is no particular technique being used
  • Sometimes it can be not easy because it does not have an obvious starting point
  • You need to know your definitions
  • You can use any theorem, (e. g. axiom, logic, all of that stuff)

Examples of Direct Proof:

Theorem: if n and m are both even, then n+m is even

Proof:

  • What does even mean?
  • If an integer is even, it can be made by twice another integer
  • So n = 2k, m = 2l where l and k are both integers
  • So m+n = 2(l+k), given addition of two integers is also an integer, and having defined that 2 times any integer is an even value, we know that the addition of two even integers is equal to another even integer

Theorem: for n ∈ ℕ, n^2+n is even

Proof:

  • Two Cases, n is even, or n is odd
  • If n is even when it can be equal to 2k where k is an integer
  • So n^2+2 = (2k)^2 + 2k foiling out we get: 4k^2 + 2k or 2(2k^2) + 2k and given the fact that we know all values multiplied by 2 are even, this means that n^2 + n must also be even, at least when n is even
  • If n is odd then it can be equal to 2k+1 where k is an integer, the same logic applies
  • (2k + 1) ^ 2 + 2k+1, foiled out becomes: 4k^2 + 4k + 1 + 2k+1, then combing like terms: 4k^2 + 6k + 2, of which we can take out a two, but either way we know that any number multiple by a factor of 2 is even, and hence all values here are even, and so we know that all values here are even as well

Theorem: if a < b < 0 then a^2 > b^2

Proof:

  • Multiply the theorem by a, you end up with a^2 < ab < 0, now with the previous equation multiply it by ab < b^2 < 0, so with this you know that a^2 < ab < b^2 < 0, and so logically this would disprove the case the a^2 < b^2, BUT because we know that this is all less then zero, then these values are negative, and so you need to flip all of the signs when multiplying. So you get a^2 > ab > b^2 > 0, and so boom, it turns out that a^2 and b^2 is actually true

Pasted image 20261015133557.png

You eventually get to the point where everything is a product of 3 and some other number which means you can take out the 3 and so that means that no matter what the value of K is, it would be a multiple of 3


Proof By Contradiction / Indirect Proof

This one is similar to that of the direct proof in the idea of imagine that you want to prove that A is always true. You start with assuming that A is false of course, and then using mathematical steps and logic like the direct proof, you actually arrive at the conclusion that disproves the assumption that A is false, and therefore your proof contradicts the assumption that A is false, meaning that you have instead now proven that A is true.

Examples of Proof by contradiction

Theorem: is irrational

Proof:

  • You can assume that is rational, and then try to this prove this fact, leading to the idea that it is irrational.
  • A rational number is one that terminates or repeated it’s decimals, and can be made by dividing two integers
  • Therefore, for to be rational, it would mean that sqrt(2) = p/q for a p, q ∉ ℕ where q ≠ 0, (p, q) = 1 the last bit means that p and q are in their simplest form, and so you cannot simplify the fraction any further
  • Squaring both sides of the equation you get 2 = p^2/q^2, therefore: 2q^2 = p^2, therefore, from before hand as well, we know that p must be even.
  • Therefore, p can be written as 2k: (2k)^2 = 4k^2, this way we know that both p and q are in fact even. The fact that they are both even means they are both divisible by 2, and so p/q could have been simplified, which is contradictory to our original assumption that they were in simplest form, meaning that (p, q) = 2, and that by proof by contradiction:
  • is irrational

Theorem: There is an infinite number of prime numbers

Proof:

  • We assume there to be a finite number of prime numbers.
  • Have a given set of these prime numbers as p1, p2, p3, p4 ... pn We have to now show, that there is at least ONE prime number that is not in our given list
  • Now let N be the product of all of the given prime numbers in our list plus one
  • Do you think N is divisible by any Pi, 0 < i <= n, so in other words is the product of all primes plus one prime. Technically yes, because if it is not cleanly divisible as a product plus one, so there is always a remainder of 1, meaning it itself is it’s own prime
  • This therefore proves that N is different than any of the primes in the set of primes we had, and is greater in numeric value. The fact that this process works indefinitely is then contradictory to the assumption that there is a finite amount of prime numbers

Proof by Contrapositive:

This is similar to the idea of proof by contradiction, it is an indirect proof. This means that basically, if you can prove the contrapositive of a given proposition, then you can prove the original proposition. So assume the proposition: A → B, this is equivalent to the contrapositive of ¬B → ¬A right, and so if you can prove ¬B → ¬A you then also prove A → B

Examples for Proof by Contrapositive:

Theorem: ∀ n ∈ ℕ (n^3 + 1 is odd → n is even)

Proof:

  • For a proof by contrapositive we have A → B where A = n^3 + 1 is odd and B = n is even, so the contrapositive here is ¬B → ¬A or ∀n∈ℕ(n is odd, n^3+1 is even)
  • This is now much easier to prove because we have the definition of what an even and an odd number are. We know that an add number is 2k+1 where k is an integer. This means that we need to prove that (2k+1)^3 + 1 is even for all values of k, which can be done by foiling out this equation, and we end up with 2(4k^3 + 6k^2 + 3k + 1) the original +1 became a 2 and allowed us to factor out a 2 and showcase that n^3 + 1 is always even whenever n is odd. Thus proving by contrapositive that ∀ n ∈ ℕ (n^3 + 1 is odd → n is even)
  • ALTHOUGH IT WOULD HAVE BEEN SO MUCH EASIER TO JUST SHOW A DIRECT PROOF OF THE ORIGINAL THEOREM
    Pasted image 20261015150552.png

ANOTHER EXAMPLE:

Theorem: Suppose x, y ∈ ℕ, y^3 + yx^2 ≤ x^3 + xy^2 → y ≤ x

Proof:

  • The contrapositive proof for this would be: x, y ∈ ℕ, y > x → y^3 + yx^2 > x^3 + xy^2
  • Remember that to show a given implication is true, you have to showcase that the first portion is true, and then the second portion ends up being false. This means that we end up with needing to prove that when y > x, that the second portion ends up being false.
  • To solve this one then, assume that y - x > 0, and then multiply both sides the positive value y^2 + x^2. You then end up with (y-x)(y^2+x^2) > 0
  • Expanding this out and doing the math: y^3 + yx^2 -xy^2 - x3 > 0 so you basically just move everything from one side of the original equation to the other.
  • Then basically you move all of the negative parts of the equation to the other side, and you end up getting y^3 + yx^2 ≤ x^3 + xy^2. By doing this, you have shown that when y is greater than x, as defined by y-x > 0, you showcase this to be equal to the original theorem supposed, meaning that it holds true.

Proof by Contradiction and contrapositive - Examples

Example for Proof by Contradiction and Contrapositive:

Theorem: If 5n+2 is even, then n is even, for n

Pasted image 20261015154738.png

Pasted image 20261015154933.png

Proof:

  • Assume that the claim is false, it follows the idea of p → q so the negation of this is p ∧ ¬q So applying this logic to the theorem, we have to try and prove that 5n+2 is even and n is odd. So basically find a way to have 5n+2 be even when n = 2k+1
  • 5(2k+1) + 2 = 10k+7, we know that 2(5k) is always going to be an even number. However 2(5k) + 2(3) + 1, we know that the definition of an odd number is an even number plus one, and we also know two even numbers added are even, this means we end up with an even number plus one, making it odd. Therefore 5n+2 can never be even while n is odd, thus, by contradiction we have provided that If 5n+2 is even, then n is even, for n
  • We assumed that 5n+2 is even, and we have in fact proved that it is odd, this is an outright contradiction

Work

Now it’s time to put into practice the concepts that you have learnt so far in Week 3. Attempt the following exercises. If you get stuck, you can refer to the hints and tips on the next page.

Please note that these exercises are optional, further practice – but we strongly recommend that you engage with them in order to test your knowledge and see where you might need to do additional study.

  1. Prove that if m + n and n + p are even integers, where m, n and p are integers, then m + p is even. Use a direct proof solution.

Proof

  • We understand that two integers that are added together, that are both even, end up in an even result. This can be understand by the proof that: n+m = 2k + 2l and then n+m = 2(k+l) where K and L are both integers.
  • We can have m+n = 2a and then n+p = 2b You can then combine these two equations into m+2n+p = 2a+2b then you can move all of the values with 2 to one side of the equation: m+p = (2a+2b-2n) at which point you factor out the two and prove that m+p is even
  1. Use a direct proof to show that every odd integer is the difference of two squares.

proof:

  • We know that an odd integer is equal to 2k+1 and that the difference of two squares is x^2 - y^2 where both x and y are integers. This means that we can do: 2k+1 = x^2-y^2
  • We need to now show that there are two numbers of a^2 and b^2 that showcase that when they are subtracted they are equal to an odd integer.
  1. Show that if n is an integer and 3n + 5 is odd, then n is even using:

    1. a proof by contraposition
      • For the proof by contraposition we assume that p→q becomes ¬q → ¬p. So we understand that applying this to the problem becomes if n is odd, then 3n+5 is even
      • We understand an odd number to be 2k+1 so 3(2k+1)+5 should then be even.
      • Foiling out we get 6k+8 = 2(3k+4) we know that 3k+4 is an integer and any integer multiplied by 2 is even, therefore we can say that ¬q → ¬p is in fact true for this scenario, and therefore so it p → q via proof by contraposition
    2. a proof by contradiction.
      • A proof by contradiction would have to assume that p→q is false, and therefore p ∧ ¬q is true.
      • In the context of this example, this means that 3n+5 is odd and n is odd.
      • We undergo the same process of knowing that 2k+1 is the presentation of an odd integer, and so 3(2k+1)+5 = 2(3k+4) which is always even.
      • This contradicts our original assumption that 3n+5 is odd, and therefore means that the original statement is proven via proof by contradiction.
  2. Prove that if n is an integer and 3n + 2 is even, then n is even using:

    1. a proof by contraposition
      1. Same logic as the one above it
    2. a proof by contradiction.
      1. Same logic as the one above it.

“Proof techniques part 1.pdf” could not be found.

Book Reading:

This reading covers the subjects that you have studied in Week 3. It contains detailed explanations and a variety of examples to enable you to understand concepts such as direct proof, proof by contradiction and proof by contrapositive. We strongly recommend that you to first watch the videos and then study the essential reading.

  • Rosen, K.H. Discrete mathematics and its applications. (New York: McGraw-Hill, 2011) 7th edition, Chapter 1.7, pp.80–90.

This reading is available in the Online Library and in the ProQuest Collection. Find out how to search for the book.


Proofs

A proof is a valid argument that establishes the truth of a mathematical statement. A proof can use the hypotheses of the theorem, if any, acimoms assumed to be true, and previously proven theorems.

Formal proofs are ones where basically all steps are supplied and the rules for each step in the argument was given. This is okay and cool for simple proofs, but gets to be very tedious and long for more useful proofs. This is why most proofs for human consumption are informal proofs

Informal Proofs allow for more than one rule of inference to be used in each step. Where steps may be skipped, or axioms be assumed and not directly stated.

Informal proofs actually usually explain the reasoning and good understanding as to why a given statement is true, one that is easy for a human to learn. Whereas a computer can understand a formal proof better because it is much better at brute force than it is institutional thinking.

Not only are proofs important for proving given mathematical theorems, but they are also useful for things in other fields as well. In computer science a proof is good for making sure that a computer program is correct, making sure an operating system is secure, and reasoning in AI.


Terminology

Theorem is a statement that can be shown true. This is generally something that can be said for most propositions, but only the really important ones actually get called theorems. Less important theorems are instead then called propositions / facts / results

A given theorem is a universal quantification of a statment with one or more premises that result in a conclusion. It may be some other logical statement. You prove a theorem is true with a proof.

Proof is a valid argument that establishes the truth of a theorem. The statements inside of a proof may include axioms (or posulates) which are statements we assume to be true. This can be things like all odd numbers can be defined as 2k+1 or even something like the axioms for the real numbers.

The proof can contain these postulates, as well as the premises of the current theorem (if it has one), and previously proven theorems. Any other term used inside of the theorem must be well defined inside of the theorem itself. The proof itself has to be a typing in together of rules of inference with the stated definitions above, with the final line of the proof just usually being the conclusion of the theorem.

Let it be known that, for clarity, it is often good to recap the statement of the theorem as the final step of a proof.

Lemma (plural: lemmas or lemmata) are generally less important or even less complicated theorems that are used to prove a larger theorem. Large and complex theorems are usually best understood when broken down into a set of different smaller lemmas.

Corollary is a theorem that can be established directly from a theorem that has already been proven. So for example with something like we can also then have the corollary: as a valid theorem from manipulation of the original one.

Conjecture is a statement that is PROPOSED TO BE TRUE, usually on some basis of partial evidence or argument. However a conjecture is true if and only if it is actually proven, at which point it becomes a theorem that can be used. Conjecture is often time shown to be false, and so then it is not a theorem.


How Theorems are stated:

Generally a theorem would be true for all given numbers inside of a certain domain, such as integers or real numbers basically. It is true that a given precise statement does in fact need to include a universal quantifier, it is often omitted because of the sheer implication of it’s existence:

So:

  • “If x > y, where x and y are positive real numbers, then x^2 > y^2”
    Is really:
  • “For all positive real numbers x and y, if x > y, then x^2 > y^2”

This can then be written in math terms of course, using the given universal quantifier or excluding it if you really wish to. In general when these kinds of theorems are proved, you do so by selecting a general element from the domain specified. You then modify it to show that the element has the property in question, under which point you can then generalize this same property to all other elements in that domain.


Methods of Proving Theorems

A mathematical proof of a theorem is generally something that is very hard, or at least can be very hard. This is why it is good to have a large number of different models and understandings whenever it comes to proofing a theorem.

Whenever you choose a given proof method, you can then use it in tandem with axioms, definitions of terms, and previously proved results in order to arrive at a valid proof. YOU CAN ONLY USE THESE, otherwise your proof is wrong.

In order to prove a given theorem of the form ∀x(P(x) → Q(x)), we need to show that P(c) → Q(c) where c is an arbitrary element of the domain, and then once that has been proven, apply the universal generalization.

For this given proof you need to prove a conditional statement is true. To do so you can focus on methods that show that conditional statements are true. This can be done with things like showing that p → q is true unless p is true but q is false. So we just need to show that q is true if p is true.

The following proofs and their different types are useful for a large number of different methods and apply in several different places. Sometimes in a proof you might see the word obviously or clearly which are just words to indicate that steps have been omitted and that the reader is expected to fill them in based on content. If you omit too much however, your proof does not become intuitive, so try to have a good balance


Direct Proofs

A Direct Proof of a conditional statement p→q is constructed when the first step is the assumption that p is true; and then the subsequent inferential steps leading to the final step to show that q MUST also be true.

A direct proof shows that a conditional statement p->q is true by showing that if p is true, then q MUST ALSO BE true. This way the combination of p being true and q being false never appears, and so the promise is never broken, meaning that the statement is always true, and thus proves the theorem.

In general, within of a direct proof you start out with the assumption that p is true, and then use the different parts of a proof like an axiom, definition, or other theorem in order to show that q must also be true in that given case. Generally this is simple enough because as long as you know where to start you can generally get to the proof of q. The tricky part is only knowing where to actually start.

Examples:

Theorem: If n is an Odd integer, then n^2 is odd.

Proof work:

  • We know that for a direct proof we have to show that p→q and that whenever p is true, q MUST also be true. So for this example we apply that to the given idea that if an integer is odd, then it’s square value MUST also be odd.
  • Now that we know where we are and where we are going, we can use the definition of an odd integer: 2k+1 to showcase that n = (2k+1) then (2k+1)^2 must also be in the form of an odd integer
  • So: (2k+1)^2 = (4k^2 + 4k + 1) = n^2
  • Therefore, foiling this out we understand that 2(2k^2 + 2k) + 1 will also be an odd integer for the fact that it is an even integer as denoted by the multiplication by two, unto which you then add 1 to make it odd.
  • Therefore, by the definition of an odd integer, we can conclude that n^2 is an odd integer (it is one more than twice an integer). Consequently we have proved that if n is an odd integer, then n^2 is an odd integer.

Theorem: Given a direct proof that if m and n are both perfect squares, then (n)(m) is also a perfect square. ( An integer is a perfect square if there is an integer b such that a = b^2)

Proof work

  • Once again for a conditional theorem we have to assume that if the condition is true, then the corresponding outcome is also true. If we can prove this to be the case, then we know that for all possible outcomes that our theorem is true. We need to prove that if it is the case that n and m are both perfect squares, then their product is also a perfect square.
  • Assume that n = a^2 and m = b^2 by the definition of a perfect square.
  • if this is the case, then we can substitute these values in nm to be a^2b^2 = (aa)(bb) which when foiled out becomes (ab)(ba), so using the commutative property we understand that (ab)^2.
  • By the definition of a perfect square (a number that is gotten by taking another integer to the second power) we understand that (mn) is in fact a perfect square. Thus we have proved that if n and m are both perfect squares, that mn must also be a perfect square.

Proof by Contrapositive

Unlike a direct proof, which starts at the premise of a theorem, and then uses logical steps and reasoning to showcase the conclusion. A proof by contrapositive instead is an indirect proof that focuses on the fact that p→q ≡ ¬q → ¬p. This means that if we can prove the contrapositive, by the fact that it is equivalent to the original proposition, we can then use this to prove the theorem.

This is useful in the case that a direct proof reaches a dead-end, and you simply are not able to outright prove something with the direct proof. It might instead be much easier to showcase that if the conclusion is false, or can be assumed false, then the premise will always be false as well. Then per the definition of the contrapositive, we know that in the same case p→q must follow.

Examples

Theorem: if n is an integer, and 3n+2 is odd, then n is odd.

Proof theorem

  • We can try a direct proof, and doing so would mean that we take the premise that n is an integer and that 3n+2 is odd, and all that we really get from that is that n can be any value and that 3n+2 = 2k+1 by the definition of a odd integer. We cannot actually do anything with this though as there is no way to then prove this is makes n odd at all since it cannot be isolated.

  • Instead we can try proof by contrapositive which would mean that we can assume ¬q→¬p. Or basically in this context, if n is NOT an odd number, so it is even, then we would have to try to prove that 3n+2 is also always NOT an odd number, aka even

  • So we assume that n = 2k by the definition of an even number.

  • We can plug in the value of n into out equation, in which we get 3(2k)+2 foiling this out we then get 6k+2 = 2(3k+1) we know that 3k+1 is an integer and by the definiton of an even number (a integer multiplied by 2) we know 2(3k+1) is always even.

  • So because we have proved that 3n+2 is always even whenever n is also even. Then, via the proof of contrapositive, we have also proved that if 3n+2 is odd and n is an integer, then n is also odd

Theorem: if n=ab, where a and b are positive integers, then a <= sqrt(n) or b<sqrt(n)

Proof work:

  • This one has a little bit more teeth to it, you cannot directly show that the condition q is true if the condition p is also true, so the idea of a direct proof is out of the window. You have to attempt a proof by contrapositive.
  • For a proof by contrapositive we need to assume that ¬q → ¬p. Therefore, in this context we have to assume that a > sqrt(n) ^ b > sqrt(n) as this is the negation of an or statement following the idea of De Morgan’s law. Then we use this to showcase that if this is infact false, then n=ab is also false, so in other words: n≠ab
  • Assume that a > sqrt(n) ^ b > sqrt(n). Using this, we can then multiply these two inequalities together (using the fact that if 0 < s < t and 0 < u < v, then su < tv). With this we end up with ab > n. This inadvertantly shows that ab ≠ n because it is actually larger than it.
  • Therefore, the negation of the conclusion of the conditional statement implies that the hypothesis is false, and the original statement is then true. So, by proof of contraposition, we can say that: if n=ab, where a and b are positive integers, then a <= sqrt(n) or b<sqrt(n)

Vacuous and Trivial Proofs:
Pasted image 20261017212026.png

THERE IS MORE EXAMPLES (3-9) IN THE BOOK FOR CONTRA-POSITIVES

There should be a little note here that you should try to see if you can do something with a direct proof, then the contrapositive, and then the contradiction. The guy or gal in the book actually have several proofs that are proven directly inside of the contrapositive section.


Proof by Contradiction

ALRIGHT SO BOOM: Basically say you want to prove a statement p is true. Then, imagine if you find a contradiction such that ¬p → q is true. Because of the fact that q is false, but ¬p → q is true. We can then actually conclude that p is true.

Basically, because the outcome of what we wanted to happen, so the actual action that was supposed to come out of the promise is false. However ¬p → q is true. We know that q is true and therefore equal to zero. However for the statement above to be true, we know that ¬p needs to be equal to zero as well, which means that p is equal to one. Aka the thing we wanted to prove.

We know that logically a contradiction would be r ∧ ¬r where r is some proposition. It is something is always going to be false. Therefore, if we wanted to prove p, then we can simply show that ¬p → (r ∧ ¬r). Where basically q ≡ (r ∧ ¬r). So we basically need to showcase that if we have the negation of our proposition p, then this leads to a contradiction. This is then called proof by contradiction.

Examples:

Theorem: Show that at least four of any 22 days must fall on the same day of the week.

Proof Work:

  • Our proposition here, p is that at least four of 22 chosen days fall on the same day of the week. To use proof by contradiction, we need to showcase that ¬p then leads to a contradiction. We cannot use direct proofs or contra-positives because there is no way to directly prove if you choose 22 days then at least 4 of them always fall on the same day of the week.
  • So lets assume that ¬p aka at most three of the 22 days chosen fall on the same day of the week.
  • We know that there are 7 days of the week. Because there are 7 days of the week, this implies that at most 21 unique days could have been chosen with only repeating at most 3 days. This outright contradicts the premise that we could have chosen 22 days with repeating a given day at most 3 times. That is, if r is the statement that 22 days are chosen, then we have shown that ¬p → (r ∧ ¬r). Consequently, we know that p is therefore true. So we have proven that at least four of the 22 chosen days fall on the same day of the week.

Theorem: Prove that sqrt(2) is irrational by giving a proof of contradiction.

  • We understand that we are asked to prove the statement p which is that the square root of 2 is an irrational number. To undergo this using the proof of contradiction, we have to assume that ¬p so we assume sqrt(2) to be a rational number. We then have to showcase that ¬p → (r ∧ ¬r)
  • Assume sqrt(2) is a rational number. The definition of a rational number is a number that can be represented by a/b where b ≠ 0 AND a and b have no common factors.
  • So we assume that sqrt(2) = a/b. This can then be transformed into 2 = a^2 / b^2 and then 2b^2 = a^2
  • Now that we have this, we know that by the definition of an even integer that a^2 is an even integer. We also then use the fact that if a^2 is even, then a must also be even as proven in the direct proof proofs. This means that we can represent a as some integer c multiplied by 2. So a = 2c
  • Plugging in for a we get that 2b^2 = 4c^2. Now we can simplify and divide both sides by 2 to get b^2 = 2c^2. By the definition of even, this means that b^2 is even. This is the same process that we used for a.
  • This means that our original assumption that a and b have no common factors is contradicted by the fact that the two are even numbers and therefore are divisible by 2.
  • So, by the logical showcase that a and b would need to not have common factors in order for the square root of 2 to be rational, we have proved that ¬p → (r ∧ ¬r). Proving by contradiction that our statement p of sqrt(2) is a rational number is in fact true.

Pasted image 20261017215640.pngPasted image 20261017215748.pngPasted image 20261017215827.png