prime_multiset

The type of multisets of prime numbers. Unique factorization gives an equivalence between this set and ℕ+, as we will formalize below.

prime_multiset.of_prime

The multiset consisting of a single prime

prime_multiset.to_nat_multiset

We can forget the primality property and regard a multiset of primes as just a multiset of positive integers, or a multiset of natural numbers. In the opposite direction, if we have a multiset of positive integers or natural numbers, together with a proof that all the elements are prime, then we can regard it as a multiset of primes. The next block of results records obvious properties of these coercions.

prime_multiset.of_nat_list

Lists can be coerced to multisets; here we have some results about how this interacts with our constructions on multisets.

prime_multiset.prod_zero

The product map gives a homomorphism from the additive monoid of multisets to the multiplicative monoid ℕ+.

pnat.factor_multiset

The prime factors of n, regarded as a multiset

pnat.prod_factor_multiset

The product of the factors is the original number

prime_multiset.factor_multiset_prod

If we start with a multiset of primes, take the product and then factor it, we get back the original multiset.

pnat.factor_multiset_equiv

Positive integers biject with multisets of primes.

pnat.factor_multiset_one

Factoring gives a homomorphism from the multiplicative monoid ℕ+ to the additive monoid of multisets.

pnat.factor_multiset_of_prime

Factoring a prime gives the corresponding one-element multiset.

pnat.factor_multiset_le_iff

We now have four different results that all encode the idea that inequality of multisets corresponds to divisibility of positive integers.

pnat.factor_multiset_gcd

The gcd and lcm operations on positive integers correspond to the inf and sup operations on multisets.

pnat.count_factor_multiset

The number of occurrences of p in the factor multiset of m is the same as the p-adic valuation of m.