# Phase Shift representation reference This folder implements the representation part of the Phase Shift research. It contains a five-axis heat operator, a 32-coefficient mixed-derivative algebra, and an exact WAV carrier for quantized tensors. Its experiments validate representation properties. They do not establish an intelligence advantage from a number system, noise, a file extension, or a playback rate. ## Reproduce ```bash python phase_codec.py python plot_codec.py ``` Python 3.12 and NumPy are sufficient for the experiment. Matplotlib is used only to redraw the figure. The fixed default seed is 640291. All numerical results are recorded in `results/metrics.json`. Floating-point rounding and measured elapsed time can vary slightly between environments. The successful execution supplied with this manuscript used Python 3.12.14 and NumPy as recorded in the metrics file. The following values are observed measurements from that run: | Check | Result | |---|---:| | Maximum error of all 32 mixed-jet coefficients against an analytic formula | 4.440892098500626e-16 | | Maximum error of the five-axis heat semigroup identity | 5.551115123125783e-16 | | Structured tensor raw bytes | 46,080 | | Structured tensor zlib bytes | 3,052 | | Structured tensor complete WAV bytes | 3,598 | | Uniform random tensor raw bytes | 46,080 | | Uniform random tensor zlib bytes | 46,101 | | Uniform random tensor complete WAV bytes | 46,648 | | Integer tensor round trips | Exact | | Quantization maximum error at step 1/32 | 0.015562145321335152 | | Proven quantization bound | 0.015625 | These are reference checks on specifically constructed inputs, rather than a benchmark of natural-language storage or a representative corpus compression rate. ## Five tensor axes The experiment uses a tensor of shape `(12,10,8,6,4)`. Its 23,040 entries are signed 16-bit integers. The metadata labels the axes `u`, `v`, `layer`, `scale`, and `successor`. They are digital indexing conventions. Reinterpreting a sequence as this tensor does not create physical spatial dimensions or extra information. For a row-major array with shape `(n0,n1,n2,n3,n4)`, the one-dimensional offset of the element indexed by `(i0,i1,i2,i3,i4)` is \[ (((i_0n_1+i_1)n_2+i_2)n_3+i_3)n_4+i_4. \] Repeated Euclidean division recovers the five coordinates from the offset. Thus reshaping is a bijection once the shape and storage convention are known. The shape is part of the encoded metadata. This makes dimensionality explicit and checkable rather than a rhetorical claim. A tensor with an algebra-valued entry can be implemented as a real tensor with a 32-component value channel. The channel is an algebraic fiber, not another physical dimension. The released WAV example carries a real int16 field; it does not claim to store all unquantized real mixed-jet coefficients exactly. To transport jets, choose a declared exact finite floating-point bit representation or an explicitly bounded quantization and extend the metadata accordingly. ## The 32-coefficient algebra Let \[ \mathcal J_5=\mathbb R[\varepsilon_1,\ldots,\varepsilon_5]/ (\varepsilon_1^2,\ldots,\varepsilon_5^2). \] The generators commute. Every element has a unique expansion \[ a=\sum_{S\subseteq\{1,\ldots,5\}} a_S\varepsilon_S, \qquad \varepsilon_S=\prod_{i\in S}\varepsilon_i. \] There are 32 basis elements. This is a tensor product of five standard dual-number algebras. It is not a field: each nonzero generator is a zero divisor. In particular, dividing by a pure infinitesimal is undefined. The implementation permits an inverse only when the scalar coefficient is nonzero. ### Proposition R1 — multiplication and associativity Multiplication is given by \[ (ab)_S=\sum_{A\sqcup B=S}a_A b_B. \] Here the union is disjoint. Terms with an index in both factors contain the square of a generator and vanish. The coefficient of a given basis element is therefore exactly the sum over the ordered disjoint partitions of its index set. Polynomial multiplication is associative and commutative, and both properties pass to a quotient by an ideal. Equivalently, each coefficient of a product of three elements is a sum over the same ordered disjoint triple partitions, independently of parenthesization. This proves the assertion. There are `3**5 = 243` ordered disjoint pairs `(A,B)`: each index is in A, in B, or in neither. The reference multiplication explicitly visits these pairs. Computing many derivative coefficients in one algebraic evaluation incurs real arithmetic and memory cost. It should not be described as a free replacement for a scalar evaluation. ### Proposition R2 — nilpotence, exponentiation, and inverses If `n` has zero scalar coefficient, then `n**6 = 0`. Every monomial in its sixth power has positive degree in each of six factors. Because only five distinct generators exist, some generator occurs twice, and the monomial vanishes. Consequently \[ \exp(a_\varnothing+n)=e^{a_\varnothing} \sum_{k=0}^{5}\frac{n^k}{k!}. \] This is exact as a finite algebraic identity. If the scalar part `a0` is nonzero, then \[ (a_0+n)^{-1}=\frac{1}{a_0}\sum_{k=0}^{5}(-n/a_0)^k. \] Multiplying the right side by `a0+n` gives a finite geometric series with remainder proportional to `n**6`, which is zero. If the scalar part is zero, an inverse cannot exist because taking scalar coefficients of a hypothetical inverse identity would give `0 = 1`. Floating-point implementation introduces ordinary rounding. The exact identity does not make a computed floating-point derivative mathematically exact to arbitrary precision. In 50 executed trials the observed associativity discrepancy was at most 1.4210854715202004e-14 and the inverse discrepancy was at most 3.1086244689504383e-15; nilpotence at degree six was exactly zero in the implementation. ### Proposition R3 — mixed jets with distinct axis rates For an analytic scalar function `f(x1,...,x5)`, evaluate it on \[ x_i+v_i\varepsilon_i. \] The coefficient of `epsilon_S` is \[ [\varepsilon_S]f(x+v\varepsilon)= \left(\prod_{i\in S}v_i\right)\partial_S f(x). \] To prove this, expand the multivariate Taylor series. Terms with any repeated variable exponent vanish because the corresponding generator squares to zero. Each surviving multi-index has only zero and one entries; hence its factorial is one. Exactly the displayed coefficient remains. The same statement extends to the finite jet of a sufficiently differentiable function when its jet extension is defined, without needing a globally convergent analytic series. The rates `v_i` describe perturbation scales. They are not clock frequencies. Recovering a derivative requires dividing by the known product of the nonzero selected rates. Very small or very large rates can worsen floating-point conditioning even though the formal algebraic identity is unchanged. The code evaluates \[ f(x)=e^{a^Tx}+x_1x_2x_3x_4x_5. \] For every subset S, its exact mixed partial is \[ \partial_S f(x)=e^{a^Tx}\prod_{i\in S}a_i+ \prod_{j\notin S}x_j. \] All 32 coefficients were compared with this independent closed form. The maximum absolute discrepancy was 4.440892098500626e-16. A central finite-difference control for the fifth mixed derivative had absolute error approximately 2.2592e-6 at step 0.01 but 1388.8492 at step 0.0001, illustrating subtractive cancellation in this particular finite-difference formula. This does not show superiority to reverse-mode automatic differentiation or another well-implemented derivative system; no such runtime benchmark was performed. ## Continuous coarsening and multilayer noise On a periodic grid, let L_i be the negative discrete second-difference operator in axis i. Its Fourier eigenvalues are \[ \lambda_i(k_i)=4\sin^2(\pi k_i/n_i)\geq0. \] For rates `r_i >= 0`, define \[ H_t=\exp\left(-t\sum_{i=1}^{5}r_iL_i\right). \] The implementation uses FFTs to multiply each frequency coefficient by \[ e^{-t\sum_i r_i\lambda_i(k_i)}. \] This is a continuous family of discrete operators: the grid remains finite, while the attenuation parameter changes continuously. Actual rounding to integer pixel levels is a separate discontinuous operation. Calling hard quantization itself continuous would be false. ### Proposition R4 — semigroup and contraction For `s,t >= 0`, `H_s H_t = H_(s+t)`. Every frequency multiplier multiplies to the multiplier with summed time. The zero mode has multiplier one, so the mean is preserved. Every other multiplier lies in `(0,1]`, hence Parseval's identity gives \[ \|H_t x\|_2\leq\|x\|_2, \qquad\|H_t(x-\bar x)\|_2\leq\|x-\bar x\|_2. \] The semigroup makes this latter norm nonincreasing as time grows. These results follow directly from diagonalization, with no stochastic assumption about the input. At any finite time on a finite grid, all multipliers are strictly positive. Therefore the exact real-arithmetic heat map is invertible. Its inverse may be severely ill conditioned. Smoothing alone should not be conflated with irreversible information loss in exact arithmetic; quantization, finite precision, discarding modes, or an infinite-time limit makes the distinction operational. The inverse amplifies a frequency error by `exp(t*sum_i r_i*lambda_i)`. The test forms a mixed field from a smooth signal, independent white Gaussian noise, and a filtered version of that same noise. These layers are deliberately correlated. It evaluates six times with rates `(0.4,0.8,1.2,1.6,2.0)` and verifies mean preservation and nonincreasing centered norm. The nested and direct heat maps at times 0.7 and 1.3 agree to 5.551115123125783e-16. No empirical claim about denoising semantics follows merely from decreased norm: a zero tensor also has low norm. ### Proposition R5 — quantization error Let `Q_delta(x)=delta*round(x/delta)` and assume no saturation. Componentwise \[ |Q_\delta(x)-x|\leq\delta/2. \] Every real number lies at distance at most one half from a nearest integer, which proves the scalar claim after scaling. For N elements, \[ \|Q_\delta(x)-x\|_2\leq(\delta/2)\sqrt N. \] Ties do not invalidate the bound. Overflow or clipping does invalidate it unless explicitly included. The experiment chooses field amplitudes that fit into int16 at delta=1/32 and checks a maximum error 0.015562145321335152 against the bound 0.015625. Quantization occurs before the lossless WAV transport. ## WAV format and exact recovery A RIFF WAVE file is a sequence of chunks. The reference file has a standard PCM `fmt ` chunk, a custom `psri` metadata chunk, and a `data` chunk. The PCM payload consists of the exact zlib bytes, padded by at most one zero byte to a complete 16-bit word. It is a binary transport, not a synthesized music or speech file. General-purpose players may interpret the bytes as sound; that interpretation has no role in the experiment. The metadata stores shape, dtype, storage order, compression algorithm, exact raw and compressed lengths, and SHA-256 digests. The decoder removes only the declared final padding, decompresses the byte sequence, checks both lengths and digests, and restores the original shape. The sample-rate field controls the nominal duration if a player interprets the data as PCM. It does not alter the compressed bytes. ### Proposition R6 — round-trip identity On the declared domain of five-dimensional int16 tensors whose byte length fits the RIFF format, let E be the encoder and D the decoder. Then `D(E(X))=X`, up to converting the dtype to canonical little-endian int16 while preserving values and shape. The canonical row-major int16 serialization is injective once shape is specified. zlib is a lossless compression/decompression pair. Adding known RIFF framing and at most one padding byte is invertible because the exact compressed length is saved. The stored shape reverses flattening. Composition of these inverses proves the identity. Checksums detect a large class of corruption but are not needed for the mathematical inverse on encoder-produced files. They are not a proof against malicious collision construction or a substitute for access control. The experiment reports exact equality of every entry after encoding and decoding both structured and random tensors. Headers at 24,000, 48,000, and 96,000 samples/s produce identical data chunks and identical tensor metadata. Complete file lengths remain 3,598 bytes while nominal durations change from 0.0635833 to 0.0317917 to 0.0158958 seconds. This is an experimentally checked invariance: faster playback is not faster learning or additional computational throughput. ## Information accounting and a necessary negative result ### Proposition R7 — independent noise cannot supply missing target information Let Y be a finite target variable, X the available evidence, and R random noise independent of `(X,Y)`. Let `Z=T(X,R)` for any randomized representation transformation with no other information source. Then \[ I(Y;Z)\leq I(Y;X,R)=I(Y;X). \] The inequality is data processing for `Y -> (X,R) -> Z`; the equality follows from independence via the mutual-information chain rule. If X is also independent of Y, then `I(Y;Z)=0`. A deterministic reversible carrier preserves mutual information rather than increasing it. A lossy representation may remove irrelevant variation and improve finite-resource learning, but that computational advantage is distinct from creating information. A learner can legitimately acquire target information through labels, evaluations, interaction, physical measurement, or prior learned structure. In that case those inputs must be included in X. Random probes are useful because their evaluated responses contain information about the task; the random probes alone do not. This accounting is central to interpreting the broader RSI mechanism. ### Proposition R8 — no universally shortening lossless code There are `2**n` binary strings of length n and only `2**n-1` binary strings of length less than n, including the empty string. An injective encoder cannot map every n-bit string to a shorter string. Under a prefix-free or uniquely decodable code, the expected encoded length is at least the source entropy. A file container cannot evade these statements. In the released control, zlib compresses a deliberately redundant quantized field from 46,080 to 3,052 bytes, while the complete WAV occupies 3,598 bytes. The random field expands to 46,101 compressed bytes and 46,648 container bytes. The structured reduction is a property of this input and the compressor. The WAV container adds framing and metadata. It is not evidence for storing arbitrary noise in fewer bits, and its compressed size is not a measure of intelligence. ## What these checks establish The package gives a precise, reproducible interpretation of otherwise ambiguous language in the research title: continuous coarse-graining, mixed noise, five digital axes, mixed jets, byte-preserving WAV storage, and separate evolution rates. It supplies engineering building blocks whose mathematical behavior can be inspected directly. The broader mechanism must earn any learning advantage through its task feedback, retained optimizer state, and successor evaluation; the representation tests by themselves do not establish such an advantage. ## Direct hypernumber-to-WAV demonstration The delivered `results/jet_coefficients.wav` carries the actual 32 real coefficients produced by the mixed-jet evaluation. They are quantized with step `1/4096`, reshaped to `(2,2,2,2,2)`, and encoded with binary mask axes `epsilon_4, epsilon_3, epsilon_2, epsilon_1, epsilon_0`. In C order, the last axis is the least-significant mask bit. Thus a single five-generator hypernumber becomes a five-axis binary-index tensor, with a coefficient at each subset mask. This demonstration does not add an unreported sixth value channel. The custom metadata records the quantization step, zero offset, ordering, dtype, original source type, and checksums. Decoding the integer tensor and multiplying by the recorded step reconstructs the approximate real hypernumber without consulting an external sidecar. The maximum coefficient discrepancy after recovery is 0.00011689572360618072, below the 0.0001220703125 bound. The integer round trip is exact. The full file is 760 bytes, versus 64 bytes for the quantized integer coefficients before framing. This tiny example has more metadata than payload. It demonstrates exact transport and bounded approximation, not a storage saving for short coefficient vectors. The 32 original float64 coefficients would occupy 256 raw bytes, and quantizing them to 64 bytes deliberately loses precision. These two sources of size change must be kept separate from lossless compression. ## Calibrated denoising comparison Run `python denoising_experiment.py` to reproduce an additional 40-instance experiment. The continuous signal is a finite Gaussian combination of seven specified Fourier sine/cosine pairs plus a random constant on the grid `(8,8,4,4,4)`. Strong legitimate variation occurs along the first axis. The corruption is a sum of three independent Gaussian layers: white noise with coefficient 0.7, an RMS-normalized lowpass field with coefficient 0.5, and an RMS-normalized highpass field along the second axis with coefficient 0.45. Signal and noise draws are independent. Both practical methods receive 25 predetermined candidate schedules, evaluated on the same 20 calibration instances. Isotropic candidates vary a scalar heat time between zero and 1.5. Anisotropic candidates vary five declared rate profiles and five heat times. Ground-truth mean squared error is used to choose one schedule on calibration data. Those choices are frozen before constructing the 20 disjoint test instances. The source explicitly records all candidate settings, calibration errors, and raw test results. The selected isotropic setting uses time 0.1875 and all rates one. The selected anisotropic setting uses time 0.3 and rates `(0.08,1.5,1.5,1.5,1.0)`. These rates appropriately protect signal variation along the first axis in this designed family. The comparison has equal counts of candidate evaluations, but different inductive biases. It does not establish superiority on arbitrary 5D data. | Method | Mean test MSE | Approximate 95% t interval | |---|---:|---:| | Raw noisy field | 0.945322 | [0.928432, 0.962212] | | Calibrated isotropic heat | 0.278423 | [0.236069, 0.320777] | | Calibrated anisotropic heat | 0.152631 | [0.128491, 0.176772] | | Oracle distributional Wiener filter | 0.054488 | [0.037205, 0.071771] | On these test fields, anisotropic heat reduces mean MSE by 83.85% relative to the raw input and 45.18% relative to the selected isotropic filter. It has lower error on all 20 paired instances. The mean paired isotropic-minus-anisotropic difference is 0.125792, with a 95% t interval [0.087032, 0.164552]. These t intervals are descriptive intervals across independent random instances, with no multiple-comparison correction and no assertion of exact coverage for the non-Gaussian distribution of squared errors. All values can be recomputed from the raw CSV. The oracle filter is `P_signal/(P_signal+P_noise)` in Fourier space, using the exact known signal-basis covariance and exact noise-spectrum covariance. It has privileged knowledge of the designed distribution and is not trained from the 20 calibration instances. Because sine/cosine coefficients and noise are jointly Gaussian with the declared diagonal Fourier covariance, this is the distributional conditional-mean filter. The comparator shows the remaining gap to an estimator with richer knowledge; it is not presented as an equally informed baseline. A negative control feeds only the independent noise to the frozen filters while retaining the hidden target signal for scoring. The zero predictor has mean MSE 1.040468. Raw noise gives 1.993469; isotropic heat gives 1.178148; anisotropic heat gives 1.137553; the same prior-aware Wiener filter gives 1.093591. Mean spatial correlations with the hidden target are respectively approximately 0.0009, 0.0096, 0.0141, and 0.0361 across this finite sample. Lower error comes from suppressing irrelevant output toward the prior mean, not extracting a target from noise. The zero predictor remains better than every such estimate on the reported average. This is consistent with the information theorem and with the absence of target evidence. These denoising results are successful experiments in representation and calibrated filtering. They neither train an LLM nor demonstrate recursive improvement by themselves. Their role in the complete manuscript is to establish that different rates can usefully encode a real statistical anisotropy, while exposing the dependence on structured examples and valid calibration.