Numbers of distinct colorings for some concrete examples #
Trivial group #
When using the trivial group, every coloring is equivalent only to itself. The number of distinct colorings is equal to the number of
functions. ⊥ : Subgroup (X ≃ X) denotes the trivial subgroup of X ≃ X.
Necklaces #
We interpret the elements of Fin n as n beads of a necklace, where x is connected to x + 1 and x - 1, computed modulo n.
Necklaces can be rotated, but not reflected. We use the additive group Fin n with multiplicative notation, because our definitions
require a group with multiplicative notation. Elements of Multiplicative (Fin n) are rotations of the necklace, where i : Fin n
rotates the necklace by 2πi/n. We define that there is a single coloring of a necklace with 0 beads. This is defined separately
because Multiplicative (Fin 0) is not a group.
Number of distinct colorings of a necklace with n beads and m colors.
Equations
- Necklaces.numDistinctColoringsOfNecklace 0 x = 1
- Necklaces.numDistinctColoringsOfNecklace n.succ x = DistinctColorings.numDistinctColorings (Fin (n + 1)) (Fin x) (Multiplicative (Fin (n + 1)))
Instances For
Computes the number of distinct colorings of a necklace with n beads and m colors.
Equations
Instances For
computeNumDistinctColoringsOfNecklace computes the number of distinct colorings of a necklace with n beads and m colors.
Bracelets #
We interpret the elements of ZMod n as n beads of a bracelet, where x is connected to x + 1 and x - 1, computed modulo n.
Bracelets can be rotated and reflected. We use the DihedralGroup n, which contains elements r i that rotate the bracelet by 2πi/n
and sr i that rotate the bracelet by 2πi/n and then reflect it. We define that there is a single coloring of a bracelet with 0 beads.
This is defined separately because ZMod 0 is ℤ by definition.
Finite enumeration of ZMod (n + 1). ZMod 0 is ℤ by definition and cannot be finitely enumerated.
Equations
Number of distinct colorings of a bracelet with n beads and m colors.
Equations
- Bracelets.numDistinctColoringsOfBracelet 0 x = 1
- Bracelets.numDistinctColoringsOfBracelet n.succ x = DistinctColorings.numDistinctColorings (ZMod (n + 1)) (Fin x) (DihedralGroup (n + 1))
Instances For
Computes the number of distinct colorings of a bracelet with n beads and m colors.
Equations
Instances For
computeNumDistinctColoringsOfBracelet computes the number of distinct colorings of a bracelet with n beads and m colors.
Cube #
We interpret the elements of Fin 6 as 6 faces of the cube, where:
0is the face at the front,1is the face at the right,2is the face at the back,3is the face at the left,4is the face at the top,5is the face at the bottom.
There are 24 rotational symmetries of the cube.
The rotation of the cube by π/2 around the axis through the centers of the top and bottom faces. The front face moves to the
position of the right face.
Equations
- Cube.r = (↑[0, 1, 2, 3]).formPerm Cube.r.proof_2
Instances For
The rotation of the cube by π/2 around the axis through the centers of the front and back faces. The right face moves to the
position of the top face.
Equations
- Cube.s = (↑[1, 4, 3, 5]).formPerm Cube.s.proof_2
Instances For
The finite set of rotational symmetries of the cube. First, we rotate the cube using s at most three times to set the position of
1. Then, we move 0 to the position of any other face by rotating the cube appropriately. To move 0 to one of the faces in
{0, 1, 2, 3}, we use r the appropriate number of times. To move 0 to 4 or 5, we first use r once to move 0 to 1, then
use s once or three times. Since we can move 0 to any position and 1 to any position adjacent to the new position of 0
(by using s the appropriate number of times in the beginning), we have 6 * 4 = 24 different rotational symmetries. Since we can
infer the new positions of all faces based only on the new positions of 0 and 1, we have obtained all rotational symmetries of the
cube.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Multiplying r by an element of rotationalSymmetriesOfCube results in an element that is in rotationalSymmetriesOfCube.
Multiplying s by an element of rotationalSymmetriesOfCube results in an element that is in rotationalSymmetriesOfCube.
Multiplying sⁿ * rᵐ * sᵏ by an element of rotationalSymmetriesOfCube results in an element that is in rotationalSymmetriesOfCube.
The predicate defined by a ∈ RotationalSymmetriesOfCubeSubgroup is decidable. This instance enables inference of
Fintype RotationalSymmetriesOfCubeSubgroup and guarantees that the number of distinct colorings can be computed.
Equations
Number of distinct colorings of the faces of a cube with n colors.
Equations
Instances For
Computes the number of distinct colorings of the faces of a cube with n colors.
Equations
Instances For
computeNumDistinctColoringsOfCube computes the number of distinct colorings of the faces of a cube with n colors.
Permutation group #
We interpret the elements of Fin n as n unordered, indistinguishable objects. We use the group Equiv.Perm (Fin n), which contains
all permutations of Fin n. Its elements permute our objects. Since we can permute the objects in any way and still obtain an equivalent
configuration, two colorings are equivalent if and only if they assign the same number of objects to each color. Consequently, the number
of distinct colorings of n unordered, indistinguishable objects with m colors is equal to the number of ways to separate n objects
into m ordered sets (the number of weak compositions of n into m parts), which is equal to (n + m - 1).choose (m - 1) when
m > 0. There is exactly one coloring of 0 objects with 0 colors, and no valid colorings of more than 0 objects with 0 colors.
The number of distinct colorings of n unordered, indistinguishable objects with m colors.
Equations
Instances For
The number of weak compositions of n into m parts. This represents the number of ways to separate n objects into m ordered
sets.
Equations
- PermutationGroup.numWeakCompositions 0 0 = 1
- PermutationGroup.numWeakCompositions n.succ 0 = 0
- PermutationGroup.numWeakCompositions x m.succ = (x + m).choose m
Instances For
A function that takes a function f : Fin n → Fin (m + 1) and a proof that f maps no element to m and returns a function of type
Fin n → Fin m that behaves exactly the same as f on all inputs.
Equations
- PermutationGroup.contractCodomain h i = ⟨↑(f i), ⋯⟩
Instances For
A recurrence formula for the number of distinct colorings of a set of n + 1 unordered, indistinguishable objects with m + 1 colors.
It equals the sum of the number of distinct colorings of a set of n + 1 unordered, indistinguishable objects with m colors and the
number of distinct colorings of a set of n unordered, indistinguishable objects with m + 1 colors.
The number of distinct colorings of n unordered, indistinguishable objects with m colors is equal to the number of weak
compositions of n into m parts.