Let \(R\) be a positive-definite simply-laced root system of rank \(n\) in Euclidean space \(\mathbb{R}^n\), normalized so that every root \(\alpha \in R\) has squared norm \((\alpha, \alpha) = 2\). An ordered orthogonal \(k\)-frame in \(R\) is an ordered \(k\)-tuple \((\alpha_1, \dots, \alpha_k) \in R^k\) satisfying \((\alpha_i, \alpha_j) = 2\delta_{ij}\) for \(1 \le i, j \le k\). Let \(N_k(R)\) denote the number of ordered orthogonal \(k\)-frames in \(R\) (with \(N_0(R) = 1\)). When \(R = \operatorname{Roots}(L)\) is the root system of an even lattice \(L\), \(N_k(R)\) equals the diagonal Fourier coefficient \(a(I_k, \Theta_L^{(k)})\) of the degree-\(k\) Siegel theta series evaluated at \(I_k = \operatorname{diag}(1, \dots, 1)\) [1, 7].
Under an orthogonal direct sum \(R = \bigoplus_i m_i X_i\) into irreducible ADE components \(X_i \in \{A_m\;(m \ge 1),\, D_m\;(m \ge 4),\, E_6, E_7, E_8\}\), the exponential frame-generating function
is multiplicative. Passing to the formal logarithm linearizes the frame convolution:
For each integer \(M \ge 1\), define the \(M\)-moment map \(\Lambda_M : \mathcal{R}_n^{\mathrm{ADE}} \to \mathbb{Q}^M\) on the set \(\mathcal{R}_n^{\mathrm{ADE}}\) of isomorphism classes of rank-\(n\) ADE root systems by \[ \Lambda_M(R) = \big(c_1(R), c_2(R), \dots, c_M(R)\big), \] and let \(n^*_{\mathrm{ADE}}(M)\) denote the minimal rank \(n\) at which \(\Lambda_M\) fails to be injective on \(\mathcal{R}_n^{\mathrm{ADE}}\). In companion work on genus-four Niemeier separation and four-moment ADE rigidity, it was shown that \(a(I_4, \Theta_N^{(4)})\) separates all \(24\) Niemeier lattices pairwise at minimal genus \(g_{\mathrm{sep}} = 4\), and that \(\Lambda_4\) is globally injective on \(\mathcal{R}_n^{\mathrm{ADE}}\) for all \(1 \le n \le 42\), colliding first at \(n^*_{\mathrm{ADE}}(4) = 43\).
In this paper, we extend this program to orders \(k = 5\) and \(k = 6\). Our main results are organized as follows:
Throughout this section, for an integer \(x\) and a non-negative integer \(m\), we write the falling factorial as \[ x^{\underline{m}} := \prod_{j=0}^{m-1}(x - j) = x(x-1)\cdots(x-m+1), \qquad x^{\underline{0}} := 1. \]
| \(k\) | \(c_k(A_n)\) | \(c_k(D_n)\) |
|---|---|---|
| \(1\) | \(n(n+1)\) | \(2n(n-1)\) |
| \(2\) | \(-n(n+1)(2n-1)\) | \(-2n(n-1)(4n-7)\) |
| \(3\) | \(\frac{4}{3}n(n+1)(5n^2-7n+3)\) | \(\frac{8}{3}n(n-1)(20n^2-74n+69)\) |
| \(4\) | \(-2n(n+1)(14n^3-37n^2+39n-15)\) | \(-4n(n-1)(112n^3-672n^2+1378n-963)\) |
| \(5\) | \(\frac{16}{5}n(n+1)(42n^4-176n^3+326n^2-296n+105)\) | \(\frac{32}{5}n(n-1)(672n^4-5784n^3+19301n^2-29489n+17295)\) |
| \(6\) | \(-\frac{16}{3}n(n+1)(132n^5-794n^4+2228n^3-3458n^2+2838n-945)\) | \(-\frac{32}{3}n(n-1)(4224n^5-48544n^4+231932n^3-573747n^2+730487n-379905)\) |
Expanding \(\log F_X(t) = \sum_{k=1}^6 c_k(X)t^k + O(t^7)\) from Lemma 2.1 yields the closed-form polynomials in Table 1, together with the exact exceptional six-moment vectors:
| Component \(X\) | Mult. \(m_i\) | \(r\) | \(h\) | \(c_1(X)\) | \(c_2(X)\) | \(c_3(X)\) | \(c_4(X)\) | \(c_5(X)\) | \(c_6(X)\) |
|---|---|---|---|---|---|---|---|---|---|
| Constituents of \(L_1 = A_2^{\oplus 8} \oplus A_4^{\oplus 2} \oplus A_7^{\oplus 2} \oplus A_9^{\oplus 2} \oplus D_4^{\oplus 5} \oplus E_6\) | |||||||||
| \(A_2\) | \(\times 8\) | \(2\) | \(3\) | \(6\) | \(-18\) | \(72\) | \(-324\) | \(\frac{7776}{5}\) | \(-7776\) |
| \(A_4\) | \(\times 2\) | \(4\) | \(5\) | \(20\) | \(-140\) | \(\frac{4400}{3}\) | \(-17800\) | \(232000\) | \(-\frac{9464000}{3}\) |
| \(A_7\) | \(\times 2\) | \(7\) | \(8\) | \(56\) | \(-728\) | \(\frac{44576}{3}\) | \(-363664\) | \(\frac{48814976}{5}\) | \(-\frac{829528448}{3}\) |
| \(A_9\) | \(\times 2\) | \(9\) | \(10\) | \(90\) | \(-1530\) | \(41400\) | \(-1358100\) | \(49278240\) | \(-1897797600\) |
| \(D_4\) | \(\times 5\) | \(4\) | \(6\) | \(24\) | \(-216\) | \(2976\) | \(-46320\) | \(\frac{3844224}{5}\) | \(-13292928\) |
| \(E_6\) | \(\times 1\) | \(6\) | \(12\) | \(72\) | \(-1512\) | \(50976\) | \(-2011824\) | \(\frac{427151232}{5}\) | \(-3786321024\) |
| Weighted Sum \(L_1\) | \(20\) | \(82\) | — | \(572\) | \(-7532\) | \(\frac{545648}{3}\) | \(-5725144\) | \(\frac{1039166912}{5}\) | \(-\frac{24623314112}{3}\) |
| Constituents of \(L_2 = A_1^{\oplus 4} \oplus A_3^{\oplus 7} \oplus A_5^{\oplus 4} \oplus A_8^{\oplus 3} \oplus D_6 \oplus D_7\) | |||||||||
| \(A_1\) | \(\times 4\) | \(1\) | \(2\) | \(2\) | \(-2\) | \(\frac{8}{3}\) | \(-4\) | \(\frac{32}{5}\) | \(-\frac{32}{3}\) |
| \(A_3\) | \(\times 7\) | \(3\) | \(4\) | \(12\) | \(-60\) | \(432\) | \(-3528\) | \(\frac{153792}{5}\) | \(-279360\) |
| \(A_5\) | \(\times 4\) | \(5\) | \(6\) | \(30\) | \(-270\) | \(3720\) | \(-60300\) | \(1058400\) | \(-19447200\) |
| \(A_8\) | \(\times 3\) | \(8\) | \(9\) | \(72\) | \(-1080\) | \(25632\) | \(-733968\) | \(\frac{115800192}{5}\) | \(-773504640\) |
| \(D_6\) | \(\times 1\) | \(6\) | \(10\) | \(60\) | \(-1020\) | \(27600\) | \(-876600\) | \(30098880\) | \(-1081035840\) |
| \(D_7\) | \(\times 1\) | \(7\) | \(12\) | \(84\) | \(-1764\) | \(59472\) | \(-2380728\) | \(\frac{519027264}{5}\) | \(-4753818048\) |
| Weighted Sum \(L_2\) | \(20\) | \(82\) | — | \(572\) | \(-7532\) | \(\frac{545648}{3}\) | \(-5725144\) | \(\frac{1039166912}{5}\) | \(-\frac{24705336512}{3}\) |
For any irreducible simply-laced root system \(X\) of rank \(r = \operatorname{rk}(X)\) and Coxeter number \(h = h(X)\), define the universal \(A\)-series baseline polynomial \(P_k(h) \equiv \frac{c_k(A_{h-1})}{h-1}\) and the normalized order-\(k\) branching defect
From Table 1, substituting \(n = h - 1\) gives:
For \(k \in \{1, 2, 3\}\), \(\Delta_k(X) = 0\) for all \(X \in \{A_n, D_n, E_6, E_7, E_8\}\).
Theorem 4.1 has a direct consequence for the genus-five Siegel theta series of the five equal-\(h\) Niemeier collision classes studied in genus four.
| \(h\) | Collision Pair \((N_1,\,N_2)\) | \(a(I_5,\Theta_{N_1}^{(5)})\) | \(a(I_5,\Theta_{N_2}^{(5)})\) | \(\Delta a(I_5)\) | \(\Delta a(I_5)/\Delta a(I_4)\) |
|---|---|---|---|---|---|
| \(6\) | \((A_5^4D_4,\;D_4^6)\) | \(14\,103\,244\,800\) | \(14\,222\,407\,680\) | \(119\,162\,880\) | \(2586/5\) |
| \(10\) | \((A_9^2D_6,\;D_6^4)\) | \(147\,388\,723\,200\) | \(148\,885\,862\,400\) | \(1\,497\,139\,200\) | \(722\) |
| \(12\) | \((A_{11}D_7E_6,\;E_6^4)\) | \(349\,816\,320\,000\) | \(353\,615\,155\,200\) | \(3\,798\,835\,200\) | \(4122/5\) |
| \(18\) | \((A_{17}E_7,\;D_{10}E_7^2)\) | \(2\,427\,928\,473\,600\) | \(2\,455\,304\,140\,800\) | \(27\,375\,667\,200\) | \(5658/5\) |
| \(30\) | \((D_{16}E_8,\;E_8^3)\) | \(29\,295\,418\,521\,600\) | \(29\,655\,859\,968\,000\) | \(360\,441\,446\,400\) | \(1746\) |
At order \(k = 6\), the proportionality between the \(D\)-series and \(E\)-series breaks via an exact classical annihilator.
Let \(x_i = m_i^{(1)} - m_i^{(2)} \in \mathbb{Z}\) denote the net multiplicity difference of component \(X_i\) between two ADE root systems \(L_1, L_2\) of common rank \(N = \frac{1}{2}\sum_i r_i |x_i|\) (with disjoint supports), and let \(X_i = r_i x_i\) denote the rank-weighted multiplicity difference. By Theorem 4.1, \(\Delta_5(X_i) = -\frac{2(172h_i - 525)}{25}\Delta_4(X_i)\). Eliminating degree-\(\le 3\) powers of \(h_i\) via the first four equations \(\sum_i h_i^m X_i = 0\) (\(0 \le m \le 3\)) and substituting \(\sum_i \Delta_4(X_i) X_i = 28\sum_i h_i^4 X_i\) into the fifth-moment equation reduces matching \((N, c_1, c_2, c_3, c_4, c_5)\) on any subset of ADE components to the Universal Six-Row Defect System \(M_{\mathrm{clean}} X = 0\):
Specifically, let \(A_{\mathrm{raw}} \in \mathbb{Q}^{6 \times K}\) be the unreduced moment matrix with columns \((r_i, c_1(X_i), c_2(X_i), c_3(X_i), c_4(X_i), c_5(X_i))^T\). Expanding \(c_k(X_i) = r_i P_k(h_i) + r_i \Delta_k(X_i)\) via (4.2) and (4.3) gives the exact matrix factorization
with \(\det(T_{\mathrm{trans}}) = -\frac{64}{15} \neq 0\), certifying exact row-space equivalence across all \(162\) irreducible ADE components of rank \(r_i \le 81\). Equivalently, for any centering shift \(h_0 \in \mathbb{Z}\) with \(d_i = h_i - h_0\) and \(c_{5,4}(h_0) = [d^4]P_5(h_0+d)\), \(x \in \mathbb{Z}^K\) satisfies \(A_{\mathrm{NC}}(h_0)x = 0\), where rows \(0 \le m \le 3\) are \(r_i d_i^m\), row \(4\) is \(-28 r_i d_i^4 + r_i \Delta_4(X_i)\), and row \(5\) is \(\frac{672}{5} r_i d_i^5 + \frac{c_{5,4}(h_0)}{28} r_i \Delta_4(X_i) + r_i \Delta_5(X_i)\).
Our first result in this section settles minimality unconditionally, exhaustively, and basis-independently across all ADE root systems whose irreducible components have Coxeter number \(h_i \le 12\) (the Coxeter regime of the rank-82 witness \((L_1, L_2)\) of Theorem 3.1).
On the larger \(36\)-component bounded-rank domain \(r_i \le 18\) (\(h_i \le 34\)), we establish the corresponding \(30\)-dimensional kernel reduction and sparse-ball certificate:
The following self-contained Python script (tested under Python 3.12.5, SymPy 1.13.3, and NumPy 2.1.3; total runtime \(\approx 2.3\) seconds) verifies from first principles all closed-form moment polynomials (Table 1), the rank-82 collision witness (Theorem 3.1 and Table 2), the universal fifth-order identity \(\Phi_5(X) \equiv 0\) (Theorem 4.1), the genus-five Niemeier collision law (Corollary 4.3), the sixth-order functional \(\Phi_6(X)\) (Theorem 4.4), the exact \(\mathrm{GL}_6(\mathbb{Q})\) transition matrix \(T_{\mathrm{trans}}\) of (5.2) across all \(162\) ADE components, the exhaustive \(4{,}921{,}875\)-vector \(10\)-dimensional Hölder box minimality proof for \(h_{\max} \le 12\) (Theorem 5.1), all exact unimodular, rational Moore–Penrose Hölder box, and \(18{,}940\)-vector sparse \(\ell_1\)-ball assertions for \(r_i \le 18\) (Proposition 5.2), the regression test for exact Farkas reduced-cost tightening, and the global \(6 \times 162\) coefficient scales (Remark 5.4).
#!/usr/bin/env python3
"""
ade_fifth_moment_audit.py
Standalone exact rational verification suite for:
"Five-Moment Rigidity, Universal Fifth-Order Defect Proportionality,
and Explicit Collisions in Simply-Laced Root Systems"
Tested environment: Python 3.12.5, SymPy 1.13.3, NumPy 2.1.3.
"""
from itertools import product
import sympy as sp
import numpy as np
def main():
print("=" * 78)
print("EXACT RATIONAL VERIFICATION SUITE (ADE 5-MOMENT RIGIDITY)")
print("=" * 78)
t = sp.Symbol('t')
n = sp.Symbol('n')
h = sp.Symbol('h')
def fall(x, m):
return sp.prod([x - j for j in range(m)])
# 1. First-principles generating functions F_X(t) and Table 1 polynomials
def F_A(n_val, max_k=6):
return sum(
fall(n_val + 1, 2 * k) // sp.factorial(k) * (t ** k)
for k in range(min(max_k + 1, (n_val + 1) // 2 + 1))
)
def F_D(n_val, max_k=6):
res = sp.Integer(1)
for k in range(1, max_k + 1):
coeff = sum(
sp.Rational(2 ** (k - p), sp.factorial(p) * sp.factorial(k - 2 * p))
* fall(n_val, 2 * k - 2 * p)
for p in range(k // 2 + 1)
)
res += coeff * (t ** k)
return res
# By Lemma 2.1(c), N_k(X) = N_1(X) * N_{k-1}(X^perp) <=> F'_X(t) = N_1(X) * F_{X^perp}(t)
F_E6 = 1 + sp.integrate(72 * F_A(5, 6), t)
F_E7 = 1 + sp.integrate(126 * F_D(6, 6), t)
F_E8 = 1 + sp.integrate(240 * F_E7, t)
def log_moments(F_series, max_k=6):
lf = sp.series(sp.log(F_series), t, 0, max_k + 1).removeO()
return [sp.Rational(lf.coeff(t, k)) for k in range(1, max_k + 1)]
cA_pts = {k: [] for k in range(1, 7)}
cD_pts = {k: [] for k in range(1, 7)}
for nv in range(1, 13):
lms = log_moments(F_A(nv, 6), 6)
for k in range(1, 7):
cA_pts[k].append((nv, lms[k - 1]))
for nv in range(4, 16):
lms = log_moments(F_D(nv, 6), 6)
for k in range(1, 7):
cD_pts[k].append((nv, lms[k - 1]))
poly_A = {k: sp.factor(sp.interpolate(cA_pts[k][:k + 2], n)) for k in range(1, 7)}
poly_D = {k: sp.factor(sp.interpolate(cD_pts[k][:k + 2], n)) for k in range(1, 7)}
for k in range(1, 7):
assert all(poly_A[k].subs(n, nv) == val for nv, val in cA_pts[k])
assert all(poly_D[k].subs(n, nv) == val for nv, val in cD_pts[k])
c_E = {6: log_moments(F_E6, 6), 7: log_moments(F_E7, 6), 8: log_moments(F_E8, 6)}
print("[PASS] Table 1: Closed-form logarithmic moments c_1..c_6 verified from N_k(X).")
# 2. Verify Theorem 3.1 (Rank-82 Five-Moment Collision Witness & Table 2)
L1 = [('A_2', 8), ('A_4', 2), ('A_7', 2), ('A_9', 2), ('D_4', 5), ('E_6', 1)]
L2 = [('A_1', 4), ('A_3', 7), ('A_5', 4), ('A_8', 3), ('D_6', 1), ('D_7', 1)]
def eval_lattice(spec):
rank_sum = 0
moments = [sp.Integer(0)] * 6
for name, mult in spec:
fam, r_str = name.split('_')
rv = int(r_str)
rank_sum += mult * rv
if fam == 'A':
c_vec = [poly_A[k].subs(n, rv) for k in range(1, 7)]
elif fam == 'D':
c_vec = [poly_D[k].subs(n, rv) for k in range(1, 7)]
else:
c_vec = c_E[rv]
for k in range(6):
moments[k] += mult * c_vec[k]
return rank_sum, moments
r1, m1 = eval_lattice(L1)
r2, m2 = eval_lattice(L2)
expected_lambda5 = [
sp.Integer(572),
sp.Integer(-7532),
sp.Rational(545648, 3),
sp.Integer(-5725144),
sp.Rational(1039166912, 5),
]
assert r1 == 82 and r2 == 82
assert m1[:5] == expected_lambda5 and m2[:5] == expected_lambda5
assert m1[5] == sp.Rational(-24623314112, 3)
assert m2[5] == sp.Rational(-24705336512, 3)
delta_c6 = int(m1[5] - m2[5])
assert delta_c6 == 27340800
print("[PASS] Theorem 3.1 (Table 2): Rank-82 collision witness verified:")
print(f" Lambda_5(L_1) = Lambda_5(L_2) = {expected_lambda5}")
print(f" Delta c_6 = c_6(L_1) - c_6(L_2) = +{delta_c6:,}")
# 3. Verify Theorem 4.1 (Phi_5 == 0), Corollary 4.3 (Niemeier Genus-5 Ratio), and Theorem 4.4 (Phi_6)
P = {k: sp.simplify(poly_A[k].subs(n, h - 1) / (h - 1)) for k in range(1, 7)}
Delta4_D = sp.factor(poly_D[4].subs(n, h / 2 + 1) / (h / 2 + 1) - P[4])
Delta5_D = sp.factor(poly_D[5].subs(n, h / 2 + 1) / (h / 2 + 1) - P[5])
Delta6_D = sp.factor(poly_D[6].subs(n, h / 2 + 1) / (h / 2 + 1) - P[6])
assert sp.simplify(Delta4_D - 10 * h * (h - 2) * (h - 4)) == 0
assert sp.simplify(25 * Delta5_D + 2 * (172 * h - 525) * Delta4_D) == 0
assert sp.simplify(15 * Delta6_D - 2 * (1040 * h ** 2 - 6862 * h + 12579) * Delta4_D) == 0
phi6_E = {}
for r_e, h_e in [(6, 12), (7, 18), (8, 30)]:
d4_e = c_E[r_e][3] / r_e - P[4].subs(h, h_e)
d5_e = c_E[r_e][4] / r_e - P[5].subs(h, h_e)
d6_e = c_E[r_e][5] / r_e - P[6].subs(h, h_e)
assert 25 * d5_e + 2 * (172 * h_e - 525) * d4_e == 0
phi6_E[r_e] = int(r_e * (15 * d6_e - 2 * (1040 * h_e ** 2 - 6862 * h_e + 12579) * d4_e))
assert phi6_E[6] == -282009600
assert phi6_E[7] == 28 * phi6_E[6]
assert phi6_E[8] == 1120 * phi6_E[6]
polys_niem = {
'A5': F_A(5), 'A9': F_A(9), 'A11': F_A(11), 'A17': F_A(17),
'D4': F_D(4), 'D6': F_D(6), 'D7': F_D(7), 'D10': F_D(10), 'D16': F_D(16),
'E6': F_E6, 'E7': F_E7, 'E8': F_E8
}
def a_Ik(comps, k_ord):
prod_p = sp.prod([polys_niem[c] ** m for c, m in comps])
return int(sp.factorial(k_ord) * sp.series(prod_p, t, 0, k_ord + 1).removeO().coeff(t, k_ord))
niem_collisions = [
(6, [('A5', 4), ('D4', 1)], [('D4', 6)]),
(10, [('A9', 2), ('D6', 1)], [('D6', 4)]),
(12, [('A11', 1), ('D7', 1), ('E6', 1)], [('E6', 4)]),
(18, [('A17', 1), ('E7', 1)], [('D10', 1), ('E7', 2)]),
(30, [('D16', 1), ('E8', 1)], [('E8', 3)]),
]
for hv, c1, c2 in niem_collisions:
da4 = a_Ik(c2, 4) - a_Ik(c1, 4)
da5 = a_Ik(c2, 5) - a_Ik(c1, 5)
assert sp.Rational(da5, da4) == sp.Rational(256 * hv + 1050, 5)
print("[PASS] Theorem 4.1 & Corollary 4.3: Phi_5(X) == 0 and Niemeier ratio (256*h + 1050)/5 verified.")
print("[PASS] Theorem 4.4: Phi_6(A_n) = Phi_6(D_n) = 0 and r*Phi_6(E_6, E_7, E_8) in ratio 1 : 28 : 1120 verified.")
# Helper for exact unimodular kernel + LLL reduction
def build_certified_kernel_and_lll(int_rows_list, ranks_arr):
A_arr = np.array(int_rows_list, dtype=object)
m_r, K_c = A_arr.shape
M_m = [[int(A_arr[j, i]) for j in range(m_r)] + [1 if i == k else 0 for k in range(K_c)] for i in range(K_c)]
piv = 0
for col in range(m_r):
while True:
nz = [r for r in range(piv, K_c) if M_m[r][col] != 0]
if not nz:
break
best_r = min(nz, key=lambda r: abs(M_m[r][col]))
M_m[piv], M_m[best_r] = M_m[best_r], M_m[piv]
rem = False
for r in range(piv + 1, K_c):
if M_m[r][col] != 0:
q = M_m[r][col] // M_m[piv][col]
for c in range(m_r + K_c):
M_m[r][c] -= q * M_m[piv][c]
if M_m[r][col] != 0:
rem = True
if not rem:
break
if any(M_m[r][col] != 0 for r in range(piv, K_c)):
piv += 1
U_sp = sp.Matrix([[M_m[r][m_r + c] for c in range(K_c)] for r in range(K_c)])
A_sp = sp.Matrix(int_rows_list)
H_top = U_sp[:m_r, :] * A_sp.T
assert abs(U_sp.det()) == 1
assert H_top.is_upper and all(H_top[i, i] != 0 for i in range(m_r))
assert (U_sp[m_r:, :] * A_sp.T).is_zero_matrix
ker_b = np.array([M_m[r][m_r:] for r in range(piv, K_c)], dtype=object)
B_v = [np.array([int(ker_b[r, i]) * int(ranks_arr[i]) for i in range(K_c)], dtype=np.float64) for r in range(ker_b.shape[0])]
nv = len(B_v)
def gs(vecs):
ortho, mu, b_norm = [], np.zeros((nv, nv)), np.zeros(nv)
for i in range(nv):
v = vecs[i].copy()
for j in range(i):
if b_norm[j] > 1e-12:
mu[i, j] = np.dot(vecs[i], ortho[j]) / b_norm[j]
v -= mu[i, j] * ortho[j]
ortho.append(v)
b_norm[i] = np.dot(v, v)
return ortho, mu, b_norm
ortho, mu, b_norm = gs(B_v)
k_i = 1
while k_i < nv:
for j in range(k_i - 1, -1, -1):
if abs(mu[k_i, j]) > 0.5:
q = round(mu[k_i, j])
B_v[k_i] -= q * B_v[j]
ortho, mu, b_norm = gs(B_v)
if b_norm[k_i] >= (0.99 - mu[k_i, k_i - 1] ** 2) * b_norm[k_i - 1]:
k_i += 1
else:
B_v[k_i], B_v[k_i - 1] = B_v[k_i - 1], B_v[k_i]
ortho, mu, b_norm = gs(B_v)
k_i = max(k_i - 1, 1)
Bw_np = np.array([np.round(v).astype(np.int64) for v in B_v])
B0_sp = sp.Matrix([[int(ker_b[r, i]) * int(ranks_arr[i]) for i in range(K_c)] for r in range(nv)])
Bw_sp = sp.Matrix(Bw_np.tolist())
V_lll = Bw_sp * B0_sp.T * (B0_sp * B0_sp.T).inv()
assert all(val.is_integer for val in V_lll) and abs(V_lll.det()) == 1
assert V_lll * B0_sp == Bw_sp
P_ex = (Bw_sp * Bw_sp.T).inv() * Bw_sp
return Bw_np, Bw_sp, P_ex
# 4. Verify Eq. (5.2) (GL_6(Q) Row-Equivalence across all 162 types) & Theorem 5.1 (h_max <= 12 Box)
def get_d4(name, rv, hv):
if name.startswith("A_"):
return 0
if name.startswith("D_"):
return 10 * hv * (hv - 2) * (hv - 4)
return {6: 14400, 7: 86400, 8: 756000}[rv]
comps_162 = [(f"A_{rv}", rv, rv + 1) for rv in range(1, 82)] + \
[(f"D_{rv}", rv, 2 * rv - 2) for rv in range(4, 82)] + \
[("E_6", 6, 12), ("E_7", 7, 18), ("E_8", 8, 30)]
assert len(comps_162) == 162
raw_162 = [[] for _ in range(6)]
clean_162 = [[] for _ in range(6)]
for name, rv, hv in comps_162:
if name.startswith("A_"):
cv = [poly_A[k].subs(n, rv) for k in range(1, 6)]
elif name.startswith("D_"):
cv = [poly_D[k].subs(n, rv) for k in range(1, 6)]
else:
cv = c_E[rv][:5]
raw_162[0].append(sp.Integer(rv))
for k in range(5):
raw_162[k + 1].append(sp.Rational(cv[k]))
d4 = get_d4(name, rv, hv)
for m in range(4):
clean_162[m].append(sp.Integer((hv ** m) * rv))
clean_162[4].append(sp.Integer((-28 * (hv ** 4) + d4) * rv))
clean_162[5].append(sp.Integer((420 * (hv ** 5) + 235 * (hv ** 4) - 43 * hv * d4) * rv))
T_trans = sp.Matrix([
[1, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0],
[0, 3, -2, 0, 0, 0],
[0, 20, sp.Rational(-68, 3), sp.Rational(20, 3), 0, 0],
[0, 210, -310, 158, 1, 0],
[0, 3024, sp.Rational(-26304, 5), sp.Rational(17696, 5), 42, sp.Rational(8, 25)],
])
assert T_trans.det() == sp.Rational(-64, 15)
assert T_trans * sp.Matrix(clean_162) == sp.Matrix(raw_162)
print("[PASS] Eq. (5.2): Exact GL_6(Q) transition T_trans * M_clean == A_raw verified on all 162 types.")
comps_12 = [(f"A_{rv}", rv, rv + 1) for rv in range(1, 12)] + \
[(f"D_{rv}", rv, 2 * rv - 2) for rv in range(4, 8)] + \
[("E_6", 6, 12)]
assert len(comps_12) == 16
rows_12 = [[] for _ in range(6)]
for name, rv, hv in comps_12:
d4 = get_d4(name, rv, hv)
for m in range(4):
rows_12[m].append((hv ** m) * rv)
rows_12[4].append((-28 * (hv ** 4) + d4) * rv)
rows_12[5].append((420 * (hv ** 5) + 235 * (hv ** 4) - 43 * hv * d4) * rv)
int_rows_12 = [[v // int(sp.igcd(*r)) for v in r] for r in rows_12]
ranks_12 = np.array([c[1] for c in comps_12], dtype=np.int64)
Bw_12, _, P_12 = build_certified_kernel_and_lll(int_rows_12, ranks_12)
b_12 = [int(sp.ceiling(81 * (max(P_12.row(j)) - min(P_12.row(j))))) for j in range(10)]
assert b_12 == [2, 2, 2, 2, 3, 2, 2, 2, 1, 1]
Z1 = np.array(list(product(*[range(-b_12[j], b_12[j] + 1) for j in range(5)])), dtype=np.int64)
Z2 = np.array(list(product(*[range(-b_12[j], b_12[j] + 1) for j in range(5, 10)])), dtype=np.int64)
V1 = Z1 @ Bw_12[:5, :]
V2 = Z2 @ Bw_12[5:, :]
min_pos_N12 = 10 ** 9
count_82_box12 = 0
for start in range(0, len(V1), 250):
chunk = V1[start:start + 250, None, :] + V2[None, :, :]
norms = np.sum(np.abs(chunk), axis=2) // 2
pos_norms = norms[norms > 0]
min_pos_N12 = min(min_pos_N12, int(np.min(pos_norms)))
count_82_box12 += int(np.sum(norms == 82))
assert len(V1) * len(V2) == 4921875
assert min_pos_N12 == 82 and count_82_box12 == 2
print(f"[PASS] Theorem 5.1: Exhaustive 10D Holder box for h_max <= 12 (all {len(V1)*len(V2):,} vectors)")
print(f" certified min positive rank N = {min_pos_N12} (unique up to sign in b^(12) = {b_12}).")
# 5. Verify Proposition 5.2 (Exact Unimodular 30D Z-Kernel, Holder Box, and 18,940-Vector Ball for r_i <= 18)
max_comp_rank = 18
h0 = 10
comps = [(f"A_{rv}", rv, rv + 1) for rv in range(1, max_comp_rank + 1)] + \
[(f"D_{rv}", rv, 2 * rv - 2) for rv in range(4, max_comp_rank + 1)] + \
[("E_6", 6, 12), ("E_7", 7, 18), ("E_8", 8, 30)]
K = len(comps)
d_sym = sp.Symbol('d')
c54 = sp.expand(P[5].subs(h, h0 + d_sym)).coeff(d_sym, 4)
rows = [[] for _ in range(6)]
for name, rv, hv in comps:
if name.startswith("A_"):
c4v, c5v = poly_A[4].subs(n, rv), poly_A[5].subs(n, rv)
elif name.startswith("D_"):
c4v, c5v = poly_D[4].subs(n, rv), poly_D[5].subs(n, rv)
else:
c4v, c5v = c_E[rv][3], c_E[rv][4]
rd4 = c4v - rv * P[4].subs(h, hv)
rd5 = c5v - rv * P[5].subs(h, hv)
dv = hv - h0
rows[0].append(sp.Integer(rv))
rows[1].append(sp.Integer(rv * dv))
rows[2].append(sp.Integer(rv * (dv ** 2)))
rows[3].append(sp.Integer(rv * (dv ** 3)))
rows[4].append(-28 * rv * (dv ** 4) + rd4)
rows[5].append(sp.Rational(672, 5) * rv * (dv ** 5) + (c54 / 28) * rd4 + rd5)
int_rows = []
for i in range(6):
denom = sp.ilcm(*[val.q for val in rows[i]])
r_int = [int(val * denom) for val in rows[i]]
g = int(sp.igcd(*r_int))
int_rows.append([v // g for v in r_int])
ranks = np.array([c[1] for c in comps], dtype=np.int64)
B_w_int, Bw_sp, P_exact = build_certified_kernel_and_lll(int_rows, ranks)
num_vecs = B_w_int.shape[0]
exact_bounds = [
int(sp.ceiling(82 * (max(P_exact.row(j)) - min(P_exact.row(j)))))
for j in range(num_vecs)
]
assert max(exact_bounds) == 7
name_to_idx = {c[0]: idx for idx, c in enumerate(comps)}
x_82 = np.zeros(K, dtype=np.int64)
for name, m in L1:
x_82[name_to_idx[name]] += m
for name, m in L2:
x_82[name_to_idx[name]] -= m
X_w_82 = sp.Matrix((x_82 * ranks).tolist())
z_82_sp = P_exact * X_w_82
assert all(val.is_integer for val in z_82_sp)
assert Bw_sp.T * z_82_sp == X_w_82
z_82 = [int(val) for val in z_82_sp]
min_N_l1 = 10 ** 9
n_checked = 0
for i in range(num_vecs):
n_checked += 1
min_N_l1 = min(min_N_l1, int(np.sum(np.abs(B_w_int[i])) // 2))
for i in range(num_vecs):
for j in range(i, num_vecs):
for s in (1, -1):
if i == j and s == -1:
continue
n_checked += 1
min_N_l1 = min(min_N_l1, int(np.sum(np.abs(B_w_int[i] + s * B_w_int[j])) // 2))
for i in range(num_vecs):
for j in range(i, num_vecs):
for k in range(j, num_vecs):
for s1 in (1, -1):
for s2 in (1, -1):
if (i == j and s1 == -1) or (j == k and s2 == -1):
continue
if i == j == k and (s1 != 1 or s2 != 1):
continue
n_checked += 1
v = B_w_int[i] + s1 * B_w_int[j] + s2 * B_w_int[k]
nv = int(np.sum(np.abs(v)) // 2)
if nv > 0:
min_N_l1 = min(min_N_l1, nv)
assert n_checked == 18940
assert min_N_l1 == 82
# 6. Verify Corrected Farkas Reduced-Cost Tightening Function
def apply_farkas_step_pure_int(MR_int_list, r_list, lb, ub, Y_int, D_tot):
k_sub = len(r_list)
M0, M1, M2, M3, M4, M5 = MR_int_list
Y0, Y1, Y2, Y3, Y4, Y5 = Y_int
rc_pos = [0] * k_sub
rc_neg = [0] * k_sub
rhs_min = 0
for j in range(k_sub):
drj = D_tot * r_list[j]
comb = Y0 * M0[j] + Y1 * M1[j] + Y2 * M2[j] + Y3 * M3[j] + Y4 * M4[j] + Y5 * M5[j]
rc_p = drj + comb
rc_n = drj - comb
rc_pos[j] = rc_p
rc_neg[j] = rc_n
rhs_min += rc_p * (lb[j] if rc_p >= 0 else ub[j])
rhs_min += rc_n * (lb[k_sub + j] if rc_n >= 0 else ub[k_sub + j])
slack = 162 * D_tot - rhs_min
if slack < 0:
return True, lb, ub
lb_n = list(lb)
ub_n = list(ub)
for j in range(k_sub):
if ub_n[j] > lb_n[j]:
rc_p = rc_pos[j]
if rc_p > 0 and slack < rc_p * (ub_n[j] - lb_n[j]):
ub_n[j] = lb_n[j] + (slack // rc_p)
elif rc_p < 0 and slack < (-rc_p) * (ub_n[j] - lb_n[j]):
lb_n[j] = ub_n[j] - (slack // (-rc_p))
if ub_n[k_sub + j] > lb_n[k_sub + j]:
rc_n = rc_neg[j]
if rc_n > 0 and slack < rc_n * (ub_n[k_sub + j] - lb_n[k_sub + j]):
ub_n[k_sub + j] = lb_n[k_sub + j] + (slack // rc_n)
elif rc_n < 0 and slack < (-rc_n) * (ub_n[k_sub + j] - lb_n[k_sub + j]):
# Corrected: negative reduced cost tightens lower bound
lb_n[k_sub + j] = ub_n[k_sub + j] - (slack // (-rc_n))
if lb_n[j] >= 1:
ub_n[k_sub + j] = 0
if lb_n[k_sub + j] >= 1:
ub_n[j] = 0
for j in range(2 * k_sub):
if ub_n[j] < lb_n[j]:
return True, lb_n, ub_n
return False, lb_n, ub_n
MR_reg = [[201, 6]] + [[0, 0] for _ in range(5)]
ranks_reg = [1, 1]
lb_reg = [1, 0, 0, 0]
ub_reg = [1, 0, 0, 10]
Y_reg = [1, 0, 0, 0, 0, 0]
pruned, new_lb, new_ub = apply_farkas_step_pure_int(MR_reg, ranks_reg, lb_reg, ub_reg, Y_reg, 1)
assert not pruned
assert new_lb[3] <= 9 <= new_ub[3]
assert new_lb[3] == 8 and new_ub[3] == 10
print("[PASS] Regression test for exact Farkas reduced-cost tightening passed (new_lb[3] == 8).")
# 7. Verify Remark 5.4: Global 6 x 162 primitive integer matrix dynamic range
max_coeffs_162 = []
for i in range(6):
denom = sp.ilcm(*[val.q for val in raw_162[i]])
r_int = [int(val * denom) for val in raw_162[i]]
g = int(sp.igcd(*r_int))
max_coeffs_162.append(max(abs(v // g) for v in r_int))
assert max_coeffs_162 == [81, 6480, 2054160, 811911600, 357845396400, 168336171961200]
print("[PASS] Proposition 5.2(a): Saturated 30D Z-kernel (|det U|=1) & LLL basis (|det V_LLL|=1) certified.")
print(f"[PASS] Proposition 5.2(b): Exact Q-pseudoinverse Holder bounds b = {exact_bounds} (max = {max(exact_bounds)}).")
print(f"[PASS] Proposition 5.2(c): Checked {n_checked:,} vectors in 0 < ||z||_1 <= 3; min N = {min_N_l1} at z_82 = {z_82}.")
print(f"[PASS] Remark 5.4: Global 6x162 primitive row max coefficients = {max_coeffs_162}.")
print("=" * 78)
print("ALL CHECKS PASSED SUCCESSFULLY.")
if __name__ == "__main__":
main()