Fixpoint replicate {X} (n : nat) (m : X) : list X :=
  match n with
  | O => []
  | S n' => cons m (replicate n' m)
  end.

(* Specifications: *)
Lemma Forall_replicate : forall {X Y} (l : list X) (f : X -> Y) (y : Y), Forall (fun x => f x = y) l -> List.map f l = replicate (List.length l) y.
Lemma concat_list_sum : forall {X} (l : list (list X)), List.length (concat l) = List.list_sum (List.map (@List.length X) l).
Lemma list_sum_rep : forall (n m : nat), List.list_sum (replicate n m) = (n * m)%nat.
Theorem arg_list_len_rel : forall {C : Config} (arg_list : list (block_id * operation))(s : state), well_formed s -> plift (fun l => List.length l = List.length arg_list * LOP)%nat (get_dist_list_bool arg_list s).
Lemma Forall_replicate : forall {X Y} (l : list X) (f : X -> Y) (y : Y), Forall (fun x => f x = y) l -> List.map f l = replicate (List.length l) y.
Lemma concat_list_sum : forall {X} (l : list (list X)), List.length (concat l) = List.list_sum (List.map (@List.length X) l).
Lemma list_sum_rep : forall (n m : nat), List.list_sum (replicate n m) = (n * m)%nat.
Theorem arg_list_len_rel : forall {C : Config} (arg_list : list (block_id * operation))(s : state), well_formed s -> plift (fun l => List.length l = List.length arg_list * LOP)%nat (get_dist_list_bool arg_list s).