| 1 | /- |
| 2 | Ported from google-deepmind/formal-conjectures at commit a61ab09632df039ef8381b6ac8accc5ce4d954d7, |
| 3 | file FormalConjectures/Wikipedia/CollatzConjecture.lean, declaration CollatzConjecture.collatz_conjecture. |
| 4 | Copyright 2025 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 |
| 5 | (https://www.apache.org/licenses/LICENSE-2.0). |
| 6 | Port: `public import FormalConjecturesUtil` replaced by specific Mathlib imports; the |
| 7 | `@[category …, AMS …]` attribute and the doc comments dropped. The module system is kept (Mathlib |
| 8 | v4.36.0 is built for it, and without `module` Lean warns on each Mathlib import); |
| 9 | `@[expose] public section` keeps both declarations public under their own names with the |
| 10 | definition's body visible. The proposition is unchanged. |
| 11 | -/ |
| 12 | module |
| 13 | |
| 14 | public import Mathlib.Algebra.Group.Nat.Even |
| 15 | public import Mathlib.Logic.Function.Iterate |
| 16 | |
| 17 | @[expose] public section |
| 18 | |
| 19 | namespace CollatzConjecture |
| 20 | |
| 21 | def collatzStep (n : ℕ) : ℕ := |
| 22 | if Even n then n / 2 else 3 * n + 1 |
| 23 | |
| 24 | theorem collatz_conjecture (n : ℕ) (hn : n > 0) : ∃ m, collatzStep^[m] n = 1 := by |
| 25 | sorry |
| 26 | |
| 27 | end CollatzConjecture |
| 28 | |
| 29 | /-- The family's target (decision 0100), under the family's name: its type is taken from upstream's |
| 30 | `CollatzConjecture.collatz_conjecture` above, so the two cannot differ. Upstream's declaration is kept for provenance; it is not a |
| 31 | target. -/ |
| 32 | theorem Collatz : type_of% @CollatzConjecture.collatz_conjecture := by |
| 33 | sorry |