test(tests/lean/run): define list head using recursive equations
This commit is contained in:
parent
828ce3f8dc
commit
6451cad38d
1 changed files with 9 additions and 0 deletions
9
tests/lean/run/eq22.lean
Normal file
9
tests/lean/run/eq22.lean
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import data.list
|
||||||
|
open list
|
||||||
|
|
||||||
|
definition head {A : Type} : Π (l : list A), l ≠ nil → A,
|
||||||
|
head nil h := absurd rfl h,
|
||||||
|
head (a :: l) _ := a
|
||||||
|
|
||||||
|
theorem head_cons {A : Type} (a : A) (l : list A) (h : a :: l ≠ nil) : head (a :: l) h = a :=
|
||||||
|
rfl
|
Loading…
Reference in a new issue