Embrace Multisets: Prime Factorization, GCD, and LCM
Target Audience: Students of mathematics, or computer science in their second semester or higher; or more senior students who want to see applications of multisets. Only surface knowledge of algebra required.
Abstract
This article is the first of a series devoted to highlighting multisets and their occurrences throughout undergraduate mathematics.
For natural numbers, the concepts of prime factorization, divisibility, greatest common divisor (
We focus on expressing these correspondences algebraically.
We recap the theory of lattices and obtain a lattice-isomorphism
Table of Contents
1 Introduction
The central idea is the following.
Every natural number
This article is driven by the following questions:
Can we say more than
Indeed, we will see that
Overview. We rigorously define multisets and their operations in Section 2.1.
In Section 2.2 we recap the theory of lattices and detail the lattices involved above.
Then, in Section 3 we prove our main theorem showing
2 Preliminaries
We work in the usual metamathematical layer and remain vague about our foundation. We, however, do presuppose some kind of set theory, e.g. ZF. To avoid confusion with multisets later, let us refer to sets from the designated set theory as classical sets, and to multisets always as multisets.
2.1 Multisets
2.1.1 Definitions
Classical sets are βcollections of objectsβ without order and without duplicates.
That is, an object is either element of a classical or is it not.
Multisets, which have been folklore for long time, lift the latter requirement and instead attach
to every element a multiplicity.
For our purposes, we define multiplicities to be integers.
Other domains may call for different choices,
e.g. fuzzy sets, where elementhood is interpreted probabilistically, can be seen as multisets with multiplicities in
Definition 2.1 [1]: A multiset is a pair
, where is a classical set and a function. For
, we say has multiplicity , or equivalently, occurs times in . If it is clear from context, we write
instead of .
Every classical set
We would like to treat two multisets as equal even if their associated functions
do not have a common domain, e.g. it should hold
Definition 2.2: Given two multisets
, we define
- the union
- the intersection
- the symmetric difference
- the negative
- the difference
where we take
and to be if lies outside their domain, respectively.
For example, we have:
Definition 2.3: We say
is finite if only for finitely many .
In the sequel, we will be working with multisets that may only contain prime numbers. In general, almost always we only work with multisets over a designated classical set, as defined below.
Definition 2.4 (Multisets over a Classical Set): Let
be a classical set. Then, define
to be the classical set of all finite multisets with elements only in . to be subset of where we only allow non-negative multiplicities.
2.1.2 Prime Factorization as a Multiset
For the rest of this article, let
Overall, this gives rise to the bijections
We have the following exemplary correspondences:
concept on β | example on β | example on | concept on |
---|---|---|---|
number | multiset of primes | ||
number | multiset of primes | ||
multiplication | union | ||
greatest common divisor | intersection | ||
least common multiple | symmetric difference |
These correspondences hold in general:
Remark 2.5: The division
of two natural numbers over β corresponds to multiset difference only if its result is a natural number again. For example,
but, depending on your definition,
, whereas corresponds to not a single natural number as it contains elements with negative multiplicities.
2.1.3 Technical Lemmas
In the following, we collect some technical lemmas concerning multisets. Of central interest for the proofs of our main theorems will be Lemmas 2.7 β 2.9.
Lemma 2.6:
- Union, intersection, symmetric difference are commutative and associative operations.
- The negative is an involution.
Click for proof
Immediate by definition.
Immediate by definition.
Immediate by definition.
The equalities amount to showing
Both identities are general properties of
following by case analysis with cases and .By dualization of point 4. β
Lemma 2.7: Intersection and symmetric difference are related as follows:
Click for proof
We have to show
This follows by a rather tedious, but straightforward case analysis on the 6 cases of all total orders possible on
.By dualization of point 1.
β
The theory of multisets also admits the decomposition theorem below, splitting a multiset into elements of positive and of negative multiplicity. We note that this theorem comes at no surprise given that we proved the negative to be an involution β since generally in mathematics, involutions often go hand-in-hand with decomposition theorems.
Lemma 2.8 (Sign Decomposition): Let
be a multiset, then with
- positive part
and - negative part
We can express intersection and symmetric difference using sign decompositions as follows.
Lemma 2.9: Let
and be multisets, then
The proofs of the latter two lemmas are left to the reader. Note that the second point of Lemma 2.9 follows by duality from the first point.
2.2 Lattices
Recall we equipped the natural numbers with
Let us begin with some motivation. Roughly, we can think of (mathematical) lattices as modeling real-world lattices such as the one in Figure 1.
Intuitively, a real-world lattice has two characteristics: its collection of nodal points and its mesh structure.
How we encode this in mathematics?
Straightforwardly, we encode the former as a classical set
Let us better understand those unique points and operations by means of the lattice in Figure 1.
Imagine you are standing on
Spoiler
With the imaginery above, it is also clear meet and join ought to be commutative and associative operations.
Here, associativity says that when three people
Definition 2.10: A lattice is a structure
consisting of a classical set and two commutative and associative operations fulfilling the absorption laws
We leave it to the reader to motivate and prove the absorption laws in context of Figure 1.
Thus,
Remark 2.11: Lattices can be equivalently described from an order-theoretical perspective: lattices are partially ordered classical sets where each the classical set possseses a greatest lower bound (also: meet) and least upper bound (join) for every two-element subset
. We refer to Wikipedia for a definition of these bounds. It often helps to think of lattices in terms of both the algebraic and order-theoretical perspective. The example lattice from above corresponds to
partially ordered by In particular, lattices are usually drawn as Hasse diagrams, as was done in Figure 1: every upwards edge stands for .
Remark 2.12: Lattice in which additionally meet and join distribute over each other, as below, are called distributive lattices.
2.2.1 Divison Lattice on β
Given two natural numbers
Lemma 2.13 (Division Lattice on β):
is a lattice.
See Figure 2 for a partial visualization of
Remark 2.14: In the division lattice on β, the element 1 has the property that it divides every other number, i.e., order-theoretically
for all . Lattices that possess such a bottom element are called lower-bounded lattices.

2.2.2 Multiset Lattices
Let

Theorem 2.15 (Multiset Lattices): Let
be a classical set.
is a distributive lattice.
is a distributive sublattice with bottom
We leave the proof to the reader.
Remark 2.16: On first sight, the reader might wonder why the join operation for the multiset lattice is symmetric difference and not union. After all, in contrast, with classical sets all subsets of
form a lattice wrt. classical intersection and classical union. This lattice is known as the powerset lattice. When generalizing to multisets, however, the classical union must not become multiset, but instead symmetric difference. This can be seen in the example from above: the join of
and is . It is clear that the latter is the order-theoretical join (wrt. given above). A multiset union of both operands would result in , counting three times. The symmetric difference avoids such overcounting.
Remark 2.17: Ignoring size issues of the chosen set theory, the class of all multisets would form a lattice, too.
3 Divison Lattice on β β Positive Finite Multisets over β
With the preliminaries done, we can finally state and prove our main theorem: the division lattice on β can be identified with the lattice of positive finite multisets over primes.
Theorem 3.1:
as lower-bounded lattices, where
maps natural numbers to their prime factorization maps multisets of primes to their multiplication Moreover, multiplication is preserved and reflected as multiset union:
Click for proof
We noted above that
Let us first recall some helper lemmas from elementary number theory.
For
It immediately follows that
meets,
and joins:
Finally
4 Division lattice on ββΊ β Finite Multisets over β
We have seen
Before defining
Definition 4.1 (Prime Factorization of Rational Numbers): Let
be a rational number with reduced fraction representation with . Let and be the prime factorizations of and with . Then, we call the prime factorization of . By convention, we set
.
This allows identifying rational numbers with multisets of their prime factors. In contrast to earlier discussions, we must now allow multiplicities in β€.
Definition 4.2 (Lattice on ββΊ): Define the lattice
with
Here, we overload the names of
For example, we have
Theorem 4.3:
as lattices, where
maps rational numbers to their prime factorization maps multisets of primes to their multiplication Moreover, multiplication and division are preserved and reflected as follows:
Again, we overload the names of
Click for proof
We noted above that
Similar to the proof of Theorem 3.1, let us first recall some (generalized) helper lemmas from elementary number theory.
For
From these identities, it immediately follows that
To arrive at line
Preservation of joins is proved analogously. β
5 Future Work
Both of our main theorems 3.1 and 4.3 state a lattice isomorphism to capture
the correspondence between
We will answer this affirmatively in a future post, namely with lattice-ordered monoids and lattice-ordered groups.
TODO for Author
- Delta has wrong spacing because itβs not a binary operator for tex
- Answer here: https://math.stackexchange.com/questions/151081/gcd-of-rationals
- D Loeb, βSets with a negative number of elementsβ https://www.sciencedirect.com/science/article/pii/0001870892900119?via%3Dihub ^