2015-01-05 01:47:18 +00:00
|
|
|
open nat
|
|
|
|
|
2015-02-26 00:20:44 +00:00
|
|
|
definition fib : nat → nat
|
|
|
|
| fib 0 := 1
|
|
|
|
| fib 1 := 1
|
|
|
|
| fib (x+2) := fib x + fib (x+1)
|
2015-01-05 01:47:18 +00:00
|
|
|
|
|
|
|
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
|