Section Repeat.
Variable A : Type.
Local Notation repeat := (@repeat A).

(* 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).