(* Constant sequences, i.e., the image of nseq. *)

Definition constant s := if s is x :: s' then all (pred1 x) s' else true.

(* Specifications: *)
Lemma all_pred1P x s : reflect (s = nseq (size s) x) (all (pred1 x) s).
Lemma all_pred1_constant x s : all (pred1 x) s -> constant s.
Lemma all_pred1_nseq x n : all (pred1 x) (nseq n x).
Lemma constant_nseq n x : constant (nseq n x).
Lemma constantP s : reflect (exists x, s = nseq (size s) x) (constant s).
Lemma uniq_catC s1 s2 : uniq (s1 ++ s2) = uniq (s2 ++ s1).
Lemma uniq_catCA s1 s2 s3 : uniq (s1 ++ s2 ++ s3) = uniq (s2 ++ s1 ++ s3).
Lemma filter_uniq s a : uniq s -> uniq (filter a s).
Lemma rot_uniq s : uniq (rot n0 s) = uniq s.
Lemma rev_uniq s : uniq (rev s) = uniq s.
Lemma size_undup s : size (undup s) <= size s.
Lemma mem_undup s : undup s =i s.
Lemma undup_uniq s : uniq (undup s).
Lemma undup_id s : uniq s -> undup s = s.
Lemma ltn_size_undup s : (size (undup s) < size s) = ~~ uniq s.
Lemma filter_undup p s : filter p (undup s) = undup (filter p s).
Lemma undup_nil s : undup s = [::] -> s = [::].