lean4-htt/old_tests/tests/lean/run/div2.lean
2018-04-10 12:56:55 -07:00

7 lines
189 B
Text

def Div : nat → nat → nat
| x y :=
if h : 0 < y ∧ y ≤ x then
have x - y < x, from nat.sub_lt (nat.lt_of_lt_of_le h.left h.right) h.left,
Div (x - y) y + 1
else
0