test(tests/lean/run): define list append using recursive equations
This commit is contained in:
parent
7fca862fc3
commit
7488378445
1 changed files with 15 additions and 0 deletions
15
tests/lean/run/eq6.lean
Normal file
15
tests/lean/run/eq6.lean
Normal file
|
@ -0,0 +1,15 @@
|
|||
import data.list
|
||||
open list
|
||||
|
||||
definition append {A : Type} : list A → list A → list A,
|
||||
append nil l := l,
|
||||
append (h :: t) l := h :: (append t l)
|
||||
|
||||
theorem append_nil {A : Type} (l : list A) : append nil l = l :=
|
||||
rfl
|
||||
|
||||
theorem append_cons {A : Type} (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
|
Loading…
Reference in a new issue