test(tests/lean/run): define fibonacci using recursive equations

This commit is contained in:
Leonardo de Moura 2015-01-04 17:47:18 -08:00
parent faf78ce3e6
commit 7fca862fc3

18
tests/lean/run/eq5.lean Normal file
View file

@ -0,0 +1,18 @@
open nat
definition fib : nat → nat,
fib 0 := 1,
fib 1 := 1,
fib (x+2) := fib x + fib (x+1)
theorem fib0 : fib 0 = 1 :=
rfl
theorem fib1 : fib 1 = 1 :=
rfl
theorem fib_succ_succ (a : nat) : fib (a+2) = fib a + fib (a+1) :=
rfl
example : fib 8 = 34 :=
rfl