2015-01-05 23:56:28 +00:00
|
|
|
import data.list
|
|
|
|
open list
|
|
|
|
|
|
|
|
variable {A : Type}
|
|
|
|
set_option pp.implicit true
|
|
|
|
|
2015-02-26 00:20:44 +00:00
|
|
|
definition append : list A → list A → list A
|
|
|
|
| append nil l := l
|
|
|
|
| append (h :: t) l := h :: (append t l)
|
2015-01-05 23:56:28 +00:00
|
|
|
|
|
|
|
theorem append_nil (l : list A) : append nil l = l :=
|
|
|
|
rfl
|
|
|
|
|
|
|
|
theorem append_cons (h : A) (t l : list A) : append (h :: t) l = h :: (append t l) :=
|
|
|
|
rfl
|
|
|
|
|
|
|
|
example : append (1 :: 2 :: nil) (3 :: 4 :: 5 :: nil) = (1 :: 2 :: 3 :: 4 :: 5 :: nil) :=
|
|
|
|
rfl
|