Variables (R : Type) (idx : R) (op : Monoid.law idx).
Implicit Types (X : {mset K}) (P : pred K) (F : K -> R).

(* Specifications: *)
Lemma big_mset0 P F : \big[op/idx]_(i <- mset0 | P i) F i = idx.
Lemma msetB11 b A : (b \in A `\ b) = (A b > 1).
Lemma msetD1K a B : (a +` B) `\ a = B.
Lemma mset1U1 x B : x \in x |` B. Proof. by rewrite !inE eqxx. Qed.
Lemma mset1D1 x B : x \in x +` B. Proof. by rewrite !inE eqxx. Qed.
Lemma mset1Ur x a B : x \in B -> x \in a |` B.
Lemma msetBDl C A B : (C `+` A) `\` (C `+` B) = A `\` B.
Lemma msubset_subset {A B} : A `<=` B -> {subset A <= B}.
Lemma msetB_eq0 (A B : {mset K}) : (A `\` B == mset0) = (A `<=` B).
Lemma msubset_refl A : A `<=` A. Proof. exact/msubsetP. Qed.
Hint Resolve msubset_refl.
Lemma msubset_trans : transitive (@msubset K).
Arguments msubset_trans {C A B} _ _ : rename.
Lemma msetUS C A B : A `<=` B -> C `|` A `<=` C `|` B.
Lemma msetDS C A B : A `<=` B -> C `+` A `<=` C `+` B.
Lemma msetSU C A B : A `<=` B -> A `|` C `<=` B `|` C.
Lemma msetIidPr {A B} : reflect (A `&` B = B) (B `<=` A).
Lemma msubsetIidr A B : (B `<=` A `&` B) = (B `<=` A).
Lemma msetUidPl A B : reflect (A `|` B = A) (B `<=` A).
Lemma msubEproper A B : A `<=` B = (A == B) || (A `<` B).
Lemma msub_proper_trans B A C :
A `<=` B -> B `<` C -> A `<` C.
Lemma msubset_neq0 A B : A `<=` B -> A != mset0 -> B != mset0.
Lemma subset_msetBLR A B C : (msubset (A `\` B) C) = (A `<=` B `+` C).
Lemma msetnP n x a : reflect (0 < n /\ x = a) (x \in msetn n a).
Lemma mset1UP x a B : reflect (x = a \/ x \in B) (x \in a |` B).
Lemma msetSI C A B : A `<=` B -> A `&` C `<=` B `&` C.
Lemma msetBS C A B : A `<=` B -> C `\` B `<=` C `\` A.
Lemma msetBSS A B C D : A `<=` C -> D `<=` B -> A `\` B `<=` C `\` D.
Lemma mem_msetD1 a A : a \notin A -> A `\ a = A.
Lemma msetIn a A n : A `&` msetn n a = msetn (minn (A a) n) a.
Lemma msubIset A B C : (B `<=` A) || (C `<=` A) -> (B `&` C `<=` A).
Lemma msubsetIP A B C : reflect (A `<=` B /\ A `<=` C) (A `<=` B `&` C).
Lemma msubUsetP A B C : reflect (A `<=` C /\ B `<=` C) (A `|` B `<=` C).
Lemma msetDBA A B C : C `<=` B -> A `+` B `\` C = (A `+` B) `\` C.
Lemma mset_0Vmem A : (A = mset0) + {x : K | x \in A}.
Definition size_mset A : size A = \sum_(a <- finsupp A) A a.
Lemma size_mset_eq0 A : (size A == 0) = (A == mset0).
End MSetTheory.