Module docstring
{"# Multisets
Multisets are finite sets with duplicates allowed. They are implemented here as the quotient of lists by permutation. This gives them computational content.
This file contains the definition of Multiset and the basic predicates. Most operations
have been split off into their own files. The goal is that we can define Finset with only
importing Multiset.Defs.
Main definitions
Multiset: the type of finite sets with duplicates allowed.Coe (List α) (Multiset α): turn a list into a multiset by forgetting the order.Multiset.pmap: map a partial function defined on a superset of the multiset's elements.Multiset.attach: add a proof of membership to the elements of the multiset.Multiset.card: number of elements of a multiset (counted with repetition).Membership α (Multiset α)instance:x ∈ sifxhas multiplicity at least one ins.Subset (Multiset α)instance:s ⊆ tif everyx ∈ salso enjoysx ∈ t.PartialOrder (Multiset α)instance:s ≤ tif allxhave multiplicity insless than their multiplicity int.Multiset.Pairwise:Pairwise r sholds iff there exists a list of elements ofssuch thatrholds pairwise.Multiset.Nodup:Nodup sholds if the multiplicity of any element is at most 1.
Notation (defined later)
0: The empty multiset.{a}: The multiset containing a single occurrence ofa.a ::ₘ s: The multiset containing one more occurrence ofathansdoes.s + t: The multiset for which the number of occurrences of eachais the sum of the occurrences ofainsandt.s - t: The multiset for which the number of occurrences of eachais the difference of the occurrences ofainsandt.s ∪ t: The multiset for which the number of occurrences of eachais the max of the occurrences ofainsandt.s ∩ t: The multiset for which the number of occurrences of eachais the min of the occurrences ofainsandt. ","###Multiset.Subset","### Partial order onMultisets ","### Cardinality ","### Map for partial functions "}