Section test.
Variable P : Prop.
Variable dec_P : dec P.
Goal if Dec (1 = 1) then True else False.
Goal P -> if (Dec P) then True else False.
Goal ~ P -> if (Dec P) then False else True.
Goal P -> (if (Dec P) then False else True) -> False.
Goal ~ P -> (if (Dec P) then True else False) -> False.
End test.
Ltac inv_pair :=
once lazymatch goal with
| [ H : (_, _) = (_, _) |- _] => inv H
| [ |- (_, _) = (_, _) ] => f_equal
end.
Ltac destruct_param_tape_pair :=
once lazymatch goal with
| [ x : _ * tapes _ _ |- _] =>
let ymid := fresh "ymid" in
let tmid := fresh "tmid" in
destruct x as (ymid&tmid)
end.
Ltac destruct_unit :=
repeat once lazymatch goal with
| [ x : unit |- _ ] => destruct x
end.
(* Rewrite [eq]-assumptions, but only in the goal. This is much faster than [TMSimp]. *)
Ltac TMSimp_goal :=
repeat multimatch goal with
| [ H : ?X = _ |- _ ] => rewrite H
end.
Fixpoint all_vec {X:Type} {n:nat}  {struct n}: (Vector.t X n -> Prop) -> Prop :=
match n with
0 => fun A => A (@Vector.nil _)
| S n => fun A => forall x, all_vec (fun xs => A (x:::xs))
end.

Lemma all_vec_correct {X:Type} {n:nat} (P : Vector.t X n -> Prop):
all_vec P -> forall xs, P xs.