12 lines
20 KiB
JSON
12 lines
20 KiB
JSON
{
|
|
"hash": "aedf4d163403b2bc105f164dc4636db9",
|
|
"result": {
|
|
"engine": "jupyter",
|
|
"markdown": "---\ntitle: \"Counting in 2D, Part 2: Reorienting Polynomials\"\ndescription: |\n Geometric properties of certain 2D systems and attempts to classify them.\nformat:\n html:\n html-math-method: katex\ndate: \"2021-03-07\"\ndate-modified: \"2025-02-23\"\njupyter: python3\ncategories:\n - algebra\n - geometry\n - sandpile\n - python\nexecute:\n echo: false\n---\n\n<style>\n .cell-output-display .figure {\n text-align: center;\n }\n\n .figure-img {\n max-width: 512px;\n object-fit: contain;\n height: 100%;\n }\n</style>\n\n\n\n[Previously](../cell1), I explored some very basic 2D counting systems, which turned out to include sandpiles.\nAs the name suggests, these planar numbers require a discrete grid of numbers to contain them.\nWhat follows is a deeper investigation into this natural extension of positional systems.\n\n\nDirection of Propagation\n------------------------\n\nGiven a carry (expressed as a polynomial in two variables or a grid) and an increasing sequence of integers,\n the expansions of the sequence will appear to propagate in a certain direction.\nRecall that from the last post, we know that $x + y = 2$ and a certain case of\n the folium of Descartes will make similar patterns:\n\n$$\n\\begin{gather*}\n & ~ & \\text{Folium} \\\\\n x + y - 2 & ~ &\n x^3 + y^3 - 2xy \\\\\n \\begin{array}{|c} \\hline\n \\bar{2} & 1 \\vphantom{2^{2^2}} \\\\\n 1\n \\end{array} & ~ &\n \\begin{array}{|c} \\hline\n 0 & 0 & 0 & 1 \\\\\n 0 & \\bar{2} \\\\\n 0 \\\\\n 1\n \\end{array}\n\\end{gather*}\n$$\n\nThe general direction in which we carry can be understood as the directions from the negative term of the carry\n (hereafter *pseudo-base*) to the other terms.\nThese can interpreted vectors extending from the pseudo-base to every other term.\nThe simplest way to get these vectors is by placing the pseudo-base at the constant position\n and reading off the exponent of the other terms.\n\n$$\n\\begin{gather*}\n \\begin{array}{|c} \\hline\n \\bar{2} & \\textcolor{red}{1} \\vphantom{2^{2^2}} \\\\\n \\textcolor{blue}{1}\n \\end{array} & ~ &\n \\begin{array}{c|cc}\n 0 & 0 & 0 & \\textcolor{red}{1} \\\\ \\hline\n 0 & \\bar{2} \\vphantom{2^{2^2}} \\\\\n 0 \\\\\n \\textcolor{blue}{1}\n \\end{array} \\\\\n \\begin{matrix}\n \\textcolor{red}{ x^1 y^0 } \\implies \\langle 1, 0 \\rangle \\\\\n \\textcolor{blue}{ x^0 y^1 } \\implies \\langle 0, 1 \\rangle\n \\end{matrix}\n & ~ &\n \\begin{matrix}\n \\textcolor{red}{ x^2 y^{-1} } \\implies \\langle 2, -1 \\rangle \\\\\n \\textcolor{blue}{ x^{-1} y^2 } \\implies \\langle -1, 2 \\rangle\n \\end{matrix}\n\\end{gather*}\n$$\n\nIt is clear that as we count, the expansions can extend only in a linear combination of these vectors.\nHowever, they cannot propagate in the reverse direction, as there is no sense of \"backwards\".\n\n\n### Balancing Act\n\nWe can naively balance the carry by adding additional carry digits.\nTo do this, we just need to double the pseudo-base and add reflections each vector in it.\nEquivalently, this adds the carry with the carry where we have replaced *x* and *y* with their reciprocals.\n\nIf we balance the left carry, it yields the Laplacian.\nBut what about the right?\nUnsurprisingly, it just stretches the expansions along the different \"basis\" vectors.\n\n::: {layout-ncol=\"2\"}\n$$\n\\textcolor{red}{ x^{-2} y^{1} } + x^{-1} y^{2} + \\textcolor{blue}{ x^{1} y^{-2} } + x^{2} y^{-1} - 4 \\\\\n\\begin{array}{cc|ccc}\n & & & \\textcolor{blue}{1} \\\\\n & & 0 & 0 & 1 \\\\ \\hline\n & 0 & \\bar{4} & 0 \\vphantom{2^{2^2}} \\\\\n \\textcolor{red}{1} & 0 & 0 \\\\\n & 1\n\\end{array} \\\\\n\\text{Added Vectors:} \\\\\n\\begin{matrix}\n \\textcolor{red}{\n \\langle -2, 1 \\rangle\n } \\\\\n \\textcolor{blue}{\n \\langle 1, -2 \\rangle\n }\n\\end{matrix}\n$$\n\n\n\n{{< video ./count_balanced_folium.mp4 >}}\n:::\n\n\n### Half-Balanced\n\nThe Laplacian carry is remarkably balanced, but it provokes the question of what the expansions\n look like if there are only three directions to propagate.\nThe intuition from above says that it should span a half-plane,\n up from the quarter-plane that $x + y = 2$ spans.\n\n::: {layout-ncol=\"2\"}\n$$\n\\textcolor{red}{ x^{-1} } + x^1 + y^1 - 3 \\\\\n\\begin{array}{c|cc} \\hline\n \\textcolor{red}{1} & \\bar{3} & 1 \\vphantom{2^{2^2}} \\\\\n 0 & 1 & 0\n\\end{array} \\\\\n\\text{Added Vector:} \\\\\n\\begin{matrix}\n \\textcolor{red}{\n \\langle -1, 0 \\rangle\n }\n\\end{matrix}\n$$\n\n\n\n{{< video ./count_half_laplacian.mp4 >}}\n:::\n\nFortunately, this is the case.\n\n\n### 2D Carry Types\n\nBased on the extent of the vectors, in general there appear to be four classes:\n\n1. The degenerate one-dimensional case\n - The carry is equivalent to the product of a polynomial in a single variable and any power *x* and/or *y*.\n2. Quarter-planes, like $x + y = 2$\n - Arise when the inverses of the vectors are inaccessible.\n3. Half-planes, like the above \"semi-\"Laplacian\n - Arise when two vectors are collinear and point in opposite directions,\n but every other vector is either on one side of this line or are also collinear.\n4. Full planes, like the Laplacian\n - Arise when the inverses of both vectors are accessible.\n\nQuarter-plane is a bit of a misnomer.\nTechnically, the fraction of the plane spanned is between 0 and 1/2 noninclusive\n (as these bounds correspond to the previous and next cases respectively).\nFor example, $x + y = 2$ actually to a quarter-plane, as the first row/column\n (which contain binary expansions) are unbounded.\nHowever, the Folium encompasses slightly more of the plane, or...\n\n$$\n\\frac{1}{2\\pi}\\arccos \\left (\n \\frac{\\langle 2, -1 \\rangle \\cdot \\langle -1, 2 \\rangle}\n {\\| \\langle 2, -1 \\rangle \\| \\| \\langle -1, 2 \\rangle \\|}\n\\right)\n= \\frac{1}{2\\pi} \\arccos \\left ( -\\frac 4 5 \\right )\n\\approx 0.397584\n$$\n\n...about 39% of the plane.\nThis is still smaller than the half-plane case.\n\n\nHunting for Implicitness\n------------------------\n\nWith these categories in mind, I would now like to shift focus.\nAll systems discussed thus far have been explicit and irreducible, meaning they are\n not derived from any \"simpler\" implicit rules.\nDo such rules exist, and cam we find any?\n\nAs mentioned previously, in the 1D case, we form explicit carries from implicit ones by\n multiplying the latter by cyclotomic polynomials.\nIt would be convenient if the same were true in two dimensions -- we generate an explicit 2D carry from\n the product of some input polynomial and a cyclotomic polynomial in x and y.\nHowever, I would like to leverage the visual representation used previously,\n since working with coefficients is linear, unintuitive, and most importantly, annoying.\n\n<!-- TODO: ipympl version? -->\n\n\nAbove is a screenshot of (my admittedly low-effort) attempt to ameliorate these shortcomings.\nThe left image is clickable, with the coefficients incrementing with left clicks and decrementing with right.\nThe text box controls the second multiplicand in the center image by selecting a cyclotomic polynomial\n and evaluating it with a particular expression.\nThe right image is the product.\n\nIt could obviously be improved by showing the coefficients in the picture and using color to only indicate sign.\nHowever, there is a benefit to hiding coefficients behind solid colors.\nFor instance, I don't need to recognize numerals to pinpoint what the product should look like.\n\n\n### Degenerate Expressions\n\nI have chosen to evaluate the right term (center image) at $x + y$ for a reason.\nChoosing *x* or *y* on their own is a poor decision because they change nothing from the one dimensional case.\nPut another way, when arranged in a grid, the coefficients are all collinear.\nAt first blush, *xy* seems like a decent pick, but it has the exact same problem;\n the line simply extends along the diagonal instead.\n$x/y$ has the same problem, but it is instead collinear along the anti-diagonals.\nWe allow negative exponents for the same reason we can carry at any location in an expansion\n\n::: {#f5ee7f1a .cell execution_count=5}\n\n::: {.cell-output .cell-output-display}\n{width=512 height=469}\n:::\n:::\n\n\nIt should go without saying that these are all degenerate, and can only span a line.\nOn the other hand, expressions like the sum of *x* and *y* form triangles, 2D shapes\n from which it is possible to build our goal polynomial.\nSince $x + y$ is symmetric in *x* and *y*, it is expected that the products have a similar sense of symmetry.\n\n\nFirst Results\n-------------\n\n\n\nThe first explicit product I was able to find is above.\nIt can be decomposed as the folium of Descartes, but with an extra term to the upper-left of the pseudo-base.\nThe implicit carry (the left multiplicand) describes the rearrangement of coefficients\n in a backwards L-shape to and from a sparser upside-down L-shape.\nSince the coefficients of this factor sum to zero, it passes through $(1, 1)$.\n\n$$\n\\begin{gather*}\n \\text{Folium} & ~ & \\text{New carry} \\\\\n x^3 + y^3 - 2xy & ~ &\n x^3 + y^3 + 1 - 3xy \\\\\n \\begin{array}{|c} \\hline\n 0 & 0 & 0 & 1 \\\\\n 0 & \\bar{2} \\\\\n 0 \\\\\n 1\n \\end{array} & ~ &\n \\begin{array}{|c} \\hline\n 1 & 0 & 0 & 1 \\\\\n 0 & \\bar{3} \\\\\n 0 \\\\\n 1\n \\end{array}\n\\end{gather*}\n$$\n\n\n### Cousin Systems\n\nMy first thought upon seeing this carry was to see what makes counting in this system different\n from its \"neighbors\".\nBy this, I mean moving the $x^3$ and $y^3$ terms further inward and outward.\n\n$$\n\\begin{gather*}\n x + y + 1 - 3xy &\n x^2 + y^2 + 1 - 3xy \\\\\n \\begin{array}{|c} \\hline\n 1 & 1 \\\\\n 1 & \\bar{3} \\\\\n \\end{array} &\n \\begin{array}{|c} \\hline\n 1 & 0 & 1 \\\\\n 0 & \\bar{3} \\\\\n 1\n \\end{array} \\\\\n \\textcolor{red} {x^3 + y^3 + 1 - 3xy} &\n x^4 + y^4 + 1 - 3xy \\\\\n \\textcolor{red} {\n \\begin{array}{|c} \\hline\n 1 & 0 & 0 & 1 \\\\\n 0 & \\bar{3} \\\\\n 0 \\\\\n 1\n \\end{array}\n } &\n \\begin{array}{|c} \\hline\n 1 & 0 & 0 & 0 & 1 \\\\\n 0 & \\bar{3} \\\\\n 0 \\\\\n 0 \\\\\n 1\n \\end{array}\n\\end{gather*}\n$$\n\nAll polynomials besides the one under consideration (highlighted in red) are irreducible.\nThis means that these carries hide no implicit rules, and are as fundamental as the Laplacian or $x + y = 2$.\n\nAnalyzing the carry vectors, it is clear that the pattern produced by each should be different:\n\n$$\n\\begin{gather*}\n x^{-1} y^{0} + x^{-1} y^{-1} + x^{0} y^{-1} - 3 &\n x^{-1} y^{1} + x^{-1} y^{-1} + x^{1} y^{-1} - 3 \\\\\n \\begin{matrix}\n \\langle -1, 0 \\rangle \\\\\n \\langle -1, -1 \\rangle \\\\\n \\langle 0, -1 \\rangle\n \\end{matrix} &\n \\begin{matrix}\n \\langle -1, 1 \\rangle \\\\\n \\langle -1, -1 \\rangle \\\\\n \\langle 1, -1 \\rangle\n \\end{matrix} \\\\\n x^{-1} y^{2} + x^{-1} y^{-1} + x^{2} y^{-1} - 3 &\n x^{-1} y^{3} + x^{-1} y^{-1} + x^{3} y^{-1} - 3 \\\\\n \\begin{matrix}\n \\langle -1, 2 \\rangle \\\\\n \\langle -1, -1 \\rangle \\\\\n \\langle 2, -1 \\rangle\n \\end{matrix} &\n \\begin{matrix}\n \\langle -1, 3 \\rangle \\\\\n \\langle -1, -1 \\rangle \\\\\n \\langle 3, -1 \\rangle\n \\end{matrix} \\\\\n\\end{gather*}\n$$\n\nThe vectors in the top-left carry contain only negative numbers, so it will tend toward\n the quarter-plane case like $x + y = 2$.\nIn the top-right carry, all vectors are equidistant and meet at right (and straight) angles.\nThis means that it is a 45° rotation of the altered Laplacian, which spans a half-plane.\nThe remaining two should both propagate into the full plane. Is this reflected in the counting videos?\n\n::: {}\n\n\n\n{{< video ./count_triangle_carries.mp4 >}}\n\nCounting in each of the $x^n + y^n + \\ldots$ systems\n:::\n\nIndeed it is.\nHowever, while the discovered carry remarkably remains centered, the final one tends more toward\n propagating to the lower right.\nIt has somehow exceeded a threshold that the centered one has not.\n\nIncidentally, the L-shapes in the implicit carry (which I noted can be interchanged) never turn up,\n and the \"initial rule\" is useless.\nPhinary, the simplest implicit case in one dimension, still requires the initial rule to go\n from the expansion of two (10.01) to three (100.01).\n\n\nIsosceles Rotations\n-------------------\n\nOne of the similar carries is a rotation of a pattern we were already familiar with,\n like the folium was to $x + y = 2$\nDoes this mean we can rotate the centered pattern?\nIf so, is will the carry polynomial still be factorable?\n\nNaively, the following carry might look similar...\n\n::: {layout-ncol=\"2\"}\n$$\n\\begin{array}{|c} \\hline\n & & \\textcolor{red}{1} \\\\\n & & \\bar{3} \\\\\n \\textcolor{green}{1} & & & & \\textcolor{blue}{1}\n \\end{array} \\\\\n \\begin{matrix}\n \\textcolor{red}{\\langle 0,-1 \\rangle} \\\\\n \\textcolor{green}{\\langle -2,1 \\rangle} \\\\\n \\textcolor{blue}{\\langle 2,1 \\rangle} \\\\\n \\text{Angle to top} \\approx 116°\n\\end{matrix}\n$$\n\n\n\n{{< video ./count_bad_rotated_triangle.mp4 >}}\n:::\n\nBut there are only even numbers in the first component of each vector.\nTherefore, the carry below will produce the same pattern.\n\n::: {layout-ncol=\"2\"}\n$$\n\\begin{array}{|c} \\hline\n & \\textcolor{red}{1} \\\\\n & \\bar{3} \\\\ \\textcolor{green}{1}\n && \\textcolor{blue}{1}\n\\end{array} \\\\\n\\begin{matrix}\n \\textcolor{red}{\\langle 0,-1 \\rangle} \\\\\n \\textcolor{green}{\\langle -1,1 \\rangle} \\\\\n \\textcolor{blue}{\\langle 1,1 \\rangle} \\\\\n \\text{Angle to top} = 135°\n\\end{matrix}\n$$\n\n\n\n{{< video ./count_bad_rotated_triangle_reduced.mp4 >}}\n:::\n\nNeither of these are similar to the original.\nFor comparison, the largest angle in the nonrotated case is ~108°.\nIn fact, the shape is much closer to the similar orientation with $x^4 + y^4 + \\ldots$ terms.\n\n\n### Checking Magnitudes\n\nMeasuring these quantities as angles is a bit of a lie.\nSince all of these triangles are isosceles, two of the vectors have equal magnitude.\nFurther, each can be characterized by the ratio between them and the final vector's magnitude.\nThe previous two triangles have ratio:\n\n$$\n\\\\\n\\frac{m_1}{n_1} =\n\\frac{\\| \\langle -2, -1 \\rangle \\|}{\\| \\langle 0, -1 \\rangle \\|} =\n\\frac{\\sqrt 5}{1} =\n\\sqrt 5\n\\\\\n\\frac{m_2}{n_2} =\n\\frac{\\| \\langle -1, -1 \\rangle \\|}{\\| \\langle 0, -1 \\rangle \\|} =\n\\frac{\\sqrt 2}{1} =\n\\sqrt 2\n$$\n\nThe triangle we are trying to rotate has ratio:\n\n$$\n\\frac{m}{n} =\n\\frac{\\| \\langle 2, -1 \\rangle \\|}{\\| \\langle -1, -1 \\rangle \\|} =\n\\frac{\\sqrt 5}{\\sqrt 2} =\n\\frac{\\sqrt {10}}{2}\n$$\n\nObviously, one cannot express $\\sqrt 10$ from only one of $\\sqrt 2$ or $\\sqrt 5$.\nFortunately, this suggests the rotation:\n\n::: {layout-ncol=\"2\"}\n$$\n\\begin{gather*}\n \\begin{array}{|c} \\hline\n & & & \\textcolor{red}{\\bar{1}} \\\\\n \\\\\n & & & \\bar{3} \\\\\n \\textcolor{green}{1} & & & & & & \\textcolor{blue}{1}\n \\end{array} ~~\n \\begin{matrix}\n \\textcolor{red}{\\langle 0,-2 \\rangle} \\\\\n \\textcolor{green}{\\langle -3,1 \\rangle} \\\\\n \\textcolor{blue}{\\langle 3,1 \\rangle} \\\\\n \\end{matrix} \\\\\n \\frac{\\| \\langle -3, 1 \\rangle \\|}{\\| \\langle 0, -2 \\rangle \\|}\n = \\frac{\\sqrt {10}}{2} \\\\\n\\end{gather*}\n$$\n\n\n\n{{< video ./count_good_rotated_triangle.mp4 >}}\n:::\n\nThe counting video looks very promising, but can the polynomial factored?\nFortunately, yes.\n\n$$\n\\begin{gather*}\n x^{6} y^{3} + x^{3} + y^{3} - 3 x^{3} y^{2} &=&\n (x^{4} y^{2} - x^{3} y - x^{2} y^{2} + x^{2} - x y + y^{2}) \\\\\n && (x^2 y + x + y ) \\\\\n \\begin{array}{|c} \\hline\n & & & 1 \\\\\n \\\\\n & & & \\bar{3} \\\\\n 1 & & & & & & \\bar{1}\n \\end{array} &=&\n \\begin{array}{|c} \\hline\n & & 1 & \\\\\n & \\bar{1} & & \\bar{1} & \\\\\n 1 & & \\bar{1} & & 1 \\\\\n \\end{array} ~~\\cdot~~\n \\begin{array}{|c} \\hline\n & 1 & \\\\\n 1 & & 1\n \\end{array} \\\\\n & & (x y^{2} + x + y ) = \\Phi_2 \\left ( \\frac{y}{x} + xy \\right ) x\n\\end{gather*}\n$$\n\nAs noted, the the rightmost polynomial can still be expressed from $\\Phi_2$.\n\nAll powers of *x* in the product are multiples of 3.\nWe can divide these out to produce a similar carry, as we did before.\nDoing so preserves the shape of counting, but destroys the factorization, as the result is irreducible.\n\n::: {layout-ncol=\"2\"}\n$$\n\\begin{array}{|c} \\hline\n & \\textcolor{red}{1} & \\\\\n \\\\\n & \\bar{3} & \\\\\n \\textcolor{green}{1} & & \\textcolor{blue}{1}\n\\end{array} ~~\n\\begin{matrix}\n \\textcolor{red}{\\langle 0,2 \\rangle} \\\\\n \\textcolor{green}{\\langle -1,-1 \\rangle} \\\\\n \\textcolor{blue}{\\langle 1,-1 \\rangle} \\\\\n\\end{matrix} \\\\\n\\frac{| \\langle -1, -1 \\rangle |}{| \\langle 0,2 \\rangle |}\n = \\frac{\\sqrt 2}{2}\n$$\n\n\n\n{{< video ./count_good_rotated_triangle_reduced.mp4 >}}\n:::\n\nAll of these similar systems is share something in common: the pseudo-base is located at\n the centroid of the triangle formed by the remaining digits.\nThis is most obvious from the fact that the sum of all three vectors equals $\\vec 0$ in all three cases.\nThe \"threshold we exceeded\" when comparing the unrotated system's neighbors was the centroid transitioning\n between being closer to the upper point or the lower two points.\n\nThe position of the centroid is unchanged so long as the lower two points have the same midpoint as above.\nTherefore, all triangular barycentric carries should share this similar pattern.\n\n\nClosing\n-------\n\nCarries intrinsically possess a few invariants.\nFor one, they must apply at any location in an expansion, a form of translational symmetry.\nNo matter if we multiply or divide by *x* or *y*, the polynomial retains its general appearance,\n as well as whether or not it is irreducible.\nThe above method shows that rotational symmetry also exists for polynomials beyond interchanging *x* and *y*.\n\nFor integers, carries possess a symmetry which polynomials do not: the ability to contract and expand bases,\n meaning that in some sense, $P(x) \\sim P(x^k)$ for any *k*.\nThis preserves the counting system despite expansions and contractions which pay no regard for reducibility.\nThis is also the reason that systems like base-$\\sqrt 2$ are so uninteresting:\n for integers, it just amounts to spaced-out binary.\n\nThree questions that immediately come to mind are:\n\n- Not all integers can be written as the sum of two squares.\n Are there any (reducible) polynomials which have no nontrivial rotation?\n - The [Brahmagupta-Fibonacci](https://en.wikipedia.org/wiki/Brahmagupta%E2%80%93Fibonacci_identity) identity\n implies that such numbers are closed under multiplication.\n This means that it is always possible to reorient the triangle in the method shown above.\n- After compacting the counting system, can reducibility be recovered for other scaling factors\n than the one started with?\n What about from an irrational scaling (as by a rotation)?\n - I am not equipped to answer this.\n- Some geometry is impossible in the 2D square lattice -- for example, it contains no equilateral triangles.\n Equilateral triangles do however exist in the 3D square lattice.\n Are there 2D systems which *must* be embedded in 3D dimensions, or can they always be rotated and reduced?\n - Again, I am not equipped to answer this.\n\nRegardless, it is pleasing that the exponents in polynomials can easily be interpreted as\n the components of vectors.\nThe primary geometrical approach to such objects is to plot the curve or surface containing points which\n (at least approximately) satisfies the equation.\nHere however, basic coordinate geometry exists without needing to define evaluation.\nMoreover, geometry, linear algebra, and polynomial number theory all at once have a role to play in\n the story of these bizarre fractal patterns.\n\n",
|
|
"supporting": [
|
|
"index_files"
|
|
],
|
|
"filters": [],
|
|
"includes": {}
|
|
}
|
|
} |