Program Instance listOfMonotonic {A} (g : G A)
`{SizeMonotonic _ g } : SizeMonotonic (listOf g).
Next Obligation.
rewrite ! semListOfSize.
move => l [H1 H2]; split => //. by eapply leq_trans; eauto.
move => a /H2 Ha. by eapply monotonic; eauto.
Qed.

(* Specifications: *)
Lemma In_nth_exists {A} (l: list A) x def :
List.In x l -> exists n, nth def l n = x /\ (n < length l)%coq_nat.
Lemma nth_imset T (def : T) l : nth def l @: [set n | n < length l] <--> l.
Lemma semOneofSize {A} (l : list (G A)) (def : G A) s : semGenSize (oneof def l) s
<--> if l is nil then semGenSize def s else \bigcup_(x in l) semGenSize x s.
Lemma semOneof {A} (l : list (G A)) (def : G A) :
semGen (oneof def l) <-->
if l is nil then semGen def else \bigcup_(x in l) semGen x.