# Four-language reproduction This package reproduces the computations in **Affine Dynamics, Sampling, and Quadrature** in Python, Julia, Rust, and Java. Each implementation performs its own arithmetic, linear solves, recovery, and verification. None invokes another implementation to obtain its mathematical answers. The mathematical scope is the revised note supplied with this package as `PROOFS.md`. This is not a reproduction of every paper or every resource on the external website. ## What is included | File | Purpose | |---|---| | `verify.py` | Python implementation; standard library only | | `verify.jl` | Julia implementation; standard library only | | `Verify.java` | Java implementation; standard library only | | `rust/src/main.rs` | Native Rust implementation | | `rust/Cargo.toml`, `rust/Cargo.lock` | Pinned Rust dependency definitions | | `rust/vendor/`, `rust/.cargo/config.toml` | Dependency sources and configuration for offline Rust builds | | `PROOFS.md` | Complete original mathematical note and its original 12-group supplementary checker | | `run_all.py` | Build and comparison runner for the expanded implementations | | `expected.txt` | Common transcript, including 46 exact-value records | | `REPRODUCTION_REPORT.md` | Execution results, runtime versions, and scope | | `evidence/` | Retained outputs from the completed runs | | `SHA256SUMS.txt` | SHA-256 for every other packaged file | The original 12 check groups are retained and extended to **21 groups per language**. The expanded checks cover affine iteration, signed floor arithmetic, ordered residuals, exact linear solves, landmark recovery, positive-rule searches, and certified bounds for the transcendental seed and contraction parameter. ## Run the implementations The commands below start in the extracted package directory. The runtimes themselves must be installed. No Python, Julia, or Java packages are needed. Rust dependencies are bundled, so Cargo does not need network access. Python: ```sh python3 verify.py python3 -O verify.py ``` Julia: ```sh julia --startup-file=no verify.jl julia --startup-file=no -O3 verify.jl ``` Java, with a JDK supporting Java 17 or later: ```sh javac Verify.java java Verify java -da Verify ``` If the compiler executable is absent but the JDK compiler module is present, this equivalent compilation command is supported: ```sh java -m jdk.compiler/com.sun.tools.javac.Main Verify.java ``` Rust: ```sh cd rust cargo run --offline --locked cargo run --offline --locked --release ``` Run the complete comparison from the package directory: ```sh python3 run_all.py ``` The runner also accepts `--julia`, `--cargo`, `--rustc`, `--java`, and `--javac` executable paths, plus `--output` for its build and log directory. It checks every process exit status and compares complete output bytes. A missing runtime, failed check, or differing transcript stops the run with a nonzero exit status. It does not download or install runtimes. On success, every implementation ends with the tab-separated line `TOTAL 21 PASS`. The comparison runner executes Python normally and with `-O`, Julia normally and with `-O3`, Rust in debug and release mode, and Java normally and with assertions explicitly disabled. ## Arithmetic and output contract Rational quantities use arbitrary-size integers. Quadratic-field quantities are represented as $$x=a+b\sqrt5,\qquad a,b\in\mathbb Q.$$ Python uses `fractions.Fraction`. Julia uses `Rational{BigInt}`. Java uses a normalized rational class built on `BigInteger`. Rust uses the pinned `num-bigint` and `num-rational` crates, with `num-integer` and `num-traits` supporting integer operations. Division uses the field norm: $$ \frac1{a+b\sqrt5}=\frac{a-b\sqrt5}{a^2-5b^2}. $$ Sign decisions use rational comparisons. When $a$ and $b$ have opposite signs, comparing $a^2$ with $5b^2$ identifies which term has greater magnitude. No floating-point approximation is used for a mass sign, equality, feasibility decision, or boundary classification. The transcript format is tab-separated text: ```text VALUE /;/ APPROX canonical_amplification 1.49442171 PASS TOTAL 21 PASS ``` The `VALUE` records contain reduced exact rational coefficients. There are seven seed fixtures, with six reported quantities each, plus four rational enclosure endpoints. The seed fixtures are $$ 10^{-6},\quad 1/10,\quad 1/4,\quad (\sqrt5-1)/4, \quad 1/2,\quad 3/4,\quad 999999/1000000. $$ The `APPROX` record is explicitly a floating-point illustration of the one-arcsecond amplification. It is rounded to eight decimal places for output and checked within $10^{-12}$ of the reference approximation. It is not used to prove an exact sign or threshold. The one-arcsecond seed and the contraction parameter also receive independent rational enclosures, described below. The programs use explicit exceptions, returned errors, or unconditional failure branches for acceptance. Their checks do not depend on Python `assert`, Julia `@assert`, Java `assert`, or Rust `debug_assert!`. ## Coverage of the mathematical note | Note result | Reproduction | |---|---| | Proposition 1: affine conjugacy and iterates | Repeated affine updates compared exactly with the closed form for 36 parameter and initial-value combinations, including negative ratios and zero displacement | | Proposition 2: residual identity and bounds | Exact quantized trajectories and their weighted residual sums through 23 steps for 12 combinations | | Quotient–residual representation | Negative, zero, positive, fractional, and greater-than-160-bit inputs; exact reconstruction and remainder bounds | | Integer reverse map | Five 23-step ledgers, including a negative seed and a seed larger than $2^{160}$; full reversal; malformed remainder and divisibility rejection | | Proposition 3: grid compatibility | Exact aligned-grid identity and unaligned-grid counterexample | | Proposition 4: evaluation and record recovery | Exact coefficient recovery through degree five; recovery of two corrupted records, four erased records, and mixed corruption/erasure; dimension and budget checks | | Proposition 5: moment equations | Exact elimination solves the six-node moment system independently of the closed-form weights | | Theorem 6: positive moment representation | Exhaustive independent-support enumeration for degrees 3–6 at one seed below, at, and above the transition; every returned witness is checked | | Theorem 7: explicit masses | Formal polynomial identities in two indeterminates after denominator clearing, plus exact field evaluations | | Theorem 8: sharp degree limits | Exact degree-four and degree-six obstruction identities, positive cubic rules, boundary masses, and signs | | Corollary 9: cross-ratio criterion | Exact threshold comparisons; a nontrivial projective transformation; inverse seed recovery with the correct positive square-root branch | | Theorem 10: amplification | Exact total variation, attaining error signs, the boundary value, and the one-sided small-seed limit | There are $3\cdot4\cdot3=36$ affine parameter/initial-value combinations, each checked at 19 successive indices. The coverage description above counts no new theorem for repeated checks; these are computational consequences of the written arguments. The all-parameter proofs remain in `PROOFS.md`. In particular, a finite fixture set is not substituted for the root-counting argument, the separation argument, the positivity inequalities over the full parameter interval, or the limit proof. These are executable reproductions and exact algebra checks, not proof-assistant formalizations. Agreement among ports can detect implementation discrepancies but does not exclude a shared mathematical mistake; the written proofs and independent moment solve provide separate lines of assessment. ## Why the additional algorithms are valid ### Exact linear solving `solve` performs Gaussian elimination over $\mathbb Q(\sqrt5)$, including consistency checks on surplus equations. It returns a unique solution for a full-column-rank system, and no solution object when consistency or the required column rank fails. For polynomial evaluation at distinct nodes, the relevant rank statement follows from the Vandermonde/root-counting argument. ### Positive support enumeration For the six-node instrument and degrees 0 through 6, `positive_rule` enumerates node supports of size at most $\min(6,d+1)$ and solves their moment equations exactly. It accepts only nonnegative solutions. This search is complete for the stated finite instrument. If a nonnegative representation uses more than $d+1$ columns, those columns are linearly dependent. A nonzero dependence vector has coefficients summing to zero because the first moment row is constant one, so it has both positive and negative entries. Subtract the largest admissible nonnegative multiple of that dependence from the weights. The moments remain fixed, no weight becomes negative, and at least one active weight becomes zero. Repeating leaves at most $d+1$ active nodes. Their columns are independent because the nodes are distinct and the relevant monomials include a square Vandermonde subsystem. One of the enumerated supports must therefore succeed whenever a nonnegative rule exists. The search is intentionally small and exhaustive, not a large-scale linear-programming implementation. The general criterion in Theorem 6 is established by the written proof. ### Affine record recovery `recover_affine` requires six distinct known nodes, six labeled record slots, a positive common coordinate dimension for retained records, and $2e+r_0\leq4$. It enumerates pairs of retained records, reconstructs a candidate affine array from each pair, and counts complete-record mismatches. Under the stated corruption bound, at least two retained records are correct, so one enumerated pair produces the true candidate. Two different affine arrays agree at at most one labeled node, giving distance at least five; hence two distinct candidates cannot both satisfy the allowed error/erasure budget. Shape checks occur before coordinate-wise operations, preventing silent truncation of a record. The guarantee assumes exact retained coordinates and that the actual corruption lies within the declared budget. It does not claim universal detection of additional undeclared corruption or ordinary measurement noise. ### Certified bounds for the one-arcsecond seed For $0