(** A list of [n] elements, all equal to [x]. *)

Fixpoint list_repeat {A: Type} (n: nat) (x: A) {struct n} :=
  match n with
  | O => nil
  | S m => x :: list_repeat m x
  end.

(* Specifications: *)
Lemma length_list_repeat: forall (A: Type) n (x: A), length (list_repeat n x) = n.
Lemma in_list_repeat: forall (A: Type) n (x: A) y, In y (list_repeat n x) -> y = x.