INDEPENDENT VERIFICATION-CODE AUDIT -- 2026-10-18
Files audited: odd_prime_diagnostics.py, GENERAL_PROOF.txt and the existing
odd_prime_diagnostics.json. This audit does not modify those sources. Fresh
experiment: independent_dense_pvm.py -> independent_dense_pvm_results.json.

DECISION
No convention, Fourier-sign, orbit-label, or tested-dimension stabilizer-enumeration
error was found. Fresh dense character projectors independently agree with the
original physical affine-orbit law. This is finite complex128 corroboration,
not a verification of the complete learner or the all-n theorem.

ACTUAL ORIGINAL COVERAGE
Seven one-site cases p=3,5,7,11,13,17,19, each with 22 states (maximally mixed,
one enumerated stabilizer, 20 seeded random density matrices of varying rank).
Two two-site cases (p,n)=(3,2),(5,2), each with 12 states (two fixed and ten random).
Thus 178 tested states. Only the first FOUR states per case have the affine-orbit
physical-law check: 36 laws total, not all 178. The local scalar inequality is
checked on maximizing stabilizer bases only in the seven n=1 cases. Exact rational
factorization/sign tests cover 101 rational f-grid points for each of ten p-values
(1010 identities), not continuous intervals by computation. No learner simulation,
conditioning experiment, sample-complexity measurement, arbitrary-n enumeration,
or gate-synthesis implementation is present.
The existing JSON reports PASS, but this auditor did not rerun its entire loop;
its reported numeric extrema remain source-reported. Fresh results below were run.

WEYL AND FOURIER CONVENTIONS
The code maps |q> to omega^(a.q+a.b/2)|q+b>, exactly the written
omega^(-a.b/2) Z^a X^b convention when X shifts q positively. Multiplication has
phase [u,v]/2. chi's einsum computes Tr(rho W_u), not its conjugate or a misplaced
transpose. The matrix four[x,u]=omega^[x,u]/D^2 implements inversion of
hat f(u)=sum_x f(x) omega^[u,x]. Its conjugate-transpose times D^2 is the forward
transform. Although |chi|^2 is even and would conceal some sign mistakes, the
physical_batch test compares the generally complex product of chi directly;
the independent dense check additionally tests full outcome laws.

PHYSICAL AFFINE-ORBIT CONSTRUCTION
All weights used are nonzero and have sum of squares zero modulo p. Translation
by z on each register q_i -> q_i+t_i z is free, so each orbit has D members and
the seen set partitions the full input computational basis. On an orbit the
commuting weighted shifts have a Fourier basis; the quadratic z phase cancels.
The code's vector phase is omega^(-r.z), and its quadratic form uses its conjugate
on the left. The outcome label (-r,s), s=sum_i t_i q_i, has precisely the written
character under R_u. Each orbit contributes one orthonormal Fourier basis. Adding
probabilities from different orbits is a refinement of the intended PVM, not an
incoherent measurement of individual physical tensor factors. The summed law
matches the dense character-projector law in the fresh checks below.

STABILIZER AND HYPERPLANE ENUMERATION
n=1 lists all p+1 isotropic lines and all p eigenstates per line. In n=2 every
Lagrangian has an independent pair of projective lines; all commuting pairs are
enumerated and span deduplication removes repeated bases. The reported counts
40,156 agree with (p+1)(p^2+1); counts 360,3900 equal D times those values.
The spectral-product construction produces the p^n rank-one states per Lagrangian;
it checks idempotence and trace. Hyperplanes of a two-dimensional Lagrangian are
exactly its p+1 lines; the code enumerates them all, then tests S minus each.
In n=1 the only hyperplane is {0}. The code takes the minimum over all maximizing
owners (within a 1e-8 numerical tie tolerance), so it does not silently choose the
easiest optimizer. Inclusion of a near-tie owner strengthens the finite check.
LIMIT: setup's generic-looking else branch spans TWO generators only. It is
correct for the tested n=2 and is not an arbitrary-n stabilizer enumerator.
For n>2 it cannot generate the intended full Lagrangians. This is a scope limit,
not a defect in the stated finite experiment, which explicitly lists n<=2.

FRESH ALTERNATIVE FINITE CHECK
Constructed X and Z matrices independently, formed Weyls via matrix powers,
formed every R_u by Kronecker products, and formed all P_y directly by the
D^-2 character sum. No affine-orbit construction is used for that calculation.
Then checked Hermiticity, projector idempotence, pairwise orthogonality,
completeness, minimum eigenvalue, and trace. Evaluated probabilities on one fresh
seeded full-rank random rho per case, their normalization/positivity and complex
weighted-chi characteristic function; finally compared to the original affine
function loaded without running its top-level experiment.
p=5,n=1,k=2,t=(1,2): 25-dimensional joint system, projector trace 1;
maximum matrix error 1.24e-15, characteristic error 2.23e-16,
full law discrepancy 1.39e-17, minimum probability 0.0317640.
p=3,n=1,k=3,t=(1,1,1): 27-dimensional joint system, projector trace 3;
maximum matrix error 5.62e-15, characteristic error 3.34e-16,
full law discrepancy 2.78e-17, minimum probability 0.0965384.
Small negative eigenvalues (>=-2.86e-16) are roundoff. Both cases PASS at 1e-10.
See machine-readable result for exact computed residuals and seed 181026.

REMAINING LIMITS
The random states and dimensions do not exhaust all mixed inputs or optimizer
geometries. In particular these checks do not establish the robust learner,
coherent conditioning argument, uniform-in-p complexity, novelty, or publication
readiness. No mathematical claim is inferred solely from reported PASS or hashes.
