Proof Basics
1Introduction
The common perception of mathematics is that it is about calculation. In reality, however, it is about understanding generally valid statements. To be certain that these are indeed valid statements, and not just some measurement error
, we precisely justify, or prove, these statements. It should therefore come as no surprise to us that proofs are an integral part of the Mathematical Olympiad, as well as university courses. In this material, we will provide a basic overview of what proofs look like in mathematics. We will illustrate them with several examples. The illustrative examples will mainly concern numbers, where the principles are best illustrated. However, the described theory can of course be applied in other areas – we will encounter proofs in all materials.
2Basic Types of Proofs
In general, we distinguish two basic types of proofs: direct proof and proof by contradiction. In short:
- Direct proof: We derive the statement to be proved from valid statements.
- Proof by contradiction: We assume that the statement to be proved does not hold and try to derive a mathematically invalid statement, to reach a contradiction.
We can imagine this as follows: Let's say that all the statements we start from are in a large pot of soup. The process of proving consists of combining statements from the soup and adding new ones from them – for example, if we have in the soup, we can add to the soup, thanks to which we can add to the soup, etc. We then view our two types of proofs as follows:
- A direct proof works by gradually adding new and new statements to the soup until we add the one we aim to prove.
- On the other hand, in a proof by contradiction, we add the negation of the statement to be proved to the soup and proceed as if we were proving directly. We add new statements until the soup curdles and we get some nonsense, such as , or the opposite of one of the assumptions.
In the following two sections, we will show specific interesting examples of proofs. But first, two notes:
- A very important technique is proof by mathematical induction. Strictly speaking, this is not so much a type of proof as it is a recipe for adding new valid statements to the soup.
- In school, a distinction is usually made between two types of
indirect proofs
: indirect proof by contradiction and proof by contrapositive. We will explain that the latter is actually a special case of proof by contradiction.
2.1Direct Proof
Direct proofs are quite natural – we combine assumptions from the problem statement with existing knowledge until we reach the statement to be proved. Every proof can therefore be written as a series of chains of implications:
Example 1
Prove that the squares of odd numbers leave a remainder of 1 when divided by 8.
✓Solution
First, let's take this complete written proof:
Odd numbers can be written in the form for an integer . We are proving that leaves a remainder of 1 when divided by 8. One of the numbers , is even, so is an even number, so is divisible by 8, so leaves a remainder of 1 when divided by 8, which was to be proved.
Before we go further, let's realize the structure of that proof. It consists of these statements:
- : is an odd integer
- : for some integer
- : is an integer, thus is even or is even
- : is even
- : is divisible by 8
- : leaves a remainder of 1 when divided by 8
- : leaves a remainder of 1 when divided by 8
- : leaves a remainder of 1 when divided by 8
The proof consists of the transitions and . By combining and we get .
A verbal description is obviously more practical than a bulleted one. Its problem may be that more complicated problems can get lost in it: Poorly written solutions often fail because the implications are not clear from the text. Practical advice: for every statement, ask yourself the question: is it clear what the assumptions are and how something was derived from them? With such self-checking, one often realizes that their solution has a mistake.
Exercise 1
Prove that for prime numbers , it holds that is a number divisible by 24.
✓Solution
We decompose the expression into the product . Since is a prime number greater than 3, it is not divisible by 3, so it gives a remainder of 1 or 2. In the first case, 3 divides the factor , in the second . At the same time, is odd, so and are two consecutive even numbers. One of them is therefore divisible by 2 and the other even by 4, so their product is divisible by 8. Since the number is divisible by both 3 and 8, and these numbers are coprime, it is also divisible by 24.
As an interesting aside, let us present another solution that uses the result from the previous example: squares of odd numbers leave a remainder of 1 when divided by 8. Thanks to this, we actually have that is divisible by 8 – it remains to justify that is divisible by 3. Since is not 3, has the form either or for some , in short . Then
which is clearly divisible by three.
In harder problems, it may not be immediately obvious how to use the assumptions from the problem statement and it is necessary to analyze the situation.
Example 2
Prove that if a natural number is the square of an integer, then it has an odd number of divisors.
✓Solution
How to use the fact that is the square of an integer? We can write , which was the first step in the previous illustrative example – but that won't help us for long. The key is to think about divisors, after all, we are proving something about them. The basic idea is:
Divisors of a natural number typically
come in pairs, is a divisor of if and only if is a divisor of . If it never happened that these are the same divisors, then the number of divisors of is even.
But when does it happen that this pairing pairs a divisor with itself? Exactly when , i.e., when . And that is exactly our assumption! Consequently, all divisors except the divisor will pair up with someone, so in total we will have an odd number of divisors, which was to be proved.
Note. This example actually holds as an equivalence. In fact, it would be easier if the reverse implication were given, because the fact that it is a square is used only at the end of the reasoning chain. In competition problems, however, it is common for authors to try to mask these key steps.
The previous example can also be solved using the generally useful formula for the number of divisors:
Theorem 1
Let , where are distinct prime numbers and are integers. Then the number has exactly
divisors.
Proof
Consider an arbitrary divisor of . Since divides and the prime factorization of contains only the primes , the factorization of must also contain only these primes. We can therefore write . For each , we must have (the upper bound follows from the fact that , as a divisor of , cannot contain a higher power of than does). Every divisor can thus be uniquely represented as a -tuple satisfying . The number of divisors is therefore equal to the number of such -tuples.
To determine the number of -tuples, we use the combinatorial rule of product. The choices of the individual exponents are independent of one another – the value of does not restrict the values of the other exponents in any way. For the exponent , we have options, namely all integers from to . By the rule of product, the total number of -tuples is
Exercise 2
Prove the previous example, i.e., the theorem about the oddness of the number of divisors of perfect squares, using the theorem on the number of divisors. Also prove the reverse implication of this theorem.
✓Solution
Let . Since is the square of an integer, all exponents must be even. According to the theorem, the number of divisors is equal to the product . Since each is even, each parenthesis represents an odd number. The product of odd numbers is always odd, thus the number of divisors is odd.
Problem 1
Given a composite number . Prove that it is divisible by a prime number not exceeding .
1Hint
The number is composite, let's write it as , where .
2Hint
The idea is to say that the smaller of the numbers , i.e., , is divisible by a sufficiently small prime. To do this, it suffices to say that it is sufficiently small in itself (in the tightest case, it is a prime itself).
✓Solution
Since is composite, we can write it as , where . Multiplying the inequality by the number , we get , from which . The number has at least one prime divisor . Clearly . Since divides and divides , then divides , which we wanted to prove.
Problem 2*
A natural number has exactly divisors. Prove that the product of the divisors of is equal to .
1Hint
Use the trick with the paired divisor again.
2Hint
Distinguish the cases where is and is not a square.
✓Solution
In the solution, we will consider the pairing of divisors: is a divisor of if and only if is a divisor of . The product of such divisors is .
Let's analyze two cases:
- If is not a square, then for every divisor holds (otherwise ). All divisors thus form exactly such pairs. The total product is .
- If is a square, then forms a pair with itself. The remaining divisors form pairs with product . The total product is therefore
To conclude this section, one important note. When writing proofs, a common imprecision is omitting assumptions, for example someone may write , so necessarily
. This can be a valid part of a solution, provided the problem statement tells us that is positive. However, if we do not include this assumption in the solution, it sounds suspicious because it is unclear whether the solver was aware of it, and therefore may lead to a loss of points. Correctly, we would write something like and is positive, so necessarily
. Let us illustrate a very common situation where this occurs:
Example 3
When does and hold for integers ?
✓Solution
The intuitive answer is that necessarily . In solutions, we sometimes indeed see the reasoning that and , so . This is indeed true if we know that the numbers are non-negative. Let us analyze the situation in detail:
The relation gives that there exists an integer such that . Similarly, means that there exists an integer such that . Multiplying these equalities, we have .
If , i.e., if for example , then the relation gives . Then both relations mean , which is fine† and holds.
If , then gives . The number can be written as a product of integers in exactly two ways: and . This gives us two solutions and , which correspond to and . If, however, are non-negative, then either one is zero, which was resolved above, or both are positive, which cannot happen when – so in that case we would indeed have .
The conclusion is that and if and only if or , and for non-negative numbers even directly .
2.2Proof by Contradiction
This type of proof is particularly useful in cases where what is being proved is hard to grasp
and it is far simpler to say something about its negation. A very common example where this is illustrated:
Example 4
Prove that the number is irrational.
✓Solution
We proceed by contradiction. Assume that is a rational number, i.e., it can be written as a fraction in simplest form (numbers are coprime). After squaring and multiplying by the denominator, we get .
The right side is divisible by two, so and subsequently must also be even, i.e., . By substituting, we have , which simplifies to . Now we see that must also be even. The numbers and are thus both divisible by two, which is a contradiction with the assumption that they are coprime.
Exercise 3
This proof would not pass if we had . Where would it fail?
✓Solution
It would fail in the step where we try to show that is also divisible. We would have the equation , from which it follows that is even, i.e., . However, by substituting, we get , which after canceling simplifies to . From this equality, it does not follow that is even (nor divisible by 4). Thus, we do not get a contradiction with the coprimality of .
Exercise 4
Prove the generalization of the statement about the irrationality of : Let be a natural number. The number is irrational if and only if there exists a prime number which appears in the prime factorization of with an odd power.
✓Solution
We proceed by contradiction. Let for coprime . We rearrange the equation to . In the prime factorization of a square ( and ), every prime number has an even exponent. On the left side, the exponent of any prime number is the sum of its exponent in and in . For equality to hold, this sum must be even, which means that the exponent of every prime number in must be even. Thus, if contains a prime number with an odd power, we get a contradiction. Conversely, if all exponents are even, is a square and is a rational number.
Problem 3
Prove that the sum of a rational and an irrational number is an irrational number.
1Hint
We proceed by contradiction. What if for rational and irrational it holds that ?
✓Solution
We proceed by contradiction. Let be rational and be an irrational number. Assume that their sum is rational. Then we can express . Since the difference of two rational numbers is always a rational number, must also be rational. However, this is a contradiction with the assumption that is irrational.
Problem 4
Prove that the number is irrational.
1Hint
We proceed by contradiction. Let . We need to get rid of the roots.
2Hint
The key to getting rid of the roots is squaring. By squaring the equality from the previous hint, we will have one root instead of two.
✓Solution
We proceed by contradiction. Let be a rational number. By squaring the equality, we get , from which we express . Since is rational, the right side is also rational. This would mean that is a rational number, which is a contradiction (the proof is analogous to that for ).
Note. A typically erroneous proof might consist of the argument that the sum of two irrational numbers is always irrational. Convince yourself, however, that this is not true.
The following examples show that proof by contradiction is technically
used even when we are proving that something does not hold.
Problem 5
Prove that the sum of three squares of odd integers is never a square of an integer.
1Hint
The key is to look at divisibility by eight.
2Hint
Recall the statement proved in the section on direct proof, that the squares of odd numbers leave a remainder of 1 when divided by 8.
✓Solution
According to the previously proven statement, the square of an odd number leaves a remainder of 1 when divided by 8. The sum of three such numbers therefore leaves a remainder of 3. But then it cannot be a square, since that would have to be odd and, again according to our statement, leave a remainder of 1.
Problem 6
73-CSMO-B-II-1Patrik chose two distinct positive integers , , wrote each on 10 cards and placed all 20 cards around the circumference of a circle. He noticed that each number is now a divisor of the sum of the two numbers on the adjacent cards. Prove that the numbers on the cards alternate.
1Hint
We are proving that something cannot happen – what would it mean if it potentially could, i.e., if the numbers did not alternate? What is actually the negation of this statement?
2Hint
If the numbers did not alternate, then some two identical numbers are next to each other, e.g. . If we now walk along the circle in some direction, e.g. to the right, we must eventually reach , so we have . What do we get from this?
3Hint
The triple gives us , so . It would be great to find something similar somewhere else.
4Hint
To obtain , we need to find a triple . Why must there also be on the circle? Think about the number of alternating groups: if you merge two 's into one group, you reduce the number of available groups for . Where must all the 's fit then?
5Hint
If from the triple we find that , and from the triple we find that , what conclusion follows for two positive integers ?
✓Solution
We prove the claim by contradiction. Suppose that the numbers , are not placed in alternating fashion. This clearly means that there are two adjacent 's and simultaneously two adjacent 's somewhere on the circle†. Pick two adjacent 's. If we start from this pair and travel around the circle in one direction, we will encounter a (otherwise the circle would contain only 's). Once this happens, we will have an adjacent triple . According to the problem statement, holds, from which . By an analogous argument, we find a triple , from which we get . For positive integers , we thus have and , and therefore , which contradicts the fact that , are distinct. This completes the solution.
Note 1. Without loss of generality, we could have assumed from the start of the proof by contradiction that, say, . Then we would only need the argument about the triple leading to the contradictory conclusion .
Note 2. Let us additionally show that for numbers , satisfying the problem statement, either or must hold. By symmetry, it suffices to prove in the case . With alternating placement, from the triple we have , so for a suitable positive integer . From the assumption , however, follows, from which , i.e., , and therefore , as we wanted to prove.
Finally, we will show perhaps the most famous proof of this widely known fact, which Euclid† was already able to prove.
Theorem 2
Prove that there are infinitely many prime numbers.
Proof
We proceed by contradiction. Assume that there are finitely many prime numbers . Consider the number . This number is greater than 1, so it must have at least one prime divisor . This divisor must be one of our prime numbers . At the same time, however, leaves a remainder of 1 when divided by any , so no divides it. This is a contradiction, so there must be infinitely many prime numbers.
Try to solve the next two problems in a similar way:
Problem 7*
Prove that there are infinitely many prime numbers that divide for a suitable natural .
1Hint
We go by contradiction. If there were finitely many of them, denote them . Try to construct a suitable expression.
2Hint
Think about the expression .
✓Solution
Assume that there are finitely many such prime numbers, denote them . Consider the number
This number is greater than 1, therefore it has some prime divisor . Since divides , it divides a number of the form , so must belong to our list . But this means that divides the product , and thus also divides its square. From this, it follows that divides the difference , which is a contradiction.
Problem 8**
Prove that there are infinitely many prime numbers of the form , where is a natural number.
1Hint
We proceed as in the previous cases, we label the primes, we construct a suitable expression. However, one must pay attention to the special prime number 2 (which is also of our form).
2Hint
Think about the expression , where are odd prime numbers of the form .
3Hint
The key is to find some other prime number of the form in the prime factorization of our expression. Could there be none in this factorization, and what would that mean?
✓Solution
Assume that there are finitely many prime numbers of the form . Let denote all odd prime numbers of this form (we omit the number 2). Consider the number
Since are odd, is the sum of an odd number and the number 2, so is odd and is not divisible by 2. At the same time, leaves a remainder of 2 when divided by three. Therefore, must have at least one prime divisor of the form (if all divisors were of the form , would also have this form). Since is odd, . At the same time, cannot be any of the , because otherwise it would divide as well as , and thus also their difference 2. We have thus found a new prime number of the form , which is a contradiction.
At the end of the section, let's return to the promised explanation of the proof by contrapositive. In general, this is a proof of the implication , which is equivalent to the implication , for example, the implication if does not divide , then does not divide either
is equivalent to the implication if divides , then divides
. We are therefore trying to prove the negation of assumption from the negation of statement – technically, we are trying to come to a specific contradiction from the assumption that does not hold, namely with assumption . From this, it can be seen that such a proof is actually a special case of proof by contradiction – in which our goal is to come to a contradiction with any statement, not necessarily an assumption.
3What we have learned
- We use direct proof when we try to derive as many things as possible from the assumptions.
- Proof by contradiction is useful when something can be derived from the negation of the statement to be proved; from the negation we then use direct derivation.
- Proof by contrapositive is actually a special case of proof by contradiction.
4What next
In the next materials, we will focus on specific proof techniques, starting with mathematical induction, which is so important that it deserves a separate material.