---
title: "Starter problems: 26 graded problems in formal proof, solver certificates and reproducible computation | certXiv"
url: https://certxiv.org/students/starter-problems
description: "26 practice problems for students, graded from an afternoon's work to a project: prove a theorem in Lean 4, settle a puzzle with a SAT solver and a checked certificate, or reproduce a known number with a deterministic program."
---

[For students](https://certxiv.org/students) · practice

# Starter problems

26 problems in three kinds, each with an exact definition of done that a computer can check. They are practice: nothing here is published, and there is nothing to sign up for. When your repository passes its own check, you have the skills an [open challenge](https://certxiv.org/challenges) or a [submission](https://certxiv.org/submit) needs.

Levels: **Starter** (An afternoon, once the tools are installed.) · **Intermediate** (A few sessions. Expect to get stuck once and work your way out.) · **Stretch** (A project. Good preparation for an open challenge.)

## Formal proofs in Lean 4

State a theorem precisely and prove it so that Lean's kernel accepts every step. These build the skills behind the TCB-0 tier.

**You need**

Lean 4 with Mathlib (free). The Lean community's own tutorials are the place to learn the basics.

**Done means**

lake build succeeds, the file contains no sorry, and #print axioms on your theorem shows only propext, Classical.choice and Quot.sound.

### Starter

P1

#### The first n odd numbers add up to n squared

Prove that 1 + 3 + 5 + … + (2n − 1) = n² for every natural number n.

```
theorem sum_first_odds (n : ℕ) :
    ∑ i ∈ Finset.range n, (2 * i + 1) = n ^ 2
```

**Hand in:** One Lean file with the theorem and your proof by induction.

P2

#### Twice the sum 0 + 1 + … + n

Prove Gauss's formula in the form that avoids division: twice the sum of 0 through n equals n(n + 1).

```
theorem gauss_sum (n : ℕ) :
    2 * ∑ i ∈ Finset.range (n + 1), i = n * (n + 1)
```

**Hand in:** One Lean file with the theorem and your proof.

P3

#### n² + n is always even

Prove that n² + n is even for every natural number n.

```
theorem even_sq_add_self (n : ℕ) : Even (n ^ 2 + n)
```

**Hand in:** One Lean file. Try it twice: once by cases on whether n is even, once by induction.

P4

#### 2ab is at most a² + b²

Prove that 2ab ≤ a² + b² for all real numbers a and b, starting from the fact that a square is never negative.

```
theorem two_mul_le_sq_add_sq (a b : ℝ) : 2 * a * b ≤ a ^ 2 + b ^ 2
```

**Hand in:** One Lean file. Do not finish it with a single call to nlinarith or polyrith: write out the step that uses (a − b)² ≥ 0.

### Intermediate

P5

#### A fraction that never simplifies (IMO 1959, Problem 1)

Prove that the fraction (21n + 4)/(14n + 3) is in lowest terms for every natural number n. This was the first problem of the first International Mathematical Olympiad.

```
theorem imo1959_q1 (n : ℕ) : Nat.Coprime (21 * n + 4) (14 * n + 3)
```

**Hand in:** One Lean file. Mathlib's Archive contains a solution; write your own before you look at it.

P6

#### The square root of 2 is not a fraction

Prove that no natural numbers p and q, with q not zero, satisfy p² = 2q². Do it from scratch, without Mathlib's irrationality lemmas.

```
theorem sq_ne_two_mul_sq (p q : ℕ) (hq : q ≠ 0) : p ^ 2 ≠ 2 * q ^ 2
```

**Hand in:** One Lean file, with a comment naming each lemma you used and why.

P7

#### Bernoulli's inequality

Prove that (1 + x)ⁿ ≥ 1 + nx for every real x ≥ −1 and every natural number n.

```
theorem bernoulli (x : ℝ) (hx : -1 ≤ x) (n : ℕ) :
    1 + (n : ℝ) * x ≤ (1 + x) ^ n
```

**Hand in:** One Lean file with a proof by induction on n. Mathlib already has this result; do not call it.

P8

#### The arithmetic mean is at least the geometric mean

Prove that √(ab) ≤ (a + b)/2 for non-negative real numbers a and b.

```
theorem amgm_two (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) :
    Real.sqrt (a * b) ≤ (a + b) / 2
```

**Hand in:** One Lean file. Say in a comment where the two hypotheses are needed.

### Stretch

P9

#### Two of n + 1 integers leave the same remainder

Prove that among any n + 1 integers, two differ by a multiple of n. This is the pigeonhole principle in its most used form.

```
theorem two_with_same_remainder (n : ℕ) (hn : 0 < n) (f : Fin (n + 1) → ℤ) :
    ∃ i j, i ≠ j ∧ (n : ℤ) ∣ f i - f j
```

**Hand in:** One Lean file, and a paragraph explaining how your formal statement matches the sentence above.

P10

#### Infinitely many primes of the form 4k + 3

Prove that above every natural number N there is a prime that leaves remainder 3 when divided by 4, by adapting Euclid's argument.

```
theorem exists_prime_three_mod_four (N : ℕ) :
    ∃ p, N < p ∧ p.Prime ∧ p % 4 = 3
```

**Hand in:** A Lean file with your own argument, not a call to a library theorem about primes in arithmetic progressions, and a short write-up of the proof in words.

## Puzzles a solver can settle

Turn a combinatorial question into a formula, let a SAT solver answer it, and keep the certificate that proves the answer. These build the skills behind the TCB-1 tier.

**You need**

A SAT solver that writes DRAT proofs (CaDiCaL or Kissat) and the drat-trim checker, all free. You write the script that generates the formula.

**Done means**

For a yes answer, your script prints a solution and checks it. For a no answer, drat-trim accepts the solver's proof and prints s VERIFIED.

### Starter

C1

#### Four pigeons, three holes

Encode the statement "4 pigeons fit into 3 holes with no two sharing" as a formula, and have a solver prove it impossible.

```
Target: UNSAT, with a DRAT proof that drat-trim accepts.
```

**Hand in:** The script that writes the formula, the formula, the proof file, and the checker's output.

C2

#### Count the eight-queens solutions

Place 8 queens on a chessboard so that none attacks another. Find every solution with a solver by adding a clause that rules out each one found, until the solver says there are no more.

```
Target: exactly 92 solutions, then UNSAT with a checked proof.
```

**Hand in:** The generator script, the list of 92 boards, and the checked proof that there is no 93rd.

### Intermediate

C3

#### Six people at a party

Colour each edge between 6 points red or blue. Show that some triangle always has all three edges the same colour, and that with 5 points you can avoid it.

```
Target: R(3,3) = 6. A colouring for 5 points (SAT), and a checked UNSAT proof for 6.
```

**Hand in:** Both formulas, the 5-point colouring with a script that checks it, and the checked proof for 6.

C4

#### Evenly spaced numbers of one colour

Colour the numbers 1 to N red or blue, avoiding three evenly spaced numbers of the same colour (such as 2, 5, 8). Show it can be done for N = 8 and not for N = 9.

```
Target: the van der Waerden number W(2, 3) = 9.
```

**Hand in:** A valid colouring of 1 to 8 with a checking script, and a checked UNSAT proof for 1 to 9.

C5

#### Splitting numbers so no two add to a third

Split the numbers 1 to N into two groups so that no group contains x, y and z with x + y = z (x and y may be equal). Show it can be done for N = 4 and not for N = 5.

```
Target: the Schur number S(2) = 4.
```

**Hand in:** A valid split of 1 to 4 with a checking script, and a checked UNSAT proof for 1 to 5.

### Stretch

C6

#### A red triangle or four blue points

Colour each edge between 9 points red or blue. Show there is always a red triangle or four points joined only by blue edges, and that 8 points are not enough to force it.

```
Target: R(3,4) = 9.
```

**Hand in:** An 8-point colouring with a checking script, and a checked UNSAT proof for 9. Report the proof's size and how long it took to check.

C7

#### Three groups, no two adding to a third

Repeat the Schur problem with three groups. Show the numbers 1 to 13 can be split and 1 to 14 cannot.

```
Target: the Schur number S(3) = 13.
```

**Hand in:** A valid split of 1 to 13 with a checking script, and a checked UNSAT proof for 1 to 14.

C8

#### Four evenly spaced numbers

Repeat the evenly-spaced problem for runs of four. Show 1 to 34 can be coloured with no four evenly spaced numbers of one colour, and 1 to 35 cannot.

```
Target: the van der Waerden number W(2, 4) = 35.
```

**Hand in:** A valid colouring of 1 to 34 with a checking script, and a checked UNSAT proof for 1 to 35. Try a symmetry-breaking clause and report whether the proof gets smaller.

## Experiments to reproduce

Reproduce a known number with a program that gives the same output every time it runs. These build the skills behind the TCB-2 tier.

**You need**

Python and Docker (free). Fix every random seed, pin your package versions, and print the result at the end.

**Done means**

A single command (for example python verify.py) runs with no network access, finishes, and prints the target value to the stated accuracy, twice in a row with identical output.

### Starter

X1

#### The longest Collatz chain under a million

Start from n. If n is even halve it, otherwise triple it and add 1, and repeat until you reach 1. Find the starting number below 1,000,000 that takes the most steps.

```
Target: 837799, which takes 524 steps.
```

**Hand in:** verify.py printing the starting number and the step count, and the time it took.

X2

#### Count the primes

Count the primes below 10⁶, 10⁷ and 10⁸ with a sieve, and compare each count with the estimate x / ln x.

```
Targets: π(10⁶) = 78,498, π(10⁷) = 664,579, π(10⁸) = 5,761,455.
```

**Hand in:** verify.py printing the three counts and the percentage error of the estimate for each.

X3

#### Estimate π by throwing darts

Pick random points in a square and count how many land inside the inscribed circle. Estimate π for 10³, 10⁴, …, 10⁷ points and show that the error shrinks like one over the square root of the number of points.

```
Target: an estimate within three standard errors of 3.14159…, at every sample size, from a fixed seed.
```

**Hand in:** verify.py with a fixed seed, printing each estimate with its standard error.

### Intermediate

X4

#### The birthday problem, two ways

Compute exactly the probability that at least two of 23 people share a birthday (365 equally likely days), then estimate it by simulation and show the two agree.

```
Target: 0.5073 (exactly 0.507297… to six places).
```

**Hand in:** verify.py printing the exact value from the formula, the simulated value with its standard error, and whether they agree.

X5

#### Verify Goldbach's conjecture to a million

Check that every even number from 4 to 1,000,000 is a sum of two primes. Report the even number whose smallest such prime is largest.

```
Target: no counterexample. (The conjecture is unproved; you are verifying a finite range, not proving it.)
```

**Hand in:** verify.py printing the count checked, the hardest case and its two primes.

X6

#### Find Feigenbaum's constant

For the map x → r·x·(1 − x), find the values of r where the long-run behaviour doubles its period (1 to 2, 2 to 4, 4 to 8, 8 to 16). The ratios of the gaps between them approach a universal constant.

```
Target: δ ≈ 4.669. Your last ratio should be within 0.01 of it.
```

**Hand in:** verify.py printing the bifurcation points to six decimal places and the successive ratios.

### Stretch

X7

#### When does a grid let water through?

Open each cell of an L × L grid at random with probability p. Estimate the value of p at which a path of open cells from top to bottom first becomes likely, for L = 64, 128 and 256, and extrapolate.

```
Target: the site percolation threshold of the square lattice, p ≈ 0.5927.
```

**Hand in:** verify.py with fixed seeds, printing the estimate and its uncertainty for each L, and a short note on how you extrapolated.

X8

#### The temperature where a magnet forgets

Simulate the two-dimensional Ising model on a square grid with the Metropolis algorithm and locate the temperature at which the magnetisation disappears. Compare it with Onsager's exact answer.

```
Target: T = 2 / ln(1 + √2) ≈ 2.269 (in units where the coupling and Boltzmann's constant are 1).
```

**Hand in:** verify.py with fixed seeds, printing magnetisation against temperature for at least two grid sizes and your estimate with its uncertainty.

## Finished one?

- Put it in a public repository with a short README saying how to run the check. That is already a portfolio piece anyone can verify.
- Starter problems are practice and are not published in the journal: their answers are known. The [open challenges](https://certxiv.org/challenges) are the ones whose answers are not yet on record here.
- If you took a problem further than it asks (a new bound, a faster method, a generalisation), that may be worth [submitting](https://certxiv.org/submit). [This worked example](https://certxiv.org/students/from-starter-problem-to-paper) takes one starter problem further and writes it up as a paper.
- The Lean statements are written for a current Mathlib. If a name has changed in your version, adjust the statement and say so.

[Open challenges](https://certxiv.org/challenges) [What is a kernel-verified proof?](https://certxiv.org/guides/what-is-a-kernel-verified-proof) [Notes for teachers](https://certxiv.org/students#teachers)
