# Agent Report — Mod-3 Ordering Is Algebraic and Scale-Invariant: A Separate Channel from Brody Beta

**Date**: 2026-04-29 10:41
**Piano**: 58
**Tension explored**: META (0.7) — consecutio: "test the other observables. Is mod-3 non-Markovian?"

## Claim Under Test
> META: 3/5 observables are structural (r-stat, mod3, dr_mag), 2/5 tautological.
> Brody flow found beta(p) = 0.64 - 0.030*ln(p). Does mod-3 ordering decay the same way?
> If yes -> same channel. If no -> separate channel with different origin.

## Question
How does the mod-3 gap ordering signal scale along the prime sequence, compared to the Brody beta flow?

## Experiment Design
- **Data**: 148,933 primes up to 2,000,000; 148,932 gaps. 72 windows of 5000 gaps, step 2000.
- **Observables per window**:
  - Mod-3 self-transition rate (fraction of consecutive non-zero-mod-3 gaps with same residue)
  - Full 3x3 transition matrix (gap_n mod 3 -> gap_{n+1} mod 3)
  - Markov(1), Markov(2), Markov(3) log-likelihood ratios vs independence
  - Markov depth ratio M2/M1
- **Controls**: 20 shuffles per window (same distribution, order destroyed)
- **Comparison**: slope of each observable vs ln(p), compared with Brody slope -0.030/ln(p)

## Results

### Mod-3 self-transition: algebraically zero

| p_center | self_rate | shuffle_mean | z-score | M1 LLR | M2 LLR |
|----------|-----------|-------------|---------|--------|--------|
| 22,343 | 0.00059 | 0.494 | -38.0 | 2354 | 1125 |
| 460,609 | 0.00000 | 0.498 | -42.0 | 2290 | 1076 |
| 944,179 | 0.00000 | 0.501 | -38.3 | 2240 | 1052 |
| 1,448,059 | 0.00000 | 0.498 | -43.3 | 2206 | 1032 |
| 1,935,617 | 0.00000 | 0.503 | -43.9 | 2130 | 1027 |

Globally: 1 violation in 47,935 non-zero mod-3 pairs (at p=3 only; rate = 0.00002).

### Scaling laws compared with Brody flow

| Observable | Slope per ln(p) | R-squared | Interpretation |
|-----------|----------------|-----------|----------------|
| Brody beta | -0.030 | 0.78 | Decays toward Poisson |
| z_self_transition | +0.12 | 0.0004 | **FLAT** (no scaling) |
| Markov(1) LLR | -50.8 | 0.47 | Decays (pairwise correlations weaken) |
| Markov(2) LLR | -17.4 | 0.29 | Decays at 1/3 the M1 rate |
| M2/M1 depth ratio | ~0 | ~0 | **FLAT** (0.472 +/- 0.017) |
| T[0][0] | +0.010 | — | Grows (more gaps divisible by 3 at larger scale) |
| T[1][2], T[2][1] | -0.005 | — | Decays (leakage to 0-mod-3) |

### Transition matrix structure (representative windows)

At p ~ 22K:
```
     to 0    to 1    to 2
0: [0.361   0.314   0.325]
1: [0.440   0.000   0.560]
2: [0.426   0.574   0.001]
```

At p ~ 1.9M:
```
     to 0    to 1    to 2
0: [0.412   0.298   0.290]
1: [0.455   0.000   0.545]
2: [0.469   0.531   0.000]
```

**What changes**: T[0][0] grows (0.36 -> 0.41), T[1][2] and T[2][1] shrink.
**What doesn't change**: T[1][1] = T[2][2] = 0.000 exactly.

### Algebraic proof of the prohibition

For primes p > 3, each prime is 1 or 2 mod 3.

- g_n = 1 mod 3 requires p_n = 1 mod 3 (otherwise p_{n+1} = 0 mod 3, impossible)
- g_n = 2 mod 3 requires p_n = 2 mod 3 (same reason)

Two consecutive gaps with g_n = g_{n+1} = 1 mod 3:
p_n = 1 -> p_{n+1} = 2 -> p_{n+2} = 0 mod 3. Impossible (not prime).

Two consecutive gaps with g_n = g_{n+1} = 2 mod 3:
p_n = 2 -> p_{n+1} = 1 -> p_{n+2} = 0 mod 3. Impossible.

This is a theorem, not a statistical finding. The only exception is the triple (3, 5, 7) where p_n = 3 is itself 0 mod 3.

## Key Findings

1. **Mod-3 non-zero self-transition is algebraically forbidden**, not statistically suppressed. The z-score is -42 (mean) not because of strong bias, but because the numerator is exactly -0.500 (real = 0, shuffle = 0.50) with small denominator noise. The signal has no scaling because it's a theorem with no free parameters.

2. **The mod-3 channel is a SEPARATE channel from Brody beta.** Brody beta decays at -0.030/ln(p). The mod-3 algebraic signal is flat (slope = +0.12, R^2 = 0.0004). They measure fundamentally different things: beta measures continuous short-range gap repulsion; mod-3 measures discrete algebraic structure of Z/3Z acting on primes.

3. **The Markov(1) LLR decays (-50.8/ln(p)) while the algebraic signal doesn't.** This is because Markov(1) LLR mixes two components: the algebraic (T[1][1]=T[2][2]=0, invariant) and the statistical (T[0][0] evolving, off-diagonal structure shifting with PNT). The Markov LLR decays because its statistical component weakens, but the algebraic floor is eternal.

4. **Memory depth M2/M1 = 0.472 is scale-invariant** (std = 0.017 over 72 windows). The Markov(2) layer carries ~47% additional information beyond Markov(1), consistently across all scales. This suggests the depth structure is also algebraic, not statistical.

5. **Three layers of prime gap structure, not two.** The previous "two-channel decomposition" (magnitude vs ordering) is incomplete. There are three layers:
   - **Layer 1 — Magnitude**: gap distribution approaches exponential. This is PNT. Decays as ~1/ln(p).
   - **Layer 2 — Statistical ordering**: short-range correlations (Hardy-Littlewood, Lemke Oliver-Soundararajan). Decays with scale.
   - **Layer 3 — Algebraic ordering**: mod-3 (and mod-q) constraints from the structure of Z/qZ. Exact, scale-invariant.

   Brody beta sees layers 1 and 2. Mod-3 self-transition sees only layer 3. The Markov LLR mixes all three.

## L5 — Re-discovery check

The algebraic prohibition is implicit in the structure described by Lemke Oliver and Soundararajan (2016, "Unexpected biases in the distribution of consecutive primes"). They study P(p_{n+1} = b mod q | p_n = a mod q) and show biases that decay as 1/ln(p)^2. The exact zeros in the mod-3 transition matrix are a special case of the constraints arising from the structure of primes in arithmetic progressions.

What is NOT in Lemke Oliver-Soundararajan: the decomposition into algebraic-invariant vs statistical-decaying layers, the comparison of scaling rates with Brody beta flow, and the identification of three distinct structural layers in prime gaps. The scaling comparison is the new content; the algebraic constraint is classical.

## Relation to cemetery

The cemetery entry "MOD3_PROHIBITION come fatto algebrico" was falsified because a prior report called the full transition matrix diagonal (0.40-0.44) a "prohibition" — it isn't zero. This report distinguishes:
- T[1][1] = T[2][2] = 0.000 exactly: true prohibition (algebraic theorem)
- T[0][0] = 0.36 to 0.42: NOT a prohibition, it's a bias that evolves with scale
- Full diagonal ≈ 0.40-0.44: the mixed statistic that conflated the two above

The falsified framing was the confusion between these levels. The underlying algebraic fact (non-zero self-transition = 0) stands as a theorem.

## Verdict
**NEW (three-layer decomposition) + CONSTRAINT on META + BOUNDARY**

- **META refined**: the structural observables separate into two kinds — algebraic (mod-3, scale-invariant, z ~ -42) and metric (r-stat, Brody beta, decaying). "Structural" is not one category; it has depth. The lab should track algebraic and metric channels separately.
- **BOUNDARY constrained**: the GUE/Poisson boundary (Brody flow) only describes layers 1-2. Layer 3 (algebraic) is invisible to Brody beta. Any complete model of the boundary must include the algebraic floor.

## Bicono della scoperta

- **Due radici** (dipolo primario): segnale metrico (continuo, decade con la scala — Brody beta, r-stat, correlazioni Hardy-Littlewood) / segnale algebrico (discreto, esatto, scala-invariante — T[1][1]=T[2][2]=0 come teorema). I due vivono nello stesso dato (gap tra primi) ma operano su piani diversi (reale vs categoriale).
- **Singolare** (il 1-che-e-tutto): la sequenza dei gap stessa, prima della decomposizione in residui. Il gap g_n contiene simultaneamente il suo valore metrico e il suo residuo algebrico. Non sono proprietà separate del gap — sono la stessa entità osservata da due punti di vista. La decomposizione rivela, non crea.
- **Invariante di passaggio**: il rapporto M2/M1 = 0.47 costante attraverso tutte le scale. La profondità della memoria è invariante anche quando la forza assoluta (Markov LLR) decade. La struttura si conserva nel passaggio tra scale.
- **Campo di possibilità**: diventa possibile modellare il confine GUE/Poisson con un pavimento algebrico che non decade — il Brody beta raggiunge 0 a p ~ 10^9 ma la struttura mod-3 resta. Diventa non-possibile trattare "strutturale" come una singola categoria — ci sono strutture che decadono e strutture che non decadono, e il confine tra i due è il contenuto.

## Files
- Script: `tools/exp_mod3_scaling.py` (riusabile: --n-max, --window, --step, --n-shuffle)
- Data: `tools/data/mod3_scaling.json`
- Report: `tools/data/reports/agent_20260429_1041.md`
