#!/usr/bin/env python3 """ test_332 -- THEOREM C MADE EXACT: FIVE CONDITIONS AT EVERY NONDEGENERATE SHAPE OPERATOR (SYMBOLIC), CARTAN'S TEST IN EXACT ARITHMETIC AT SIXTEEN SHAPE OPERATORS, AND THE SLICE ON WHICH THE SYMBOL IS ALWAYS INJECTIVE For MA section 4, after the independent referee read of 29 Oct 2026. The referee found: (a) the "five conditions per point" claim was proved only off the exceptional set Z, although it looked provable outright; (b) tests 325 and 326 compute ranks by floating-point SVD with tolerance 1e-8, while the text said "exact"; (c) ker sigma(xi) = {xi (.) v} + span{K} at every xi (K - Q_xi = xi (.) w), so the TT characteristic set is a property of the TT slice, not of F, and sigma(xi) is injective on S_xi = {h : h xi = 0, = 0} wherever Q_xi != 0 (always, on U). Conventions and symbol machinery as test_326 (formal symbol; K invertible; Cayley-rotated rational frame). PRE-REGISTERED: P1 (symbolic, every nondegenerate K) In a principal frame K = diag(k1, k2, k3): (i) the images of sigma(e1), sigma(e2), sigma(e3) (on h in Sym^2(e_i-perp)) span a 5-dimensional space: after scaling tau_3 by (det K)^2 some 5x5 minor is a nonzero rational multiple of a monomial in k1, k2, k3; (ii) the four identity functionals (cyclic, and B_b of Lemma 4.6(2)) have a 4x4 minor equal to +-k1 k2 k3. Since rank tau_3 <= 5 for every K (dim g_3 >= dim M_K^3 = 55), rank tau_3 = 5 at EVERY nondegenerate K, and the four identities are independent and span its left null space there. (Both minors were first seen in a scratch exploration on 29 Oct; they are recomputed here.) P2 (exact, sixteen K) Ranks of tau_3, tau_4, tau_5 and of the restrictions of tau_3 to polynomials free of x1, of x1 and x2, computed by Gaussian elimination modulo the prime p = 2^31 - 1. rank mod p <= rank over Q, and rank over Q <= the value forced by M_K (dim g_q >= (q+2)(2q+5)); Cartan's inequality dim g_4 <= dim g_3 + dim g_{3,1} + dim g_{3,2} holds in every frame. So rank_p = N_q - (q+2)(2q+5) gives dim g_q = (q+2)(2q+5) over Q, and dim_p g_{3,1} = 19, dim_p g_{3,2} = 4 give 78 <= sum_Q <= sum_p = 78: Cartan's test holds with equality over Q, exactly, at each K. The sixteen: test_326's fifteen and diag(13/10, 21/10, 4/5), all in the same Cayley frame. P3 (exact) ker sigma(xi) = {xi (.) v} + span{K} (K itself is killed, and the sum is direct), and sigma(xi) is injective on the 2-dimensional S_xi = {h : h xi = 0, = 0}, at random rational K on both branches and random rational xi, and at the TT-characteristic covector e1 of K = diag(2, 3, -3), where TT fails. BUNDLE EDIT (29 October): the archive's [M] labels were removed from the claims; nothing else changed. """ import sys import itertools import sympy as sp FAILURES = [] PR = 2**31 - 1 def check(name, ok, detail=""): print(f" [{'PASS' if ok else 'FAIL'}] {name}" + (f" -- {detail}" if detail else "")) if not ok: FAILURES.append(name) SYM = [(0, 0), (1, 1), (2, 2), (0, 1), (0, 2), (1, 2)] CODIDX = [(a, b, c) for (a, b) in ((0, 1), (0, 2), (1, 2)) for c in range(3)] def symmat(vals): S = sp.zeros(3, 3) for v, (i, j) in zip(vals, SYM): S[i, j] = S[j, i] = v return S def Ebasis(w): E = sp.zeros(3, 3) i, j = SYM[w] E[i, j] = E[j, i] = 1 return E def sigma_M(xi, h): x2 = (xi.T * xi)[0] hx = h * xi Ric = (xi * hx.T + hx * xi.T - x2 * h - xi * xi.T * h.trace()) / 2 R = (xi.T * h * xi)[0] - x2 * h.trace() return -(Ric - R * sp.eye(3) / 2) def Dadj_poly(K, X): s1 = K.trace() return K * X + X * K - s1 * X - X.trace() * K + (s1 * X.trace() - (K * X).trace()) * sp.eye(3) def dadj_matrix(K): zs = sp.symbols("z0:6") Z = symmat(zs) D = Dadj_poly(K, Z) return sp.Matrix([[sp.diff(D[i, j], zz) for zz in zs] for (i, j) in SYM]) def symbol_poly(K): """9 x 6 matrix of sigma(X) with X = (X0, X1, X2) symbolic: entries cubic in X.""" Xv = sp.Matrix(sp.symbols("X0:3")) Ainv = dadj_matrix(K).inv() cols = [] for w in range(6): Y = sigma_M(Xv, Ebasis(w)) L = symmat(list(Ainv * sp.Matrix([Y[i, j] for (i, j) in SYM]))) cols.append([sp.expand(Xv[a] * L[b, c] - Xv[b] * L[a, c]) for (a, b, c) in CODIDX]) return sp.Matrix(cols).T, list(Xv) def symbol_at(K, xi): S, Xv = symbol_poly(K) return S.subs(dict(zip(Xv, list(xi)))) def monomials(deg): return [m for m in itertools.product(range(deg + 1), repeat=3) if sum(m) == deg] def modp(r): r = sp.Rational(r) assert r.q % PR != 0 return (int(r.p) % PR) * pow(int(r.q) % PR, PR - 2, PR) % PR def tau_modp(Spoly, Xv, q): """tau_q as in test_326 (rows: monomial m of degree q-3 and component u; columns: (monomial M of degree q, w)), entries reduced mod PR.""" cols = {(M, w): i for i, (M, w) in enumerate((M, w) for M in monomials(q) for w in range(6))} terms = [[sp.Poly(Spoly[u, w], *Xv).terms() for w in range(6)] for u in range(9)] rows = [] for m in monomials(q - 3): for u in range(9): row = [0] * len(cols) for w in range(6): for mon, coef in terms[u][w]: if coef != 0: j = cols[(tuple(a + b for a, b in zip(mon, m)), w)] row[j] = (row[j] + modp(coef)) % PR rows.append(row) return rows, cols def rank_modp(rows): A = [list(r) for r in rows] if not A: return 0 nr, nc = len(A), len(A[0]) rk, col = 0, 0 while rk < nr and col < nc: piv = next((i for i in range(rk, nr) if A[i][col] % PR), None) if piv is None: col += 1 continue A[rk], A[piv] = A[piv], A[rk] inv = pow(A[rk][col], PR - 2, PR) A[rk] = [x * inv % PR for x in A[rk]] for i in range(nr): if i != rk and A[i][col]: f = A[i][col] A[i] = [(x - f * y) % PR for x, y in zip(A[i], A[rk])] rk += 1 col += 1 return rk # ---------------------------------------------------------------- P1 print("P1 five conditions at every nondegenerate K (symbolic, principal frame)") k = sp.symbols("k1:4") Kd = sp.diag(*k) Sd, Xd = symbol_poly(Kd) mons3 = monomials(3) T3 = sp.zeros(9, 60) for u in range(9): for w in range(6): num, den = sp.fraction(sp.together(Sd[u, w])) pn = sp.Poly(num, *Xd) for mi, m in enumerate(mons3): T3[u, mi * 6 + w] = sp.cancel(pn.coeff_monomial(m) / den) T3 = (T3 * (k[0] * k[1] * k[2])**2).applyfunc(sp.cancel) col = lambda m, w: mons3.index(m) * 6 + w sel = ([col((3, 0, 0), w) for w in (1, 2, 5)] + [col((0, 3, 0), w) for w in (0, 2, 4)] + [col((0, 0, 3), w) for w in (0, 1, 3)]) B = T3[:, sel] best = None for rows_ in itertools.combinations(range(9), 5): for cs in itertools.combinations(range(9), 5): d = sp.factor(B.extract(list(rows_), list(cs)).det()) if d != 0 and all(fac.is_Symbol or fac.is_Number for fac in sp.Mul.make_args(d) for fac in [fac.as_base_exp()[0]]): best = d break if best is not None: break ok1i = best is not None # (ii) the four identity functionals s1 = Kd.trace() def Cfull(vec): C = [[[0] * 3 for _ in range(3)] for _ in range(3)] for val, (a, b, c) in zip(vec, CODIDX): C[a][b][c] = val C[b][a][c] = -val return C Fm = [] I9 = sp.eye(9) Fm.append([(lambda C: C[0][1][2] + C[1][2][0] + C[2][0][1])(Cfull(list(I9[:, i]))) for i in range(9)]) for b in range(3): r = [] for i in range(9): C = Cfull(list(I9[:, i])) r.append(sum(Kd[c, b] * C[a][c][a] for a in range(3) for c in range(3)) - s1 * sum(C[a][b][a] for a in range(3)) + sum(Kd[a, c] * C[a][b][c] for a in range(3) for c in range(3))) Fm.append(r) Fm = sp.Matrix(Fm) m4 = {sp.factor(Fm[:, list(cs)].det()) for cs in itertools.combinations(range(9), 4)} ok1ii = (k[0] * k[1] * k[2] in m4) or (-k[0] * k[1] * k[2] in m4) # the identities annihilate tau_3 symbolically ok1iii = (Fm * T3).applyfunc(sp.cancel) == sp.zeros(4, 60) check("a 5x5 minor of the coordinate-covector images is a monomial; a 4x4 minor of the identities is +-k1k2k3; " "the identities kill tau_3", ok1i and ok1ii and ok1iii, f"5x5 minor (scaled by (det K)^10): {best}") # ---------------------------------------------------------------- P2 print("P2 Cartan's test in exact arithmetic at sixteen shape operators") def rat_rot(a, b, c): A = sp.Matrix([[0, -c, b], [c, 0, -a], [-b, a, 0]]) return (sp.eye(3) - A) * (sp.eye(3) + A).inv() R = rat_rot(sp.Rational(2, 7), sp.Rational(-3, 5), sp.Rational(5, 11)) CASES = [(1, 1, 1), (1, 1, 2), (1, 1, -1), (2, 3, -3), (-1, 1, 2), (1, 2, 3), (1, 1, -2), (-1, 2, 2), (2, 2, -1), (1, -2, -2), (3, -1, -1), (1, 2, -1), (5, -2, 1), (1, 1, sp.Rational(1, 10)), (1, -1, 1), (sp.Rational(13, 10), sp.Rational(21, 10), sp.Rational(4, 5))] ok2, det2 = True, [] for kd in CASES: Kr = R * sp.diag(*kd) * R.T Sp_, Xv = symbol_poly(Kr) dims, gk = {}, [] for q in (3, 4, 5): rows_, cols = tau_modp(Sp_, Xv, q) dims[q] = 6 * len(monomials(q)) - rank_modp(rows_) if q == 3: for kfree in (1, 2): idx = [i for (M, w), i in cols.items() if all(M[j] == 0 for j in range(kfree))] gk.append(len(idx) - rank_modp([[r[i] for i in idx] for r in rows_])) good = dims[3] == 55 and gk == [19, 4] and dims[4] == 78 and dims[5] == 105 ok2 &= good det2.append(f"{tuple(str(x) for x in kd)}:{'ok' if good else f'{dims} {gk}'}") check("dim g_3 = 55, g_{3,1} = 19, g_{3,2} = 4, dim g_4 = 78, dim g_5 = 105, exactly over Q, at all sixteen", ok2, ", ".join(det2)) # ---------------------------------------------------------------- P3 print("P3 the kernel is gauge + span{K}; sigma(xi) is injective on S_xi") ok3, det3 = True, [] TESTS = [(sp.diag(2, 3, -3), sp.Matrix([1, 0, 0]))] for kd, xi in (((1, 2, 3), (1, -2, 3)), ((2, -1, -3), (3, 1, -1)), ((5, -2, 1), (-1, 4, 2)), ((1, 1, sp.Rational(1, 10)), (2, 2, -1)), ((2, 3, -3), (0, 1, 1))): TESTS.append((R * sp.diag(*kd) * R.T, sp.Matrix(xi))) for Kr, xi in TESTS: S = symbol_at(Kr, xi) vec6 = lambda H: sp.Matrix([H[i, j] for (i, j) in SYM]) # S acts on coordinates in the SYM basis E_w (h = sum c_w E_w) kills_K = S * vec6(Kr) == sp.zeros(9, 1) gauge = [vec6((xi * e.T + e * xi.T) / 2) for e in (sp.Matrix([1, 0, 0]), sp.Matrix([0, 1, 0]), sp.Matrix([0, 0, 1]))] kerspan = sp.Matrix.hstack(*gauge, vec6(Kr)) direct = kerspan.rank() == 4 kills_gauge = all(S * gv == sp.zeros(9, 1) for gv in gauge) rank2 = S.rank() == 2 # S_xi: h xi = 0 and = 0 (Frobenius), Q_xi = P K P with P = 1 - xi xi^T / |xi|^2 P = sp.eye(3) - xi * xi.T / (xi.T * xi)[0] Q = P * Kr * P cs = sp.symbols("c0:6") H = symmat(cs) eqs = list(H * xi) + [sum(H[i, j] * Q[i, j] for i in range(3) for j in range(3))] sol = sp.linsolve(eqs, cs) (gen,) = sol free = sorted(set().union(*[sp.sympify(g).free_symbols for g in gen]), key=str) basis = [vec6(symmat([sp.sympify(g).subs({f: (1 if f == fv else 0) for f in free}) for g in gen])) for fv in free] Sbasis = sp.Matrix.hstack(*basis) inj = len(free) == 2 and (S * Sbasis).rank() == 2 # TT_xi for comparison eqsTT = list(H * xi) + [H.trace()] (genT,) = sp.linsolve(eqsTT, cs) freeT = sorted(set().union(*[sp.sympify(g).free_symbols for g in genT]), key=str) basT = sp.Matrix.hstack(*[vec6(symmat([sp.sympify(g).subs({f: (1 if f == fv else 0) for f in freeT}) for g in genT])) for fv in freeT]) ttrank = (S * basT).rank() ok3 &= kills_K and direct and kills_gauge and rank2 and inj det3.append(f"TT rank {ttrank}, S_xi rank {(S * Sbasis).rank()}") check("sigma(xi) kills xi(.)v and K (direct, dim 4), rank 2, injective on S_xi; TT rank shown for comparison", ok3, "; ".join(det3)) print() print(f"test_332: {'ALL PASS' if not FAILURES else 'FAILURES: ' + ', '.join(FAILURES)}") sys.exit(1 if FAILURES else 0)