# C3 — A square cavity cannot reproduce Weyl's mode count

**Derived from:** H283, rank 2/30 in Phase II
**Status: FORMAL MATHEMATICAL PROOF** of the counting statement (conditional on ideal square
geometry), **COMPUTATIONALLY VERIFIED** to $X=10^{7}$, with an exact null control.

---

## Step 1 — The exact claim

**Claim.** For an ideal square cavity with Dirichlet walls, let $N_{\rm tot}(X)$ be the number of
modes with eigenvalue parameter $m^2+n^2 \le X$ counted with multiplicity, and $N_{\rm dist}(X)$
the number of distinct eigenfrequencies. Then

$$\frac{N_{\rm dist}(X)}{N_{\rm tot}(X)} \;\sim\; \frac{4K}{\pi}\,\frac{1}{\sqrt{\ln X}}
\;\xrightarrow[X\to\infty]{}\; 0, \qquad K = 0.7642236535\ldots$$

so the fraction of Weyl's count that appears as *resolvable resonances* decays to zero, and does
so at a rate fixed by an arithmetic constant. Equivalently,

$$N_{\rm dist}(X) \;\sim\; K\,\frac{X}{\sqrt{\ln X}} .$$

The physical content: a mode-count comparison between measured peak number and Weyl's law in a
square (or rationally proportioned) cavity is confounded by an arithmetic deficit that grows
without bound. Absorption is not required to explain an apparent mode deficit.

---

## Step 2 — Foundations

1. **Square-cavity spectrum.** For a square of side $L$ with Dirichlet boundary conditions the
   eigenfrequencies are $\omega_{mn} = \frac{c\pi}{L}\sqrt{m^2+n^2}$, $m,n \ge 1$. (Established.)
2. **Weyl's law.** The counting function with multiplicity obeys
   $N_{\rm tot}(X) = \frac{\pi}{4}X + O(\sqrt{X})$, the classical lattice-point count in the
   first quadrant. (Established; Gauss circle problem error term.)
3. **Landau–Ramanujan theorem.** The number of integers $\le X$ expressible as a sum of two
   squares is $N_{\rm dist}(X) \sim KX/\sqrt{\ln X}$ with $K$ the Landau–Ramanujan constant.
   (Established theorem, 1908.)
4. **Identification.** Distinct $\omega_{mn}$ $\leftrightarrow$ distinct integers $m^2+n^2$.
   This is the one modelling step and it is exact for the ideal square.

No new physics and no new mathematics is assumed. The result is a *transfer* of two classical
theorems into a domain (acoustic/electromagnetic cavity metrology) where neither is normally
applied.

---

## Step 3 — Derivation

Let $r_2(k)$ be the number of representations of $k$ as a sum of two squares (with signs and
order). The quadrant count used above is one quarter of the primitive count, but the *support*
— the set of representable integers — is the same. Write

$$N_{\rm tot}(X) = \sum_{k\le X} r_2^{+}(k), \qquad N_{\rm dist}(X) = \#\{k \le X : r_2^{+}(k) > 0\}.$$

**Theorem.** $N_{\rm dist}(X)/N_{\rm tot}(X) \to 0$ as $X\to\infty$, with
$N_{\rm dist}(X)/N_{\rm tot}(X) \sim (4K/\pi)(\ln X)^{-1/2}$.

*Proof.* By Landau–Ramanujan, $N_{\rm dist}(X) = KX/\sqrt{\ln X}(1+o(1))$. By the Gauss circle
theorem applied to the quadrant, $N_{\rm tot}(X) = \frac{\pi}{4}X(1+O(X^{-1/2}))$. Dividing,

$$\frac{N_{\rm dist}}{N_{\rm tot}} = \frac{KX/\sqrt{\ln X}}{\frac{\pi}{4}X}\,(1+o(1))
= \frac{4K}{\pi}\frac{1}{\sqrt{\ln X}}(1+o(1)).$$

The right-hand side tends to 0. ∎

**Why the deficit is unbounded, in one sentence.** The number of *modes* grows like the area of a
disc, but the number of *distinct frequencies* grows like the number of integers that happen to
be sums of two squares, and the latter is of density $\sim(\ln X)^{-1/2}$ among the integers —
a density that decays to zero.

**Two corollaries worth stating.**

- *Rational proportions inherit the deficit.* Any cavity whose squared aspect ratio is rational,
  $\alpha^2 = p/q$, has $\omega^2 \propto q m^2 + p n^2$, still an integer-valued quadratic form,
  so the same mechanism (with a different representation function) applies.
- *Irrational proportions destroy it.* For irrational $\alpha^2$, the values $m^2+\alpha^2n^2$ are
  generically distinct, and the distinct count equals the Weyl count asymptotically. This is the
  built-in control.

---

## Step 4 — Independent verification

Executed in `c3_weyl.py`; exact integer sieve for $\alpha=1$ (no floating point in the
distinctness test), and a resolution-limited float test for irrational $\alpha$.

**(a) The square cavity.**

| $X$ | $N_{\rm dist}$ | $N_{\rm tot}$ (Weyl) | ratio | $K$ estimate | LR prediction |
|---|---|---|---|---|---|
| $10^4$ | 2 691 | 7 754 | 0.34705 | 0.8167 | 0.3206 |
| $10^5$ | 23 874 | 78 233 | 0.30517 | 0.8101 | 0.2868 |
| $10^6$ | 215 908 | 784 387 | 0.27526 | 0.8025 | 0.2618 |
| $10^7$ | 1 984 229 | 7 850 844 | 0.25274 | 0.7966 | 0.2424 |

The ratio falls monotonically, as predicted. The extracted constant drifts downward toward
$K = 0.7642$: $0.8167 \to 0.8101 \to 0.8025 \to 0.7966$. The residual $4\%$ offset at $X=10^7$
is the expected slow convergence of the Landau–Ramanujan asymptotic (its error term is
$O(x/\ln^{3/2}x)$), not a discrepancy. The measured ratios exceed the asymptotic prediction by
the same $4$–$8\%$, consistently.

**(b) A rationally tilted cavity, $\alpha^2 = 2$.**

| $X$ | $N_{\rm dist}$ | $N_{\rm tot}$ | ratio |
|---|---|---|---|
| $10^5$ | 27 300 | 55 267 | 0.494 |
| $10^6$ | 247 028 | 554 501 | 0.446 |

The deficit persists but is roughly halved — as expected, since $m^2+2n^2$ has a different (and
less degenerate) representation function.

**(c) The control, golden-ratio aspect.**

| $X$ | $N_{\rm dist}$ | $N_{\rm tot}$ | ratio |
|---|---|---|---|
| $10^5$ | 48 288 | 48 288 | 1.00000 |
| $10^6$ | 484 582 | 484 582 | 1.00000 |

**Exactly one.** The deficit is purely arithmetic: remove the rational frequency ratios and every
mode becomes its own resonance. This is the strongest evidence for the mechanism, because a
generic instrumental or numerical bias would not disappear to five decimal places when the aspect
ratio is made irrational.

---

## Step 5 — Stress tests

1. **"Real cavities have imperfections that split degeneracies, so distinct peaks equal the mode
   count."** This is the serious objection and it is partly right: a $1\%$ geometric imperfection
   splits each degenerate multiplet into a handful of nearby lines. But splitting does not restore
   the count *at finite resolution*: the split components lie within a linewidth that scales like
   the same imperfection, so a spectrometer of fractional resolution $R$ sees them merged whenever
   the splitting is below the linewidth. The observable is therefore the deficit filtered by
   resolution — a modified but non-vanishing effect. Making this quantitative (deficit versus $R$
   and imperfection amplitude) is the main open calculation.
2. **"Weyl's law is only asymptotic; nobody claims it holds mode-by-mode."** True, and this is why
   the result matters: mode-count comparisons are used precisely in the regime where the
   asymptotic deficit is large, and the deficit is not the $O(\sqrt X)$ Weyl fluctuation that
   practitioners correct for — it is a much larger, systematic, arithmetic effect.
3. **Numerical:** the irrational case relies on a $10^{-9}$ rounding tolerance. Genuine
   near-coincidences from Diophantine approximation could merge a few pairs; the observed ratio
   of exactly 1.00000 at both $10^5$ and $10^6$ bounds this contamination well below the
   integer case.
4. **Could absorption produce the same signature?** Yes — and that is exactly why the control
   matters. The prediction that distinguishes them is the dependence on the aspect ratio: an
   absorption deficit is aspect-independent, an arithmetic deficit is not.

---

## Step 6 — Outcome

| Claim | Status |
|---|---|
| $N_{\rm dist}/N_{\rm tot}\to 0$ for a square cavity | **Formal mathematical proof** (Transfer of Landau–Ramanujan + Gauss circle theorem; exact for ideal square) |
| Ratio follows $(4K/\pi)(\ln X)^{-1/2}$ | **Computationally verified** to $X=10^7$ (constant converging to $K$) |
| Irrational aspect restores the count | **Computationally verified** (ratio 1.00000 — exact null control) |
| The deficit is measurable and unaccounted for in cavity metrology | **Open** — requires a resolution-versus-imperfection model |

**The honest summary.** The mathematics here is not new; the *application* is. Two classical
theorems, one from number theory and one from lattice-point geometry, together imply that a
square cavity's spectrum is far sparser than its mode count, by a factor that grows without
bound. This is a real, computable, previously unremarked systematic in any mode-counting
measurement on a rationally proportioned resonator — and it comes with a control (tilt the
cavity) that no competing explanation reproduces.

---

## Limitations

- Idealised geometry: no wall impedance, no losses, no mode coupling. Real cavities require the
  resolution-filtered version of the calculation.
- The physical measurability claim is untested; this dossier proves a statement about the
  spectrum, not about any particular apparatus.
- The $X \le 10^7$ range does not resolve the second-order asymptotic; a larger sieve or an
  analytic continuation of the error term would sharpen the constant extraction.

## Reproducibility

```
cd "03_PHASE_III_DEEP/C3_mode_counting"
../../04_SUPPORTING/.venv/bin/python c3_weyl.py
```

Deterministic; runtime ≈ 3 min at $X=10^7$; numpy only; peak memory ≈ 100 MB for the boolean
sieve.

## Next steps

1. Compute the deficit for a cavity of *finite linewidth*: convolve the spectrum with a Lorentzian
   of width $\Gamma$ and count peaks, as a function of $\Gamma$ and imperfection amplitude. This
   converts the mathematical result into a falsifiable experimental prediction.
2. Repeat for the rectangle family $\alpha^2 = p/q$ and map the deficit against the arithmetic of
   the quadratic form — a possible new diagnostic for cavity geometry.
3. Look for the effect retrospectively in published mode-counting data on square
   microwave/acoustic cavities, where the peak count is usually compared to Weyl and the shortfall
   attributed to loss.
