"""Lemma 23.4 (from the Siegel-Whittaker coefficient to frequency zero), steps 2 and 3, in type B_m, m=2n: simulate, for r=m-1,...,n+1: row separation (Lemma 22.3 with b=0), removal of e_r+e_m, exchange of U_{e_r} for U_{-e_m}, and conjugation by w_r; check the hypotheses of the exchange lemma at the level of roots (including a+2b), the root sets, and, with explicit matrices in SO_{2m+1}, that w_r is an isometry of determinant one carrying the character of step 2 to lambda_{r-1} with all coefficients +1.""" import itertools, sys import numpy as np def comb(a,b): out=[] for i,j in ((1,1),(1,2),(2,1)): out.append(tuple(i*x+j*y for x,y in zip(a,b))) return out def is_root(x): nz=[t for t in x if t] return (len(nz)==2 and all(abs(t)==1 for t in nz)) or (len(nz)==1 and abs(nz[0])==1) class St: def __init__(s,S,chi): s.S=set(S); s.chi=set(chi); s.log=[]; s.grp(s.S,'init') def grp(s,S,what): for a in S: for b in S: if a 2 e_i, f_i -> -u (preserves Q) return 2*Emat(F_(i),Uu)-Emat(Uu,E_(i)) for x in list(pos)[:]: X=rootvec(x); assert not (X.T.dot(Qm)+Qm.dot(X)).any() problems=[]; ok_sets=True; ok_signs=True; ok_iso=True S,chi=chain(m-1) for r in range(m-1,n,-1): st=St(S,chi) for j in range(r+1,m): st.exchange(v((1,r),(-1,j)),v((1,j),(-1,m)),f'r={r} rowsep j={j}') st.remove(v((1,r),(1,m)),f'r={r} remove') com=pos-{v((1,m)),v((1,r)),v((1,r),(1,m))}-{v((1,r),(-1,j)) for j in range(r+1,m)} if st.S!=com|{v((1,r))}: problems.append(f'r={r}: U_com Z_r mismatch') st.exchange(v((1,r)),v((-1,m)),f'r={r} Z<->Y') problems+=st.log Sn,chin=chain(r-1) if {wroot(r,x) for x in Sn}!=st.S: ok_sets=False if {wroot(r,x) for x in chin}!=st.chi: ok_sets=False W=w_matrix(r) if (W.T.dot(Qm).dot(W)-Qm).any() or round(np.linalg.det(W))!=1: ok_iso=False Winv=np.linalg.inv(W).round().astype(int) # character of step 2 = sum over st.chi of coordinate on root vector; pull back by w_r and compare with lambda_{r-1} for x in chin: Y=W.dot(rootvec(x)).dot(Winv); tgt=rootvec(wroot(r,x)) if (Y-tgt).any(): ok_signs=False S,chi=Sn,chin Sf,chif=chain(n) print(f'n={n} (B_{m}): exchange problems={len(problems)}; root sets under w_r match={ok_sets}; ' f'w_r isometry of det 1={ok_iso}; character coefficients all +1={ok_signs}',problems[:3]) for n in (2,3,4): run(n)