diff --git a/_freeze/posts/chebyshev/1/index/execute-results/html.json b/_freeze/posts/chebyshev/1/index/execute-results/html.json new file mode 100644 index 0000000..3914367 --- /dev/null +++ b/_freeze/posts/chebyshev/1/index/execute-results/html.json @@ -0,0 +1,12 @@ +{ + "hash": "f0d1956695c45b1ca4b803d88c0a4bf5", + "result": { + "engine": "jupyter", + "markdown": "---\ntitle: \"Generating Polynomials, Part 1: Regular Constructibility\"\ndescription: |\n What kinds of regular polygons are constructible with compass and straightedge?\nformat:\n html:\n html-math-method: katex\ndate: \"2021-08-18\"\ndate-modified: \"2025-06-17\"\ncategories:\n - geometry\n - generating functions\n - algebra\n - python\n---\n\n\n\n\n\n[Recently](/posts/misc/platonic-volume), I used coordinate-free geometry to derive\n the volumes of the Platonic solids, a problem which was very accessible to the ancient Greeks.\nOn the other hand, they found certain problems regarding which figures can be constructed via\n compass and straightedge to be very difficult. For example, they struggled with problems\n like [doubling the cube](https://en.wikipedia.org/wiki/Doubling_the_cube)\n or [squaring the circle](https://en.wikipedia.org/wiki/Squaring_the_circle),\n which are known (through circa 19th century mathematics) to be impossible.\nHowever, before even extending planar geometry by a third dimension or\n calculating the areas of circles, a simpler problem becomes apparent.\nNamely, what kinds of regular polygons are constructible?\n\n\nRegular Geometry and a Complex Series\n-------------------------------------\n\nWhen constructing a regular polygon, one wants a ratio between the length of a edge\n and the distance from a vertex to the center of the figure.\n\n![\n Regular triangle, square, and pentagons inscribed in a unit circle.\n Note the right triangle formed by the apothem, half of an edge, and circumradius.\n](./central_angle_figures.png){.wide}\n\nIn a convex polygon, the total central angle is always one full turn, or 2π radians.\nThe central angle of a regular *n*-gon is ${2\\pi \\over n}$ radians,\n and the green angle above (which we'll call *θ*) is half of that.\nThis means that the ratio we're looking for is $\\sin(\\theta) = \\sin(\\pi / n)$.\nWe can multiply by *n* inside the function on both sides to give\n $\\sin(n\\theta) = \\sin(\\pi) = 0$.\nTherefore, constructing a polygon is actually equivalent to solving this equation,\n and we can rephrase the question as how to express $\\sin(n\\theta)$ (and $\\cos(n\\theta)$).\n\n\n### Complex Recursion\n\nThanks to [Euler's formula](https://en.wikipedia.org/wiki/Euler%27s_formula)\n and [de Moivre's formula](https://en.wikipedia.org/wiki/De_Moivre%27s_formula),\n the expressions we're looking for can be phrased in terms of the complex exponential.\n\n$$\n\\begin{align*}\n e^{i\\theta}\n &= \\text{cis}(\\theta) = \\cos(\\theta) + i\\sin(\\theta)\n & \\text{ Euler's formula}\n \\\\\n \\text{cis}(n \\theta) = e^{i(n\\theta)}\n &= e^{(i\\theta)n} = {(e^{i\\theta})}^n = \\text{cis}(\\theta)^n\n \\\\\n \\cos(n \\theta) + i\\sin(n \\theta)\n &= (\\cos(\\theta) + i\\sin(\\theta))^n\n & \\text{ de Moivre's formula}\n\\end{align*}\n$$\n\nDe Moivre's formula for $n = 2$ gives\n\n$$\n\\begin{align*}\n \\text{cis}(\\theta)^2\n &= (\\text{c} + i\\text{s})^2\n \\\\\n &= \\text{c}^2 + 2i\\text{cs} - \\text{s}^2 + (0 = \\text{c}^2 + \\text{s}^2 - 1)\n \\\\\n &= 2\\text{c}^2 + 2i\\text{cs} - 1\n \\\\\n &= 2\\text{c}(\\text{c} + i\\text{s}) - 1\n \\\\\n &= 2\\cos(\\theta)\\text{cis}(\\theta) - 1\n\\end{align*}\n$$\n\nThis can easily be massaged into a recurrence relation.\n\n$$\n\\begin{align*}\n \\text{cis}(\\theta)^2\n &= 2\\cos(\\theta)\\text{cis}(\\theta) - 1\n \\\\\n \\text{cis}(\\theta)^{n+2}\n &= 2\\cos(\\theta)\\text{cis}(\\theta)^{n+1} - \\text{cis}(\\theta)^n\n \\\\\n \\text{cis}((n+2)\\theta)\n &= 2\\cos(\\theta)\\text{cis}((n+1)\\theta) - \\text{cis}(n\\theta)\n\\end{align*}\n$$\n\nRecurrence relations like this one are powerful.\nThrough some fairly straightforward summatory manipulations,\n the sequence can be interpreted as the coefficients in a Taylor series,\n giving a [generating function](https://en.wikipedia.org/wiki/Generating_function).\nCall this function *F*. Then,\n\n$$\n\\begin{align*}\n \\sum_{n=0}^\\infty \\text{cis}((n+2)\\theta)x^n\n &= 2\\cos(\\theta) \\sum_{n=0}^\\infty \\text{cis}((n+1)\\theta) x^n\n - \\sum_{n=0}^\\infty \\text{cis}(n\\theta) x^n\n \\\\\n {F(x; \\text{cis}(\\theta)) - 1 - x\\text{cis}(\\theta) \\over x^2}\n &= 2\\cos(\\theta) {F(x; \\text{cis}(\\theta)) - 1 \\over x}\n - F(x; \\text{cis}(\\theta))\n \\\\[10pt]\n F - 1 - x\\text{cis}(\\theta)\n &= 2\\cos(\\theta) x (F - 1)\n - x^2 F\n \\\\\n F - 2\\cos(\\theta) x F + x^2 F\n &= 1 + x(\\text{cis}(\\theta) - 2\\cos(\\theta))\n \\\\[10pt]\n F(x; \\text{cis}(\\theta))\n &= {1 + x(\\text{cis}(\\theta) - 2\\cos(\\theta)) \\over\n 1 - 2\\cos(\\theta)x + x^2}\n\\end{align*}\n$$\n\nSince $\\text{cis}$ is a complex function, we can separate *F* into real and imaginary parts.\nConveniently, these correspond to $\\cos(n\\theta)$ and $\\sin(n\\theta)$, respectively.\n\n$$\n\\begin{align*}\n \\Re[ F(x; \\text{cis}(\\theta)) ]\n &= {1 + x(\\cos(\\theta) - 2\\cos(\\theta)) \\over 1 - 2\\cos(\\theta)x + x^2}\n \\\\\n &= {1 - x\\cos(\\theta) \\over 1 - 2\\cos(\\theta)x + x^2} = A(x; \\cos(\\theta))\n \\\\\n \\Im[ F(x; \\text{cis}(\\theta)) ]\n &= {x \\sin(\\theta) \\over 1 - 2\\cos(\\theta)x + x^2} = B(x; \\cos(\\theta))\\sin(\\theta)\n\\end{align*}\n$$\n\nIn this form, it becomes obvious that the even though the generating function *F* was originally\n parametrized by $\\text{cis}(\\theta)$, *A* and *B* are parametrized only by $\\cos(\\theta)$.\nExtracting the coefficients of *x* yields an expression for $\\cos(n\\theta)$ and $\\sin(n\\theta)$\n in terms of $\\cos(\\theta)$ (and in the latter case, a common factor of $\\sin(\\theta)$).\n\nIf $\\cos(\\theta)$ in *A* and *B* is replaced with the parameter *z*, then all trigonometric functions\n are removed from the equation, and we are left with only polynomials[^1].\nThese polynomials are [*Chebyshev polynomials*](https://en.wikipedia.org/wiki/Chebyshev_polynomial)\n *of the first (A) and second (B) kind*.\nIn actuality, the polynomials of the second kind are typically offset by 1\n (the x in the numerator of *B* is omitted).\nHowever, retaining this term makes indexing consistent between *A* and *B*\n (and will make things clearer later).\n\n[^1]:\n This can actually be observed as early as the recurrence relation.\n\n $$\n \\begin{align*}\n \\text{cis}(\\theta)^{n+2}\n &= 2\\cos(\\theta)\\text{cis}(\\theta)^{n+1} - \\text{cis}(\\theta)^n\n \\\\\n a_{n+2}\n &= 2 z a_{n+1} - a_n\n \\\\\n \\Re[ a_0 ]\n &= 1,~~ \\Im[ a_0 ] = 0\n \\\\\n \\Re[ a_1 ]\n &= z,~~ \\Im[ a_1 ] = 1 \\cdot \\sin(\\theta)\n \\end{align*}\n $$\n\n\nWe were primarily interested in $\\sin(n\\theta)$, so let's tabulate\n the first few polynomials of the second kind (at $z / 2$).\n\n::: {#tbl-chebyshevu .cell .plain tbl-cap='[OEIS A049310](http://oeis.org/A049310)' execution_count=3}\n\n::: {.cell-output .cell-output-display .cell-output-markdown execution_count=2}\n*n* $[x^n]B(x; z / 2) = U_{n - 1}(z / 2)$ Factored\n----- --------------------------------------------- -------------------------------------------------------------------------------------------------\n0 $0$ $0$\n1 $1$ $1$\n2 $z$ $z$\n3 $z^{2} - 1$ $\\left(z - 1\\right) \\left(z + 1\\right)$\n4 $z^{3} - 2 z$ $z \\left(z^{2} - 2\\right)$\n5 $z^{4} - 3 z^{2} + 1$ $\\left(z^{2} - z - 1\\right) \\left(z^{2} + z - 1\\right)$\n6 $z^{5} - 4 z^{3} + 3 z$ $z \\left(z - 1\\right) \\left(z + 1\\right) \\left(z^{2} - 3\\right)$\n7 $z^{6} - 5 z^{4} + 6 z^{2} - 1$ $\\left(z^{3} - z^{2} - 2 z + 1\\right) \\left(z^{3} + z^{2} - 2 z - 1\\right)$\n8 $z^{7} - 6 z^{5} + 10 z^{3} - 4 z$ $z \\left(z^{2} - 2\\right) \\left(z^{4} - 4 z^{2} + 2\\right)$\n9 $z^{8} - 7 z^{6} + 15 z^{4} - 10 z^{2} + 1$ $\\left(z - 1\\right) \\left(z + 1\\right) \\left(z^{3} - 3 z - 1\\right) \\left(z^{3} - 3 z + 1\\right)$\n10 $z^{9} - 8 z^{7} + 21 z^{5} - 20 z^{3} + 5 z$ $z \\left(z^{2} - z - 1\\right) \\left(z^{2} + z - 1\\right) \\left(z^{4} - 5 z^{2} + 5\\right)$\n:::\n:::\n\n\nEvaluating the polynomials at $z / 2$ cancels the 2 in the denominator (and recurrence),\n making these expressions much simpler.\nThis evaluation has an interpretation in terms of the previous diagram --\n recall we used *half* the length of a side as a leg of the right triangle.\nFor a unit circumradius, the side length itself is then $2\\sin( {\\pi / n} )$.\nTo compensate for this doubling, the Chebyshev polynomial must be evaluated at half its normal argument.\n\n\n### Back on the Plane\n\nThe constructibility criterion is deeply connected to the Chebyshev polynomials.\nIn compass and straightedge constructions, one only has access to linear forms (lines)\n and quadratic forms (circles).\nThis means that a figure is constructible if and only if the root can be expressed using\n normal arithmetic (which is linear) and square roots (which are quadratic).\n\n\n#### Pentagons\n\nLet's look at a regular pentagon.\nThe relevant polynomial is\n\n$$\n[x^5]B ( x; z / 2 )\n = z^4 - 3z^2 + 1\n = (z^2 - z - 1) (z^2 + z - 1)\n$$\n\nAccording to how we derived this series, when $z = 2\\cos(\\theta)$, the roots of this polynomial\n correspond to when $\\sin(5\\theta) / \\sin(\\theta) = 0$.\nThis relation itself is true when $\\theta = \\pi / 5$, since $\\sin(5 \\pi / 5) = 0$.\n\nOne of the factors must therefore be the minimal polynomial of $2\\cos(\\pi / 5 )$.\nThe former happens to be correct correct, since $2\\cos( \\pi / 5 ) = \\varphi$, the golden ratio.\nNote that the second factor is the first evaluated at -*z*.\n\n\n#### Heptagons\n\nAn example of where constructability fails is for $2\\cos( \\pi / 7 )$.\n\n$$\n\\begin{align*}\n [x^7]B ( x; z / 2 )\n &= z^6 - 5 z^4 + 6 z^2 - 1\n \\\\\n &= ( z^3 - z^2 - 2 z + 1 ) ( z^3 + z^2 - 2 z - 1 )\n\\end{align*}\n$$\n\nWhichever is the minimal polynomial (the former), it is a cubic, and constructing\n a regular heptagon is equivalent to solving it for *z*.\nBut there are no (nondegenerate) cubics that one can produce via compass and straightedge,\n and all constructions necessarily fail.\n\n\n#### Decagons\n\nOne might think the same of $2\\cos(\\pi /10 )$\n\n$$\n\\begin{align*}\n [x^{10}]B ( x; z / 2 )\n &= z^9 - 8 z^7 + 21 z^5 - 20 z^3 + 5 z\n \\\\\n &= z ( z^2 - z - 1 )( z^2 + z - 1 )( z^4 - 5 z^2 + 5 )\n\\end{align*}\n$$\n\nThis expression also contains the polynomials for $2\\cos( \\pi / 5 )$.\nThis is because a regular decagon would contain two disjoint regular pentagons,\n produced by connecting every other vertex.\n\n![\n  \n](./decagon_divisible.png)\n\nThe polynomial which actually corresponds to $2\\cos( \\pi / 10 )$ is the quartic,\n which seems to suggest that it will require a fourth root and somehow decagons are not constructible.\nHowever, it can be solved by completing the square...\n\n$$\n\\begin{align*}\n z^4 - 5z^2 &= -5\n \\\\\n z^4 - 5z^2 + (5/2)^2 &= -5 + (5/2)^2\n \\\\\n ( z^2 - 5/2)^2 &= {25 - 20 \\over 4}\n \\\\\n ( z^2 - 5/2) &= {\\sqrt 5 \\over 2}\n \\\\\n z^2 &= {5 \\over 2} + {\\sqrt 5 \\over 2}\n \\\\\n z &= \\sqrt{ {5 + \\sqrt 5 \\over 2} }\n\\end{align*}\n$$\n\n...and we can breathe a sigh of relief.\n\n\nThe Triangle behind Regular Polygons\n------------------------------------\n\nPreferring *z* to be halved in $B(x; z/2)$ makes something else more evident.\nObserve these four rows of the Chebyshev polynomials\n\n::: {#273cfec0 .cell .plain execution_count=4}\n\n::: {.cell-output .cell-output-display .cell-output-markdown execution_count=3}\n*n* $[x^n]B(x; z / 2)$ *k* $[z^{k}][x^n]B(x; z / 2)$\n----- ------------------------------- ----- ---------------------------\n4 $z^{3} - 2 z$ 3 1\n5 $z^{4} - 3 z^{2} + 1$ 2 -3\n6 $z^{5} - 4 z^{3} + 3 z$ 1 3\n7 $z^{6} - 5 z^{4} + 6 z^{2} - 1$ 0 -1\n:::\n:::\n\n\nThe last column looks like an alternating row of Pascal's triangle\n (namely, ${n - \\lfloor {k / 2} \\rfloor - 1 \\choose k}(-1)^k$).\nThis resemblance can be made more apparent by listing the coefficients of the polynomials in a table.\n\n::: {#92d420a6 .cell .plain execution_count=5}\n\n::: {.cell-output .cell-output-display .cell-output-markdown execution_count=4}\n n $z^9$ $z^8$ $z^7$ $z^6$ $z^5$ $z^4$ $z^3$ $z^2$ $z$ $1$\n--- ------------------------------ ------------------------------------ ------------------------------------- ----------------------------------- ----------------------------------- ----------------------------------- ------------------------------------ ------------------------------------- ------------------------------------- -------------------------------------\n 1 1\n 2 1 0\n 3 1 0 -1\n 4 1 0 -2 0\n 5 1 0 -3 0 1\n 6 1 0 -4 0 3 0\n 7 1 0 -5 0 6 0 -1\n 8 1 0 -6 0 10 0 -4 0\n 9 1 0 -7 0 15 0 -10 0 1\n 10 1 0 -8 0 21 0 -20 0 5 0\n:::\n:::\n\n\nThough they alternate in sign, the rows of Pascal's triangle appear along diagonals,\n which I have marked in rainbow.\nMeanwhile, alternating versions of the naturals (1, 2, 3, 4...),\n the triangular numbers (1, 3, 6, 10...),\n the tetrahedral numbers (1, 4, 10, 20...), etc.\n are present along the columns, albeit spaced out by 0's.\n\nThe relationship of the Chebyshev polynomials to the triangle is easier to see if\n the coefficient extraction of $B(x; z / 2)$ is reversed.\nIn other words, we extract *z* before extracting *x*.\n\n$$\n\\begin{align*}\n B(x; z / 2) &= {x \\over 1 - zx + x^2}\n = {x \\over 1 + x^2 - zx}\n = {x \\over 1 + x^2}\n \\cdot {1 \\over {1 + x^2 \\over 1 + x^2} - z{x \\over 1 + x^2}}\n \\\\[10pt]\n [z^n]B(x; z / 2) &= {x \\over 1 + x^2} [z^n] {1 \\over 1 - z{x \\over 1 + x^2}}\n = {x \\over 1 + x^2} \\left( {x \\over 1 + x^2} \\right)^n\n \\\\\n &= \\left( {x \\over 1 + x^2} \\right)^{n+1}\n = x^{n+1} (1 + x^2)^{-n - 1}\n \\\\\n &= x^{n+1} \\sum_{k=0}^\\infty {-n - 1 \\choose k}(x^2)^k\n \\quad \\text{Binomial theorem}\n\\end{align*}\n$$\n\nWhile the use of the binomial theorem is more than enough to justify\n the appearance of Pascal's triangle (along with explaining the 0's),\n I'll simplify further to explicitly show the alternating signs.\n\n$$\n\\begin{align*}\n {(-n - 1)_k} &= (-n - 1)(-n - 2) \\cdots (-n - k)\n \\\\\n &= (-1)^k (n + k)(n + k - 1) \\cdots (n + 1)\n \\\\\n &= (-1)^k (n + k)_k\n \\\\\n \\implies {-n - 1 \\choose k}\n &= {n + k \\choose k}(-1)^k\n \\\\[10pt]\n [z^n]B(x; z / 2)\n &= x^{n+1} \\sum_{k=0}^\\infty {n + k \\choose k} (-1)^k x^{2k}\n\\end{align*}\n$$\n\nSquinting hard enough, the binomial coefficient is similar to the earlier\n which gave the third row of Pascal's triangle.\nIf k is fixed, then this expression actually generates the antidiagonal entries\n of the coefficient table, which are the columns with uniform sign.\nThe alternation instead occurs between antidiagonals (one is all positive,\n the next is 0's, the next is all negative, etc.).\nThe initial $x^{n+1}$ lags these sequences so that they reproduce the triangle.\n\n\n### Imagined Transmutation\n\nThe generating function of the Chebyshev polynomials resembles other two term recurrences.\nFor example, the Fibonacci numbers have generating function\n\n$$\n\\sum_{n = 0}^\\infty \\text{Fib}_n x^n = {1 \\over 1 - x - x^2}\n$$\n\nThis resemblance can be made explicit with a simple algebraic manipulation.\n\n$$\n\\begin{align*}\n B(ix; -iz / 2)\n &= {1 \\over 1 -\\ (-i z)(ix) + (ix)^2}\n = {1 \\over 1 -\\ (-i^2) z x + (i^2)(x^2)}\n \\\\\n &= {1 \\over 1 -\\ z x -\\ x^2}\n\\end{align*}\n$$\n\nIf $z = 1$, these two generating functions are equal.\nThe same can be said for $z = 2$ with the generating function of the Pell numbers,\n and so on for higher recurrences (corresponding to metallic means) for higher integral *z*.\n\nIn terms of the Chebyshev polynomials, this series manipulation removes the alternation in\n the coefficients of $U_n$, restoring Pascal's triangle to its nonalternating form.\nRelated to the previous point, it is possible to find the Fibonacci numbers (Pell numbers, etc.)\n in Pascal's triangle, which you can read more about\n [here](http://users.dimi.uniud.it/~giacomo.dellariccia/Glossary/Pascal/Koshy2011.pdf).\n\n\nManipulating the Series\n-----------------------\n\nLook back to the table of $U_{n - 1}(z / 2)$ (@tbl-chebyshevu).\nWhen I brought up $U_{10 - 1}(z / 2)$ and decagons, I pointed out their relationship to pentagons\n as an explanation for why $U_{5 -\\ 1}(z / 2)$ appears as a factor.\nConveniently, $U_{2 -\\ 1}(z / 2) = z$ is also a factor, and 2 is likewise a factor of 10.\n\nThis pattern is present throughout the table; $n = 6$ contains factors for\n $n = 2 \\text{ and } 3$ and the prime numbers have no smaller factors.\nIf this observation is legitimate, call the newest term $f_n(z)$\n and denote $p_n(z) = U_{n -\\ 1}( z / 2 )$.\n\n\n### Factorization Attempts\n\nThe relationship between $p_n$ and the intermediate $f_d$, where *d* is a divisor of *n*,\n can be made explicit by a [Möbius inversion](https://en.wikipedia.org/wiki/M%C3%B6bius_inversion_formula).\n\n$$\n\\begin{align*}\n p_n(z) &= \\prod_{d|n} f_n(z)\n \\\\\n \\log( p_n(z) )\n &= \\log \\left( \\prod_{d|n} f_d(z) \\right)\n = \\sum_{d|n} \\log( f_d(z) )\n \\\\\n \\log( f_n(z) ) &= \\sum_{d|n} { \\mu \\left({n \\over d} \\right)}\n \\log( p_d(z) )\n \\\\\n f_n(z) &= \\prod_{d|n} p_d(z)^{ \\mu (n / d) }\n \\\\[10pt]\n f_6(z) = g_6(z)\n &= p_6(z)^{\\mu(1)}\n p_3(z)^{\\mu(2)}\n p_2(z)^{\\mu(3)}\n \\\\\n &= {p_6(z) \\over p_3(z) p_2(z)}\n\\end{align*}\n$$\n\nUnfortunately, it's difficult to apply this technique across our whole series.\nMöbius inversion over series typically uses more advanced generating functions such as\n [Dirichlet series](https://en.wikipedia.org/wiki/Dirichlet_series#Formal_Dirichlet_series)\n or [Lambert series](https://en.wikipedia.org/wiki/Lambert_series).\nHowever, naively reaching for these fails for two reasons:\n\n- We built our series of polynomials on a recurrence relation, and these series\n are opaque to such manipulations.\n- To do a proper Möbius inversion, we need these kinds of series over the *logarithm*\n of each polynomial (*B* is a series over the polynomials themselves).\n\nIgnoring these (and if you're in the mood for awful-looking math) you may note\n the Lambert equivalence[^2]:\n\n[^2]:\n This equivalence applies to other polynomial series obeying the same factorization rule\n such as the [cyclotomic polynomials](https://en.wikipedia.org/wiki/Cyclotomic_polynomial).\n\n$$\n\\begin{align*}\n \\log( p_n(z) )\n &= \\sum_{d|n} \\log( f_d(z) )\n \\\\\n \\sum_{n = 1}^\\infty \\log( p_n ) x^n\n &= \\sum_{n = 1}^\\infty \\sum_{d|n} \\log( f_d ) x^n\n \\\\\n &= \\sum_{k = 1}^\\infty \\sum_{m = 1}^\\infty \\log( f_m ) x^{m k}\n \\\\\n &= \\sum_{m = 1}^\\infty \\log( f_m ) \\sum_{k = 1}^\\infty (x^m)^k\n \\\\\n &= \\sum_{m = 1}^\\infty \\log( f_m ) {x^m \\over 1 - x^m}\n\\end{align*}\n$$\n\nEither way, the number-theoretic properties of this sequence are difficult to ascertain\n without advanced techniques.\nIf research has been done, it is not easily available in the OEIS.\n\n\n### Total Degrees\n\nIt can be also be observed that the new term is symmetric ($f(z) = f(-z)$), and is therefore\n either irreducible or the product of polynomial and its reflection (potentially negated).\nFor example,\n\n$$\np_9(z) = \\left\\{\n\\begin{matrix}\n (z - 1)(z + 1)\n & \\cdot\n & (z^3 - 3z - 1)(z^3 - 3z + 1)\n \\\\\n \\shortparallel && \\shortparallel\n \\\\\n f_3(z)\n & \\cdot\n & f_9(z)\n \\\\\n \\shortparallel && \\shortparallel\n \\\\\n g_3(z) \\cdot g_3(-z)\n & \\cdot\n & g_9(z) \\cdot -g_9(-z)\n\\end{matrix}\n\\right.\n$$\n\nThese factor polynomials $g_n$ are the minimal polynomials of $2\\cos( \\pi / n )$.\n\nMultiplying these minimal polynomials by their reflection can be observed in the Chebyshev polynomials\n for $n = 3, 5, 7, 9$, strongly implying that it occurs on the odd terms.\nAssuming this is true, we have\n\n$$\nf_n(z) = \\begin{cases}\n g_n(z) & \\text{$n$ is even}\n \\\\\n g_n(z)g_n(-z)\n & \\text{$n$ is odd and ${\\deg(f_n) \\over 2}$ is even}\n \\\\\n -g_n(z)g_n(-z)\n & \\text{$n$ is odd and ${\\deg(f_n) \\over 2}$ is odd}\n\\end{cases}\n$$\n\nWithout resorting to any advanced techniques, the degrees of $f_n$ are\n not too difficult to work out.\nThe degree of $p_n(z)$ is $n -\\ 1$, which is also the degree of $f_n(z)$ if *n* is prime.\nIf *n* is composite, then the degree of $f_n(z)$ is $n -\\ 1$ minus the degrees\n of the divisors of $n -\\ 1$.\nThis leaves behind how many numbers less than *n* are coprime to *n*.\nTherefore $\\deg(f_n) = \\phi(n)$, the\n [Euler totient function](https://en.wikipedia.org/wiki/Euler_totient_function) of the index.\n\nThe totient function can be used to examine the parity of *n*.\nIf *n* is odd, it is coprime to 2 and all even numbers.\nThe introduced factor of 2 to 2*n* removes the evens from the totient, but this is compensated by\n the addition of the odd multiples of old numbers coprime to *n* and new primes.\nThis means that $\\phi(2n) = \\phi(n)$ for odd *n* (other than 1).\n\nThe same argument can be used for even *n*: there are as many odd numbers from 0 to *n* as there are\n from *n* to 2*n*, and there are an equal number of numbers coprime to 2*n* in either interval.\nTherefore, $\\phi(2n) = 2\\phi(n)$ for even *n*.\n\nThis collapses all cases of the conditional factorization of $f_n$ into one,\n and the degrees of $g_n$ are\n\n$$\n\\begin{align*}\n \\deg( g_n(z) )\n &= \\begin{cases}\n \\deg( f_n(z) )\n = \\phi(n)\n & n \\text{ is even} & \\implies \\phi(n) = \\phi(2n) / 2\n \\\\\n \\deg( f_n(z) ) / 2\n = \\phi(n) / 2\n & n \\text{ is odd} & \\implies \\phi(n) / 2 = \\phi(2n) / 2\n \\end{cases}\n \\\\\n &= \\varphi(2n) / 2\n\\end{align*}\n$$\n\nThough they were present in the earlier Chebyshev table,\n the $g_n$ themselves are presented again, along with the expression for their degree\n\n::: {#835a5369 .cell .plain execution_count=6}\n\n::: {.cell-output .cell-output-display .cell-output-markdown execution_count=5}\nn $\\varphi(2n)/2$ $g_n(z)$ Coefficient list, rising powers\n--- --------------------------------------- ------------------------- ---------------------------------------\n2 1 $z$ [0, 1]\n3 1 $z - 1$ [-1, 1]\n4 2 $z^{2} - 2$ [-2, 0, 1]\n5 2 $z^{2} - z - 1$ [-1, -1, 1]\n6 2 $z^{2} - 3$ [-3, 0, 1]\n7 3 $z^{3} - z^{2} - 2 z + 1$ [1, -2, -1, 1]\n8 4 $z^{4} - 4 z^{2} + 2$ [2, 0, -4, 0, 1]\n9 3 $z^{3} - 3 z - 1$ [-1, -3, 0, 1]\n9 3 $z^{3} - 3 z + 1$ [1, -3, 0, 1]\n10 4 $z^{4} - 5 z^{2} + 5$ [5, 0, -5, 0, 1]\n- [OEIS A055034](http://oeis.org/A055034) - [OEIS A187360](http://oeis.org/A187360)\n:::\n:::\n\n\nClosing\n-------\n\nMy initial jumping off point for writing this article was completely different.\nHowever, in the process of writing, its share of the article shrank and shrank until its\n introduction was only vaguely related to what preceded it.\nBut alas, the introduction via geometric constructions flows better coming off my\n [post about the Platonic solids](/posts/misc/platonic-volume).\nAlso, it reads better if I rely less on \"if you search for this sequence of numbers\"\n and more on how to interpret the definition.\n\nConsider reading [the follow-up](../2) to this post if you're interested in another way\n one can obtain the Chebyshev polynomials.\n\nDiagrams created with GeoGebra.\n\n\n\n", + "supporting": [ + "index_files" + ], + "filters": [], + "includes": {} + } +} \ No newline at end of file diff --git a/_freeze/posts/permutations/1/index/execute-results/html.json b/_freeze/posts/permutations/1/index/execute-results/html.json new file mode 100644 index 0000000..a363e57 --- /dev/null +++ b/_freeze/posts/permutations/1/index/execute-results/html.json @@ -0,0 +1,12 @@ +{ + "hash": "895ef8d2c498a83dc789e762bbc35fd2", + "result": { + "engine": "jupyter", + "markdown": "---\ntitle: \"A Game of Permutations, Part 1\"\ndescription: |\n Some basic, interesting connections between graph theory and permutation groups.\nformat:\n html:\n html-math-method: katex\njupyter: haskell\ndate: \"2022-01-18\"\ndate-modified: \"2025-07-04\"\ncategories:\n - graph theory\n - group theory\n - sorting algorithms\n---\n\n\n\nIn the time since [my last post](../chebyshev/2) discussing graphs,\n I have been spurred on to continue playing with them, with a slight focus on abstract algebra.\nThis post will primarily focus on some fundamental concepts before launching into some constructions which will make the journey down this road more manageable.\nHowever, I will still assume you are already familiar with what both a\n [group](https://mathworld.wolfram.com/Group.html) and a\n [graph](https://mathworld.wolfram.com/Graph.html) are.\n\n\nThe Symmetric Group\n-------------------\n\nSome of the most important finite groups are the symmetric groups of degree *n* ($S_n$).\nThey are the groups formed by permutations of lists containing *n* items.\nThere is a group element for each permutation, so the order of the group is the\n same as the number of permutations, *n!*.\n\n
\n On lists versus sets \n\n The typical definition of the symmetric group uses sets, which are fundamentally unordered.\n This is potentially confusing, since it can appear as though an object after applying\n a permutation is the same object as before.\n\n For example, let *p* be the permutation swapping \"1\" and \"3\".\n Then,\n\n $$\n \\begin{align*}\n p(\\{ 1, 2, 3 \\}) = \\{ p(1), p(2), p(3) \\} = \\{ 3, 2, 1 \\}\n \\\\\n p([ 1, 2, 3 ]) = [ p(1), p(2), p(3) ] = [ 3, 2, 1 ]\n \\end{align*}\n $$\n\n After applying *p*, the set is unchanged, since all of the elements are the same.\n On the other hand, the lists differ in the first element and cannot be equal.\n\n Sets are still useful as a container.\n For example, the elements of a group are unordered.\n To keep vocabulary simple, I will do my best to refer to objects in a group as\n \"group elements\" and the objects in a list as \"items\".\n
\n\nThere are many ways to denote elements of the symmetric group.\nI will take the liberty of explaining some common notations, each of which are useful in different ways.\nMore information about them can be found [elsewhere](https://mathworld.wolfram.com/Permutation.html)\n [online](https://en.wikipedia.org/wiki/Permutation#Notations)\n as well as any adequate group theory text.\n\n\n### Naive List Notation\n\nArguably the simplest way to do things is to denote the permutation by the result\n of applying it to a canonical list.\nTake the element of $S_3$ which can be described as the action\n \"assign the first item to the second index, the second to the third, and the third to the first\".\nOur canonical list in this case is $[1, 2, 3]$, matching the degree of the group.\nThis results in $[3, 1, 2]$, since \"1\" is in now in position two, and similarly for the other items.\n\nUnfortunately, this choice is too result-oriented.\nThis choice makes it difficult to compose group elements in a meaningful way, since all\n of the information about the permutation is in the position of items in the list,\n rather than the items of the list themselves.\nFor example, under the same rule, $[c, b, a]$ is mapped to $[a, c, b]$.\n\n\n### True List Notations (Two- and One-line Notation)\n\nInstead, let's go back to the definition of the element.\nAll we have to do is list out every index on one line, then the destination\n of every index on the next.\nThis is known as *two-line notation*.\n\n$$\n\\begin{pmatrix}\n 1 & 2 & 3 \\\\\n p(1) & p(2) & p(3)\n\\end{pmatrix}\n= \\begin{pmatrix}\n 1 & 2 & 3 \\\\\n 2 & 3 & 1\n\\end{pmatrix}\n$$\n\nFor simplicity, the first row is kept as a list whose items match their indices.\n\nThis notation makes it easier to identify the inverse of a group element.\nAll we have to do is sort the columns of the permutation by the second row,\n then swap the two rows.\n\n$$\n\\begin{pmatrix}\n 1 & 2 & 3 \\\\\n 2 & 3 & 1\n\\end{pmatrix}^{-1}\n= \\begin{pmatrix}\n 3 & 1 & 2 \\\\\n 1 & 2 & 3\n\\end{pmatrix}^{-1}\n= \\begin{pmatrix}\n 1 & 2 & 3 \\\\\n 3 & 1 & 2\n\\end{pmatrix}\n$$\n\nNote that the second row is now the same as the result from the naive notation.\n\nSince the first row will be the same in all cases, we can omit it, which results in\n *one-line notation*.\nThe *n*th item in the list now describes the position in which *n* can be found after\n the permutation.\n\n$$\n\\begin{pmatrix}\n 1 & 2 & 3 \\\\\n 2 & 3 & 1\n\\end{pmatrix}\n\\equiv [\\![2, 3, 1]\\!]\n$$\n\nDouble brackets are used to distinguish this as a permutation and not an ordinary list.\n\nThese notations make it straightforward to encode symmetric group elements on a computer.\nAfter all, we only have to read the items of a list by the indices in another.\nHere's a compact definition in Haskell:\n\n::: {#2e6870e0 .cell execution_count=2}\n``` {.haskell .cell-code}\n-- convenient wrapper type for below\nnewtype Permutation = P { unP :: [Int] }\n\napply :: Permutation -> [a] -> [a]\napply = flip (\\xs ->\n map ( -- for each item of the permutation, map it to...\n (xs !!) -- the nth item of the first list\n . (+(-1)) -- (indexed starting with 1)\n ) . unP) -- (after undoing the type wrapping)\n-- written in a non-point free form\napply' (P xs) ys = map ( \\n -> ys !! (n-1) ) xs\n\nprint $ P [2,3,1] `apply` [1,2,3]\n```\n\n::: {.cell-output .cell-output-display}\n```\n[2,3,1]\n```\n:::\n:::\n\n\nNote that this means `P [2,3,1]` is actually equivalent to $[\\![2, 3, 1]\\!]^{-1}$,\n since we don't get $[3, 1, 2]$.\n\nWhile these notations are fairly explicit and easy to describe to a computer,\n it's easy to misinterpret an element as its inverse.\nThere is also some redundancy: $[\\![2, 1]\\!]$ and $[\\![2, 1, 3]\\!]$ both describe a group element\n which swaps the first two items of a list.\nOn one hand, the $S_n$ each belongs to is explicit, but on the other,\n every element of a smaller symmetric group also belongs to a larger one.\nThe verbosity of these notations also makes composing group elements difficult[^1].\n\n[^1]: Composition is relatively easy to describe in two-line notation.\n Recall that we reordered columns when finding an inverse.\n We can do so to match rows of two elements, then compose a new element\n by looking at the first and last rows.\n For example, with group inverses:\n $$\n \\begin{pmatrix}\n 1 & 2 & 3 \\\\\n 2 & 3 & 1\n \\end{pmatrix}\n \\begin{pmatrix}\n 1 & 2 & 3 \\\\\n 2 & 3 & 1\n \\end{pmatrix}^{-1}\n = \\begin{matrix}\n \\begin{pmatrix}\n 1 & 2 & 3 \\\\\n \\cancel{2} & \\cancel{3} & \\cancel{1}\n \\end{pmatrix}\n \\\\\n \\begin{pmatrix}\n \\cancel{2} & \\cancel{3} & \\cancel{1} \\\\\n 1 & 2 & 3\n \\end{pmatrix}\n \\end{matrix}\n = \\begin{pmatrix}\n 1 & 2 & 3 \\\\\n 1 & 2 & 3\n \\end{pmatrix}\n $$\n\n\n### Cycle Notation\n\n*Cycle notation* addresses all of these issues, but gets rid of the transparency with respect to lists.\nLet's try phrasing the element we've been describing differently.\n\n> assign the first item to the second index, the second to the third, and the third to the first\n\nWe start at index 1 and follow it to index 2, and from there follow it to index 3.\nContinuing from index 3, we return to index 1, and from then we'd loop forever.\nThis describes a *cycle*, denoted as $(1 ~ 2 ~ 3)$.\n\nCycle notation is much more delicate than list notation, since the notation is nonunique:\n\n- Naturally, the elements of a cycle may be cycled to produce an equivalent one.\n - $(1 ~ 2 ~ 3) = (3 ~ 1 ~ 2) = (2 ~ 3 ~ 1)$\n- Cycles which have no common elements (i.e., are disjoint) commute,\n since they act on separate parts of the list.\n - $(1 ~ 2 ~ 3)(4 ~ 5) = (4 ~ 5)(1 ~ 2 ~ 3)$\n\n\n#### Cycle Algebra\n\nThe true benefit of cycles is that they are easy to manipulate algebraically.\nFor some reason, [Wikipedia](https://en.wikipedia.org/wiki/Permutation#Cycle_notation)\n does not elaborate on the composition rules for cycles,\n and the text which I read as an introduction to group theory simply listed it as an exercise.\nWhile playing around with them and deriving these rules oneself *is* a good idea,\n I will list the most important here:\n\n- Cycles can be inverted by reversing their order.\n - $(1 ~ 2 ~ 3)^{-1} = (3 ~ 2 ~ 1) = (1 ~ 3 ~ 2)$\n- Cycles may be composed if the last element in the first is the first index on the right.\n Inversely, cycles may also be decomposed by partitioning on an index and duplicating.\n - $(1 ~ 2 ~ 3) = (1 ~ 2)(2 ~ 3)$\n- If an index in a cycle is repeated twice, it may be omitted from the cycle.\n - $(1 ~ 2 ~ 3)(1 ~ 3) = (1 ~ 2 ~ 3)(3 ~ 1) = (1 ~ 2 ~ 3 ~ 1) = (1 ~ 1 ~ 2 ~ 3) = (2 ~ 3)$\n\nGoing back to $(1 ~ 2 ~ 3)$, if we apply this permutation to the list $[1, 2, 3]$:\n\n$$\n(1 ~ 2 ~ 3) \\left( \\vphantom{0^{0^0}} [1, 2, 3] \\right)\n = (1 ~ 2)(2 ~ 3) \\left( \\vphantom{0^{0^0}} [1, 2, 3] \\right)\n = (1 ~ 2) \\left( \\vphantom{0^{0^0}} [1, 3, 2] \\right)\n = [3, 1, 2]\n$$\n\nWhich is exactly what we expected with our naive notation.\n\n\nGenerators, Permutation Groups, and Sorting\n-------------------------------------------\n\nIf we have a group *G*, then we can select a set of elements\n $\\langle g_1, g_2, g_3, ... \\rangle$ as *generators*.\nIf we form all possible products -- not only the pairwise ones $g_1 g_2$,\n but also $g_1 g_2 g_3$ and all powers of any $g_n$ -- then the products form a subgroup of *G*.\nNaturally, such a set is called a *generating set*.\n\nSymmetric groups are of primary interest because of their subgroups, also known as permutation groups.\n[Cayley's theorem](https://en.wikipedia.org/wiki/Cayley%27s_theorem),\n a fundamental result of group theory, states that all finite groups\n are isomorphic to one of these subgroups.\nThis means that we can encode effectively any group using elements of the symmetric group.\n\nFor example, consider the generating set $\\langle (1 ~ 2) \\rangle$, which contains a single element\n that swaps the first two items of a list.\nIts square is the identity, meaning that its inverse is itself.\nThe identity and $(1 ~ 2)$ are the only two elements of the generated group,\n which is isomorphic to $C_2$, the cyclic group of order 2.\nSimilarly, the 3-cycle in the generating set $\\langle (1 ~ 2 ~ 3) \\rangle$ generates $C_3$,\n the cyclic group of order 3.\n\nHowever, the generating set $\\langle (1 ~ 2), (1 ~ 2 ~ 3)\\rangle$, which contains both of these permutations, generates the entirety of $S_3$.\nIn fact, [\n every symmetric group can be generated by two elements\n ](https://groupprops.subwiki.org/wiki/Symmetric_group_on_a_finite_set_is_2-generated):\n a permutation which cycles all elements once, and the permutation which swaps the first two elements.\n\n$$\nS_n = \\langle (1 ~ 2), (1 ~ 2 ~ 3 ~ 4 ~ ... ~ n) \\rangle\n$$\n\n\n### Sorting and 2-Cycles\n\nThe proof linked to above, that every symmetric group can be generated by two elements,\n uses the (somewhat obvious) result that one can produce any permutation of a list by picking two items,\n swapping them, and repeating until the list is in the desired order.\n\nThis is reminiscent of how sorting algorithms are able to sort a list by only comparing and swapping items.\nAs mentioned earlier when finding inverses using in two-line notation, sorting is almost the inverse of permuting.\nHowever, not all 2-cycles are necessary to generate the whole symmetric group.\n\n\n### Bubble Sort\n\nConsider [bubble sort](https://en.wikipedia.org/wiki/Bubble_sort).\nIn this algorithm, we swap two items when the latter is less than the former,\n looping over the list until it is sorted.\nUntil the list is sorted, the algorithm finds all such adjacent inversions.\nIn the worst case, it will swap every pair of adjacent items, some possibly multiple times.\nThis corresponds to the generating set\n $\\langle (1 ~ 2), (2 ~ 3), (3 ~ 4), (4 ~ 5), …, (n-1 ~\\ ~ n) \\rangle$.\n\n![\n Bubble sort ordering a reverse-sorted list\n](./bubble_sort.gif){.narrow}\n\n\n### Selection Sort\n\nAnother method, [selection sort](https://en.wikipedia.org/wiki/Selection_sort),\n searches through the list for the smallest item and swaps it to the beginning.\nIf this is the final item of the list, this results in the permutation $(1 ~ n)$.\nSupposing that process is continued with the second item and we also want it\n to swap with the final item, then the next swap corresponds to $(2 ~ n)$.\nContinuing until the last item, this gives the generating set\n $\\langle (1 ~ n), (2 ~ n), (3 ~ n), (4 ~ n), …, (n-1 ~\\ ~ n) \\rangle$.\n\n![\n Selection sort ordering a particular list, using only swaps with the final item\n](./selection_sort.gif){.narrow}\n\nThis behavior for selection sort is uncommon, and this animation omits the selection of a swap candidate.\nThe animation below shows a more destructive selection sort, in which the\n candidate least item is placed at the end of the list (position 5).\nOnce the algorithm hits the end of the list, the candidate is swapped to the least unsorted position,\n and the algorithm continues on the rest of the list.\n\n![\n \"Destructive\" selection sort.\n The actual list being sorted consists of the initial four items, with the final item as temporary storage.\n](./destructive_selection_sort.gif){.narrow}\n\n\nSwap Diagrams\n-------------\n\nGiven a set of 2-cycles, it would be nice to know at a glance if the entire group is generated.\nIn cycle notation, a 2-cycle is an unordered pair of natural numbers which swap items of an *n*-list.\nSimilarly, the edges of an undirected graph on *n* vertices (labelled from 1 to *n*)\n may be interpreted as an unordered pair of the vertices it connects.\n\nIf we treat the two objects as the same, then we can convert between graphs and sets of 2-cycles.\nGoing from the latter to the former, we start on an empty graph on n vertices\n (labelled from 1 to *n*).\nThen, we connect two vertices with an edge when the set includes the permutation swapping\n the indices labelled by the vertices.\n\nReturning to the generating sets we identified with sorting algorithms,\n we identify with each a graph family.\n\n- Bubble sort: $\\langle (1 ~ 2), (2 ~ 3), (3 ~ 4), (4 ~ 5), …, (n-1 ~~ n) \\rangle$\n - The path graphs ($P_n$), which are precisely as they sound:\n an unbranching path formed by *n* vertices.\n- \"Selection\" sort: $\\langle (1 ~ n), (2 ~ n), (3 ~ n), (4 ~ n), …, (n-1 ~~ n) \\rangle$\n - The star graphs ($\\bigstar_n$, as $S_n$ means the symmetric group),\n one vertex connected to all others.\n- Every 2-cycle in $S_n$\n - The complete graphs ($K_n$), which connect every vertex to every other vertex.\n\n![ ](./example_graphs.png)\n\nThis interpretation of these objects doesn't have proper name, but I think the name \"swap diagram\" fits.\nThey allow us to answer at least one question about the generating set from a graph theory perspective.\n\n\n### Connected Graphs\n\nA graph is connected if a path exists between all pairs of vertices.\nThe simplest possible path is simply a single edge, which we already know to be an available 2-cycle.\n\nThe next simplest case is a path consisting of two edges.\nSome cycle algebra shows that we can produce a third cycle which corresponds\n to an edge connecting the two distant vertices.\n\n:::: {layout-ncol=\"2\"}\n![ ](./induced_edge.png)\n\n::: {}\n$$\n\\begin{align*}\n &(m ~ n) (n ~ o) (m ~ n) \\\\\n &= (m ~ n ~ o) (m ~ n) \\\\\n &= (n ~ o ~ m) (m ~ n) \\\\\n &= (n ~ o ~ m ~ n) \\\\\n &= (o ~ m) = (m ~ o)\n\\end{align*}\n$$\nNote that this is just the conjugation of $(n ~ o)$ by $(m ~ n)$\n:::\n::::\n\nIn other words, if we have have two adjacent edges, the new edge corresponds to\n a product of elements from the generating set.\nGraph theory has a name for this operation: when we produce *all* new edges by linking vertices\n that were separated by a distance of 2, the result is called the *square of that graph*.\nIn fact, higher [graph powers](https://en.wikipedia.org/wiki/Graph_power) will reflect connections\n induced by more conjugations of adjacent edges.\n\n![\n As you might be able to guess, this implies that $(1 ~ 4) = (3 ~ 4)(2 ~ 3)(1 ~ 2)(2 ~ 3)(3 ~ 4)$.\n Also, $\\bigstar_n^2 \\cong K_n$.\n](./P4_powers.png)\n\nIf our graph is connected, then repeating this operation will tend toward a complete graph.\nComplete graphs contain every possible edge, and so correspond to all possible 2-cycles,\n which trivially generate the symmetric group.\nConversely, if a graph has *n* vertices, then for it to be connected, it must have at least $n - 1$ edges.\nThus, a generating set of 2-cycles must have at least $n - 1$ items to generate the symmetric group.\n\nPicking a different vertex labelling will correspond to a different generating set.\nFor example, in the image of $P_4$ above, if the edge connecting vertices 1 and 2\n is replaced with an edge connecting 1 and 4, then the resulting graph\n is still $P_4$, even though it describes a different generating set.\nWe can ignore these extra cases entirely -- either way, the graph power argument shows\n that a connected graph corresponds to a set generating the whole symmetric group.\n\n\n### Disconnected Graphs\n\nA disconnected graph is the\n [disjoint union](https://en.wikipedia.org/wiki/Disjoint_union_of_graphs) of connected graphs.\nUnder graph powers, we know that each connected graph tends toward a complete graph,\n meaning a disconnected graph as a whole tends toward a disjoint union of complete graphs,\n or [cluster graph](https://en.wikipedia.org/wiki/Cluster_graph).\nBut what groups do cluster graphs correspond to?\n\nThe simplest case to consider is what happens when the graph is $P_2 \\oplus P_2$.\nIf there is an edge connecting vertices 1 and 2 and an edge connecting vertices 3 and 4,\n it corresponds to the generating set $\\langle (1 ~ 2), (3 ~ 4) \\rangle$.\nThis is a pair of disjoint cycles, and the group they generate is\n\n$$\n\\{e, (1 ~ 2), (3 ~ 4), (1 ~ 2)(3 ~ 4) \\}\n \\cong S_2 \\times S_2\n \\cong C_2 \\times C_2\n$$\n\nOne way to look at this is by considering paths on each component:\n we can either cross an edge on the first component (corresponding to $(1 ~ 2)$),\n the second component (corresponding to $(3 ~ 4)$),\n or both at the same time.\nThis independence means that one group's structure is duplicated over the other's,\n or more succinctly, gives the direct product.\nIn general, if we denote *γ* as the map which \"runs\" the swap diagram and produces the group, then\n\n$$\n\\gamma( A \\oplus B ) = S_{|A|} \\times S_{|B|},\n ~ A, B \\text{ connected}\n$$\n\nwhere $|A|$ is the number of vertices in *A*.\n\n*γ* has the interesting property of mapping a sum-like object onto a product-like object.\nIf we express a disconnected graph *U* as the disjoint union of its connected components $V_i$, then\n\n$$\n\\begin{gather*}\n U = \\bigsqcup_i V_i\n \\\\\n \\gamma( U ) = \\gamma \\left( \\bigsqcup_i V_i \\right) = \\prod_i S_{|V_i|}\n\\end{gather*}\n$$\n\nThis describes *γ* for every simple graph.\nIt also shows that we're rather limited in the kinds of groups which can be expressed by a swap diagram.\n\n\nClosing\n-------\n\nThis concludes the dry introduction to some investigations of mine into symmetric groups.\nWhile I could have omitted the sections about permutation notation and generators,\n I wanted to be thorough and tie it to concepts which were useful to my understanding.\nThe notion of a graph encoding a generating set in particular will be fairly important going forward.\n\nOriginally, this post was half of a single, sprawling, meandering article.\nI hope I've improved the organization by keeping the digression about sorting algorithms\n to this initial article.\nThe [next post](../2) will cover some interesting structures which fill Euclidean space\n and incredibly large graphs.\n\nSorting and graph diagrams made with GeoGebra.\n\n", + "supporting": [ + "index_files" + ], + "filters": [], + "includes": {} + } +} \ No newline at end of file diff --git a/_freeze/posts/permutations/2/index/execute-results/html.json b/_freeze/posts/permutations/2/index/execute-results/html.json new file mode 100644 index 0000000..295151f --- /dev/null +++ b/_freeze/posts/permutations/2/index/execute-results/html.json @@ -0,0 +1,12 @@ +{ + "hash": "cfab1947f023fe38d9c86abc8bb49fc3", + "result": { + "engine": "jupyter", + "markdown": "---\ntitle: \"A Game of Permutations, Part 2\"\ndescription: |\n Notes on an operation which makes some very large graphs.\nformat:\n html:\n html-math-method: katex\njupyter: python3\ndate: \"2022-01-18\"\ndate-modified: \"2025-07-06\"\ncategories:\n - graph theory\n - group theory\n---\n\n\n\n\n\nThis post assumes you have read (or at least skimmed over parts of) the [first post](../1),\n which talks about graphs and the symmetric group.\nThis post will contain some more \"empirical\" results, since I'm not an expert on graph theory.\nHowever, one hardly needs to be an expert to learn or to make computations, observations, and predictions.\n\nWe left off talking about producing a group from a graph, so we begin now by considering how to do the reverse.\n\n\nCayley Graphs\n-------------\n\nFor a given generating set, we can assign every element in the group it generates to a vertex in a graph.\nStarting with each of the generators, we draw edges from one vertex to another when\n the product of the initial vertex and a generator (in that order) is the product vertex.\nThis process continues until there are no more arrows to draw.\nThe resulting figure is known as a [Cayley graph](https://mathworld.wolfram.com/CayleyGraph.html)[^1].\n\n[^1]: The construction implies a labelling of edges by its generating set and a labelling\n of vertices by the generated elements.\n It is also common to describe an unlabelled graph as \"Cayley\" if it could\n be generated by this procedure.\n\nCayley graphs depend on the generating set used, so they can take a wide variety of shapes.\nHere are a few examples of Cayley graphs made from elements of $S_4$:\n\n![\n Left: $\\{(1 ~ 3 ~ 2 ~ 4), (3 ~ 4), (1 ~ 4 ~ 2 ~ 3)\\}$, cube graph
\n Middle: $\\{(1 ~ 2 ~ 3), (2 ~ 3 ~ 4)\\}$, cuboctahedral graph
\n Right: $\\{(2 ~ 3), (3 ~ 4), (2 ~ 3 ~ 4)\\}$, octahedral graph
\n Generating sets obtained from the previous MathWorld article.\n](./s4_cayley_graphs.png)\n\nOwing to the way in which they are defined, Cayley graphs have a few useful properties as graphs.\nAt every vertex, we have as many outward edges as we do generators in the generating set,\n so the outward (and in fact, inward) degree of each vertex is the same.\nIn other words, it is a regular graph.\nMore than that, it is [vertex-transitive](https://mathworld.wolfram.com/Vertex-TransitiveGraph.html),\n since labelling a single vertex's outward edges will label that of the entire graph.\n\nIn general, the Cayley graph is a directed graph.\nHowever, if for every member of the generating set, we also include its inverse,\n every directed edge will be matched by an edge in the opposite direction,\n and the Cayley graph may be considered undirected.\n\n\nGraphs to Graphs\n----------------\n\nAll 2-cycles are their own inverse, so generating sets which include only them\n produce undirected Cayley graphs.\nSince this kind of generating set can itself be thought of as a graph,\n we may consider an operation on graphs that maps a swap diagram to its Cayley graph.\n\n![\n An example of this operation, denoted as $\\exp$.\n The proper Cayley graphs for $(1 ~ 2)$ and $(3 ~ 4)$ are not shown;\n they are isomorphic to the corresponding swap graphs, but have different vertex labels.\n](./exp_p2_oplus_p2.png)\n\nIt seems to be the case that $\\exp( A \\oplus B ) = \\exp( A ) \\times \\exp( B )$,\n where $\\oplus$ signifies the disjoint uinion and $\\times$ signifies the\n [Cartesian (box) product of graphs](https://en.wikipedia.org/wiki/Cartesian_product_of_graphs)[^2].\nUnlike *γ* from the previous post, both the input and output of this operation are graphs.\nBecause of this and the sum/product relationship, I've taken to calling this operation the\n \"graph exponential\"[^3].\n\n[^2]: Graphs have many product structures, such as the tensor product and strong product.\n The Cartesian product is (categorically) more natural when paired with disjoint unions.\n\n[^3]: Originally, I called this operation the \"graph factorial\", since it involves permutations\n and the number of vertices in the resulting graph grows factorially.\n\nThis operation is my own invention, so I am unsure whether or not\n it constitutes anything useful.\nIn fact, the possible graphs grow so rapidly that computing anything about the exponential\n of order 8 graphs starts to overwhelm a single computer.\nIt is, however, interesting, as I will hopefully be able to convince.\n\nA random graph will not generally correspond to an interesting generating set,\n and therefore, will also generally have an uninteresting exponential graph.\nHence, I will continue with the examples used previously: paths, stars, and complete graphs.\nThey are among the simplest graphs one can consider, and as we will see shortly,\n have exponentials which appear to have natural correspondences to other graph families.\n\n\nSome Small Exponential Graphs\n-----------------------------\n\nBecause of [the difficulty in determining graph isomorphism](\n https://en.wikipedia.org/wiki/Graph_isomorphism_problem\n ), it is challenging for a computer to find a graph in an encyclopedia.\nComputers think of graphs as a list of vertices and their outward edges,\n but this implementation faces inherent labelling issues.\nThese persist even if the graph is described as a list of (un)ordered pairs,\n an adjacency matrix, or an incidence matrix,\n the latter two of which have very large memory footprints[^4].\n\n[^4]: I was able to locate a project named the\n [Encyclopedia of Finite Graphs](https://github.com/thoppe/Encyclopedia-of-Finite-Graphs),\n but it is only able to build a database simple connected graphs which\n can be queried by invariants (and is outdated since it uses Python 2).\n\nHowever, as visual objects, humans can compare graphs fairly easily\n -- the name means \"drawing\" after all.\nExponentials of order 3 and order 4 graphs are neither so small as to be uninteresting\n nor so big as to be unparsable by humans.\n\n\n### Order 3\n\n![ ](./exp_order_3.png){.narrow}\n\nAt this stage, we only really have two graphs to consider, since $P_3 = \\bigstar_3$.\nImmediately, one can see that $\\exp( P_3 ) = \\exp( \\bigstar_3 ) = C_6$,\n the 6-cycle graph (or hexagonal graph).\nIt is also apparent that $\\exp( K_3 )$ is the utility graph, $K_{3,3}$.\n\n![\n Graph exponential of a disconnected graph.
\n Note that the red element commutes with the green and blue ones.\n This produces two types of squares in the exponential graph.\n Meanwhile, the green and blue elements have an order 3 product, and produce the hexagon.\n](./exp_p3_oplus_p2.png)\n\nHere, we can again demonstrate the sum rule of the graph exponential with $\\exp( P_3 \\oplus P_2 )$.\nSimplifying, since we know $\\exp( P_3 ) = C_6$, the result is $C_6 \\times P_2 = \\text{Prism}_6$,\n the hexagonal prism graph.\n\n\n### Order 4 (and beyond)\n\n::: {layout=\"[[1,1],[1]]\"}\n![$\\exp( P_4 )$](./exp_p4_networkx.png)\n\n![$\\exp( \\bigstar_4 )$](./exp_star4_networkx.png)\n\n![](./exp_order_4.png)\n:::\n\nWith some effort, $\\exp( P_4 )$ can be imagined as a projection of a 3D object,\n the [truncated octahedron](https://en.wikipedia.org/wiki/Truncated_octahedron).\nBecause of its correspondence to a 3D solid, this graph is planar.\nBoth the hexagon and this solid belong to a class of polytopes called\n [*permutohedra*](https://en.wikipedia.org/wiki/Permutohedron), which are figures\n that are also formed by permutations of the coordinate (1, 2, 3, ..., *n*) in Euclidean space[^5].\nTechnically, there is a distinction between the Cayley graphs and permutohedra\n since their labellings differ.\nBoth have edges generated by swaps, but in the latter case, the connected vertices are expected to be\n separated by a certain distance.\nMore information about the distinction can be found at this article on [Wikimedia](\n https://commons.wikimedia.org/wiki/Category:Permutohedron_of_order_4_%28raytraced%29#Permutohedron_vs._Cayley_graph\n )[^6].\n\n[^5]: In fact, these figures are able to completely tessellate the $n-1$ dimensional subspace of\n $\\mathbb{R}^n$ where the coordinates sum to the $n-1$th triangular number.\n Note also that the previous graph in the sequence of $\\exp(P_n)$, the hexagonal graph,\n is visible in the truncated octahedron.\n This corresponds to the projection $(x,y,z,w) \\mapsto (x,y,z)$ over\n the coordinates of the permutohedra.\n\n[^6]: Actually, if one considers a *right* Cayley graph, where each generator is right-multiplied\n to the permutation at a node rather than left-multiplied, then a true correspondence is obtained,\n at least for order 4.\n\nMeanwhile, $\\exp( \\bigstar_4 )$ is more difficult to identify, at least without rearranging its vertices.\nIt turns out to be isomorphic to the [Nauru graph](https://mathworld.wolfram.com/NauruGraph.html),\n a graph with many strange properties.\nNotably, whereas the graph isomorphic to the permutohedron is obviously a spherical polyhedron,\n the Nauru graph can be topologically embedded on a torus.\nThe Nauru graph also belongs to the family of\n [permutation star graphs](https://mathworld.wolfram.com/PermutationStarGraph.html)\n $PS_n$ (*n* = 4), which also includes the hexagonal graph (*n* = 3).\nThe MathWorld article confirms some kind of correspondence, stating graphs of this form\n are generated by pairwise swaps.\n\nMy attempts at finding a graph isomorphic to $\\exp( K_4 )$ have thus far ended in failure.\nIt is certainly *not* isomorphic to $K_{4,4}$, since this graph has 8 vertices,\n as opposed to 24 in $\\exp( K_4 )$.\n\n\nGraph Invariants\n----------------\n\nWhile I have managed to identify the families to which some of these graphs belong,\n I am rather fond of computing (and conjecturing) sequences from objects.\nNot only is it much easier to consult something like [the OEIS](https://oeis.org/) for these quantities,\n but after finding a matching sequence, there are ample articles to consult for more information.\nBy linking to their respective entries, I hope you'll consider reading more there.\n\nEven though I have obtained these values empirically, I am certain that the sequences for\n $\\exp( P_n )$ and $\\exp( \\bigstar_n )$ match the corresponding OEIS entries.\nI also have great confidence in the sequences I found for $\\exp( K_n )$.\n\n\n### Edge Counts\n\nDespite knowing how many vertices there are (*n*!, the order of the symmetric group),\n we don't necessarily know how many edges there are.\n\n::: {#a412d7a0 .cell .plain execution_count=3}\n\n::: {.cell-output .cell-output-display .cell-output-markdown execution_count=7}\n*n* $\\#E(\\exp( P_n ))$ $\\#E(\\exp( \\bigstar_n ))$ $\\#E(\\exp( K_n ))$\n-------- ------------------------------------------------------------------------- --------------------------- --------------------------------------\n3 6 6 9\n4 36 36 72\n5 240 240 600\n6 1800 1800 5400\n7 15120 15120 52920\nSequence Second column of Lah numbers
[OEIS A001286](http://oeis.org/A001286) Same as previous [OEIS 001809](http://oeis.org/A001809)\nRule $L(n,2) = n!{(n-1)(n-2) \\over 4}$ $n!{n(n-1) \\over 4}$\n:::\n:::\n\n\n### Radius and Distance Classes\n\nThe radius of a graph is the smallest possible distance which separates two maximally-separated vertices.\nDue to vertex transitivity, the greatest distance between two vertices is the same for every vertex.\n\n::: {#8a1cc334 .cell .plain execution_count=4}\n\n::: {.cell-output .cell-output-display .cell-output-markdown execution_count=8}\n*n* $r(\\exp( P_n ))$ $r(\\exp( \\bigstar_n ))$ $r(\\exp( K_n ))$\n-------- --------------------------------------------------------------- -------------------------------------------------------------------------------- ------------------\n3 4 4 3\n4 7 5 4\n5 11 7 5\n6 16 8 6\n7 22 10 7\nSequence Triangular numbers
[OEIS A000217](http://oeis.org/A000217) Integers not congruent to 2 (mod 3)
[OEIS A032766](http://oeis.org/A032766) *n* - 1\nRule $\\Delta_{n-1} = {n(n-1) \\over 2}$ $\\lfloor {n-1 \\over 2} \\rfloor + n -\\ 1$\n:::\n:::\n\n\nThese quantities are somewhat reductive.\nIf a vertex is distinguished, the remaining vertices may be partitioned into classes by their\n distance from it.\nIncluding the vertex itself (which is distance 0 away), there will be $r + 1$ such classes,\n where *r* is the radius.\nThese classes are the same for every vertex due to transitivity.\n\nIn the case of these graphs, they are a partition of *n*!.\n\n::: {#b3698cfa .cell .plain execution_count=5}\n\n::: {.cell-output .cell-output-display .cell-output-markdown execution_count=9}\n*n* $\\text{dists}(\\exp( P_n ))$ $\\text{dists}(\\exp( \\bigstar_n ))$ $\\text{dists}(\\exp( K_n ))$\n-------- -------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------\n3 [1, 2, 2, 1] [1, 2, 2, 1] [1, 3, 2]\n4 [1, 3, 5, 6, 5, 3, 1] [1, 3, 6, 9, 5] [1, 6, 11, 6]\n5 [1, 4, 9, 15, 20, 22, 20, 15, 9, 4, 1] [1, 4, 12, 30, 44, 26, 3] [1, 10, 35, 50, 24]\n6 [1, 5, 14, 29, 49, 71, 90, 101
101, 90, 71, 49, 29, 14, 5, 1] [1, 5, 20, 70, 170, 250, 169, 35] [1, 15, 85, 225, 274, 120]\n7 [1, 6, 20, 49, 98, 169, 259, 359, 455, 531, 573
573, 531, 455, 359, 259, 169, 98, 49, 20, 6, 1] [1, 6, 30, 135, 460, 1110, 1689, 1254, 340, 15] [1, 21, 175, 735, 1624, 1764, 720]\nSequence Mahonian numbers
[OEIS A008302](http://oeis.org/A008302) Whitney numbers of the second kind (star poset)
[OEIS A007799](http://oeis.org/A007799) Stirling numbers of the first kind
[OEIS A132393](http://oeis.org/A132393)\n:::\n:::\n\n\nI am certain that the appearance of the Stirling numbers here is legitimate,\n since these numbers count the number of permutations of *n* objects with *k* disjoint cycles.\nObviously, the identity element is distance 1 from all 2-cycles since they are all in the generating set;\n likewise, all 3-cycles are distance 2 from the identity (but distance 1 from the 2-cycles),\n and so on until the entire graph has been mapped.\nThe shapes induced by these classes were used to create the diagrams\n of $\\exp( K_3 )$ and $\\exp( K_4 )$ above.\n\n\n#### Spectrum\n\nThe eigenvalues of the adjacency matrix of a graph can be interesting\n and sometimes help in identifying a graph.\nUnfortunately, eigenvalues are not necessarily integers, and therefore not easily\n found in the OEIS (though they are always real for graphs).\n\n::: {#1ce3c98e .cell .plain execution_count=6}\n\n::: {.cell-output .cell-output-display .cell-output-markdown execution_count=10}\n *n* $\\text{Spec}(\\exp( P_n ))$ $\\text{Spec}(\\exp( \\bigstar_n )$ $\\text{Spec}(\\exp( K_n ))$\n----- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 3 $$\\begin{gather*}(\\pm1)^{2\\phantom{0}} \\\\ (\\pm2)^{1\\phantom{0}}\\end{gather*}$$ $$\\begin{gather*}(\\pm1)^{2\\phantom{0}} \\\\ (\\pm2)^{1\\phantom{0}}\\end{gather*}$$ $$\\begin{gather*}(0)^{4\\phantom{0}} \\\\ (\\pm3)^{1\\phantom{0}}\\end{gather*}$$\n 4 $$\\begin{gather*}(\\pm1)^{3} (\\pm3)^{1} \\\\ \\left(x^{2} - 3\\right)^{2} \\\\ \\left(x^{2} + 2 x - 1\\right)^{3} \\\\ \\left(x^{2} - 2 x - 1\\right)^{3} \\\\ \\left(x^{2} + 2 x - 1\\right)^{3} \\\\ \\left(x^{2} - 2 x - 1\\right)^{3}\\end{gather*}$$ $$\\begin{gather*}(0)^{4\\phantom{0}} \\\\ (\\pm1)^{3\\phantom{0}} \\\\ (\\pm2)^{6\\phantom{0}} \\\\ (\\pm3)^{1\\phantom{0}}\\end{gather*}$$ $$\\begin{gather*}(0)^{4\\phantom{0}} \\\\ (\\pm2)^{9\\phantom{0}} \\\\ (\\pm6)^{1\\phantom{0}}\\end{gather*}$$\n 5 $$\\begin{gather*}(0)^{12} (\\pm1)^{6} (\\pm4)^{1} \\\\ \\left(x^{2} - 5\\right)^{6} \\\\ \\left(x^{2} - 5 x + 5\\right)^{4} \\\\ \\left(x^{2} + 5 x + 5\\right)^{4} \\\\ \\left(x^{2} - 3 x + 1\\right)^{4} \\\\ \\left(x^{2} + 3 x + 1\\right)^{4} \\\\ \\left(x^{2} + 2 x - 1\\right)^{5} \\\\ \\left(x^{2} - 2 x - 1\\right)^{5} \\\\ \\left(x^{3} + 2 x^{2} - 5 x - 4\\right)^{5} \\\\ \\left(x^{3} - 2 x^{2} - 5 x + 4\\right)^{5}\\end{gather*}$$ $$\\begin{gather*}(0)^{30\\phantom{00}} \\\\ (\\pm1)^{4\\phantom{00}} \\\\ (\\pm2)^{28\\phantom{00}} \\\\ (\\pm3)^{12\\phantom{00}} \\\\ (\\pm4)^{1\\phantom{00}}\\end{gather*}$$ $$\\begin{gather*}(0)^{36\\phantom{00}} \\\\ (\\pm2)^{25\\phantom{00}} \\\\ (\\pm5)^{16\\phantom{00}} \\\\ (\\pm10)^{1\\phantom{00}}\\end{gather*}$$\n 6 $$\\begin{gather*}(0)^{20} (\\pm1)^{25} (\\pm2)^{15}\\\\(\\pm3)^{5} (\\pm4)^{5} (\\pm5)^{1} \\\\ \\left(x^{2} - 3\\right)^{20}\\end{gather*}$$Not shown: 558 other roots $$\\begin{gather*}(0)^{168\\phantom{000}} \\\\ (\\pm1)^{30\\phantom{000}} \\\\ (\\pm2)^{120\\phantom{000}} \\\\ (\\pm3)^{105\\phantom{000}} \\\\ (\\pm4)^{20\\phantom{000}} \\\\ (\\pm5)^{1\\phantom{000}}\\end{gather*}$$ $$\\begin{gather*}(0)^{256\\phantom{000}} \\\\ (\\pm3)^{125\\phantom{000}} \\\\ (\\pm5)^{81\\phantom{000}} \\\\ (\\pm9)^{25\\phantom{000}} \\\\ (\\pm15)^{1\\phantom{000}}\\end{gather*}$$\n 7 $$\\begin{gather*}(0)^{35\\phantom{00}} \\\\ (\\pm1)^{20\\phantom{00}} \\\\ (\\pm2)^{45\\phantom{00}} \\\\ (\\pm6)^{1\\phantom{00}}\\end{gather*}$$Not shown: 4873 other roots $$\\begin{gather*}(0)^{840\\phantom{000}} \\\\ (\\pm1)^{468\\phantom{000}} \\\\ (\\pm2)^{495\\phantom{000}} \\\\ (\\pm3)^{830\\phantom{000}} \\\\ (\\pm4)^{276\\phantom{000}} \\\\ (\\pm5)^{30\\phantom{000}} \\\\ (\\pm6)^{1\\phantom{000}}\\end{gather*}$$ $$\\begin{gather*}(0)^{400\\phantom{0000}} \\\\ (\\pm1)^{441\\phantom{0000}} \\\\ (\\pm3)^{1225\\phantom{0000}} \\\\ (\\pm6)^{196\\phantom{0000}} \\\\ (\\pm7)^{225\\phantom{0000}} \\\\ (\\pm9)^{196\\phantom{0000}} \\\\ (\\pm14)^{36\\phantom{0000}} \\\\ (\\pm21)^{1\\phantom{0000}}\\end{gather*}$$\n 8 Not shown: all 40320 roots $$\\begin{gather*}(0)^{3960\\phantom{0000}} \\\\ (\\pm1)^{5691\\phantom{0000}} \\\\ (\\pm2)^{2198\\phantom{0000}} \\\\ (\\pm3)^{6321\\phantom{0000}} \\\\ (\\pm4)^{3332\\phantom{0000}} \\\\ (\\pm5)^{595\\phantom{0000}} \\\\ (\\pm6)^{42\\phantom{0000}} \\\\ (\\pm7)^{1\\phantom{0000}}\\end{gather*}$$ $$\\begin{gather*}(0)^{9864\\phantom{0000}} \\\\ (\\pm2)^{3136\\phantom{0000}} \\\\ (\\pm4)^{6125\\phantom{0000}} \\\\ (\\pm7)^{4096\\phantom{0000}} \\\\ (\\pm8)^{196\\phantom{0000}} \\\\ (\\pm10)^{784\\phantom{0000}} \\\\ (\\pm12)^{441\\phantom{0000}} \\\\ (\\pm20)^{49\\phantom{0000}} \\\\ (\\pm28)^{1\\phantom{0000}}\\end{gather*}$$\n:::\n:::\n\n\nFrom what I have been able to identify, the spectrum of an exponential graph is symmetric about 0,\n by which I mean that the characteristic polynomial is even.\nThis has been the case for all graphs I have tried testing, even outside these graph families.\n\nSince all eigenvalues of $\\exp( \\bigstar_n )$ calculated are integers,\n it appears they are integral graphs, a fact of which I am reasonably sure\n because of the aforementioned correspondence to permutation star graphs.\nAdditionally, the eigenvalues are very conveniently the integers up to $n-1$ and down to $-n+1$.\nUnfortunately, despite the ease of reading the eigenvalues themselves,\n there isn't an OEIS entry for the multiplicities.\nI was able to identify the multiplicity of the 0 eigenvalue with\n [OEIS A217213](http://oeis.org/A217213), which counts orderings on Dyck paths.\nIf this is truly the sequence being generated, it means there is a 1:1 correspondence between\n these orderings and a basis of the nullspace of the adjacency matrix.\n\nIt seems to be the case that $\\exp( K_n )$ are also integral graphs.\nPerplexingly, the multiplicities for each of the eigenvalues appear to mostly be perfect powers.\nThis is the case until n = 8, which ruins the pattern because neither of\n $9864 = 2^3 \\cdot 3^2 \\cdot 137$ or $6125 = 5^3 \\cdot 7^2$ are perfect powers.\nI find both this[^7] and the fact that such a large prime appears among the factorization of the former\n rather creepy since all other primes which appear here are small -- 2, 3, 5, and 7.\n\n[^7]: Some physicists are fond of 137 for its closeness to the reciprocal\n of the fine structure constant (a bit of mostly-harmless numerology).\n\n\n### Notes about Spectral Computation\n\nFor *n* = 3 through 6, exactly computing the spectrum\n (or more accurately, the characteristic polynomial)\n is possible, although it takes upwards of 10 minutes for *n* = 6 on my machine using `sympy`.\nThe spectra of *n* = 7, 8 are marked with an asterisk because they were computed numerically,\n which still took nearly 8 hours in the case of the latter.\nIn fact, these graphs grow so quickly that it becomes nearly impossible to compute\n the spectrum without an explicit formula.\n\nFor *n* = 8, even storing the adjacency matrix in memory is a problem.\nAssuming the use of single-precision floating point, this behemoth of a matrix is\n $(8!)^2 \\cdot 4 \\text{ bytes} = 6.5\\text{GB}$.\nThis doesn't even factor in additional space requirements for eigenvalue algorithms,\n and is the reason I certainly won't be attempting to compute the spectrum for *n* = 9.\n\n\nGallery of Adjacency Matrices\n-----------------------------\n\nThe patterns in adjacency matrices depend on an enumeration of $S_n$ so that the vertices\n can be labelled from 1 to *n*!.\nWhile this is a fascinating topic unto itself, this post is already long enough,\n and I feel comfortable with just sharing the pictures.\n\n\n### [Plain Changes](https://en.wikipedia.org/wiki/Steinhaus%E2%80%93Johnson%E2%80%93Trotter_algorithm)\n\n::: {layout-ncol=\"3\"}\n![$P_5$](plain-changes/plain_path_5.png)\n\n![$\\bigstar_5$](plain-changes/plain_star_5.png)\n\n![$K_5$](plain-changes/plain_k_5.png)\n\n![$P_6$](plain-changes/plain_path_6.png)\n\n![$\\bigstar_6$](plain-changes/plain_star_6.png)\n\n![$K_6$](plain-changes/plain_k_6.png)\n:::\n\n\n### [Heap's Algorithm](https://en.wikipedia.org/wiki/Heap%27s_algorithm)\n\n:::: {}\n::: {layout-ncol=\"3\"}\n![$P_5$](heap/heap_path_5.png)\n\n![$\\bigstar_5$](heap/heap_star_5.png)\n\n![$K_5$](heap/heap_k_5.png)\n\n![$P_6$](heap/heap_path_6.png)\n\n![$\\bigstar_6$](heap/heap_star_6.png)\n\n![$K_6$](heap/heap_k_6.png)\n:::\n\nNote: GHC's `Data.List.permutations` is slightly different from Heap's algorithm as displayed on Wikipedia\n::::\n\n\nClosing\n-------\n\nAs previously stated, I am only mostly sure of the validity of the exponential law for graphs.\nIt *seems* too good to be true, but testing it directly on some graphs by comparing the spectra\n of the exponential of the sum against the product of the exponentials shows that they are at least cospectral.\nTry it yourself, preferably with a better tool than [the ones I made in Haskell](https://github.com/queue-miscreant/SymmetricGraph).\n\nFrom the articles I was able to find, permutation star graphs have applications to parallel computing,\n which is somewhat ironic considering how little care I had for the topic when writing this article.\nIf I needed ruthless efficiency, I probably could have used a library with GPU algorithms\n (or taken a stab at writing a shader myself).\nHowever, I *was* able to use this as a learning experience regarding mutable objects in Haskell.\nWith only immutable objects (and enough garbage to create an island in the Pacific),\n I was running out of memory even with 16GB of RAM and 16GB of swap.\nIntroducing mutability not only brought improvements in space, but also a great deal of speedup,\n enough to make rendering adjacency matrix images of order 8 graphs just barely doable within\n a reasonable time span.\n\nSaid images are cursed.\nRemember, as raw bitmaps, these files are on the order of *gigabytes* big.\nOn a much weaker computer than I used to render the images, merely opening my file explorer\n to the folder containing *the folder containing* the images\n caused its all-too-eager thumbnailer to run.\nThis started consuming all of my system resources, crashed all of my browser's tabs,\n distorted audio, and finally locked up the computer.\nDespite this, PNG is a wonderful format that is able to compress them down to just 4MB,\n which demonstrates just how sparse these matrices are.\n\nDespite everything I was able to find about permutation star graphs and permutohedra,\n I was surprised that there is no information about the Cayley graphs generated by *all*\n 2-cycles (or at least information which is easy to find).\nThis is especially disappointing considering the phantom pattern which gets destroyed by 137,\n and I would love to know more about why this happens in the first place.\n\nGraph diagrams made with GeoGebra and NetworkX (GraphViz).\n\n\n### Additional Links\n\n- [Whitney Numbers of the Second Kind for the Star Poset (\n Paper from ScienceDirect\n )](https://www.sciencedirect.com/science/article/pii/S0195669813801278)\n - This article includes a section about representing a list of generators as a graph,\n making me wonder if someone has tried defining this operation before\n- [Whitney Numbers (Josh Cooper's Mathpages)](https://people.math.sc.edu/cooper/graph.html)\n- [\n The Many Faces of the Nauru Graph (Blogpost by David Eppstein)\n ](https://11011110.github.io/blog/2007/12/12/many-faces-of.html)\n\n", + "supporting": [ + "index_files" + ], + "filters": [], + "includes": {} + } +} \ No newline at end of file diff --git a/_quarto.yml b/_quarto.yml index a13a08f..976dea5 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -2,7 +2,7 @@ project: type: website website: - favicon: ./logo.png + favicon: ./logo-favicon.png title: "zenzicubi.co" navbar: logo: "/logo-vector.svg" diff --git a/index.qmd b/index.qmd index b813b7e..3a63b58 100644 --- a/index.qmd +++ b/index.qmd @@ -2,8 +2,10 @@ title: "Posts by topic" listing: contents: - - posts/polycount/index.* + - posts/permutations/index.* + - posts/chebyshev/index.* - posts/pentagons/index.* + - posts/polycount/index.* - posts/misc/*/index.* - sort: "date desc" + sort: false --- diff --git a/logo-favicon.png b/logo-favicon.png new file mode 100644 index 0000000..e24a6a9 Binary files /dev/null and b/logo-favicon.png differ diff --git a/logo.png b/logo.png deleted file mode 100644 index 6891c2f..0000000 Binary files a/logo.png and /dev/null differ diff --git a/posts/chebyshev/1/index.qmd b/posts/chebyshev/1/index.qmd index 60cf94c..9f59527 100644 --- a/posts/chebyshev/1/index.qmd +++ b/posts/chebyshev/1/index.qmd @@ -1,7 +1,7 @@ --- title: "Generating Polynomials, Part 1: Regular Constructibility" description: | - "What kinds of regular polygons are constructible with compass and straightedge?" + What kinds of regular polygons are constructible with compass and straightedge? format: html: html-math-method: katex diff --git a/posts/chebyshev/2/index.qmd b/posts/chebyshev/2/index.qmd index 78f2dd8..6d9eb6e 100644 --- a/posts/chebyshev/2/index.qmd +++ b/posts/chebyshev/2/index.qmd @@ -1,7 +1,7 @@ --- title: "Generating Polynomials, Part 2: Ghostly Chains" description: | - "What do polygons without distance still know about planar geometry?" + What do polygons without distance still know about planar geometry? format: html: html-math-method: katex diff --git a/posts/chebyshev/_metadata.yml b/posts/chebyshev/_metadata.yml new file mode 100644 index 0000000..eaf1857 --- /dev/null +++ b/posts/chebyshev/_metadata.yml @@ -0,0 +1,5 @@ +# freeze computational output +freeze: auto + +# Enable banner style title blocks +title-block-banner: true diff --git a/posts/chebyshev/extra/index.qmd b/posts/chebyshev/extra/index.qmd index db8e471..de56084 100644 --- a/posts/chebyshev/extra/index.qmd +++ b/posts/chebyshev/extra/index.qmd @@ -1,7 +1,7 @@ --- title: "Generating Polynomials Extra: Legendary" description: | - "Another series of related, orthogonal polynomials" + Another series of related, orthogonal polynomials format: html: html-math-method: katex diff --git a/posts/chebyshev/index.qmd b/posts/chebyshev/index.qmd new file mode 100644 index 0000000..ce9ef14 --- /dev/null +++ b/posts/chebyshev/index.qmd @@ -0,0 +1,10 @@ +--- +title: "Chebyshev Polynomials" +listing: + contents: . + sort: "date" +--- + +Articles about the generating Chebyshev polynomials (and other related families). + +Publication dates correspond to the original WordPress publication dates. diff --git a/posts/permutations/1/P4_powers.png b/posts/permutations/1/P4_powers.png new file mode 100644 index 0000000..7978099 Binary files /dev/null and b/posts/permutations/1/P4_powers.png differ diff --git a/posts/permutations/1/bubble_sort.gif b/posts/permutations/1/bubble_sort.gif new file mode 100644 index 0000000..30d21ec Binary files /dev/null and b/posts/permutations/1/bubble_sort.gif differ diff --git a/posts/permutations/1/destructive_selection_sort.gif b/posts/permutations/1/destructive_selection_sort.gif new file mode 100644 index 0000000..bf4baca Binary files /dev/null and b/posts/permutations/1/destructive_selection_sort.gif differ diff --git a/posts/permutations/1/example_graphs.png b/posts/permutations/1/example_graphs.png new file mode 100644 index 0000000..edd24c3 Binary files /dev/null and b/posts/permutations/1/example_graphs.png differ diff --git a/posts/permutations/1/index.qmd b/posts/permutations/1/index.qmd new file mode 100644 index 0000000..9d82a3b --- /dev/null +++ b/posts/permutations/1/index.qmd @@ -0,0 +1,491 @@ +--- +title: "A Game of Permutations, Part 1" +description: | + Some basic, interesting connections between graph theory and permutation groups. +format: + html: + html-math-method: katex +jupyter: haskell +date: "2022-01-18" +date-modified: "2025-07-04" +categories: + - graph theory + - group theory + - sorting algorithms +--- + + + +In the time since [my last post](../chebyshev/2) discussing graphs, + I have been spurred on to continue playing with them, with a slight focus on abstract algebra. +This post will primarily focus on some fundamental concepts before launching into some constructions which will make the journey down this road more manageable. +However, I will still assume you are already familiar with what both a + [group](https://mathworld.wolfram.com/Group.html) and a + [graph](https://mathworld.wolfram.com/Graph.html) are. + + +The Symmetric Group +------------------- + +Some of the most important finite groups are the symmetric groups of degree *n* ($S_n$). +They are the groups formed by permutations of lists containing *n* items. +There is a group element for each permutation, so the order of the group is the + same as the number of permutations, *n!*. + +
+ On lists versus sets + + The typical definition of the symmetric group uses sets, which are fundamentally unordered. + This is potentially confusing, since it can appear as though an object after applying + a permutation is the same object as before. + + For example, let *p* be the permutation swapping "1" and "3". + Then, + + $$ + \begin{align*} + p(\{ 1, 2, 3 \}) = \{ p(1), p(2), p(3) \} = \{ 3, 2, 1 \} + \\ + p([ 1, 2, 3 ]) = [ p(1), p(2), p(3) ] = [ 3, 2, 1 ] + \end{align*} + $$ + + After applying *p*, the set is unchanged, since all of the elements are the same. + On the other hand, the lists differ in the first element and cannot be equal. + + Sets are still useful as a container. + For example, the elements of a group are unordered. + To keep vocabulary simple, I will do my best to refer to objects in a group as + "group elements" and the objects in a list as "items". +
+ +There are many ways to denote elements of the symmetric group. +I will take the liberty of explaining some common notations, each of which are useful in different ways. +More information about them can be found [elsewhere](https://mathworld.wolfram.com/Permutation.html) + [online](https://en.wikipedia.org/wiki/Permutation#Notations) + as well as any adequate group theory text. + + +### Naive List Notation + +Arguably the simplest way to do things is to denote the permutation by the result + of applying it to a canonical list. +Take the element of $S_3$ which can be described as the action + "assign the first item to the second index, the second to the third, and the third to the first". +Our canonical list in this case is $[1, 2, 3]$, matching the degree of the group. +This results in $[3, 1, 2]$, since "1" is in now in position two, and similarly for the other items. + +Unfortunately, this choice is too result-oriented. +This choice makes it difficult to compose group elements in a meaningful way, since all + of the information about the permutation is in the position of items in the list, + rather than the items of the list themselves. +For example, under the same rule, $[c, b, a]$ is mapped to $[a, c, b]$. + + +### True List Notations (Two- and One-line Notation) + +Instead, let's go back to the definition of the element. +All we have to do is list out every index on one line, then the destination + of every index on the next. +This is known as *two-line notation*. + +$$ +\begin{pmatrix} + 1 & 2 & 3 \\ + p(1) & p(2) & p(3) +\end{pmatrix} += \begin{pmatrix} + 1 & 2 & 3 \\ + 2 & 3 & 1 +\end{pmatrix} +$$ + +For simplicity, the first row is kept as a list whose items match their indices. + +This notation makes it easier to identify the inverse of a group element. +All we have to do is sort the columns of the permutation by the second row, + then swap the two rows. + +$$ +\begin{pmatrix} + 1 & 2 & 3 \\ + 2 & 3 & 1 +\end{pmatrix}^{-1} += \begin{pmatrix} + 3 & 1 & 2 \\ + 1 & 2 & 3 +\end{pmatrix}^{-1} += \begin{pmatrix} + 1 & 2 & 3 \\ + 3 & 1 & 2 +\end{pmatrix} +$$ + +Note that the second row is now the same as the result from the naive notation. + +Since the first row will be the same in all cases, we can omit it, which results in + *one-line notation*. +The *n*th item in the list now describes the position in which *n* can be found after + the permutation. + +$$ +\begin{pmatrix} + 1 & 2 & 3 \\ + 2 & 3 & 1 +\end{pmatrix} +\equiv [\![2, 3, 1]\!] +$$ + +Double brackets are used to distinguish this as a permutation and not an ordinary list. + +These notations make it straightforward to encode symmetric group elements on a computer. +After all, we only have to read the items of a list by the indices in another. +Here's a compact definition in Haskell: + +```{haskell} +-- convenient wrapper type for below +newtype Permutation = P { unP :: [Int] } + +apply :: Permutation -> [a] -> [a] +apply = flip (\xs -> + map ( -- for each item of the permutation, map it to... + (xs !!) -- the nth item of the first list + . (+(-1)) -- (indexed starting with 1) + ) . unP) -- (after undoing the type wrapping) +-- written in a non-point free form +apply' (P xs) ys = map ( \n -> ys !! (n-1) ) xs + +print $ P [2,3,1] `apply` [1,2,3] +``` + +Note that this means `P [2,3,1]` is actually equivalent to $[\![2, 3, 1]\!]^{-1}$, + since we don't get $[3, 1, 2]$. + +While these notations are fairly explicit and easy to describe to a computer, + it's easy to misinterpret an element as its inverse. +There is also some redundancy: $[\![2, 1]\!]$ and $[\![2, 1, 3]\!]$ both describe a group element + which swaps the first two items of a list. +On one hand, the $S_n$ each belongs to is explicit, but on the other, + every element of a smaller symmetric group also belongs to a larger one. +The verbosity of these notations also makes composing group elements difficult[^1]. + +[^1]: Composition is relatively easy to describe in two-line notation. + Recall that we reordered columns when finding an inverse. + We can do so to match rows of two elements, then compose a new element + by looking at the first and last rows. + For example, with group inverses: + $$ + \begin{pmatrix} + 1 & 2 & 3 \\ + 2 & 3 & 1 + \end{pmatrix} + \begin{pmatrix} + 1 & 2 & 3 \\ + 2 & 3 & 1 + \end{pmatrix}^{-1} + = \begin{matrix} + \begin{pmatrix} + 1 & 2 & 3 \\ + \cancel{2} & \cancel{3} & \cancel{1} + \end{pmatrix} + \\ + \begin{pmatrix} + \cancel{2} & \cancel{3} & \cancel{1} \\ + 1 & 2 & 3 + \end{pmatrix} + \end{matrix} + = \begin{pmatrix} + 1 & 2 & 3 \\ + 1 & 2 & 3 + \end{pmatrix} + $$ + + +### Cycle Notation + +*Cycle notation* addresses all of these issues, but gets rid of the transparency with respect to lists. +Let's try phrasing the element we've been describing differently. + +> assign the first item to the second index, the second to the third, and the third to the first + +We start at index 1 and follow it to index 2, and from there follow it to index 3. +Continuing from index 3, we return to index 1, and from then we'd loop forever. +This describes a *cycle*, denoted as $(1 ~ 2 ~ 3)$. + +Cycle notation is much more delicate than list notation, since the notation is nonunique: + +- Naturally, the elements of a cycle may be cycled to produce an equivalent one. + - $(1 ~ 2 ~ 3) = (3 ~ 1 ~ 2) = (2 ~ 3 ~ 1)$ +- Cycles which have no common elements (i.e., are disjoint) commute, + since they act on separate parts of the list. + - $(1 ~ 2 ~ 3)(4 ~ 5) = (4 ~ 5)(1 ~ 2 ~ 3)$ + + +#### Cycle Algebra + +The true benefit of cycles is that they are easy to manipulate algebraically. +For some reason, [Wikipedia](https://en.wikipedia.org/wiki/Permutation#Cycle_notation) + does not elaborate on the composition rules for cycles, + and the text which I read as an introduction to group theory simply listed it as an exercise. +While playing around with them and deriving these rules oneself *is* a good idea, + I will list the most important here: + +- Cycles can be inverted by reversing their order. + - $(1 ~ 2 ~ 3)^{-1} = (3 ~ 2 ~ 1) = (1 ~ 3 ~ 2)$ +- Cycles may be composed if the last element in the first is the first index on the right. + Inversely, cycles may also be decomposed by partitioning on an index and duplicating. + - $(1 ~ 2 ~ 3) = (1 ~ 2)(2 ~ 3)$ +- If an index in a cycle is repeated twice, it may be omitted from the cycle. + - $(1 ~ 2 ~ 3)(1 ~ 3) = (1 ~ 2 ~ 3)(3 ~ 1) = (1 ~ 2 ~ 3 ~ 1) = (1 ~ 1 ~ 2 ~ 3) = (2 ~ 3)$ + +Going back to $(1 ~ 2 ~ 3)$, if we apply this permutation to the list $[1, 2, 3]$: + +$$ +(1 ~ 2 ~ 3) \left( \vphantom{0^{0^0}} [1, 2, 3] \right) + = (1 ~ 2)(2 ~ 3) \left( \vphantom{0^{0^0}} [1, 2, 3] \right) + = (1 ~ 2) \left( \vphantom{0^{0^0}} [1, 3, 2] \right) + = [3, 1, 2] +$$ + +Which is exactly what we expected with our naive notation. + + +Generators, Permutation Groups, and Sorting +------------------------------------------- + +If we have a group *G*, then we can select a set of elements + $\langle g_1, g_2, g_3, ... \rangle$ as *generators*. +If we form all possible products -- not only the pairwise ones $g_1 g_2$, + but also $g_1 g_2 g_3$ and all powers of any $g_n$ -- then the products form a subgroup of *G*. +Naturally, such a set is called a *generating set*. + +Symmetric groups are of primary interest because of their subgroups, also known as permutation groups. +[Cayley's theorem](https://en.wikipedia.org/wiki/Cayley%27s_theorem), + a fundamental result of group theory, states that all finite groups + are isomorphic to one of these subgroups. +This means that we can encode effectively any group using elements of the symmetric group. + +For example, consider the generating set $\langle (1 ~ 2) \rangle$, which contains a single element + that swaps the first two items of a list. +Its square is the identity, meaning that its inverse is itself. +The identity and $(1 ~ 2)$ are the only two elements of the generated group, + which is isomorphic to $C_2$, the cyclic group of order 2. +Similarly, the 3-cycle in the generating set $\langle (1 ~ 2 ~ 3) \rangle$ generates $C_3$, + the cyclic group of order 3. + +However, the generating set $\langle (1 ~ 2), (1 ~ 2 ~ 3)\rangle$, which contains both of these permutations, generates the entirety of $S_3$. +In fact, [ + every symmetric group can be generated by two elements + ](https://groupprops.subwiki.org/wiki/Symmetric_group_on_a_finite_set_is_2-generated): + a permutation which cycles all elements once, and the permutation which swaps the first two elements. + +$$ +S_n = \langle (1 ~ 2), (1 ~ 2 ~ 3 ~ 4 ~ ... ~ n) \rangle +$$ + + +### Sorting and 2-Cycles + +The proof linked to above, that every symmetric group can be generated by two elements, + uses the (somewhat obvious) result that one can produce any permutation of a list by picking two items, + swapping them, and repeating until the list is in the desired order. + +This is reminiscent of how sorting algorithms are able to sort a list by only comparing and swapping items. +As mentioned earlier when finding inverses using in two-line notation, sorting is almost the inverse of permuting. +However, not all 2-cycles are necessary to generate the whole symmetric group. + + +### Bubble Sort + +Consider [bubble sort](https://en.wikipedia.org/wiki/Bubble_sort). +In this algorithm, we swap two items when the latter is less than the former, + looping over the list until it is sorted. +Until the list is sorted, the algorithm finds all such adjacent inversions. +In the worst case, it will swap every pair of adjacent items, some possibly multiple times. +This corresponds to the generating set + $\langle (1 ~ 2), (2 ~ 3), (3 ~ 4), (4 ~ 5), …, (n-1 ~\ ~ n) \rangle$. + +![ + Bubble sort ordering a reverse-sorted list +](./bubble_sort.gif){.narrow} + + +### Selection Sort + +Another method, [selection sort](https://en.wikipedia.org/wiki/Selection_sort), + searches through the list for the smallest item and swaps it to the beginning. +If this is the final item of the list, this results in the permutation $(1 ~ n)$. +Supposing that process is continued with the second item and we also want it + to swap with the final item, then the next swap corresponds to $(2 ~ n)$. +Continuing until the last item, this gives the generating set + $\langle (1 ~ n), (2 ~ n), (3 ~ n), (4 ~ n), …, (n-1 ~\ ~ n) \rangle$. + +![ + Selection sort ordering a particular list, using only swaps with the final item +](./selection_sort.gif){.narrow} + +This behavior for selection sort is uncommon, and this animation omits the selection of a swap candidate. +The animation below shows a more destructive selection sort, in which the + candidate least item is placed at the end of the list (position 5). +Once the algorithm hits the end of the list, the candidate is swapped to the least unsorted position, + and the algorithm continues on the rest of the list. + +![ + "Destructive" selection sort. + The actual list being sorted consists of the initial four items, with the final item as temporary storage. +](./destructive_selection_sort.gif){.narrow} + + +Swap Diagrams +------------- + +Given a set of 2-cycles, it would be nice to know at a glance if the entire group is generated. +In cycle notation, a 2-cycle is an unordered pair of natural numbers which swap items of an *n*-list. +Similarly, the edges of an undirected graph on *n* vertices (labelled from 1 to *n*) + may be interpreted as an unordered pair of the vertices it connects. + +If we treat the two objects as the same, then we can convert between graphs and sets of 2-cycles. +Going from the latter to the former, we start on an empty graph on n vertices + (labelled from 1 to *n*). +Then, we connect two vertices with an edge when the set includes the permutation swapping + the indices labelled by the vertices. + +Returning to the generating sets we identified with sorting algorithms, + we identify with each a graph family. + +- Bubble sort: $\langle (1 ~ 2), (2 ~ 3), (3 ~ 4), (4 ~ 5), …, (n-1 ~~ n) \rangle$ + - The path graphs ($P_n$), which are precisely as they sound: + an unbranching path formed by *n* vertices. +- "Selection" sort: $\langle (1 ~ n), (2 ~ n), (3 ~ n), (4 ~ n), …, (n-1 ~~ n) \rangle$ + - The star graphs ($\bigstar_n$, as $S_n$ means the symmetric group), + one vertex connected to all others. +- Every 2-cycle in $S_n$ + - The complete graphs ($K_n$), which connect every vertex to every other vertex. + +![ ](./example_graphs.png) + +This interpretation of these objects doesn't have proper name, but I think the name "swap diagram" fits. +They allow us to answer at least one question about the generating set from a graph theory perspective. + + +### Connected Graphs + +A graph is connected if a path exists between all pairs of vertices. +The simplest possible path is simply a single edge, which we already know to be an available 2-cycle. + +The next simplest case is a path consisting of two edges. +Some cycle algebra shows that we can produce a third cycle which corresponds + to an edge connecting the two distant vertices. + +:::: {layout-ncol="2"} +![ ](./induced_edge.png) + +::: {} +$$ +\begin{align*} + &(m ~ n) (n ~ o) (m ~ n) \\ + &= (m ~ n ~ o) (m ~ n) \\ + &= (n ~ o ~ m) (m ~ n) \\ + &= (n ~ o ~ m ~ n) \\ + &= (o ~ m) = (m ~ o) +\end{align*} +$$ +Note that this is just the conjugation of $(n ~ o)$ by $(m ~ n)$ +::: +:::: + +In other words, if we have have two adjacent edges, the new edge corresponds to + a product of elements from the generating set. +Graph theory has a name for this operation: when we produce *all* new edges by linking vertices + that were separated by a distance of 2, the result is called the *square of that graph*. +In fact, higher [graph powers](https://en.wikipedia.org/wiki/Graph_power) will reflect connections + induced by more conjugations of adjacent edges. + +![ + As you might be able to guess, this implies that $(1 ~ 4) = (3 ~ 4)(2 ~ 3)(1 ~ 2)(2 ~ 3)(3 ~ 4)$. + Also, $\bigstar_n^2 \cong K_n$. +](./P4_powers.png) + +If our graph is connected, then repeating this operation will tend toward a complete graph. +Complete graphs contain every possible edge, and so correspond to all possible 2-cycles, + which trivially generate the symmetric group. +Conversely, if a graph has *n* vertices, then for it to be connected, it must have at least $n - 1$ edges. +Thus, a generating set of 2-cycles must have at least $n - 1$ items to generate the symmetric group. + +Picking a different vertex labelling will correspond to a different generating set. +For example, in the image of $P_4$ above, if the edge connecting vertices 1 and 2 + is replaced with an edge connecting 1 and 4, then the resulting graph + is still $P_4$, even though it describes a different generating set. +We can ignore these extra cases entirely -- either way, the graph power argument shows + that a connected graph corresponds to a set generating the whole symmetric group. + + +### Disconnected Graphs + +A disconnected graph is the + [disjoint union](https://en.wikipedia.org/wiki/Disjoint_union_of_graphs) of connected graphs. +Under graph powers, we know that each connected graph tends toward a complete graph, + meaning a disconnected graph as a whole tends toward a disjoint union of complete graphs, + or [cluster graph](https://en.wikipedia.org/wiki/Cluster_graph). +But what groups do cluster graphs correspond to? + +The simplest case to consider is what happens when the graph is $P_2 \oplus P_2$. +If there is an edge connecting vertices 1 and 2 and an edge connecting vertices 3 and 4, + it corresponds to the generating set $\langle (1 ~ 2), (3 ~ 4) \rangle$. +This is a pair of disjoint cycles, and the group they generate is + +$$ +\{e, (1 ~ 2), (3 ~ 4), (1 ~ 2)(3 ~ 4) \} + \cong S_2 \times S_2 + \cong C_2 \times C_2 +$$ + +One way to look at this is by considering paths on each component: + we can either cross an edge on the first component (corresponding to $(1 ~ 2)$), + the second component (corresponding to $(3 ~ 4)$), + or both at the same time. +This independence means that one group's structure is duplicated over the other's, + or more succinctly, gives the direct product. +In general, if we denote *γ* as the map which "runs" the swap diagram and produces the group, then + +$$ +\gamma( A \oplus B ) = S_{|A|} \times S_{|B|}, + ~ A, B \text{ connected} +$$ + +where $|A|$ is the number of vertices in *A*. + +*γ* has the interesting property of mapping a sum-like object onto a product-like object. +If we express a disconnected graph *U* as the disjoint union of its connected components $V_i$, then + +$$ +\begin{gather*} + U = \bigsqcup_i V_i + \\ + \gamma( U ) = \gamma \left( \bigsqcup_i V_i \right) = \prod_i S_{|V_i|} +\end{gather*} +$$ + +This describes *γ* for every simple graph. +It also shows that we're rather limited in the kinds of groups which can be expressed by a swap diagram. + + +Closing +------- + +This concludes the dry introduction to some investigations of mine into symmetric groups. +While I could have omitted the sections about permutation notation and generators, + I wanted to be thorough and tie it to concepts which were useful to my understanding. +The notion of a graph encoding a generating set in particular will be fairly important going forward. + +Originally, this post was half of a single, sprawling, meandering article. +I hope I've improved the organization by keeping the digression about sorting algorithms + to this initial article. +The [next post](../2) will cover some interesting structures which fill Euclidean space + and incredibly large graphs. + +Sorting and graph diagrams made with GeoGebra. diff --git a/posts/permutations/1/induced_edge.png b/posts/permutations/1/induced_edge.png new file mode 100644 index 0000000..b9124d9 Binary files /dev/null and b/posts/permutations/1/induced_edge.png differ diff --git a/posts/permutations/1/selection_sort.gif b/posts/permutations/1/selection_sort.gif new file mode 100644 index 0000000..778a54e Binary files /dev/null and b/posts/permutations/1/selection_sort.gif differ diff --git a/posts/permutations/2/exp_order_3.png b/posts/permutations/2/exp_order_3.png new file mode 100644 index 0000000..5487028 Binary files /dev/null and b/posts/permutations/2/exp_order_3.png differ diff --git a/posts/permutations/2/exp_order_4.png b/posts/permutations/2/exp_order_4.png new file mode 100644 index 0000000..eb20357 Binary files /dev/null and b/posts/permutations/2/exp_order_4.png differ diff --git a/posts/permutations/2/exp_p2_oplus_p2.png b/posts/permutations/2/exp_p2_oplus_p2.png new file mode 100644 index 0000000..a21a965 Binary files /dev/null and b/posts/permutations/2/exp_p2_oplus_p2.png differ diff --git a/posts/permutations/2/exp_p3_oplus_p2.png b/posts/permutations/2/exp_p3_oplus_p2.png new file mode 100644 index 0000000..ff3e572 Binary files /dev/null and b/posts/permutations/2/exp_p3_oplus_p2.png differ diff --git a/posts/permutations/2/exp_p4_networkx.png b/posts/permutations/2/exp_p4_networkx.png new file mode 100644 index 0000000..8d70bf1 Binary files /dev/null and b/posts/permutations/2/exp_p4_networkx.png differ diff --git a/posts/permutations/2/exp_star4_networkx.png b/posts/permutations/2/exp_star4_networkx.png new file mode 100644 index 0000000..8da7486 Binary files /dev/null and b/posts/permutations/2/exp_star4_networkx.png differ diff --git a/posts/permutations/2/graph_data/__init__.py b/posts/permutations/2/graph_data/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/posts/permutations/2/graph_data/base.py b/posts/permutations/2/graph_data/base.py new file mode 100644 index 0000000..22f6ed6 --- /dev/null +++ b/posts/permutations/2/graph_data/base.py @@ -0,0 +1,141 @@ +from dataclasses import dataclass +import sympy +from sympy.abc import x + + +def display_integral_root( + root: int, multiplicity: int, pad_to: int | None = None +) -> str: + return ( + "(" + # denote sign + + ("\\pm" if root != 0 else "") + + str(root) + + ")^{" + + str(multiplicity) + # pad multiplicity + + ( + ("\\phantom{" + ("0" * (pad_to - len(str(multiplicity))) + "}")) + if pad_to is not None and len(str(multiplicity)) < pad_to + else "" + ) + + "}" + ) + + +@dataclass +class SymmetricSpectrum: + """ + Dataclass for symmetric spectra -- those for which, if a spectrum contains a root, + it also contains its negative. + + If a root polynomial is not symmetric, then its symmetric counterpart will *not* be specified. + """ + + # Either the integral root or a polynomial with the root, and the multiplicity + roots: list[tuple[sympy.Expr | int, int]] + not_shown_count: int = 0 + + def to_markdown(self) -> str: + """ + Display a spectrum as a markdown string + """ + integer_roots = [ + (root, multiplicity) + for root, multiplicity in self.roots + if isinstance(root, int) + ] + # symmetrify polynomials + polynomial_roots = [ + (root, multiplicity) + for base_root, multiplicity in self.roots + if isinstance(base_root, sympy.Expr) + for root in set( + [base_root, (-1) ** (sympy.degree(base_root)) * base_root.subs(x, -x)] + ) + ] + + shown_roots = len(polynomial_roots) > 0 or len(integer_roots) > 0 + not_shown_string = ( + ( + f"*Not shown: {self.not_shown_count} other roots*" + if shown_roots + else f"*Not shown: all {self.not_shown_count} roots*" + ) + if self.not_shown_count > 0 + else "" + ) + + # strictly integral spectra + if len(polynomial_roots) == 0 and len(integer_roots) != 0: + longest_integer = max( + len(str(multiplicity)) for _, multiplicity in integer_roots + ) + return ( + ( + "$$\\begin{gather*}" + + " \\\\ ".join( + display_integral_root(*rm, pad_to=longest_integer) + for rm in integer_roots + ) + + "\\end{gather*}$$" + ) + if shown_roots + else "" + ) + not_shown_string + + # conditionally split integral roots onto multiple lines + integral_roots_lines = ( + " ".join(display_integral_root(*rm) for rm in integer_roots) + if len(integer_roots) < 5 + else ( + " ".join( + display_integral_root(*rm) + for rm in integer_roots[: len(integer_roots) // 2] + ) + + "\\\\" + + " ".join( + display_integral_root(*rm) + for rm in integer_roots[len(integer_roots) // 2 :] + ) + ) + ) + + return ( + ( + "$$\\begin{gather*}" + + integral_roots_lines + + " \\\\ " + + " \\\\ ".join( + sympy.latex(root**multiplicity) + for root, multiplicity in polynomial_roots + ) + + "\\end{gather*}$$" + ) + if shown_roots + else "" + ) + not_shown_string + + +def count_roots_spectrum(spectrum: SymmetricSpectrum) -> int: + return ( + sum( + [ + ( + (multiplicity * 2 if root != 0 else multiplicity) + if isinstance(root, int) + else (int(sympy.degree(root, x)) * multiplicity) + ) + for root, multiplicity in spectrum.roots + ] + ) + + spectrum.not_shown_count + ) + + +@dataclass +class GraphData: + spectrum: SymmetricSpectrum + vertex_count: int | None = None + edge_count: int | None = None + distance_classes: list[int] | None = None diff --git a/posts/permutations/2/graph_data/complete.py b/posts/permutations/2/graph_data/complete.py new file mode 100644 index 0000000..e37ed6b --- /dev/null +++ b/posts/permutations/2/graph_data/complete.py @@ -0,0 +1,80 @@ +from .base import GraphData, SymmetricSpectrum + +# TODO: other non-spectral data +data = { + 3: GraphData( + vertex_count=6, + edge_count=9, + distance_classes=[1, 3, 2], + spectrum=SymmetricSpectrum([(0, 4), (3, 1)]), + ), + 4: GraphData( + vertex_count=24, + edge_count=72, + distance_classes=[1, 6, 11, 6], + spectrum=SymmetricSpectrum([(0, 4), (2, 9), (6, 1)]), + ), + 5: GraphData( + vertex_count=120, + edge_count=600, + distance_classes=[1, 10, 35, 50, 24], + spectrum=SymmetricSpectrum( + [ + (0, 36), + (2, 25), + (5, 16), + (10, 1), + ] + ), + ), + 6: GraphData( + vertex_count=720, + edge_count=5400, + distance_classes=[1, 15, 85, 225, 274, 120], + spectrum=SymmetricSpectrum( + [ + (0, 256), + (3, 125), + (5, 81), + (9, 25), + (15, 1), + ] + ), + ), + 7: GraphData( + vertex_count=5040, + edge_count=52920, + distance_classes=[1, 21, 175, 735, 1624, 1764, 720], + spectrum=SymmetricSpectrum( + [ + (0, 400), + (1, 441), + (3, 1225), + (6, 196), + (7, 225), + (9, 196), + (14, 36), + (21, 1), + ] + ), + ), + 8: GraphData( + vertex_count=40320, + spectrum=SymmetricSpectrum( + [ + (0, 9864), + (2, 3136), + (4, 6125), + (7, 4096), + (8, 196), + (10, 784), + (12, 441), + (14, 400), + (20, 49), + (28, 1), + ] + ), + ), +} + +# TODO (maybe): verify these quantities with outputs from Haskell diff --git a/posts/permutations/2/graph_data/path.py b/posts/permutations/2/graph_data/path.py new file mode 100644 index 0000000..3f951b1 --- /dev/null +++ b/posts/permutations/2/graph_data/path.py @@ -0,0 +1,100 @@ +from .base import SymmetricSpectrum, GraphData, x + +data = { + 3: GraphData( + vertex_count=6, + edge_count=6, + distance_classes=[1, 2, 2, 1], + spectrum=SymmetricSpectrum([(1, 2), (2, 1)]), + ), + 4: GraphData( + vertex_count=24, + edge_count=36, + distance_classes=[1, 3, 5, 6, 5, 3, 1], + spectrum=SymmetricSpectrum( + [ + (1, 3), + (3, 1), + (x**2 - 3, 2), + (x**2 - 2 * x - 1, 3), + (x**2 + 2 * x - 1, 3), + ] + ), + ), + 5: GraphData( + vertex_count=120, + edge_count=240, + distance_classes=[1, 4, 9, 15, 20, 22, 20, 15, 9, 4, 1], + spectrum=SymmetricSpectrum( + [ + (0, 12), + (1, 6), + (4, 1), + (x**2 - 5, 6), + (x**2 + 5 * x + 5, 4), + (x**2 + 3 * x + 1, 4), + (x**2 + 2 * x - 1, 5), + (x**3 + 2 * x**2 - 5 * x - 4, 5), + ] + ), + ), + 6: GraphData( + vertex_count=720, + edge_count=1800, + distance_classes=[1, 5, 14, 29, 49, 71, 90, 101, 101, 90, 71, 49, 29, 14, 5, 1], + spectrum=SymmetricSpectrum( + [ + (0, 20), + (1, 25), + (2, 15), + (3, 5), + (4, 5), + (5, 1), + (x**2 - 3, 20), + ], + not_shown_count=558, + ), + ), + 7: GraphData( + vertex_count=5040, + edge_count=15120, + distance_classes=[ + 1, + 6, + 20, + 49, + 98, + 169, + 259, + 359, + 455, + 531, + 573, + 573, + 531, + 455, + 359, + 259, + 169, + 98, + 49, + 20, + 6, + 1, + ], + spectrum=SymmetricSpectrum( + [ + (0, 35), + (1, 20), + (2, 45), + (6, 1), + ], + not_shown_count=4873, + ), + ), + 8: GraphData( + vertex_count=40320, spectrum=SymmetricSpectrum([], not_shown_count=40320) + ), +} + +# TODO (maybe): verify these quantities with outputs from Haskell diff --git a/posts/permutations/2/graph_data/star.py b/posts/permutations/2/graph_data/star.py new file mode 100644 index 0000000..cd5276f --- /dev/null +++ b/posts/permutations/2/graph_data/star.py @@ -0,0 +1,85 @@ +from .base import SymmetricSpectrum, GraphData + +data = { + 3: GraphData( + vertex_count=6, + edge_count=6, + distance_classes=[1, 2, 2, 1], + spectrum=SymmetricSpectrum([(1, 2), (2, 1)]), + ), + 4: GraphData( + vertex_count=24, + edge_count=36, + distance_classes=[1, 3, 6, 9, 5], + spectrum=SymmetricSpectrum( + [ + (0, 4), + (1, 3), + (2, 6), + (3, 1), + ] + ), + ), + 5: GraphData( + vertex_count=120, + edge_count=240, + distance_classes=[1, 4, 12, 30, 44, 26, 3], + spectrum=SymmetricSpectrum( + [ + (0, 30), + (1, 4), + (2, 28), + (3, 12), + (4, 1), + ] + ), + ), + 6: GraphData( + vertex_count=720, + edge_count=1800, + distance_classes=[1, 5, 20, 70, 170, 250, 169, 35], + spectrum=SymmetricSpectrum( + [ + (0, 168), + (1, 30), + (2, 120), + (3, 105), + (4, 20), + (5, 1), + ] + ), + ), + 7: GraphData( + vertex_count=5040, + edge_count=15120, + distance_classes=[1, 6, 30, 135, 460, 1110, 1689, 1254, 340, 15], + spectrum=SymmetricSpectrum( + [ + (0, 840), + (1, 468), + (2, 495), + (3, 830), + (4, 276), + (5, 30), + (6, 1), + ] + ), + ), + 8: GraphData( + vertex_count=40320, + spectrum=SymmetricSpectrum( + [ + (0, 3960), + (1, 5691), + (2, 2198), + (3, 6321), + (4, 3332), + (5, 595), + (6, 42), + (7, 1), + ] + ), + ), +} + +# TODO (maybe): verify these quantities with outputs from Haskell diff --git a/posts/permutations/2/heap/heap_k_5.png b/posts/permutations/2/heap/heap_k_5.png new file mode 100644 index 0000000..b31a95e Binary files /dev/null and b/posts/permutations/2/heap/heap_k_5.png differ diff --git a/posts/permutations/2/heap/heap_k_6.png b/posts/permutations/2/heap/heap_k_6.png new file mode 100644 index 0000000..64057ab Binary files /dev/null and b/posts/permutations/2/heap/heap_k_6.png differ diff --git a/posts/permutations/2/heap/heap_path_5.png b/posts/permutations/2/heap/heap_path_5.png new file mode 100644 index 0000000..1090f02 Binary files /dev/null and b/posts/permutations/2/heap/heap_path_5.png differ diff --git a/posts/permutations/2/heap/heap_path_6.png b/posts/permutations/2/heap/heap_path_6.png new file mode 100644 index 0000000..7d59b06 Binary files /dev/null and b/posts/permutations/2/heap/heap_path_6.png differ diff --git a/posts/permutations/2/heap/heap_star_5.png b/posts/permutations/2/heap/heap_star_5.png new file mode 100644 index 0000000..c579385 Binary files /dev/null and b/posts/permutations/2/heap/heap_star_5.png differ diff --git a/posts/permutations/2/heap/heap_star_6.png b/posts/permutations/2/heap/heap_star_6.png new file mode 100644 index 0000000..2cd043f Binary files /dev/null and b/posts/permutations/2/heap/heap_star_6.png differ diff --git a/posts/permutations/2/index.qmd b/posts/permutations/2/index.qmd new file mode 100644 index 0000000..43d1dc2 --- /dev/null +++ b/posts/permutations/2/index.qmd @@ -0,0 +1,518 @@ +--- +title: "A Game of Permutations, Part 2" +description: | + Notes on an operation which makes some very large graphs. +format: + html: + html-math-method: katex +jupyter: python3 +date: "2022-01-18" +date-modified: "2025-07-06" +categories: + - graph theory + - group theory +--- + + + +```{python} +#| echo: false + +from IPython.display import Markdown +from tabulate import tabulate + +from graph_data import complete, path, star +``` + + +This post assumes you have read (or at least skimmed over parts of) the [first post](../1), + which talks about graphs and the symmetric group. +This post will contain some more "empirical" results, since I'm not an expert on graph theory. +However, one hardly needs to be an expert to learn or to make computations, observations, and predictions. + +We left off talking about producing a group from a graph, so we begin now by considering how to do the reverse. + + +Cayley Graphs +------------- + +For a given generating set, we can assign every element in the group it generates to a vertex in a graph. +Starting with each of the generators, we draw edges from one vertex to another when + the product of the initial vertex and a generator (in that order) is the product vertex. +This process continues until there are no more arrows to draw. +The resulting figure is known as a [Cayley graph](https://mathworld.wolfram.com/CayleyGraph.html)[^1]. + +[^1]: The construction implies a labelling of edges by its generating set and a labelling + of vertices by the generated elements. + It is also common to describe an unlabelled graph as "Cayley" if it could + be generated by this procedure. + +Cayley graphs depend on the generating set used, so they can take a wide variety of shapes. +Here are a few examples of Cayley graphs made from elements of $S_4$: + +![ + Left: $\{(1 ~ 3 ~ 2 ~ 4), (3 ~ 4), (1 ~ 4 ~ 2 ~ 3)\}$, cube graph
+ Middle: $\{(1 ~ 2 ~ 3), (2 ~ 3 ~ 4)\}$, cuboctahedral graph
+ Right: $\{(2 ~ 3), (3 ~ 4), (2 ~ 3 ~ 4)\}$, octahedral graph
+ Generating sets obtained from the previous MathWorld article. +](./s4_cayley_graphs.png) + +Owing to the way in which they are defined, Cayley graphs have a few useful properties as graphs. +At every vertex, we have as many outward edges as we do generators in the generating set, + so the outward (and in fact, inward) degree of each vertex is the same. +In other words, it is a regular graph. +More than that, it is [vertex-transitive](https://mathworld.wolfram.com/Vertex-TransitiveGraph.html), + since labelling a single vertex's outward edges will label that of the entire graph. + +In general, the Cayley graph is a directed graph. +However, if for every member of the generating set, we also include its inverse, + every directed edge will be matched by an edge in the opposite direction, + and the Cayley graph may be considered undirected. + + +Graphs to Graphs +---------------- + +All 2-cycles are their own inverse, so generating sets which include only them + produce undirected Cayley graphs. +Since this kind of generating set can itself be thought of as a graph, + we may consider an operation on graphs that maps a swap diagram to its Cayley graph. + +![ + An example of this operation, denoted as $\exp$. + The proper Cayley graphs for $(1 ~ 2)$ and $(3 ~ 4)$ are not shown; + they are isomorphic to the corresponding swap graphs, but have different vertex labels. +](./exp_p2_oplus_p2.png) + +It seems to be the case that $\exp( A \oplus B ) = \exp( A ) \times \exp( B )$, + where $\oplus$ signifies the disjoint uinion and $\times$ signifies the + [Cartesian (box) product of graphs](https://en.wikipedia.org/wiki/Cartesian_product_of_graphs)[^2]. +Unlike *γ* from the previous post, both the input and output of this operation are graphs. +Because of this and the sum/product relationship, I've taken to calling this operation the + "graph exponential"[^3]. + +[^2]: Graphs have many product structures, such as the tensor product and strong product. + The Cartesian product is (categorically) more natural when paired with disjoint unions. + +[^3]: Originally, I called this operation the "graph factorial", since it involves permutations + and the number of vertices in the resulting graph grows factorially. + +This operation is my own invention, so I am unsure whether or not + it constitutes anything useful. +In fact, the possible graphs grow so rapidly that computing anything about the exponential + of order 8 graphs starts to overwhelm a single computer. +It is, however, interesting, as I will hopefully be able to convince. + +A random graph will not generally correspond to an interesting generating set, + and therefore, will also generally have an uninteresting exponential graph. +Hence, I will continue with the examples used previously: paths, stars, and complete graphs. +They are among the simplest graphs one can consider, and as we will see shortly, + have exponentials which appear to have natural correspondences to other graph families. + + +Some Small Exponential Graphs +----------------------------- + +Because of [the difficulty in determining graph isomorphism]( + https://en.wikipedia.org/wiki/Graph_isomorphism_problem + ), it is challenging for a computer to find a graph in an encyclopedia. +Computers think of graphs as a list of vertices and their outward edges, + but this implementation faces inherent labelling issues. +These persist even if the graph is described as a list of (un)ordered pairs, + an adjacency matrix, or an incidence matrix, + the latter two of which have very large memory footprints[^4]. + +[^4]: I was able to locate a project named the + [Encyclopedia of Finite Graphs](https://github.com/thoppe/Encyclopedia-of-Finite-Graphs), + but it is only able to build a database simple connected graphs which + can be queried by invariants (and is outdated since it uses Python 2). + +However, as visual objects, humans can compare graphs fairly easily + -- the name means "drawing" after all. +Exponentials of order 3 and order 4 graphs are neither so small as to be uninteresting + nor so big as to be unparsable by humans. + + +### Order 3 + +![ ](./exp_order_3.png){.narrow} + +At this stage, we only really have two graphs to consider, since $P_3 = \bigstar_3$. +Immediately, one can see that $\exp( P_3 ) = \exp( \bigstar_3 ) = C_6$, + the 6-cycle graph (or hexagonal graph). +It is also apparent that $\exp( K_3 )$ is the utility graph, $K_{3,3}$. + +![ + Graph exponential of a disconnected graph.
+ Note that the red element commutes with the green and blue ones. + This produces two types of squares in the exponential graph. + Meanwhile, the green and blue elements have an order 3 product, and produce the hexagon. +](./exp_p3_oplus_p2.png) + +Here, we can again demonstrate the sum rule of the graph exponential with $\exp( P_3 \oplus P_2 )$. +Simplifying, since we know $\exp( P_3 ) = C_6$, the result is $C_6 \times P_2 = \text{Prism}_6$, + the hexagonal prism graph. + + +### Order 4 (and beyond) + +::: {layout="[[1,1],[1]]"} +![$\exp( P_4 )$](./exp_p4_networkx.png) + +![$\exp( \bigstar_4 )$](./exp_star4_networkx.png) + +![](./exp_order_4.png) +::: + +With some effort, $\exp( P_4 )$ can be imagined as a projection of a 3D object, + the [truncated octahedron](https://en.wikipedia.org/wiki/Truncated_octahedron). +Because of its correspondence to a 3D solid, this graph is planar. +Both the hexagon and this solid belong to a class of polytopes called + [*permutohedra*](https://en.wikipedia.org/wiki/Permutohedron), which are figures + that are also formed by permutations of the coordinate (1, 2, 3, ..., *n*) in Euclidean space[^5]. +Technically, there is a distinction between the Cayley graphs and permutohedra + since their labellings differ. +Both have edges generated by swaps, but in the latter case, the connected vertices are expected to be + separated by a certain distance. +More information about the distinction can be found at this article on [Wikimedia]( + https://commons.wikimedia.org/wiki/Category:Permutohedron_of_order_4_%28raytraced%29#Permutohedron_vs._Cayley_graph + )[^6]. + +[^5]: In fact, these figures are able to completely tessellate the $n-1$ dimensional subspace of + $\mathbb{R}^n$ where the coordinates sum to the $n-1$th triangular number. + Note also that the previous graph in the sequence of $\exp(P_n)$, the hexagonal graph, + is visible in the truncated octahedron. + This corresponds to the projection $(x,y,z,w) \mapsto (x,y,z)$ over + the coordinates of the permutohedra. + +[^6]: Actually, if one considers a *right* Cayley graph, where each generator is right-multiplied + to the permutation at a node rather than left-multiplied, then a true correspondence is obtained, + at least for order 4. + +Meanwhile, $\exp( \bigstar_4 )$ is more difficult to identify, at least without rearranging its vertices. +It turns out to be isomorphic to the [Nauru graph](https://mathworld.wolfram.com/NauruGraph.html), + a graph with many strange properties. +Notably, whereas the graph isomorphic to the permutohedron is obviously a spherical polyhedron, + the Nauru graph can be topologically embedded on a torus. +The Nauru graph also belongs to the family of + [permutation star graphs](https://mathworld.wolfram.com/PermutationStarGraph.html) + $PS_n$ (*n* = 4), which also includes the hexagonal graph (*n* = 3). +The MathWorld article confirms some kind of correspondence, stating graphs of this form + are generated by pairwise swaps. + +My attempts at finding a graph isomorphic to $\exp( K_4 )$ have thus far ended in failure. +It is certainly *not* isomorphic to $K_{4,4}$, since this graph has 8 vertices, + as opposed to 24 in $\exp( K_4 )$. + + +Graph Invariants +---------------- + +While I have managed to identify the families to which some of these graphs belong, + I am rather fond of computing (and conjecturing) sequences from objects. +Not only is it much easier to consult something like [the OEIS](https://oeis.org/) for these quantities, + but after finding a matching sequence, there are ample articles to consult for more information. +By linking to their respective entries, I hope you'll consider reading more there. + +Even though I have obtained these values empirically, I am certain that the sequences for + $\exp( P_n )$ and $\exp( \bigstar_n )$ match the corresponding OEIS entries. +I also have great confidence in the sequences I found for $\exp( K_n )$. + + +### Edge Counts + +Despite knowing how many vertices there are (*n*!, the order of the symmetric group), + we don't necessarily know how many edges there are. + +```{python} +#| echo: false +#| classes: plain + +Markdown(tabulate( + [ + [i, pathG.edge_count, starG.edge_count, completeG.edge_count] + for i in range(3, 8) + for pathG, starG, completeG in ( + [path.data[i], star.data[i], complete.data[i]], + ) + ] + [ + [ + "Sequence", + "Second column of Lah numbers
[OEIS A001286](http://oeis.org/A001286)", + "Same as previous", + "[OEIS 001809](http://oeis.org/A001809)", + ], + [ + "Rule", + r"$L(n,2) = n!{(n-1)(n-2) \over 4}$", + "", + r"$n!{n(n-1) \over 4}$" + ] + ], + headers=[ + "*n*", + r"$\#E(\exp( P_n ))$", + r"$\#E(\exp( \bigstar_n ))$", + r"$\#E(\exp( K_n ))$" + ] +)) +``` + + +### Radius and Distance Classes + +The radius of a graph is the smallest possible distance which separates two maximally-separated vertices. +Due to vertex transitivity, the greatest distance between two vertices is the same for every vertex. + +```{python} +#| echo: false +#| classes: plain + +Markdown(tabulate( + [ + [i, len(pathG), len(starG), len(completeG)] + for i in range(3, 8) + for pathG, starG, completeG in ( + [path.data[i].distance_classes, star.data[i].distance_classes, complete.data[i].distance_classes], + ) + ] + [ + [ + "Sequence", + "Triangular numbers
[OEIS A000217](http://oeis.org/A000217)", + "Integers not congruent to 2 (mod 3)
[OEIS A032766](http://oeis.org/A032766)", + "*n* - 1" + ], + [ + "Rule", + r"$\Delta_{n-1} = {n(n-1) \over 2}$", + r"$\lfloor {n-1 \over 2} \rfloor + n -\ 1$" + ] + ], + headers=[ + "*n*", + r"$r(\exp( P_n ))$", + r"$r(\exp( \bigstar_n ))$", + r"$r(\exp( K_n ))$" + ] +)) +``` + +These quantities are somewhat reductive. +If a vertex is distinguished, the remaining vertices may be partitioned into classes by their + distance from it. +Including the vertex itself (which is distance 0 away), there will be $r + 1$ such classes, + where *r* is the radius. +These classes are the same for every vertex due to transitivity. + +In the case of these graphs, they are a partition of *n*!. + +```{python} +#| echo: false +#| classes: plain + +half_break = lambda x: str(x[:len(x) // 2])[:-1] + "
" + str(x[len(x) // 2:])[1:] + +Markdown(tabulate( + [ + [i, pathG if i <= 5 else half_break(pathG), starG, completeG] + for i in range(3, 8) + for pathG, starG, completeG in ( + [path.data[i].distance_classes, star.data[i].distance_classes, complete.data[i].distance_classes], + ) + ] + [ + [ + "Sequence", + "Mahonian numbers
[OEIS A008302](http://oeis.org/A008302)", + "Whitney numbers of the second kind (star poset)
[OEIS A007799](http://oeis.org/A007799)", + "Stirling numbers of the first kind
[OEIS A132393](http://oeis.org/A132393)" + ] + ], + headers=[ + "*n*", + r"$\text{dists}(\exp( P_n ))$", + r"$\text{dists}(\exp( \bigstar_n ))$", + r"$\text{dists}(\exp( K_n ))$" + ] +)) +``` + +I am certain that the appearance of the Stirling numbers here is legitimate, + since these numbers count the number of permutations of *n* objects with *k* disjoint cycles. +Obviously, the identity element is distance 1 from all 2-cycles since they are all in the generating set; + likewise, all 3-cycles are distance 2 from the identity (but distance 1 from the 2-cycles), + and so on until the entire graph has been mapped. +The shapes induced by these classes were used to create the diagrams + of $\exp( K_3 )$ and $\exp( K_4 )$ above. + + +#### Spectrum + +The eigenvalues of the adjacency matrix of a graph can be interesting + and sometimes help in identifying a graph. +Unfortunately, eigenvalues are not necessarily integers, and therefore not easily + found in the OEIS (though they are always real for graphs). + +```{python} +#| echo: false +#| classes: plain + +Markdown(tabulate( + [ + [i, pathG.to_markdown(), starG.to_markdown(), completeG.to_markdown()] + for i in range(3, 9) + for pathG, starG, completeG in ( + [path.data[i].spectrum, star.data[i].spectrum, complete.data[i].spectrum], + ) + ], + headers=[ + "*n*", + r"$\text{Spec}(\exp( P_n ))$", + r"$\text{Spec}(\exp( \bigstar_n )$", + r"$\text{Spec}(\exp( K_n ))$" + ] +)) +``` + +From what I have been able to identify, the spectrum of an exponential graph is symmetric about 0, + by which I mean that the characteristic polynomial is even. +This has been the case for all graphs I have tried testing, even outside these graph families. + +Since all eigenvalues of $\exp( \bigstar_n )$ calculated are integers, + it appears they are integral graphs, a fact of which I am reasonably sure + because of the aforementioned correspondence to permutation star graphs. +Additionally, the eigenvalues are very conveniently the integers up to $n-1$ and down to $-n+1$. +Unfortunately, despite the ease of reading the eigenvalues themselves, + there isn't an OEIS entry for the multiplicities. +I was able to identify the multiplicity of the 0 eigenvalue with + [OEIS A217213](http://oeis.org/A217213), which counts orderings on Dyck paths. +If this is truly the sequence being generated, it means there is a 1:1 correspondence between + these orderings and a basis of the nullspace of the adjacency matrix. + +It seems to be the case that $\exp( K_n )$ are also integral graphs. +Perplexingly, the multiplicities for each of the eigenvalues appear to mostly be perfect powers. +This is the case until n = 8, which ruins the pattern because neither of + $9864 = 2^3 \cdot 3^2 \cdot 137$ or $6125 = 5^3 \cdot 7^2$ are perfect powers. +I find both this[^7] and the fact that such a large prime appears among the factorization of the former + rather creepy since all other primes which appear here are small -- 2, 3, 5, and 7. + +[^7]: Some physicists are fond of 137 for its closeness to the reciprocal + of the fine structure constant (a bit of mostly-harmless numerology). + + +### Notes about Spectral Computation + +For *n* = 3 through 6, exactly computing the spectrum + (or more accurately, the characteristic polynomial) + is possible, although it takes upwards of 10 minutes for *n* = 6 on my machine using `sympy`. +The spectra of *n* = 7, 8 are marked with an asterisk because they were computed numerically, + which still took nearly 8 hours in the case of the latter. +In fact, these graphs grow so quickly that it becomes nearly impossible to compute + the spectrum without an explicit formula. + +For *n* = 8, even storing the adjacency matrix in memory is a problem. +Assuming the use of single-precision floating point, this behemoth of a matrix is + $(8!)^2 \cdot 4 \text{ bytes} = 6.5\text{GB}$. +This doesn't even factor in additional space requirements for eigenvalue algorithms, + and is the reason I certainly won't be attempting to compute the spectrum for *n* = 9. + + +Gallery of Adjacency Matrices +----------------------------- + +The patterns in adjacency matrices depend on an enumeration of $S_n$ so that the vertices + can be labelled from 1 to *n*!. +While this is a fascinating topic unto itself, this post is already long enough, + and I feel comfortable with just sharing the pictures. + + +### [Plain Changes](https://en.wikipedia.org/wiki/Steinhaus%E2%80%93Johnson%E2%80%93Trotter_algorithm) + +::: {layout-ncol="3"} +![$P_5$](plain-changes/plain_path_5.png) + +![$\bigstar_5$](plain-changes/plain_star_5.png) + +![$K_5$](plain-changes/plain_k_5.png) + +![$P_6$](plain-changes/plain_path_6.png) + +![$\bigstar_6$](plain-changes/plain_star_6.png) + +![$K_6$](plain-changes/plain_k_6.png) +::: + + +### [Heap's Algorithm](https://en.wikipedia.org/wiki/Heap%27s_algorithm) + +:::: {} +::: {layout-ncol="3"} +![$P_5$](heap/heap_path_5.png) + +![$\bigstar_5$](heap/heap_star_5.png) + +![$K_5$](heap/heap_k_5.png) + +![$P_6$](heap/heap_path_6.png) + +![$\bigstar_6$](heap/heap_star_6.png) + +![$K_6$](heap/heap_k_6.png) +::: + +Note: GHC's `Data.List.permutations` is slightly different from Heap's algorithm as displayed on Wikipedia +:::: + + +Closing +------- + +As previously stated, I am only mostly sure of the validity of the exponential law for graphs. +It *seems* too good to be true, but testing it directly on some graphs by comparing the spectra + of the exponential of the sum against the product of the exponentials shows that they are at least cospectral. +Try it yourself, preferably with a better tool than [the ones I made in Haskell](https://github.com/queue-miscreant/SymmetricGraph). + +From the articles I was able to find, permutation star graphs have applications to parallel computing, + which is somewhat ironic considering how little care I had for the topic when writing this article. +If I needed ruthless efficiency, I probably could have used a library with GPU algorithms + (or taken a stab at writing a shader myself). +However, I *was* able to use this as a learning experience regarding mutable objects in Haskell. +With only immutable objects (and enough garbage to create an island in the Pacific), + I was running out of memory even with 16GB of RAM and 16GB of swap. +Introducing mutability not only brought improvements in space, but also a great deal of speedup, + enough to make rendering adjacency matrix images of order 8 graphs just barely doable within + a reasonable time span. + +Said images are cursed. +Remember, as raw bitmaps, these files are on the order of *gigabytes* big. +On a much weaker computer than I used to render the images, merely opening my file explorer + to the folder containing *the folder containing* the images + caused its all-too-eager thumbnailer to run. +This started consuming all of my system resources, crashed all of my browser's tabs, + distorted audio, and finally locked up the computer. +Despite this, PNG is a wonderful format that is able to compress them down to just 4MB, + which demonstrates just how sparse these matrices are. + +Despite everything I was able to find about permutation star graphs and permutohedra, + I was surprised that there is no information about the Cayley graphs generated by *all* + 2-cycles (or at least information which is easy to find). +This is especially disappointing considering the phantom pattern which gets destroyed by 137, + and I would love to know more about why this happens in the first place. + +Graph diagrams made with GeoGebra and NetworkX (GraphViz). + + +### Additional Links + +- [Whitney Numbers of the Second Kind for the Star Poset ( + Paper from ScienceDirect + )](https://www.sciencedirect.com/science/article/pii/S0195669813801278) + - This article includes a section about representing a list of generators as a graph, + making me wonder if someone has tried defining this operation before +- [Whitney Numbers (Josh Cooper's Mathpages)](https://people.math.sc.edu/cooper/graph.html) +- [ + The Many Faces of the Nauru Graph (Blogpost by David Eppstein) + ](https://11011110.github.io/blog/2007/12/12/many-faces-of.html) diff --git a/posts/permutations/2/plain-changes/plain_k_5.png b/posts/permutations/2/plain-changes/plain_k_5.png new file mode 100644 index 0000000..67924f7 Binary files /dev/null and b/posts/permutations/2/plain-changes/plain_k_5.png differ diff --git a/posts/permutations/2/plain-changes/plain_k_6.png b/posts/permutations/2/plain-changes/plain_k_6.png new file mode 100644 index 0000000..1d20978 Binary files /dev/null and b/posts/permutations/2/plain-changes/plain_k_6.png differ diff --git a/posts/permutations/2/plain-changes/plain_path_5.png b/posts/permutations/2/plain-changes/plain_path_5.png new file mode 100644 index 0000000..e7ef642 Binary files /dev/null and b/posts/permutations/2/plain-changes/plain_path_5.png differ diff --git a/posts/permutations/2/plain-changes/plain_path_6.png b/posts/permutations/2/plain-changes/plain_path_6.png new file mode 100644 index 0000000..a8509f1 Binary files /dev/null and b/posts/permutations/2/plain-changes/plain_path_6.png differ diff --git a/posts/permutations/2/plain-changes/plain_star_5.png b/posts/permutations/2/plain-changes/plain_star_5.png new file mode 100644 index 0000000..f1324f3 Binary files /dev/null and b/posts/permutations/2/plain-changes/plain_star_5.png differ diff --git a/posts/permutations/2/plain-changes/plain_star_6.png b/posts/permutations/2/plain-changes/plain_star_6.png new file mode 100644 index 0000000..79cfa68 Binary files /dev/null and b/posts/permutations/2/plain-changes/plain_star_6.png differ diff --git a/posts/permutations/2/s4_cayley_graphs.png b/posts/permutations/2/s4_cayley_graphs.png new file mode 100644 index 0000000..c82b9a6 Binary files /dev/null and b/posts/permutations/2/s4_cayley_graphs.png differ diff --git a/posts/permutations/3/coxeter_a2.png b/posts/permutations/3/coxeter_a2.png new file mode 100644 index 0000000..c40816d Binary files /dev/null and b/posts/permutations/3/coxeter_a2.png differ diff --git a/posts/permutations/3/coxeter_a2_both.png b/posts/permutations/3/coxeter_a2_both.png new file mode 100644 index 0000000..8070733 Binary files /dev/null and b/posts/permutations/3/coxeter_a2_both.png differ diff --git a/posts/permutations/3/coxeter_a3_generator_b.png b/posts/permutations/3/coxeter_a3_generator_b.png new file mode 100644 index 0000000..4086726 Binary files /dev/null and b/posts/permutations/3/coxeter_a3_generator_b.png differ diff --git a/posts/permutations/3/coxeter_a3_pair.png b/posts/permutations/3/coxeter_a3_pair.png new file mode 100644 index 0000000..d9b6fe0 Binary files /dev/null and b/posts/permutations/3/coxeter_a3_pair.png differ diff --git a/posts/permutations/3/coxeter_an.png b/posts/permutations/3/coxeter_an.png new file mode 100644 index 0000000..4c400dc Binary files /dev/null and b/posts/permutations/3/coxeter_an.png differ diff --git a/posts/permutations/3/index.qmd b/posts/permutations/3/index.qmd new file mode 100644 index 0000000..f223a1e --- /dev/null +++ b/posts/permutations/3/index.qmd @@ -0,0 +1,424 @@ +--- +title: "A Game of Permutations, Part 3" +description: | + Extending swap diagrams (with apologies to H.S.M. Coxeter). +format: + html: + html-math-method: katex +date: "2022-05-20" +date-modified: "2025-07-06" +categories: + - graph theory + - group theory +--- + + + + +This post assumes you have read the [first post](../1), which talks about swap diagrams + and the symmetric group. +The section about Cayley graphs from the [second post](../2) will also be useful. + +To summarize from the first post, a swap diagram is a graph where each vertex represents + a list index and each edge represents the permutation which swaps the two entries. +I singled out three graph families for their symmetry: + +- Paths, which link adjacent swaps +- Stars, in which all swaps contain a distinguished index +- Complete graphs, which contain all possible swaps + +Swap diagrams are ultimately limited by only being able to describe collections of 2-cycles. +If we wanted to include higher-order elements, we'd require a weaker + mathematical structure called a [hypergraph](https://en.wikipedia.org/wiki/Hypergraph). +These are even more difficult to draw than simple graphs, much less understand. + +Another way we are limited is in the kinds of groups which can be encoded. +One can rather quickly notice that swap diagrams will only generate symmetric groups + and direct products thereof. +Also, while edges are members of a generating set, the vertices contain information + which is ultimately irrelevant to the group. + + +Upgrading Diagrams +------------------ + +What if we forgot the roles of the vertices, allowed the edges to take their place? +In other words, we want to make a graph where the vertices represent generators, + rather than the edges. + +Ideally, we'd still like to preserve some information about coincident edges. +Graph-theoretically, we can elevate the role of the edges to that of the vertices + by making a [line graph](https://en.wikipedia.org/wiki/Line_graph). +This operation produces a graph such that + +- Every edge in the original graph becomes a vertex in the new graph +- Coincident edges in the new graph are connected by an edge in the new graph + - In other words, we convert adjacent edges to adjacent vertices. + +![ + While line graphs of paths simply shrink, + $\bigstar_5$ shrinks to $K_4$ before expanding to $K_{2,2,2}$ +](./line_graphs.png) + +The line graph of a swap diagram results in a graph where the vertices are the 2-cycles. +In a swap diagram, when two distinct 2-cycles share an index (vertex), their product has order 3. +Thus, in the line graph, the edges mean that the product of the two vertices has order 3. +Non-adjacent vertices still have a product with order 2, since they represent disjoint 2-cycles. + +To push the group/graph correspondence the even further, we can impose a final restriction. +Namely, a subgraph should represent a sub*group*. +Specifically, we want an *induced* subgraph + (one where if two connected vertices are included, then so is the edge joining them) + since this maintains the relationship between the generators. +Unfortunately, this restriction disqualifies many of the line graphs of swap diagrams. +At least our beloved paths are left untouched, since $L(P_n) = P_{n-1}$. + + +### Coxeter Diagrams + +As it turns out, these restrictions are significant and produce some very deep mathematical objects, + known as *Coxeter diagrams* (named for the same Coxeter as in [Goldberg-Coxeter](/posts/pentagons/1)). +In this domain, the aforementioned rules about vertices and edges apply: + each vertex corresponds to an order 2 element and each edge signifies + that the product of two elements has order 3. +Furthermore, *disconnected* vertices correspond to elements which commute with one another, + just like disjoint 2-cycles. +However, each vertex need not correspond to a single 2-cycle, + and can instead be *any* element of order 2, i.e., a product of disjoint 2-cycles. + + + +
+
+ + Finite coxeter.svg + + +
+ The most important Coxeter diagrams. + Note that the $A_n$ diagrams are just the familiar path graphs. +
+ Source: Rgugliel, via Wikimedia Commons +
+
+
+ +Coxeter diagrams are frequently extended to enable describing higher-order products + by labelling the edge[^1]. +For example, the product between $(1 ~ 2)(3 ~ 4)$ and $(2 ~ 3)$ has order 4. +A diagram for these elements would therefore include two vertices connected + with an edge labelled "4", corresponding to $B_2$. + +[^1]: Unlabelled edges still have order 3. + + +### How Big and What Shape? + +We already know how big the group a swap diagram generates. +Each connected component with *n* vertices generates the group $S_n$. +They combine via the direct product to give a group of order + +$$ +\left | \prod_i S_{n_i} \right | = \prod_i | S_{n_i} | = \prod_i n_i! +$$ + +Removing an edge from a swap diagram has the potential to make the graph disconnected. +In this case, the graph is split into two parts, which map to $S_m$ and $S_n$. +This tells us that $S_m \times S_n$ embeds in $S_{m + n}$. + +The subgroup restriction makes Coxeter diagrams a lot more sensitive to changes. +We at least know that if we remove a vertex, the resulting diagram is a subgroup of the whole diagram. +What we need is some way to measure the effect this has on the rest of the group. + + +Coxeter-Todd Algorithm +---------------------- + +This is exactly what the [*Coxeter-Todd algorithm*]( + https://en.wikipedia.org/wiki/Todd%E2%80%93Coxeter_algorithm + ) does. +It more-or-less generalizes the procedure for creating Cayley graphs. +Using the vertices of the Coxeter diagram as generators[^2], we convert products between + them to paths in a graph. + +[^2]: For clarity, I'll try to refer to these vertices specifically as "generators". + +Let's apply the algorithm to the diagram $A_3$. +First, we need to label our generators as *a*, *b*, and *c*. +Then, we select a select a generator to remove and create a graph according to the following steps: + + +### 1. Initialization + +In a Cayley graph, we start out with a single vertex representing the identity. +Here, the first vertex instead corresponds to the subgroup generated by all other generators. + +For each generator other than the one being removed, we attach loops to the vertex. +This is because the subgroup is closed -- when we multiply the set of all elements + of the subgroup by any of its elements, it doesn't change the set. +In other words, $hH = H, h \in H$. + +For the remaining generator, we draw an edge connecting to a new vertex, + which represents a new set of elements. +This is a coset of the subgroup -- that is, each vertex we make in this new graph + corresponds to a disjoint partition of elements of the whole group. + +![ + Left: the Coxeter diagram $A_3$
+ Right: the first step of generating a graph from removing generator *a*. + The (group generated by the) *bc* subdiagram is represented by the vertex with the *b* and *c* loops. +](./steps/coxeter_todd_1.png) + +Note that all loops and edges we draw will be undirected, since all generators have order 2. +Performing the same operation twice just takes us back to where we started. + + +### 2. Loop Transference + +At the new vertex, we transfer over every loop whose label is not connected to the label of the edge. +This is due to the rule stating that non-adjacent generators commute. +In other words, their product has order 2. +For our graph, this can be seen for $acac = a^2 c^2 = \text{id} = (ac)^2$, and means after following + labels *acac*, we end up at the same vertex we started at. + +![ ](./steps/coxeter_todd_step_2.png) + + +### 3. Extension, Branching, and Rejoining + +At the new vertex, we still need an edge labelled *b*, but it cannot be a loop. +Adjacent generators have a product whose order is the label (*n*) of the edge connecting them + (defaulting to 3 for unlabelled ones). +This means we need to form a path alternating between the two generators, + such that following it would loop back to the vertex we started at. +That is, + +$$ +(ab)^n = \stackrel{n \text{ times}}{\overbrace{(ab)(ab) ... (ab)(ab)}} = \text{id} +$$ + +![ + Attaching a *b* edge to a new vertex with an *a* loop so that $ababab = \text{id}$ +](./steps/coxeter_todd_step_3.png) + +If the Coxeter diagram branches, then so does the generated graph. +The labels of each pair of branching edges have a product with a known order, + so following a path alternating between two of them must return to the same vertex. +Since it alternates between the two labels *n* times, this ends up producing even-sided polygons + in our generated graph. +Commuting vertices form either a square or a pair of loops connected by an edge. +The latter is actually a special case of the former, which can be seen by matching + a pair of opposite edges. + +![ + Top: two nonadjacent vertices form a square
+ Bottom: two adjacent vertices form a hexagon +](./steps/coxeter_todd_cycles.png){.narrower} + + +### 4. Finalization + +If we ensure at each new vertex that we can follow a valid path for every pair of generators, + then this process will either terminate or continue indefinitely with a repeating pattern. +A quick sanity check on the resulting graph is to add the number of loops and edges at a vertex. +The sum should be the number of generators. + +![ + Final graph to the middle right. The *ab* and *bc* paths are shown above and below. +](./steps/coxeter_todd_step_4.png){.narrower} + +As stated earlier, each vertex in the graph corresponds to a coset of the group + under the subgroup being considered. +The number of cosets is the index of the subgroup, the quantity we were after the whole time. +In this case, the index of the three-vertex diagram ($A_3$) on the two-vertex diagram + ($A_2$, the same diagram without *a*) is 4. + + +### Results + +We can remove vertices one-by-one until we eventually reduce the graph to a single vertex, + which we know has order 2. +Multiplying all of the indices at each stage together gives us the order of the group we are after. + +![ + Coxeter diagrams (left) and the graphs generated by removing the a vertex (right).
+ Permutations shown above vertices which give a permutation group embedding. +](./coxeter_an.png){.narrow} + +It is readily shown that the group generated by $A_3$ has order $4 \cdot 3 \cdot 2 = 24$, + which coincides with the order of $S_4$. + +We can assign a permutation to each of our generators, so long as the edge condition + as it relates to their product is obeyed. +In the diagrams above, $(1 ~ 2)$ and $(2 ~ 3)$ have a product of order 3, + but $(1 ~ 2)$ and $(3 ~ 4)$ have a product of order 2, + since the cycles (and in the diagram, the vertices) are disjoint. +This argument generalizes nicely to higher $A_n$. + + +Other Diagrams for $A_3$ +------------------------ + +A path is hardly the most interesting diagram. +However, there are yet more graphs which can be produced from $A_3$. + + +### Starting in the Middle + +Selecting either endpoint of the diagram (generator *a* or *c*) will generate the same graph as shown above. +This is easy to see if you read the generated graph right-to-left rather than left-to-right. +However, the center point *b* has two neighbors. +If we try generating a graph by removing this generator, our graph branches. + +![ ](./coxeter_a3_generator_b.png){.narrow} + +The index of 6 given by this graph is correct, since the remaining diagram + $A_1 A_1$ has an order of $2 \cdot 2 = 4$. +This group is isomorphic to the [Klein four-group](https://en.wikipedia.org/wiki/Klein_four-group), + so this diagram shows that it occurs within $S_4$. + + +### Removing Multiple Vertices + +We can remove more than one generator from the Coxeter diagram at once, as long as we follow all the rules. +Instead, the initial vertex in the new graph branches immediately and has fewer loops. +For example, removing two generators from $A_3$ produces a figure with squares and hexagons: + +![ + Graph generated by removing any two vertices from $A_3$.
+ For the circled generators *a* and *b*, the diagram starts from the circled vertex + on the right (or its identical neighbor).
+ If *b* and *c* were removed instead, the diagram would start from + the similar vertices with *a* loops at the top of the graph.
+ If *a* and *c* were removed, the diagram would start from either the leftmost or rightmost vertex, + which both have a *b* loop. +](./coxeter_a3_pair.png){.narrow} + +A figure composed of squares and hexagons should be familiar from the previous post. +The truncated octahedron also contains only squares and hexagons and is generated by $S_4$. +In fact, the figure above is the truncated octahedron folded in half. +It is folded in "half" specifically because the single remaining vertex in the Coxeter diagram has order 2. +Consequently, the number of vertices in the graph must be half that + of the whole group (or complete permutahedron). + +If we remove both generators in $A_2$, we end up with a hexagon. + +![ + Graph generated by removing both generators from $A_2$. + All vertices are identical, so all may be considered "starting" vertices. +](./coxeter_a2_both.png){.narrow} + +Also from the previous post, we know this to be the Cayley graph for $S_3$ generated by a pair of swaps. +In this way, the Cayley graph can be thought of as a sort of "limiting" graph of the Coxeter diagram, + where each coset contains only a single element. + + +The Traditional Explanation +--------------------------- + +I must now admit that that I have not given anywhere near the whole explanation of Coxeter diagrams, + and have only succeeded in leading us down the proverbial algebraic rabbit hole. + +Coxeter diagrams also come equipped with a standard geometric interpretation. +The "order 2 elements" we discussed previously are replaced with mirrors, + and the edge labels are the angle between mirrors, + interpreted as half of the central angle of a regular *n*-gon (triangle: 60°, square: 45°, ...). + + +
+
+ + Dihedral symmetry domains 3 + + +
+ Fundamental domains of Coxeter diagram ![](coxeter_a2.png) +
+ Source: Tomuren, via Wikimedia Commons +
+
+
+ +The image above is composed of the mirrors specified by $A_2$. +One of the generators is the red reflection and the other is the the green reflection. +It is clear that alternating between red and green three times will take one back + to where they started, just like the algebra tells us. + +All of the plane ends up assigned to one of the domains. +Note also that points along mirrors which are equidistant from the center + form a hexagon made up of six equilateral triangles, one in each domain. + + +### Struggles in 3D + +$A_3$ has an additional vertex and edge. +This means that an additional mirror needs to be placed in along every preexisting reflection. +We end up reflecting into another dimension, and our domains shoot out into 3D space. +It is easier to imagine the additional domains by rotating two of the axes around each other, + so that the pairs will join together into equilateral triangular "cones". + +![ + Mirror axes in 3D for $A_3$. + The red, green, and blue lines all lie within the same plane, and correspond to $A_2$. + The cyan line is perpendicular to the red one, and is formed by rotating + either green about blue or blue about green by 60°. +](./roots/roots_a3.png){.narrowest} + +In 2D, equidistant points form a hexagon; in 3D, the points instead form a cuboctahedron. +Connecting the triangular faces of the cuboctahedron to the origin gives + a family of eight tetrahedra meeting at a point. +At this point the reflections become clearer, since certain reflections + do the same thing as in the plane above, while others will "double" a tetrahedron. + +::: {layout-ncol="2" layout-valign="center"} +![Cuboctahedron](./roots/cuboctahedron.png) + +![ + Six of the eight tetrahedra formed by connecting equidistant points ("roots") to the origin. + Note how whole tetrahedra are reflected in a mirror axis. +](./roots/roots_a3_with_domains.png) +::: + +Personally, I think the geometric way of thinking becomes is difficult even in 3D. +Every axis describes a separate rotation, which is simple enough. +But we're trying to create infinite cones of symmetry domains in 3D space, + and we can only try to interact with this using a 2D screen. +We're running out of room before even getting to 4D space, + where the visualization problems are even worse. +Also, while the angle between two mirrors is 60°, it's easy to slip into thinking + about the dihedral angle between two faces (domains) of the cones, which is *not* 60°. + + +Closing +------- + +When I initially wrote the article about swap diagrams (a name I hadn't given them at the time) + I had no idea about how closely it related to something else which I was having trouble understanding. +Now knowing better, I split the article and pushed the basics a little harder. +I find this closeness between swap diagrams and Coxeter diagrams interesting. +At the cost of simplicity, the latter enables the ability to encode higher-order cycles and give rise + to exceptional mathematical objects. + +It was difficult for me to find information documenting how to understand the algebraic perspective. +It also bears mentioning that I know very little about Lie theory, + another field of math where Coxeter diagrams turn up. +When I finally found [a group theory video](https://www.youtube.com/watch?v=BHezLvEH1DU) + by Professor Richard Borcherds, I was dismayed that there seems to be even less material + online which depicts the coset graphs. +I have written [an appendix](../appendix) cataloguing some graphs that appear when applying + the Coxeter-Todd algorithm, since I believe they are interesting in their own right. + +Images from Wikimedia belong to their respective owners. +All other diagrams created with GeoGebra. diff --git a/posts/permutations/3/line_graphs.png b/posts/permutations/3/line_graphs.png new file mode 100644 index 0000000..674d29c Binary files /dev/null and b/posts/permutations/3/line_graphs.png differ diff --git a/posts/permutations/3/roots/cuboctahedron.png b/posts/permutations/3/roots/cuboctahedron.png new file mode 100644 index 0000000..f9cc074 Binary files /dev/null and b/posts/permutations/3/roots/cuboctahedron.png differ diff --git a/posts/permutations/3/roots/roots_a3.png b/posts/permutations/3/roots/roots_a3.png new file mode 100644 index 0000000..8c38d73 Binary files /dev/null and b/posts/permutations/3/roots/roots_a3.png differ diff --git a/posts/permutations/3/roots/roots_a3_with_domains.png b/posts/permutations/3/roots/roots_a3_with_domains.png new file mode 100644 index 0000000..c01e087 Binary files /dev/null and b/posts/permutations/3/roots/roots_a3_with_domains.png differ diff --git a/posts/permutations/3/steps/coxeter_todd_1.png b/posts/permutations/3/steps/coxeter_todd_1.png new file mode 100644 index 0000000..bedc681 Binary files /dev/null and b/posts/permutations/3/steps/coxeter_todd_1.png differ diff --git a/posts/permutations/3/steps/coxeter_todd_cycles.png b/posts/permutations/3/steps/coxeter_todd_cycles.png new file mode 100644 index 0000000..c1cc7ae Binary files /dev/null and b/posts/permutations/3/steps/coxeter_todd_cycles.png differ diff --git a/posts/permutations/3/steps/coxeter_todd_step_2.png b/posts/permutations/3/steps/coxeter_todd_step_2.png new file mode 100644 index 0000000..9044d1c Binary files /dev/null and b/posts/permutations/3/steps/coxeter_todd_step_2.png differ diff --git a/posts/permutations/3/steps/coxeter_todd_step_3.png b/posts/permutations/3/steps/coxeter_todd_step_3.png new file mode 100644 index 0000000..0b45e2f Binary files /dev/null and b/posts/permutations/3/steps/coxeter_todd_step_3.png differ diff --git a/posts/permutations/3/steps/coxeter_todd_step_4.png b/posts/permutations/3/steps/coxeter_todd_step_4.png new file mode 100644 index 0000000..853fb4d Binary files /dev/null and b/posts/permutations/3/steps/coxeter_todd_step_4.png differ diff --git a/posts/permutations/_metadata.yml b/posts/permutations/_metadata.yml new file mode 100644 index 0000000..eaf1857 --- /dev/null +++ b/posts/permutations/_metadata.yml @@ -0,0 +1,5 @@ +# freeze computational output +freeze: auto + +# Enable banner style title blocks +title-block-banner: true diff --git a/posts/permutations/appendix/affine/coxeter_a2tilde_generator_a.png b/posts/permutations/appendix/affine/coxeter_a2tilde_generator_a.png new file mode 100644 index 0000000..b50724f Binary files /dev/null and b/posts/permutations/appendix/affine/coxeter_a2tilde_generator_a.png differ diff --git a/posts/permutations/appendix/affine/coxeter_a3tilde.png b/posts/permutations/appendix/affine/coxeter_a3tilde.png new file mode 100644 index 0000000..98df444 Binary files /dev/null and b/posts/permutations/appendix/affine/coxeter_a3tilde.png differ diff --git a/posts/permutations/appendix/affine/coxeter_a3tilde_generator_a.png b/posts/permutations/appendix/affine/coxeter_a3tilde_generator_a.png new file mode 100644 index 0000000..55d8240 Binary files /dev/null and b/posts/permutations/appendix/affine/coxeter_a3tilde_generator_a.png differ diff --git a/posts/permutations/appendix/affine/coxeter_c2tilde_generator_b.png b/posts/permutations/appendix/affine/coxeter_c2tilde_generator_b.png new file mode 100644 index 0000000..0e09598 Binary files /dev/null and b/posts/permutations/appendix/affine/coxeter_c2tilde_generator_b.png differ diff --git a/posts/permutations/appendix/affine/coxeter_g3tilde_generator_b.png b/posts/permutations/appendix/affine/coxeter_g3tilde_generator_b.png new file mode 100644 index 0000000..1f5a4e0 Binary files /dev/null and b/posts/permutations/appendix/affine/coxeter_g3tilde_generator_b.png differ diff --git a/posts/permutations/appendix/b3/coxeter_b3_generator_a.png b/posts/permutations/appendix/b3/coxeter_b3_generator_a.png new file mode 100644 index 0000000..2dd0d11 Binary files /dev/null and b/posts/permutations/appendix/b3/coxeter_b3_generator_a.png differ diff --git a/posts/permutations/appendix/b3/coxeter_b3_generator_b.png b/posts/permutations/appendix/b3/coxeter_b3_generator_b.png new file mode 100644 index 0000000..21cbfdf Binary files /dev/null and b/posts/permutations/appendix/b3/coxeter_b3_generator_b.png differ diff --git a/posts/permutations/appendix/b3/coxeter_b3_generator_c.png b/posts/permutations/appendix/b3/coxeter_b3_generator_c.png new file mode 100644 index 0000000..65bcfd0 Binary files /dev/null and b/posts/permutations/appendix/b3/coxeter_b3_generator_c.png differ diff --git a/posts/permutations/appendix/b3/false_octahedral_symmetry_graph.png b/posts/permutations/appendix/b3/false_octahedral_symmetry_graph.png new file mode 100644 index 0000000..6946127 Binary files /dev/null and b/posts/permutations/appendix/b3/false_octahedral_symmetry_graph.png differ diff --git a/posts/permutations/appendix/b3/octahedral_embedding.png b/posts/permutations/appendix/b3/octahedral_embedding.png new file mode 100644 index 0000000..ffd3a51 Binary files /dev/null and b/posts/permutations/appendix/b3/octahedral_embedding.png differ diff --git a/posts/permutations/appendix/b3/rhombicuboctahedral_graph.png b/posts/permutations/appendix/b3/rhombicuboctahedral_graph.png new file mode 100644 index 0000000..2aa10e9 Binary files /dev/null and b/posts/permutations/appendix/b3/rhombicuboctahedral_graph.png differ diff --git a/posts/permutations/appendix/b3/truncated_cuboctahedral_graph.png b/posts/permutations/appendix/b3/truncated_cuboctahedral_graph.png new file mode 100644 index 0000000..c0766b5 Binary files /dev/null and b/posts/permutations/appendix/b3/truncated_cuboctahedral_graph.png differ diff --git a/posts/permutations/appendix/b4/coxeter_b4_generator_a.png b/posts/permutations/appendix/b4/coxeter_b4_generator_a.png new file mode 100644 index 0000000..3933add Binary files /dev/null and b/posts/permutations/appendix/b4/coxeter_b4_generator_a.png differ diff --git a/posts/permutations/appendix/b4/coxeter_b4_generator_b.png b/posts/permutations/appendix/b4/coxeter_b4_generator_b.png new file mode 100644 index 0000000..4602e9e Binary files /dev/null and b/posts/permutations/appendix/b4/coxeter_b4_generator_b.png differ diff --git a/posts/permutations/appendix/b4/coxeter_b4_generator_c.png b/posts/permutations/appendix/b4/coxeter_b4_generator_c.png new file mode 100644 index 0000000..1abf7b9 Binary files /dev/null and b/posts/permutations/appendix/b4/coxeter_b4_generator_c.png differ diff --git a/posts/permutations/appendix/b4/coxeter_b4_generator_d.png b/posts/permutations/appendix/b4/coxeter_b4_generator_d.png new file mode 100644 index 0000000..942aeb6 Binary files /dev/null and b/posts/permutations/appendix/b4/coxeter_b4_generator_d.png differ diff --git a/posts/permutations/appendix/b4/hyperoctahedral_embedding.png b/posts/permutations/appendix/b4/hyperoctahedral_embedding.png new file mode 100644 index 0000000..e12c64c Binary files /dev/null and b/posts/permutations/appendix/b4/hyperoctahedral_embedding.png differ diff --git a/posts/permutations/appendix/b4_embedding.hs b/posts/permutations/appendix/b4_embedding.hs new file mode 100644 index 0000000..1bf260f --- /dev/null +++ b/posts/permutations/appendix/b4_embedding.hs @@ -0,0 +1,36 @@ +import Data.List (nub, sortOn) +import Cayley.Group +import Cayley.Symmetric + +-- generators of W(B_4), order 384 +goodB4Embedding = map read ["(1 3)", "(1 2)(3 4)(5 6)(7 8)", "(1 3)(2 6)(4 5)(7 8)", "(1 3)(2 4)(5 7)(6 8)"] :: [Perm] +goodB4Edges = filter ((>2) . order) [x <> y | x <- goodB4Embedding, y <- goodB4Embedding] +-- generators of H, order 192 +badb4Embedding = map read ["(1 2)(3 4)(5 6)(7 8)", "(1 3)(2 5)(4 7)(6 8)", "(1 2)(3 4)(5 7)(6 8)", "(1 2)(3 5)(4 6)(7 8)"] :: [Perm] + + +-- Order 192 subgroup of only even permutations in W(B_4) +goodB4EvenPermsSubgroup = filter ((==1) . pParity) $ generatingSet $ goodB4Embedding + +-- Count the orders in the group xs +-- Should probably be done better in CayleyOps +countOrders xs = sortOn fst $ map ((,) <*> flip numOrder xs) (nub $ map order xs) + +commutatorSubgroup xs = nub $ [commutator x y | x <- xs, y <- xs] + +printGroupData x = do + putStr "\tOrder: " + putStrLn $ show $ length x + putStr "\tElement order count: " + putStrLn $ show $ countOrders x + putStr "\tCommutator subgroup order: " + putStrLn $ show $ length $ commutatorSubgroup x + + +main = do + putStrLn "Bad embedding:" + printGroupData $ generatingSet badb4Embedding + putStrLn "Even permutation subgroup of the good embedding:" + printGroupData goodB4EvenPermsSubgroup + putStrLn "Edge-generated subgroup of the good embedding:" + printGroupData $ generatingSet goodB4Edges diff --git a/posts/permutations/appendix/de/coxeter_d4_generator_a.png b/posts/permutations/appendix/de/coxeter_d4_generator_a.png new file mode 100644 index 0000000..1e76849 Binary files /dev/null and b/posts/permutations/appendix/de/coxeter_d4_generator_a.png differ diff --git a/posts/permutations/appendix/de/coxeter_d4_generator_b.png b/posts/permutations/appendix/de/coxeter_d4_generator_b.png new file mode 100644 index 0000000..f589242 Binary files /dev/null and b/posts/permutations/appendix/de/coxeter_d4_generator_b.png differ diff --git a/posts/permutations/appendix/de/coxeter_d5_generator_a.png b/posts/permutations/appendix/de/coxeter_d5_generator_a.png new file mode 100644 index 0000000..7846a78 Binary files /dev/null and b/posts/permutations/appendix/de/coxeter_d5_generator_a.png differ diff --git a/posts/permutations/appendix/de/coxeter_d5_generator_de.png b/posts/permutations/appendix/de/coxeter_d5_generator_de.png new file mode 100644 index 0000000..fe61ce2 Binary files /dev/null and b/posts/permutations/appendix/de/coxeter_d5_generator_de.png differ diff --git a/posts/permutations/appendix/de/coxeter_e6_generator_ae.png b/posts/permutations/appendix/de/coxeter_e6_generator_ae.png new file mode 100644 index 0000000..9db2e20 Binary files /dev/null and b/posts/permutations/appendix/de/coxeter_e6_generator_ae.png differ diff --git a/posts/permutations/appendix/de/d4_embedding.png b/posts/permutations/appendix/de/d4_embedding.png new file mode 100644 index 0000000..9228053 Binary files /dev/null and b/posts/permutations/appendix/de/d4_embedding.png differ diff --git a/posts/permutations/appendix/h3/coxeter_h3_generator_a.png b/posts/permutations/appendix/h3/coxeter_h3_generator_a.png new file mode 100644 index 0000000..dc45605 Binary files /dev/null and b/posts/permutations/appendix/h3/coxeter_h3_generator_a.png differ diff --git a/posts/permutations/appendix/h3/coxeter_h3_generator_b.png b/posts/permutations/appendix/h3/coxeter_h3_generator_b.png new file mode 100644 index 0000000..c4877d9 Binary files /dev/null and b/posts/permutations/appendix/h3/coxeter_h3_generator_b.png differ diff --git a/posts/permutations/appendix/h3/coxeter_h3_generator_c.png b/posts/permutations/appendix/h3/coxeter_h3_generator_c.png new file mode 100644 index 0000000..ead476e Binary files /dev/null and b/posts/permutations/appendix/h3/coxeter_h3_generator_c.png differ diff --git a/posts/permutations/appendix/h3/false_icosahedral_symmetry_graph.png b/posts/permutations/appendix/h3/false_icosahedral_symmetry_graph.png new file mode 100644 index 0000000..c63fdf7 Binary files /dev/null and b/posts/permutations/appendix/h3/false_icosahedral_symmetry_graph.png differ diff --git a/posts/permutations/appendix/h3/icosahedral_embedding.png b/posts/permutations/appendix/h3/icosahedral_embedding.png new file mode 100644 index 0000000..cdb0e77 Binary files /dev/null and b/posts/permutations/appendix/h3/icosahedral_embedding.png differ diff --git a/posts/permutations/appendix/h3/rhomicosidodecahedral_graph.png b/posts/permutations/appendix/h3/rhomicosidodecahedral_graph.png new file mode 100644 index 0000000..5b8b88e Binary files /dev/null and b/posts/permutations/appendix/h3/rhomicosidodecahedral_graph.png differ diff --git a/posts/permutations/appendix/h3/truncated_icosidodecahedral_graph.png b/posts/permutations/appendix/h3/truncated_icosidodecahedral_graph.png new file mode 100644 index 0000000..fb94394 Binary files /dev/null and b/posts/permutations/appendix/h3/truncated_icosidodecahedral_graph.png differ diff --git a/posts/permutations/appendix/index.qmd b/posts/permutations/appendix/index.qmd new file mode 100644 index 0000000..c3fb803 --- /dev/null +++ b/posts/permutations/appendix/index.qmd @@ -0,0 +1,529 @@ +--- +title: "A Game of Permutations, Appendix" +description: | + Partial Cayley graphs of Coxeter diagrams +format: + html: + html-math-method: katex +date: "2022-05-27" +date-modified: "2025-07-11" +categories: + - graph theory + - group theory +--- + + + + +This post is an appendix to [another post](../3) discussing the basics of Coxeter diagrams. +It focuses on transforming path-like swap diagrams into proper $A_n$ Coxeter diagrams, + which correspond to symmetric groups. +This post focuses on the graphs made by the cosets made by removing a single generator + (i.e., a vertex of the Coxeter diagram). + +For finite diagrams whose order is not prohibitively big, I will also provide an embedding + as a permutation group by labelling each generator in the Coxeter diagram. +Since each generator is the product of disjoint swaps, I will also show their swap diagrams, + as well as interactions via the edges. + + +Platonic Symmetry +----------------- + +The symmetric group $S_n$ also happens to describe the symmetries of an $(n-1)$-dimensional simplex. +The 3-simplex is simply a tetrahedron and has symmetry group $T_h$, which is isomorphic to $S_4$. +We know that $S_4$ can be encoded by the diagram $A_3$. + +The string {3, 3} can be read across the edges of $A_3$, denoting the order of certain symmetries. +This happens to coincide with another datum of the tetrahedron: + its [Schläfli symbol](https://en.wikipedia.org/wiki/Schl%C3%A4fli_symbol). +It describes triangles (the first 3) which meet in triples (the second 3) at a vertex. +It may also be interpreted as the symmetry of the 2-dimensional components (faces) and the vertex-centered symmetry. +[The Wikipedia article](https://en.wikipedia.org/wiki/Tetrahedron) + on the tetrahedron presents both of these objects in its information column. + +![ + From the Wikipedia article on the tetrahedron. + The Conway notation, Schläfli symbol, Coxeter diagram, and symmetry groups are shown. +](./tetrahedron_wikipedia.png) + +The image above shows more sophisticated diagrams alongside $A_3$, + which I will not attempt describing (mostly because I don't completely understand them myself). +Other Platonic solids and their higher-dimensional analogues have different Schläfli symbols, + and correspond to different Coxeter diagrams. + + +### $B_3$: Octahedral Group + +Adding an order-4 product into the mix makes things a lot more interesting. +The cube (Schläfli symbol {4, 3}) and octahedron ({3, 4}) share a symmetry group, $O_h$, + which corresponds to the $B_3$ diagram[^1]. + +[^1]: For groups without a common name, I'll instead use *W*(*diagram*) + (for [Weyl](https://en.wikipedia.org/wiki/Weyl_group)) to represent the generated group. + For example, in this case, $W(B_3) \cong O_h$. + +::: {layout-ncol="3" layout-valign="center"} +![](./b3/coxeter_b3_generator_a.png){.lightbox group="b3"} + +![](./b3/coxeter_b3_generator_b.png){.lightbox group="b3"} + +![](./b3/coxeter_b3_generator_c.png){.lightbox group="b3"} +::: + +The center graph is the first to have a hexagon created by removing a single generator. +Meanwhile, the third graph is entirely path-like, similar to the ones created + by removing an endpoint from the $A_n$ diagrams. +In the same vein, the graph for $B_3$ resembles the graph for $A_3$ made + by removing the center generator, albeit with two extra vertices. + +Going across left to right, the order suggested by each index is: + +- $8 \cdot |A_2| = 8 \cdot 6 = 48$ +- $12 \cdot |A_1 A_1| = 12 \cdot 4 = 48$ +- $6 \cdot |B_2| = 6 \cdot 8 = 48$ + - $B_2$ describes the symmetry of a square (i.e., $\text{Dih}_4$, the dihedral group of order 8) + +Each diagram suggests the same order, which is good. +A simple embedding which obeys the edge condition assigns $(1 ~ 2)(3 ~ 4)$ to *a*, + $(2 ~ 3)$ to *b*, and $(1 ~ 2)$ to *c*. +Then $ab = (1 ~ 2 ~ 4 ~ 3)$ has order 4, $bc = (1 ~ 3 ~ 2)$ has order 3, and *ac* obviously has order 2. + +There's a problem though. +These are all elements of $S_4$, and in fact, generate it + (in fact, $S_4 \cong O$, the rotational symmetries of a cube). +The group we want is $O_h \cong S_4 \times \mathbb{Z}_2$. +If we want to embed a group of order 48 in a symmetric group, we need one for which 48 divides its order. +48 divides $|S_6| = 720$, and indeed, a quick fix is just to multiply each generator + by another disjoint 2-cycle like $(5 ~ 6)$. + +These two embeddings generate different (proper) Cayley graphs. +The one for *O* has 24 vertices and is nonplanar. +On the other hand, the one for $O_h$ is planar, and is the skeleton of the + [truncated cuboctahedron](https://en.wikipedia.org/wiki/Truncated_cuboctahedron), + a figure composed of octagons, hexagons, and squares. +These shapes are exactly what those implied by the orders of the products in the Coxeter diagram. +Note also that the [cuboctahedron](https://en.wikipedia.org/wiki/Cuboctahedron) + is the figure produced halfway between dualizing + the cube and octahedron by shrinking faces (their *rectification*). + +In either case, the products of adjacent generators (the permutations on the edges) are the same. +When made into a Cayley graph, these products generate the + [rhombicuboctahedron](https://en.wikipedia.org/wiki/Rhombicuboctahedron), + which is another shape that is in some sense midway between the cube and octahedron. +Since all of these generators are in $S_4$, it only has half the number of vertices + as the truncated cuboctahedron. + + +::: {layout="[[1,1,1],[1]]"} +![ + False embedding +](./b3/false_octahedral_symmetry_graph.png) + +![ + Good embedding +](./b3/truncated_cuboctahedral_graph.png) + +![ + Edge-generated +](./b3/rhombicuboctahedral_graph.png) + +![ + Left: false embedding, right: good embedding +](./b3/octahedral_embedding.png){.narrow} +::: + + +### $H_3$: Icosahedral Group + +Continuing with groups based on 3D shapes, the dodecahedron (Schläfli symbol {5, 3}) + and icosahedron ({3, 5}) also share a symmetry group. +It is known as $I_h$ and corresponds to Coxeter diagram $H_3$. + +::: {layout-ncol="3" layout-valign="center"} +![](./h3/coxeter_h3_generator_a.png){.lightbox group="h3"} + +![](./h3/coxeter_h3_generator_b.png){.lightbox group="h3"} + +![](./h3/coxeter_h3_generator_c.png){.lightbox group="h3"} +::: + +Two of these graphs are similar to the cube/octahedron graphs. +The middle contains a decagon, corresponding to the order 5 product between *a* and *b*. + +We have the orders: + +- $20 \cdot |A_2| = 20 \cdot 6 = 120$ + - Graph resembles an extension of the graph of $B_3 / A_1 A_1$, as hexagons joining blocks of squares +- $30 \cdot |A_1 A_1| = 30 \cdot 4 = 120$ +- $12 \cdot |H_2| = 12 \cdot 10 = 120$ + - Graph resembles an extension of the graph of $B_3 / A_2$, as a single square joining paths + +The order 120 is the same as the order of $S_5$, which corresponds to diagram $A_4$. +However, these are not the same group, since $I_h \cong \text{Alt}_5 \times \mathbb{Z}_2 \ncong S_5$. +A naive (though slightly less obvious) embedding, found similarly to $B_3$'s, + incorrectly assigns the following: + +- $a = (1 ~ 2)(3 ~ 4)$ +- $b = (2 ~ 3)(4 ~ 5)$ +- $c = (2 ~ 3)(1 ~ 4)$ + +This is certainly wrong, since all these permutations are within $S_5$. +Actually, they are all even permutations and in fact generate $I \cong \text{Alt}_5$, + with order 60. +Yet again, multiplying a disjoint 2-cycle (in this case, $(6 ~ 7)$) to each generator + boosts the order to 120 and gives a proper embedding of $I_h$. + +Similarly to $B_3$, the first, incorrect embedding gives a nonplanar Cayley graph. +The second one gives a planar graph, the skeleton of the + [truncated icosidodecahedron](https://en.wikipedia.org/wiki/Truncated_icosidodecahedron). +It consists of decagons, hexagons, and squares, just like those which appear in the graphs above. +The icosidodecahedron is also the rectification of the dodecahedron and icosahedron. +In this case, the edges generate the + [rhombicosidodecahedronal graph](https://en.wikipedia.org/wiki/Rhombicosidodecahedron). + + +::: {layout="[[1,1,1],[1]]" layout-valign="center"} +![ + False embedding +](./h3/false_icosahedral_symmetry_graph.png) + +![ + Good embedding +](./h3/truncated_icosidodecahedral_graph.png) + +![ + Edge-generated +]( ./h3/rhomicosidodecahedral_graph.png) + +![ + Left: false embedding, right: good embedding +](./h3/icosahedral_embedding.png){.narrow} +::: + +It is remarkable that the truncations of the rectifications[^2] have skeleta that are the same + as the Cayley graphs generated by their respective Platonic solids' Coxeter diagrams. +In a way, these figures describe their own symmetry. +Also, both of these figures belong to a class of polyhedra known as + [zonohedra](https://en.wikipedia.org/wiki/Zonohedron). + +[^2]: This composition is also called "omnitruncation". + + +### $B_4$: Hyperoctahedral Group + +Up a dimension from the cube and octahedron lie their 4D counterparts: + the tesseract (Schläfli symbol {4, 3, 3}, interpreted as three cubes ({4, 3}) around an edge) + and 16-cell ({3, 3, 4}, four tetrahedra ({3, 3}) around an edge). +They correspond to Coxeter diagram $B_4$. + +::: {layout-ncol="2" layout-valign="center"} +![](./b4/coxeter_b4_generator_a.png){.lightbox group="b4"} + +![](./b4/coxeter_b4_generator_b.png){.lightbox group="b4"} + +![](./b4/coxeter_b4_generator_c.png){.lightbox group="b4"} + +![](./b4/coxeter_b4_generator_d.png){.lightbox group="b4"} +::: + +Three of these graphs (those starting with *a*, *c*, and *d*) are *also* similar + to those encountered one dimension lower. +The remaining graph is best understood in three dimensions, befitting the 4D symmetries it encodes. +It appears to have similar regions to the + [omnitruncated tesseract](https://en.wikipedia.org/wiki/Runcinated_tesseracts#Omnitruncated_tesseract), + featuring both the truncated octahedron and hexagonal prism cells. + +We have the orders: + +- $16 \cdot |A_3| = 16 \cdot 24 = 384$ + - Graph resembles an extension of $B_3 / A_2$, as squares connecting paths +- $32 \cdot |A_1 A_2| = 32 \cdot 2 \cdot 6 = 384$ +- $24 \cdot |B_2 A_1| = 24 \cdot 8 \cdot 2 = 384$ + - Graph resembles an extension of $B_3 / A_1 A_1$, as hexagons joining blocks of squares +- $8 \cdot |B_3| = 8 \cdot 48 = 384$ + - Graph resembles an extension of $A_3 / A_2$, a simple path + +The order of the group, 384, suggests that it needs to be embedded in at least $S_8$ + since $384 ~ \vert ~ 8! ~ ( = 40320)$. +Indeed, such an embedding exists (found by computer search rather than by hand): + +- $a = (1 ~ 3)$ +- $b = (1 ~ 2)(3 ~ 4)(5 ~ 6)(7 ~ 8)$ +- $c = (1 ~ 3)(2 ~ 6)(4 ~ 5)(7 ~ 8)$ +- $d = (1 ~ 3)(2 ~ 4)(5 ~ 7)(6 ~ 8)$ + +Notably, this embedding takes advantage of an order 4 product between an order 2 and an order 4 element. + +A similar computer search yielded an insufficient embedding in $S_8$, with order 192: + +- $a = (1 ~ 2)(3 ~ 4)(5 ~ 6)(7 ~ 8)$ +- $b = (1 ~ 3)(2 ~ 5)(4 ~ 7)(6 ~ 8)$ +- $c = (1 ~ 2)(3 ~ 4)(5 ~ 7)(6 ~ 8)$ +- $d = (1 ~ 2)(3 ~ 5)(4 ~ 6)(7 ~ 8)$ + +This false embedding *cannot* be "fixed" by multiplying some generators[^3] by $(9 ~ 10)$ + (implicitly embedding in $S_{10}$ instead). +Quickly "running" the generators shows that the order of the group is unchanged by this maneuver. +Much of the structure permutations ensures that nonadjacent vertices still have order-2 products. + +[^3]: The only candidate choices are *a* and nothing else, every generator but *a*, or all generators. + All other choices violate edge/product constraints from the diagram. + +![](./b4/hyperoctahedral_embedding.png){.narrow} + +I won't try to identify either of these generating sets' Cayley graphs since it is impractical + to try comparing graphs of this size (and they likely correspond to a 4D object's skeleton). +In fact, *H* appears to not be isomorphic to a subgroup of $W(B_4)$. +The latter has at least 2 subgroups of order 192: one generated by the edges in the above embedding, + and one containing only the even permutations. +These are distinct from one another, since the number of elements of a particular order is different. +The latter subgroup is closer to *H*, matching the number of elements of each order, + but the even permutations have commutator subgroup of order 96 while *H* has a commutator subgroup of order 48. + + +Other Finite Diagrams +--------------------- + +Higher-dimensional Platonic solids are hardly the limits of what these diagrams can encode. +The following three diagrams also give rise to finite graphs. + +### $D_4$ + +$D_4$ is the first Coxeter diagram with a branch. +Like $B_4$ before it, it is corresponds to the symmetries of a 4D object. +We only really have two choices in which generator to remove, which generate the following graphs: + +::: {layout-ncol="2" layout-valign="center"} +![](./de/coxeter_d4_generator_a.png){.lightbox group="d4"} + +![](./de/coxeter_d4_generator_b.png){.lightbox group="d4"} +::: + +While we could also remove *c* or *d*, this would just produce a graph identical + to the one on the left, just with different labelling. +The right diagram is rather interesting, as it can be described geometrically + as two cubes attached to three hexagons sharing an edge. + +Both of these cases give the order + +- $8 \cdot |A_3| = 8 \cdot 24 = 192$ +- $24 \cdot |A_1 A_1 A_1| = 24 \cdot 8 = 192$ + +The minimum degree of symmetric group is $S_8$, since $192 ~ \vert ~ 40320$. +Fortunately, a computer search yields a correct embedding immediately: + +- $a = (1 ~ 8)(2 ~ 3)(4 ~ 7)(5 ~ 6)$ +- $b = (1 ~ 2)(3 ~ 4)(5 ~ 6)(7 ~ 8)$ +- $c = (1 ~ 5)(2 ~ 7)(3 ~ 4)(6 ~ 8)$ +- $d = (1 ~ 8)(2 ~ 4)(3 ~ 7)(5 ~ 6)$ + +![ ](./de/d4_embedding.png){.narrower} + +In fact, the group generated by this diagram is isomorphic to the even permutation subgroup of $W(B_4)$. +This can be verified by selecting order 2 elements from the latter which obey the laws in $D_4$. +On the other hand, *H* and the edge-generated subgroup do not satisfy this diagram. + + + + +### $D_5$ + +*D*-type diagrams continue by elongating one of the paths. +The next diagram, $D_5$, has really only four distinct graphs, of which I will show only two: + +::: {layout-ncol="2" layout-valign="center"} +![](./de/coxeter_d5_generator_a.png){.lightbox group="d5"} + +![](./de/coxeter_d5_generator_de.png){.lightbox group="d5"} +::: + +First, note how the graph to the right is generated by removing the generator *e*, + but the left and right sides of the diagram are asymmetrical. +This is because *d* and *e* are equivalent with respect to the branch, + and shows us that removing either generator *d* or *e* results in the same graph. + +The order suggested by each is + +- $10 \cdot |D_4| = 10 \cdot 192 = 1920$ +- $16 \cdot |A_4| = 16 \cdot 120 = 1920$ + +If we were to remove generator *b*, we'd end up with the diagram $A_1 A_3$, + which generates a group of order 48. +The graph would have 1920 / 48 = 40 vertices, which would be fairly difficult to render. +Removing generator *c* would be even worse, since the resulting diagram, $A_2 A_1 A_1$, + has order 24, and the graph would require 80 vertices -- twice as many. + +Finding an embedding at this point is difficult. +The order 1920 also divides $40320 = |S_8|$, but computer search has failed + to find an embedding in up to $S_{11}$. + + +### $E_6$ + +If one of the shorter paths of $D_5$ is extended, then we end up with the diagram $E_6$. +I will only show one of its graphs. + +![ ](./de/coxeter_e6_generator_ae.png){.narrow} + +Similarly to one of the graphs for $D_5$, this graph goes in with *a* and comes out with *e*, + which are again symmetric with respect to the branch. +I particularly like how on this graph, most of the squares are structured + so that they can bridge to the *ae* commuting square (middle, bottom). + +The order of this group is $27 \cdot 1920 = 51840$, which borders on the + incomprehensible (if that threshold hasn't been crossed already). +The graphs not shown would have the following number of vertices + (which is precisely why I won't draw them out): + +- Removing *f*: $[E_6 : A_5] = 51840 / 720 = 72$ vertices +- Removing *b* or *d*: $[E_6 : A_1 A_4] = 51840 / 240 = 216$ vertices +- Removing *c*: $[E_6 : A_2 A_2 A_1] = 51840 / 72 = 720$ vertices + +Going by order alone, $E_6$ should embed in $S_9$ ($51840 ~ \vert ~ 9!$), + but since $S_{11}$ was too small for its subgroup $D_5$, this too optimistic. +I don't know what the minimum degree is required to embed $E_6$, + but finding it directly it is beyond my computational power. + +The *E* diagrams continue with $E_7$ and $E_8$. +Each of the three corresponds to the symmetries of semi-regular higher-dimensional objects, + whose significance and structure are difficult to comprehend. +Their size alone makes continuing onward by hand a fool's errand, + and I won't be attempting to draw them out right just now. + + +Infinite (Affine) Diagrams +-------------------------- + +Not every Coxeter diagram produces a finite, closed graph. +Instead, they may proliferate vertices forever. +They are termed either "affine" or "hyperbolic", depending respectively on whether the diagrams + join up with themselves or seem to require more and more room as the algorithm advances. +This is also related to the collection of fundamental domains and roots that the diagram describes. + +Since hyperbolic graphs are difficult to draw, I'll be restricting myself to the affine diagrams. +Unlike hyperbolic diagrams, which are unnamed, affine ones are typically named by altering finite diagrams. + +### $\widetilde A_2$ + +The Coxeter diagram associated to the triangle graph $K_3$ is called $\widetilde A_2$. +This graph is also the line graph of $\bigstar_3$ so it might make sense to assign + to the vertices the generators $(1 ~ 2)$, $(2 ~ 3)$, and $(1 ~ 3)$, + which we know to generate $S_3$. +However, $S_3$ already has a diagram, $A_2$, which is clearly a subdiagram of + $\widetilde A_2$, so the new group must be larger. + +![ ](./affine/coxeter_a2tilde_generator_a.png){.narrower} + +Attempting to make a graph by following the generators results in an infinite hexagonal tiling. +You might recall that $A_2$ generates a hexagon, so it is intriguing that this generates + a tiling based on this shape. +There are three distinct types of hexagon -- *ab*, *ac*, and *bc* + -- since each pair of elements has a product of order 3. +Removing a pair of vertices from the diagram would get rid of the initial edge (*a* in this case), + and the "limiting case" where all three vertices are removed is just the true hexagonal tiling. + + +### $\widetilde G_2$ + +The hexagonal tiling has Schläfli symbol {6, 3}, and is dual to the triangular tiling. +As a Coxeter diagram, this symbol matches the Coxeter diagram $\widetilde G_2$. + +![ ](./affine/coxeter_g3tilde_generator_b.png){.narrower} + +The graph generated by removing a generator is another infinite tiling, in this case the + [truncated trihexagonal tiling](https://en.wikipedia.org/wiki/Truncated_trihexagonal_tiling). +Once again, this tiling is the truncation of the rectification of the symmetry it typically describes. +Each pair of prodcuts corresponds to a distinct polygon in the graph: *ab* to dodecagons, *ac* to squares, + and *bc* to hexagons. + + +### $\widetilde C_2$ + +The only remaining regular 2D tiling is the square tiling (Schläfli symbol {4, 4}), + whose Coxeter diagram is named $\widetilde C_2$. + +![ ](./affine/coxeter_c2tilde_generator_b.png){.narrower} + +The tiling generated by this diagram is known as the + [truncated square tiling](https://en.wikipedia.org/wiki/Truncated_square_tiling). +Mirroring the other cases, it is also the truncated *rectified* square tiling, + since rectifying the square tiling merely produces another square tiling (rotated 45°). +In this tiling, the squares always correspond to the product *ac*, + but there are octagons for both order-4 products, *ab* or *bc*. + + +### $\widetilde A_3$ + +The above diagrams are the only rank-2 affine diagrams. +The simplest diagram of rank 3 is $\widetilde A_3$, which appears similar to 4-Cycle graph. + +::: {layout-ncol="2" layout-valign="center"} +![](./affine/coxeter_a3tilde_generator_a.png){.lightbox group="a3_tilde"} + +![](./affine/coxeter_a3tilde.png){.lightbox group="a3_tilde"} +::: + +Similar to how $\widetilde A_2$'s graph is the tiling of $A_2$'s, + its Cayley graph is the honeycomb of $A_3$'s. +The left image shows the initial branches, while the right image shows + the four distinct cells which form the honeycomb. +From left to right, the figures contain only edges labelled from + *abd*, *abc*, *bcd*, and *acd*, respectively. +The squares always represent commuting pairs on opposite ends of the diagram: *ac* and *bd*. + +I am not certain in general whether $\widetilde A_n$ generates the honeycomb formed by $A_n$, + but this tessellation should always exist, since the solids formed + by the generators of $A_n$ are always permutohedra. + + +Closing +------- + +The diagrams I have studied here are only the smaller ones which I can either visualize or compute. +I might have gotten carried away with studying the groups themselves in the 4D case, + since there appears to be so much contention. +Despite this, I examined only half of the available Platonic solids in 4D, missing out on + the 24-cell (Schläfli symbol {3, 4, 3}, $F_4$), + 120-cell (Schläfli symbol {5, 3, 3}, $H_4$), + and 600-cell (Schläfli symbol {3, 3, 5}, $H_4$). +If 4D symmetries are hard to understand, then things can only get worse in higher dimensions. + +One of the things I'm curious about is the minimal degree of symmetric group + needed to embed the finite diagrams (hereafter $\mu$). +While $S_6$ is minimal for the octahedral group, it doesn't appear to be big enough + for the icosahedral one. +There is a trivial embedding for groups which are direct products given by + +$$ +\begin{align*} + G &\hookrightarrow S_m \sub S_{m+n} \\ + H &\hookrightarrow S_n \sub S_{m+n} \\ + G \times H &\hookrightarrow S_{m+n} \\ + \mu(G \times H) &\le \mu(G) + \mu(H) = m + n +\end{align*} +$$ + +but the groups we're interested in don't necessarily have this property. + +Coset and embedding diagrams made with GeoGebra. +Cayley graph images made with NetworkX (GraphViz). + + +### Additional Links + +- [Point groups in three dimensions](https://en.wikipedia.org/wiki/Point_groups_in_three_dimensions) (Wikipedia) +- [Point groups in four dimensions](https://en.wikipedia.org/wiki/Point_groups_in_four_dimensions) (Wikipedia) +- [ + Finding the minimal n such that a given finite group G is a subgroup of Sn + ](https://math.stackexchange.com/questions/1597347/finding-the-minimal-n-such-that-a-given-finite-group-g-is-a-subgroup-of-s-n) + (Mathematics Stack Exchange) +- [Omnitruncated](https://community.wolfram.com/groups/-/m/t/774393), by Clayton Shonkwiler diff --git a/posts/permutations/appendix/tetrahedron_wikipedia.png b/posts/permutations/appendix/tetrahedron_wikipedia.png new file mode 100644 index 0000000..254a098 Binary files /dev/null and b/posts/permutations/appendix/tetrahedron_wikipedia.png differ diff --git a/posts/permutations/index.qmd b/posts/permutations/index.qmd new file mode 100644 index 0000000..933e559 --- /dev/null +++ b/posts/permutations/index.qmd @@ -0,0 +1,10 @@ +--- +title: "A Game of Permutations" +listing: + contents: . + sort: "date" +--- + +Articles about diagrams at the intersection between graph theory and group theory. + +Publication dates correspond to the original WordPress publication dates. diff --git a/posts/polycount/index.qmd b/posts/polycount/index.qmd index c9fdf1e..9eac765 100644 --- a/posts/polycount/index.qmd +++ b/posts/polycount/index.qmd @@ -2,7 +2,7 @@ title: "Polynomial Counting" listing: contents: . - sort: "date desc" + sort: "date" --- Articles about generalizations of positional number systems, explained using the concept of counting on polynomials.