README.md
11.7 kB · markdown
Roulette Loops
- Reads the self crossing count of one trochoid as an exact step function of the pencil's reach
|p|, past the loop threshold|p| = 1, and the crossing count of two trochoids drawn from one wheel. - The object is
mrlynum::spirograph: a wheel of radiusrrolls inside or outside a circle withR/r = a/bin lowest terms, a pencil sits|p|wheel radii from the wheel's centre, andtracereturns the polyline every count is read back from. - Write
s = -1inside ands = +1outside,rho = a + s b,m = a + 2 s b. In wheel radii and in the closing parameterphiof[0, 2 pi)a pencil at the real seat|p|drawsz(phi) = rho e^(i b phi) + |p| b e^(i s rho phi). - With
sigma = (phi + psi)/2anddelta = (phi - psi)/2,z(phi) = z(psi)readsrho sin(b delta) + |p| b sin(s rho delta) e^(i s a sigma) = 0, sosigmais a multiple ofpi / aand the crossing equation isrho sin(b delta) = e |p| b sin(rho delta)withe = 1ore = -1. - The reflection of the curve in the line of angle
b sigmafixes the crossing, so every self crossing lies on one of theamirror linesk pi / athrough the centre, inside and outside alike. A pencil at seat anglealphaturns the whole curve by-s b alpha / a, so its mirror lines are-s b alpha / a + k pi / a; the barek pi / aneeds a real seat. - Not every mirror line has to carry a crossing:
4/1outside puts all four on two of its four lines. (a/2)(Z_1 + Z_-1), withZ_ethe roots of the crossing equation in(0, pi), counts unordered parameter pairs, so it is read off a one dimensional root count and never off a picture; it is the number of distinct double points exactly when the curve has no point of multiplicity above two and no self contact.- The one reach with a multiple point is
|p| = rho / b: therez = 0at theaparametersphi = (2j+1) pi / a, soC(a, 2)parameter pairs collapse into the centre and the point count isC(a, 2) - 1below the pair count. Elsewhere the two agree, because a multiple point needs every pairwisedeltato be a multiple ofpi / a, and such adeltasolves the crossing equation only there. - A step of the count is a double root: the crossing equation and its
deltaderivativecos(b delta) = e |p| cos(rho delta)together forcea sin(m delta) = m sin(a delta), equivalentlysinc(m delta) = sinc(a delta), with the reach|p| = |cos(b delta) / cos(rho delta)|, read as|rho sin(b delta)| / |b sin(rho delta)|where both cosines vanish, which isdelta = pi/2whenais even. - A threshold is a tangency angle
deltain[0, pi), not a reach. Several angles can share one reach, and then the step there is a multiple ofa; the count|rho - b|is a count of angles with multiplicity. delta = 0anddelta = piare roots of the crossing equation at every reach, and a root is born at each end as the reach passes1, sincef'(0) = rho b (1 - e |p|)andf'(pi) = rho b ((-1)^b - e |p| (-1)^rho). The single entry atdelta = 0stands for both births, which is why the jump at reach1isaand nota/2.- On a tangency reach the curve touches itself: the two branches meet with equal tangents, a tacnode, and the meeting count is the transversal count below plus
a/2for each tangency angle at that reach. The step function is read on the open intervals between tangency reaches, never on one. - Swapping the wheel frequency
band the rim frequencyrhofixes every tangency angle, since{a, |m|} = {rho + b, |rho - b|}is symmetric, and inverts every reach, since|cos(b delta) / cos(rho delta)|inverts. So the thresholds depend on the ordered pair(b, rho), and the fallinga < 2bstaircase is the reciprocal of the risinga > 2bone. sin(k delta)andcos(k delta)are expanded exactly inu = sin^2(delta)by the integer recursion of Sakhnovich 2023, theorems 2.1 and 2.5, so the tangency equation becomesu Q(u) = 0, timescos(delta)whenais even, for an explicit integer polynomialQ, and|p|^2 = T(u)/B(u)for explicit integer polynomialsTandB.- The tangency equation integrates:
a sin(m delta) - m sin(a delta)is2 a mtimesW(delta) = int_0^delta sin(b t) sin(rho t) dtup to sign,W'vanishes on(0, pi)only atj pi / rhoandk pi / b, and thereWis exactly(-1)^(j+1) sin(b j pi / rho) rho / (rho^2 - b^2)and(-1)^k sin(rho k pi / b) b / (rho^2 - b^2), so the threshold count is a sign count over a merged Farey sequence with no numerics in it. - The root scan starts at
0.4 / max(a, |m|)and hides nothing:W' > 0on(0, pi / max(b, rho))andmax(a, |m|) = b + rhoexceedsmax(b, rho), so no root lies below the cut. The germ atpimakesWmonotone and zero free on the last interval, so the endpoint contributes no sign change and the walk carries only the interior critical values. - Two pencils
pandqon one wheel meet at parameter pairs whererho^2 sin^2(b delta) = b^2 (P sin^2(rho delta) + E cos^2(rho delta) - s X sin(2 rho delta))withP = |p + q|^2/4,E = |p - q|^2/4andX = Im(q conj(p))/2, one root count in[0, 2 pi)timesa/2; the equation ispiperiodic indelta, so the root count is even and the halving is exact. - The pair law needs the two curves distinct, which is the coincidence law
mrlynum::spirograph::distinctalready carries. It counts parameter pairs; the point count needs the further condition that no self crossing of one curve lies on the other, and the centre correctionC(a, 2) - 1per seat that sits at reachrho / b. - Everything is checked three ways that do not share a step: the closed step function, the root count of the crossing equation, and the crossing count of the
mrlynum::spirograph::tracepolyline at two sample counts. - A polyline count blurs inside a tangency, so a threshold is decided by the algebra and the trace only brackets it; the sweep's grid is offset off the rational thresholds so no sample lands on one.
- The hypotheses on the step function are
|p| > 0,|p|not a tangency reach,|p|notrho / b, andm != 0;a = 2binside, which only2/1reaches, hasm = 0, no tangency and no crossing except at|p| = 1, where the curve is a doubled segment. - What is taken from the literature: Wieleitner 1908 has the reach 1 trichotomy and the mirror line fact for the looped epitrochoid, qualitatively; Jaekel has both staircase endpoints
a (b - 1)anda (rho - 1), the split ata = 2b, and the step sizesaand2a, with the transition reaches solved numerically; Sakhnovich 2023 has thesin^2recursion. What is added here: the tangency equation and the reaches in closed form, the sign count, the mirror lines with their seat hypothesis and a bound, the centre correction, the reciprocity, and the pair law.
RUN
CARGO_BUILD_JOBS=4 cargo run --release -p roulette-loops- About three minutes, single threaded; prints only, writes nothing, holds a few megabytes.
WITNESSES
- The mirror lines: at 24001 samples the worst distance from a trace self crossing to the nearest mirror line is
4.33e-7of the frame, overa/bin5/1, 7/2, 8/3inside and5/2, 7/3outside, reaches1.4, 2.6, 3.9, seat angles0and0.3, 30 cells. The floor istracereturningf32, not the geometry. - The step function:
a (b - 1)below the first tangency reach,a (rho - 1)above the last, anda sign(m)per tangency angle; the number of angles in[0, pi), countingdelta = 0, is|rho - b|, the same integer asmin(|m|, a). - The sign count: over all
29450coprime frequency pairsb, rhoup to220the exact integer sign count ofWreturns|rho - b|every time, in integer arithmetic with no root finding. - The census:
179coprime fractionsa/bwithaat most24,357cases over the two sides withmnonzero, the angle count equal to the sign count|rho - b|, the limit equal toa (rho - 1), and the closed form equal to the crossing equation's root count at the midpoint of every step, with0failures. - The reciprocity: over
210swaps ofbandrhowithb + rhoat most26, the worst deviation of a threshold times its partner from1is1.47e-13. - The sweep:
25578reads ofmrlynum::spirograph::traceover|p|from0.5to4in203steps,bin1..6andainb+1..11coprime, inside and outside, at4001and12001samples, disagree with the closed form0times; every jump bracket is0.0173wide or less and holds exactly the predicted angles. - The contact: at
|p|^2 = 27/2the hypotrochoid5/1has2tangency angles and2simple roots, so10meetings against5below and15above, the two branches closing to8.88e-16at radius2.041241;7/2inside gives21against14and28,11/4inside55against44and66,3/1outside6against3and9,5/2outside15against10and20and25against20and30. - The births:
3/1inside has no root in(0, pi)at reach0.98and two at reach1.02,0.1984one = 1and2.9432one = -1, count3;7/2inside goes from1.4235, 1.7181and count7to those two plus0.0750and3.0666and count14. - The centre: at
|p| = rho / bthe trace's distinct point count is the step function lessC(a, 2) - 1on every oddaread,1at3/1, 5/2, 5/3, 7/4inside,6at5/1and5/4inside,8at7/2inside,7at3/1and10at3/2and21at5/2outside, while three percent either side the two counts agree. - The thresholds of
a/b = 5/1inside:1and3.674234614175twice, exactly|p|^2 = 27/2, atu = 5/6onQ(u) = 40 - 48 u; the count is0, then5, then15. - The thresholds of
a/b = 7/2inside:1and2.353415666603twice, exactly|p|^2 = (81 + 21 sqrt 21)/32, atuthe smaller root ofQ(u) = 192 u^2 - 336 u + 140; the count is7, then14, then28. - The thresholds of
a/b = 5/1outside:1,4.180967894379twice and5.789603394549twice, exactly|p|^2 = (102 - 7 sqrt 21)/4and(102 + 7 sqrt 21)/4onQ(u) = -320 u^2 + 448 u - 140; the count is0, then5, then15, then25. - When
ais even,delta = pi/2is always a tangency and its reach is the rational|p| = rho / b, which is also the centre reach:3at4/1inside,5/3at8/3inside,13/5at8/5outside. There the centre correction and a step fall together and the step function is not read. - The pair law against the trace:
48reads over5/1, 7/2, 8/3inside and5/2outside at reaches0.6, 1.3, 2.4, 3.7against three seat kinds, equal reach, shorter reach and the wheel's centre, agree on the parameter pair count exactly. - The pair point count parts from it:
3/1inside with one seat at reachsqrt 5 - 1and one at the wheel's centre has6parameter pairs and3points, since all three self crossings of the first curve sit on the circle of radiusrhothe second draws; two percent either side gives6points. - The centre pencil draws the circle of radius
rho, the law collapses to|sin(b delta)| = b |p| / (2 rho), and the pair count is2 a bbelow|p| = 2 rho / band0above:48then0across10/3at8/3inside. - The pair count
2 a bsurvives the loop threshold|p| = 1, which is a tangency of one curve with itself and never of two curves with each other: for two seats at one reach and half anglenuapart it first fails at2.242763, 1.741061, 1.379486, 1.143270, 1.047854, 1.010207, 1.002194for5/1inside atnu = 1, 0.5, 0.2, 0.05, 0.01, 0.001, 0.0001, excess falling4.69then4.65per decade against10^(2/3) = 4.64. Seven samples at one fraction; the shape is a reading, not a bound. - The pair threshold is not monotone in
nu:8/3inside gives1.117596atnu = 1against1.523254atnu = 0.5. mrlynum::spirograph::trace,frameandtrackare the only outside calls; the counters for one polyline and for two are carried here.