2015-08-12 22:05:14 +00:00
|
|
|
import data.examples.vector
|
2014-12-02 03:08:56 +00:00
|
|
|
open nat
|
|
|
|
|
|
|
|
namespace vector
|
|
|
|
variables {A : Type} {n : nat}
|
|
|
|
|
|
|
|
protected definition destruct2 (v : vector A (succ (succ n))) {P : Π {n : nat}, vector A (succ n) → Type}
|
|
|
|
(H : Π {n : nat} (h : A) (t : vector A n), P (h :: t)) : P v :=
|
|
|
|
begin
|
2015-03-28 00:26:06 +00:00
|
|
|
cases v with [n', h', t'],
|
2014-12-02 03:08:56 +00:00
|
|
|
apply (H h' t')
|
|
|
|
end
|
|
|
|
end vector
|