(** * Dupfree vector *)
(* Author: Maximilian Wuttke *)
Require PslBase.Lists.Dupfree.
Open Scope vector_scope.
Inductive dupfree X : forall n, Vector.t X n -> Prop :=
dupfreeVN :
dupfree (@Vector.nil X)
| dupfreeVC n (x : X) (V : Vector.t X n) :
~ Vector.In x V -> dupfree V -> dupfree (x ::: V).
Ltac vector_dupfree :=
match goal with
| [ |- dupfree (Vector.nil _) ] =>
constructor
| [ |- dupfree (?a ::: ?bs)] =>
constructor; [vector_not_in | vector_dupfree]
end.
Goal dupfree [| 4; 8; 15; 16; 23; 42 |].

Lemma tolist_dupfree (X : Type) (n : nat) (xs : Vector.t X n) :
dupfree xs -> Dupfree.dupfree xs.