Skip to content

Commit

Permalink
halfing defined for collatz
Browse files Browse the repository at this point in the history
  • Loading branch information
archiebrowne committed Nov 13, 2023
1 parent f217111 commit d742928
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Game/Levels/Hard/level_2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,11 @@ LemmaDoc MyNat.Colatz as "Collatz" in "Hard" "
`Collatz` is the proof of disproof of the Collatz conjecture.
"

def even (n : ℕ) : Prop
| zero => true
| succ a => ¬ (even a)

-- halving used for the sequence
def half (n : ℕ) :=
| zero => zero
| succ a =>
match even a with
| true => half a + 1
| false => half a
| 0 => 0
| 1 => 0
| (a + 2) => half a + 1

-- 'collatz function'
def f (x : ℕ) :=
Expand Down

0 comments on commit d742928

Please sign in to comment.