2015-08-12 22:05:14 +00:00
|
|
|
import data.examples.vector
|
2015-01-06 00:52:30 +00:00
|
|
|
open nat vector
|
|
|
|
|
2015-02-26 00:20:44 +00:00
|
|
|
definition last {A : Type} : Π {n}, vector A (succ n) → A
|
|
|
|
| last (a :: nil) := a
|
|
|
|
| last (a :: v) := last v
|
2015-01-06 00:52:30 +00:00
|
|
|
|
|
|
|
theorem last_cons_nil {A : Type} {n : nat} (a : A) : last (a :: nil) = a :=
|
|
|
|
rfl
|
|
|
|
|
|
|
|
theorem last_cons {A : Type} {n : nat} (a : A) (v : vector A (succ n)) : last (a :: v) = last v :=
|
|
|
|
rfl
|