Proof Hike · Module 8 · Lean 4.36.0

Real mathematics.

Even numbers, endless primes, and a capstone.

The five steps

  1. Example 36: Even plus even
  2. Example 37: Odd squared stays odd
  3. Example 38: Neighbors make an even product
  4. Example 39: Primes never run out
  5. Example 40: Capstone: reverse, then reverse again

New words

Even
A natural number is even when it is the sum of some natural number with itself. Zero is even.
Witness
The specific value supplied by an existence proof, together with a proof of its property.
Existential quantifier
The phrase there exists. A proof supplies a witness and a proof of its required property.
Odd
A natural number of the form twice a natural number plus one.
Polynomial
An expression formed from variables and coefficients using addition, multiplication, and natural-number powers.

A checked example

E36.leanTry it live (opens official Lean editor)
module

import Mathlib.Algebra.Ring.Parity

example (a b : ℕ) (ha : Even a) (hb : Even b) : Even (a + b) := by
  obtain ⟨r, hr⟩ := ha
  obtain ⟨s, hs⟩ := hb
  refine ⟨r + s, ?_⟩
  omega

Before you move on

  • Explain the claim in everyday words.
  • Identify what Lean expects at each step.
  • Complete the warm-up exercises.
  • Read an error and explain its fix.

The full lesson includes the captured Lean output, hints, stretch tasks, and checked solutions.

Use your browser’s Print command. This course stores progress only in the learner’s browser.