Documentation

PolyaEnumerationTheorem.Concrete

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
Instances For
    @[reducible, inline]

    Computes the number of distinct colorings of a necklace with n beads and m colors.

    Equations
    Instances For

      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.

      Action of the dihedral group on ZMod n. Elements of ZMod n are interpreted as beads of a bracelet. The dihedral group contains elements r i that rotate the bracelet by 2πi/n, and elements sr i that rotate the bracelet by 2πi/n and then reflect it.

      Equations

      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
      Instances For
        @[reducible, inline]

        Computes the number of distinct colorings of a bracelet with n beads and m colors.

        Equations
        Instances For

          Cube #

          We interpret the elements of Fin 6 as 6 faces of the cube, where:

          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
          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
            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
                theorem Cube.s_pow_four :
                Cube.s ^ 4 = 1

                The order of s is 4.

                The inverse of r is .

                The inverse of s is .

                theorem Cube.pow_add_val_eq_of_pow_eq_one {n : } {G : Type u} [Monoid G] {g : G} (hg : g ^ n = 1) (i j : Fin n) :
                g ^ (i + j) = g ^ (i + j)

                If g has order n, then we can reduce its powers modulo n. When its power corresponds to a sum of elements from Fin n, it can be rewritten as the sum of their values.

                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
                @[reducible, inline]

                Number of distinct colorings of the faces of a cube with n colors.

                Equations
                Instances For
                  @[reducible, inline]

                  Computes the number of distinct colorings of the faces of a cube with n colors.

                  Equations
                  Instances For

                    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.

                    @[reducible, inline]

                    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
                      Instances For
                        def PermutationGroup.contractCodomain {n m : } {f : Fin nFin (m + 1)} (h : ∀ (i : Fin n), (f i) m) :
                        Fin nFin m

                        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
                        Instances For
                          def PermutationGroup.expandCodomain {n m : } (f : Fin nFin m) :
                          Fin nFin (m + 1)

                          A function that takes a function f : Fin n → Fin m and returns a function of type Fin n → Fin (m + 1) that behaves exactly the same as f on all inputs.

                          Equations
                          Instances For
                            def PermutationGroup.contractDomain {n m : } (f : Fin (n + 1)Fin m) :
                            Fin nFin m

                            A function that takes a function f : Fin (n + 1) → Fin m and returns a function of type Fin n → Fin m that behaves exactly the same as f on all inputs except for n, which is no longer a valid input.

                            Equations
                            Instances For
                              def PermutationGroup.expandDomain {n m : } (f : Fin nFin (m + 1)) :
                              Fin (n + 1)Fin (m + 1)

                              A function that takes a function f : Fin n → Fin (m + 1) and returns a function of type Fin (n + 1) → Fin (m + 1) that behaves exactly the same as f on all inputs except at n, where it returns m.

                              Equations
                              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.