test(tests/lean/hott): add test for 'cases' tactic
This commit is contained in:
parent
0627ad2f56
commit
70f7ec3cf2
1 changed files with 19 additions and 0 deletions
19
tests/lean/hott/cases.hlean
Normal file
19
tests/lean/hott/cases.hlean
Normal file
|
@ -0,0 +1,19 @@
|
|||
open nat
|
||||
|
||||
inductive vec (A : Type) : nat → Type :=
|
||||
nil {} : vec A zero,
|
||||
cons : Π {n}, A → vec A n → vec A (succ n)
|
||||
|
||||
namespace vec
|
||||
variables {A B C : Type}
|
||||
variables {n m : nat}
|
||||
notation a :: b := cons a b
|
||||
|
||||
protected definition destruct (v : vec A (succ n)) {P : Π {n : nat}, vec A (succ n) → Type}
|
||||
(H : Π {n : nat} (h : A) (t : vec A n), P (h :: t)) : P v :=
|
||||
begin
|
||||
cases v with (n', h', t'),
|
||||
apply (H h' t')
|
||||
end
|
||||
|
||||
end vec
|
Loading…
Reference in a new issue