(* end semFrequencySize *)

(* begin semFrequency *)
Lemma semFrequency {A} (l : list (nat * G A)) (def : G A) :
semGen (frequency def l) <-->
let l' := [seq x <- l | x.1 != 0] in
if l' is nil then semGen def else
\bigcup_(x in l') semGen x.2.