research/lab/py/spun-stack
0 directories and 2 files in research/lab/py/spun-stack.
spun-stack
- What the line stack does when every layer is rotated: which rotations keep it exact, what the exact spun stack lights, and how bright each node is.
- Layer
nat anglethetadraws the lattice(1/n) R_theta Z^2. Two layers share a node other than the origin iffcosandsinof their relative angle are both rational, so the whole-degree schedules are decided by Niven's theorem. - The exact spun stack indexes layers by nonzero associate classes of
Z[i]: layerzisz^{-1} Z[i], scale|z|and rotation-arg zin one multiplication. Its lit set is the Gaussian Farey set, its brightness a Gauss circle count. - Every rotation and every node is exact:
Fractioncoordinates, Gaussian Euclidean gcd, and the cyclotomic fieldQ(zeta_360)for the rationality ofcosandsinat whole degrees.
THE FIXED-INCREMENT COROLLARY
- Under the fixed increment, layer
ksits atk theta, so layersjandkshare an exact lattice iff(j - k) thetais a multiple of 90. Proved, three lines from the dead-spin theorem. - Write
theta/90 = p/qin lowest terms. Then(j - k) p/qis an integer iffqdividesj - k, so the layers fall into exactlyqangle classes modulo 90, sharing happens inside a class and never across, and the sharing-pair count isSum_classes C(size, 2). Proved. - If
theta/90is irrational,(j - k) theta/90is never a nonzero integer, so no two layers share and the stack is dead everywhere but the origin. Proved. - So the schedule lights up exactly at the Farey fractions of a quarter turn, and
q- the Farey denominator - is the number of eyes. Verified by the table below.
WHAT IT PRINTS
rational_angle_degreesreduces2 cos(d deg) = zeta^d + zeta^-dand2 sin(d deg) = zeta^(90-d) - zeta^(90+d)modulo the cyclotomic polynomialPhi_360and returns the degrees where both remainders are constant:0, 90, 180, 270, four of 360.spot_check_degreesre-decides twelve of those degrees throughsympy.minimal_polynomialand agrees with the cyclotomic route on all twelve.pythagorean_hitschecks that all 68 rational points of the unit circle with denominator at most 60 are of the formw^2/N(w)for a Gaussianwin the box of side 12.dead_spin_pairsruns the whole-degree schedulelayer k at angle 0, 2, 3, 5, 7, 11, ...fork = 1..30: 5 of the 435 pairs share a node other than the origin, every one of them at a relative angle of exactly 90 degrees.shared_witnessexhibits the shared lattice for each of the 5:(5, 7)with(26, 97),(6, 11)with(27, 101),(7, 13)with(28, 103),(8, 17)with(29, 107),(9, 19)with(30, 109). The shared set isR_alpha (1/g) Z^2withg = gcd(m, n), of densityg^2per unit area.unit_square_sharescounts that lattice in the open unit square with the origin excluded, the convention the script prints:1, 9, 49, 1, 9for the five, read at angles 7, 11, 13, 17 and 19 degrees. The count is notg^2in general - it depends on the angle, andshare_count_spreadgives the whole range over degrees 1 to 89:2, 3, 4atg = 2,8, 9, 10atg = 3, and41, 47, 48, 49, 50atg = 7.increment_classesruns the fixed-increment schedule on the 28 odd scales1..55, layerkatk thetadegrees, and prints the angle classes and the sharing-pair count for eachtheta.
theta | theta/90 | classes q | class sizes | sharing pairs |
|---|---|---|---|---|
| 0 | 0/1 | 1 | 28 | 378 |
| 10 | 1/9 | 9 | 4 and eight 3 | 30 |
| 11.25 | 1/8 | 8 | four 4 and four 3 | 36 |
| 15 | 1/6 | 6 | four 5 and two 4 | 52 |
| 18 | 1/5 | 5 | three 6 and two 5 | 65 |
| 22.5 | 1/4 | 4 | four 7 | 84 |
| 30 | 1/3 | 3 | 10, 9, 9 | 117 |
| 36 | 2/5 | 5 | three 6 and two 5 | 65 |
| 45 | 1/2 | 2 | 14, 14 | 182 |
| 60 | 2/3 | 3 | 10, 9, 9 | 117 |
| 67.5 | 3/4 | 4 | four 7 | 84 |
90 (sqrt2 - 1) | irrational | none | all 1 | 0 |
- Every row is confirmed by a second route in the same call: the pairwise exact test
(j - k) theta / 90 in Zagrees with the class formula on all twelve, and for the eight whole-degree increments a third route, the file's own Niven-freerational_cos_sintest on the relative angle, agrees as well. near_misssweeps the other 430 pairs over every nonzero lattice vector in the box of side 6 and reports the closest a rotated node comes to a coincidence:0.003390, at scales 17 and 25 and angles 53 and 89.- Layers are the nonzero associate classes of
Z[i], the zero layer excluded and the four units counted once, so one layer per class;literal_stackbuilds the spun stack at norm bound 50 by exact stacking of all 40 layers and finds 672 nodes, equal to the Gaussian totient sumsum Phi(d)over the same 40 classes. closed_brightnessreads each node from its reduced Gaussian denominator alone asg(floor(N/N(d)))withg(t) = sum_j (floor(t/(4j+1)) - floor(t/(4j+3))): 672 comparisons against literal stacking, 0 mismatches, the origin at 40.circle_classes_jacobiagainstcircle_classes_directfort = 0..400: equal throughout; the first twelve values are1, 2, 2, 3, 5, 5, 5, 6, 7, 9, 9, 9.totient_sumgives 672, 10608 and 168088 nodes at norm bounds 50, 200 and 800, ratios toN^2of0.268800,0.265200,0.262638againstpi / (8 zeta(2) G) = 0.260635.base_depth_checknests the layersc^-k Z[i]forc = 1 + ito depth 8 andc = 2 + ito depth 4, and confirms that brightness equalsdepth + 1 - addressat every one of the 256 and 625 deepest nodes.base_c_overlapover the box of side 10:1 + iputs all 440 nonzero points in the coarser layer,3/2 + i/2puts 220, andsqrt(2) e^iputs none, its closest approach0.0604355.
RUN
uv run python research/lab/py/spun-stack/spun_stack.py- From the repo root. One core, about seven seconds.
- Domain is the full source domain: all 360 whole degrees, all 435 prime-schedule pairs, all 378 pairs of the 28-layer increment schedule at twelve increments, the spun stack at norm bound 50 node by node, totient sums to norm bound 800.
- Nothing is written to disk.
WITNESSES
- The fixed-increment corollary:
increment_classesgives the class countq, the class sizes and the sharing-pair count at all twelve increments, by three agreeing routes. - The dead-spin theorem:
rational_angle_degreesgives the four rational rotations,dead_spin_pairsandnear_missgive the 5 sharing pairs and the0.003390floor under the other 430,unit_square_sharesandshare_count_spreadthe window convention and the angle dependence of the count. - The exact spun stack:
literal_stackagainstclosed_brightnessandtotient_sum, 672 nodes and 0 brightness mismatches at norm bound 50. - The Gaussian twin of
floor(N/b):circle_classes_jacobiagainstcircle_classes_directont = 0..400. - The complex-base corollary:
base_depth_checkandbase_c_overlap.
- README.md6.8 kB
- spun_stack.py13.1 kB