All Exercises
#35 Every Natural Number Is Even or Odd
live.lean-lang.org
Pure Lean 4 · No Mathlib
MediumNatural Numbers

35. Every Natural Number Is Even or Odd

Prove by induction that every natural number `n` is either even (`∃ k, n = 2 * k`) or odd (`∃ k, n = 2 * k + 1`). Each successor step flips parity from even to odd or from odd to even.

Target Theorem
theorem even_or_odd (n : Nat) : (∃ k, n = 2 * k) ∨ (∃ k, n = 2 * k + 1)
Hints (0/3)

Stuck? Reveal hints one step at a time without spoiling the full proof.

Symbols:
Initializing Lean 4 editor…
Infoview & Diagnosticsline 1idle
Write your proof above and click Submit Proof (or open in live.lean-lang.org).