The Collatz conjecture
Content created by Egbert Rijke, Fredrik Bakke, Jonathan Prieto-Cubides and Victor Blanchi.
Created on 2022-01-26.
Last modified on 2023-05-22.
module elementary-number-theory.collatz-conjecture where
Imports
open import elementary-number-theory.modular-arithmetic-standard-finite-types open import elementary-number-theory.multiplication-natural-numbers open import elementary-number-theory.natural-numbers open import foundation.coproduct-types open import foundation.dependent-pair-types open import foundation.universe-levels
Statement
collatz : ℕ → ℕ collatz n with is-decidable-div-ℕ 2 n ... | inl (pair y p) = y ... | inr f = succ-ℕ (3 *ℕ n) iterate-collatz : ℕ → ℕ → ℕ iterate-collatz zero-ℕ n = n iterate-collatz (succ-ℕ k) n = collatz (iterate-collatz k n) Collatz-conjecture : UU lzero Collatz-conjecture = (n : ℕ) → is-nonzero-ℕ n → Σ ℕ (λ k → is-one-ℕ (iterate-collatz k n))
Recent changes
- 2023-05-22. Fredrik Bakke, Victor Blanchi, Egbert Rijke and Jonathan Prieto-Cubides. Pre-commit stuff (#627).
- 2023-05-13. Fredrik Bakke. Refactor to use infix binary operators for arithmetic (#620).
- 2023-03-10. Fredrik Bakke. Additions to
fix-import
(#497). - 2023-03-07. Fredrik Bakke. Add blank lines between
<details>
tags and markdown syntax (#490). - 2023-03-07. Jonathan Prieto-Cubides. Show module declarations (#488).