Notation repeat := repeat.

(* Specifications: *)
Theorem repeat_length x n: length (repeat x n) = n.
Theorem repeat_spec n x y: In y (repeat x n) -> y=x.
Lemma repeat_cons n a : a :: repeat a n = repeat a n ++ [a].
Lemma repeat_app x n m : repeat x (n + m) = repeat x n ++ repeat x m.
Lemma repeat_eq_app x n l1 l2 : repeat x n = l1 ++ l2 -> repeat x (length l1) = l1 /\ repeat x (length l2) = l2.
Lemma repeat_eq_cons x y n l : repeat x n = y :: l -> x = y /\ repeat x (pred n) = l.
Lemma repeat_eq_elt x y n l1 l2 : repeat x n = l1 ++ y :: l2 -> x = y /\ repeat x (length l1) = l1 /\ repeat x (length l2) = l2.
Lemma Forall_eq_repeat x l : Forall (eq x) l -> l = repeat x (length l).
Lemma count_occ_repeat_eq x y n : x = y -> count_occ decA (repeat y n) x = n.
Lemma count_occ_repeat_neq x y n : x <> y -> count_occ decA (repeat y n) x = 0.
Lemma count_occ_unique x l : count_occ decA l x = length l -> l = repeat x (length l).
Lemma count_occ_repeat_excl x l : (forall y, y <> x -> count_occ decA l y = 0) -> l = repeat x (length l).
Lemma count_occ_sgt l x : l = [x] <-> count_occ decA l x = 1 /\ forall y, y <> x -> count_occ decA l y = 0.
Lemma nth_repeat a m n : nth n (repeat a m) a = a.
Lemma nth_repeat_lt a m n d : n < m -> nth n (repeat a m) d = a.
Lemma nth_error_repeat a m n : n < m -> nth_error (repeat a m) n = Some a.
Lemma repeat_to_concat A n (a:A) : repeat a n = concat (repeat [a] n).
Lemma map_repeat A B (a:A) n (f : A -> B): map f (repeat a n) = repeat (f a) n.
Lemma map_const (A B : Type) (b : B) (l : list A) : map (fun _ => b) l = repeat b (length l).
Lemma rev_repeat A n (a:A): rev (repeat a n) = repeat a n.
Lemma fst_list_prod [A B] l l' : map fst (@list_prod A B l l') = flat_map (fun a => repeat a (length l')) l.