research/lab/rs/carry-skeleton
1 directory and 2 files in research/lab/rs/carry-skeleton.
carry-skeleton
- One step of
m n + 1in base 2 split into itsGF(2)skeleton and its carry, and the carry read as an object of the memory dial of beneath. - Digits run least significant first, so
2nis a shift towards the higher digits and the ripple carry runs in the same direction as the skeleton's dependency. - The skeleton of
3n + 1isn xor 2n xor 1; the carry word isdefect(n) = (3n + 1) xor (n xor 2n xor 1)and the local carry count isd_loc(n) = popcount(defect(n)). - Every rule reading here is
mrlynum::memory::Rule:Rule::new(1, k, code)at window widthk, with the window(c_1, ..., c_k)read asw = sum_j c_j 2^(k - j), first digit most significant, andRule::allowed(w)true when bitwof the code is set. rhoandkappaaremrlynum::memory::perronandmrlynum::memory::kappa, which split the digraph into strongly connected components and make each component's Perron root exact against its integer characteristic polynomial.
THE METHOD
carries(n)runs the four-state Mealy transducer directly: state(n_(i-1), q_i),q_0 = 1,q_(i+1) = MAJ(n_i, n_(i-1), q_i), and its output word is asserted equal todefect(n)digit for digit.- The substitution
M = 2n + 1is checked as the exact identityM xor 2M = 2 (n xor 2n xor 1) + 1, andM xor 2Mis checked against rule 60 rebuilt digit by digit asM_i xor M_(i-1). - The zero-carry code of an odd multiplier
mis recomputed fromsupp m: the difference set{|j - j'| : j, j' in supp m}is built, the window width isdeg m + 1, and a window is allowed when no two of its1digits sit at a distance in that set. No code is copied. - A word shorter than the width holds no window and
Rule::acceptstakes it, so every integer is padded with leading zeros past the width before the set equality is asserted; leading zeros never close a forbidden pair. - The carry density is read two ways: the exact integer balance of the stationary vector of the four-state chain, and the mean of
d_locover everyn < 2^level. - The depth is the longest run of consecutive carry-on positions, sampled on uniform digit strings with a
splitmix64stream seeded in the source, so every depth row reruns identically.
THE CONTROLS
carriesagainstdefect, theMsubstitution and the rule-60 rebuild:0mismatches each over everyn < 2^18.- The zero-carry set against the rule:
0mismatches over everyn < 2^16atm = 3, 5, 7, 9, 11, 15. kappaon codes7and23asserted against0.098239and0.115204, the two values beneath already prints, reached here from the multiplier and not from the rule.- The carry-free map asserted non-growing and asserted to reach
1from everyn < 2^20. - The six refutation witnesses pinned as explicit integer pairs, and the worst-case depth
level + 1pinned atlevel 1, 2, 4, 8, 16, 32, 40.
RUN
CARGO_BUILD_JOBS=4 cargo run --release -p carry-skeletonfrom the repo root.7.53son one thread,7.43sof it the depth sampling. Prints only, writes nothing.CARGO_BUILD_JOBS=4 cargo test -p carry-skeleton,12tests, under a second after the build.
READS
- The identity:
0mismatches on all three checks below2^18, and the radius witness holds at every length2..40. - The zero-carry rules, one row per odd multiplier, every code recomputed from the difference set.
m | supp m | difference set | k | code | card W | rho | kappa |
|---|---|---|---|---|---|---|---|
| 3 | 0, 1 | 1 | 2 | 7 | 3 | 1.618034 | 0.098239 |
| 5 | 0, 2 | 2 | 3 | 95 | 6 | 1.618034 | 0.167412 |
| 7 | 0, 1, 2 | 1, 2 | 3 | 23 | 4 | 1.465571 | 0.115204 |
| 9 | 0, 3 | 3 | 4 | 22015 | 12 | 1.618034 | 0.201999 |
| 11 | 0, 1, 3 | 1, 2, 3 | 4 | 279 | 5 | 1.380278 | 0.115524 |
| 15 | 0, 1, 2, 3 | 1, 2, 3 | 4 | 279 | 5 | 1.380278 | 0.115524 |
11and15share a difference set, so they share a rule: the zero-carry set depends on the difference set ofsupp qand not onm.- The density: the stationary vector is
(2, 1, 1, 2)/6on the states(0,0), (0,1), (1,0), (1,1), all four balance residuals exactly0, carry-on mass exactly3/6. The mean ofd_locover everyn < 2^levelreads4.332031, 5.333008, 6.333252, 7.333313, 8.333328, 9.333332, 10.333333, 11.333333atlevel 8, 10, 12, 14, 16, 18, 20, 22, which islevel/2 + 1/3 - (-1)^level/(3 * 2^level)exactly: the integer form3 sum = 3 level 2^(level-1) + 2^level - (-1)^levelhas residual0at everylevel 8..22, andmean/levelfalls0.541504, 0.533301, 0.527771, 0.523808, 0.520833, 0.518518, 0.516667, 0.515152towards1/2. - The carry-free map:
0digit-count increases and0values failing to reach1over everyn < 2^20, withT_free(1) = 1. - The six refutations, each the least clashing pair below
2^16and the number of unordered pairs of integers below2^16that share the statistic and disagree ond_loc. A statistic is refuted as soon as one such pair exists; the count is how many there are.
| statistic | least clashing pair | d_loc | disagreeing pairs below 2^16 |
|---|---|---|---|
| popcount | 1, 2 | 2, 0 | 256217518 |
longest run of 1 digits | 1, 2 | 2, 0 | 417177932 |
v_2 | 1, 3 | 2, 3 | 659301399 |
| digit count | 2, 3 | 0, 3 | 662864636 |
(popcount, v_2) | 3, 5 | 3, 4 | 88157572 |
| all four at once | 19, 25 | 3, 4 | 9331881 |
- The last row subsumes every pair: two integers agreeing on all four statistics already disagree on
d_loc, so no pair of them is a summary either. - The depth: the carry-on block of the transfer matrix is
[[0, 1], [1, 1]], characteristic polynomialx^2 - x - 1, the same astransfer(Rule::new(1, 2, 7)) = [[1, 1], [1, 0]], so the survival rate per digit isphi/2and the prediction islog_(2/phi) levelat2/phi = 1.236067977.
level | samples | mean depth | standard error | log_(2/phi) level | offset | increment per quadrupling |
|---|---|---|---|---|---|---|
| 16 | 200000 | 6.338 | 0.008 | 13.082 | -6.744 | - |
| 64 | 200000 | 12.116 | 0.011 | 19.623 | -7.507 | 5.778 |
| 256 | 200000 | 18.462 | 0.013 | 26.164 | -7.702 | 6.346 |
| 1024 | 200000 | 24.967 | 0.013 | 32.706 | -7.739 | 6.504 |
| 4096 | 200000 | 31.481 | 0.014 | 39.247 | -7.766 | 6.514 |
| 16384 | 200000 | 38.029 | 0.014 | 45.788 | -7.759 | 6.548 |
- The predicted increment per quadrupling is
6.541119; the read increments rise towards it from below, the last reading6.548at a standard error of0.014per mean, and the offset settles near-7.76, so the base is supported and not established. The mean is a sample mean over200000strings and no exponent is fitted.
WITNESSES
- beneath, The carry of a Collatz step - the identity, the unbounded radius, the zero-carry table, the two couplings, the density, the carry-free cycle theorem, the refutation line and the depth conjecture.
- src/1 item
- Cargo.toml125 B
- README.md6.9 kB