"""Lemma 23.3, step 2: (U_{Wh,c}, lambda_c) ~ (U_alt, its character), at the level of Lie algebras in so_{2m+1}, m=2n, for several rational values of c: row separation (Lemma 22.3 with r=n, b=c/2), interleaving (Lemma 22.4 with A_i=e_i, B_j=e_{n+j}, d=1), then the isometry A_i->e_{2i-1}, B_j->e_{2j}, e_m<->f_m, u->-u. Every hypothesis of the exchange lemma is checked on the Lie algebra (closure, invariance of the character, pairing).""" import sympy as sp, itertools def run(n,c): m=2*n; N=2*m+1 E_=lambda i:i-1; F_=lambda i:m+i-1; U=2*m def Em(a,b): M=sp.zeros(N,N); M[a,b]=1; return M def rv(x): idx=[(i+1,t) for i,t in enumerate(x) if t] if len(idx)==2: (i,a),(j,b)=idx if a==1 and b==-1: return Em(E_(i),E_(j))-Em(F_(j),F_(i)) if a==1 and b==1: return Em(E_(i),F_(j))-Em(E_(j),F_(i)) if a==-1 and b==1: return Em(E_(j),E_(i))-Em(F_(i),F_(j)) (i,a),=idx return 2*Em(E_(i),U)-Em(U,F_(i)) def v(*t): x=[0]*m for sg,i in t: x[i-1]+=sg return tuple(x) b=sp.Rational(c)/2 L=lambda X,i: X[E_(i),E_(m)]+b*X[E_(i),F_(m)] def lam_c(X): return sum(X[E_(i),E_(i+1)] for i in range(1,n))+L(X,n)+sum(X[E_(i),E_(i+1)] for i in range(n+1,m-1))+X[E_(m-1),F_(m)] # basis of u_{Wh,c} basis=[] for i in range(1,m+1): if i!=m: basis.append(rv(v((1,i)))) for j in range(i+1,m+1): if j==m and n