Module Argument.
Local Notation "p ≃ q" := (poly_eq p q) (at level 65).
Local Notation "A ≡ B" := (mset_eq A B) (at level 65).
Definition encode_msetc (c : msetc) : polyc :=
match c with
| msetc_zero x => polyc_one x
| msetc_sum x y z => polyc_sum x y z
| msetc_h x y => polyc_prod x y
end.
(* count the number of occurrences of each element *)
Fixpoint mset_to_poly (A: list nat) :=
match A with
| [] => []
| a :: A => poly_add (repeat 0 a ++ [1]) (mset_to_poly A)
end.

Lemma mset_to_poly_appP {A B} : mset_to_poly (A ++ B) ≃ poly_add (mset_to_poly A) (mset_to_poly B).