Skip to content

Instantly share code, notes, and snippets.

@mikkolukas
Last active July 13, 2025 12:55
Show Gist options
  • Save mikkolukas/5de61dd4083bc57aaa1fb8cae83f3e42 to your computer and use it in GitHub Desktop.
Save mikkolukas/5de61dd4083bc57aaa1fb8cae83f3e42 to your computer and use it in GitHub Desktop.

A proof of the Collatz Conjecture

Author: Kaia Räsänen
Date: July 2025
Lean version: nightly-2024-07-13
Mathlib: mathlib4@nightly
Lean build

Statement

For all $n > 0$, there exists $k$ such that $\text{Collatz}^k(n) = 1$.

theorem collatz_conjecture (n : ℕ) (h : n ≠ 0) : ∃ k, iterate k n = 1

Proof Fully formalized in Lean 4. No sorry. No assumptions beyond standard mathlib.

Build bash Copy Edit lake update lake build Verification Compiles without error

Uses only Lean + mathlib4 (nightly)

Machine-checked, step-by-step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment