chore: remove workarounds
This commit is contained in:
parent
544421faf5
commit
9fed5bda7d
2 changed files with 3 additions and 7 deletions
|
|
@ -18,8 +18,7 @@ protected def div (x y : @& Nat) : Nat :=
|
|||
Nat.div (x - y) y + 1
|
||||
else
|
||||
0
|
||||
decreasing_by
|
||||
decreasing_with apply div_rec_lemma; assumption
|
||||
decreasing_by apply div_rec_lemma; assumption
|
||||
|
||||
instance : Div Nat := ⟨Nat.div⟩
|
||||
|
||||
|
|
@ -37,8 +36,7 @@ theorem div.inductionOn.{u}
|
|||
ind x y h (inductionOn (x - y) y ind base)
|
||||
else
|
||||
base x y h
|
||||
decreasing_by
|
||||
decreasing_with apply div_rec_lemma; assumption
|
||||
decreasing_by apply div_rec_lemma; assumption
|
||||
|
||||
@[extern "lean_nat_mod"]
|
||||
protected def mod (x y : @& Nat) : Nat :=
|
||||
|
|
@ -46,8 +44,7 @@ protected def mod (x y : @& Nat) : Nat :=
|
|||
Nat.mod (x - y) y
|
||||
else
|
||||
x
|
||||
decreasing_by
|
||||
decreasing_with apply div_rec_lemma; assumption
|
||||
decreasing_by apply div_rec_lemma; assumption
|
||||
|
||||
instance : Mod Nat := ⟨Nat.mod⟩
|
||||
|
||||
|
|
|
|||
|
|
@ -25,5 +25,4 @@ Computes `⌊max 0 (log₂ n)⌋`.
|
|||
@[extern "lean_nat_log2"]
|
||||
def log2 (n : @& Nat) : Nat :=
|
||||
if h : n ≥ 2 then log2 (n / 2) + 1 else 0
|
||||
termination_by _ n => n
|
||||
decreasing_by exact log2_terminates _ h
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue