#Gchar.txt Help:=proc():print(`Circ(x,k),Prod(pi,sig)`): print(`Gdet(x,k), ProdS(A,B), Inverse(pi)`): print(`InverseS(A), IsGroup(A) , PowerS(A) `): print(`GenGp(A). ein(i,n), CheckCox(n) `): end: with(linalg): with(combinat): Circ:=proc(x,k) local M,i,j: M:=matrix(k,k,[ seq(seq(x[(i+j) mod k],i=0..k-1),j=0..k-1)]): factor(det(M)): end: #ein(i,n): the permutation that transposes #i and i+1 (i betw. 1 and n-1) in one-line-not. ein:=proc(i,n) local j: [seq(j,j=1..i-1),i+1,i,seq(j,j=i+2..n)]: end: #prod(pi,sig): the product of the perms #pi and sig (of the same length) Prod:=proc(pi,sig) local i,k: k:=nops(pi): [seq(pi[sig[i]],i=1..k)]: end: #Inverse(pi):the inverse of the permutation pi Inverse:=proc(pi) local i,S: for i from 1 to nops(pi) do S[pi[i]]:=i: od: [seq(S[i],i=1..nops(pi))]: end: #Gdet(x,k), inputs a pos. integer k and outputs #the matrix representing the multiplication #table (for S_k) #in symboilc form using x[i] to denote #the i-th member of S_k . It outputs the group-det Gdet:=proc(x,k) local S,M,i,j: S:=permute(k): M:=matrix(k!,k!): for i from 1 to nops(S) do for j from 1 to nops(S) do M[i,j]:=Prod(S[i],S[j]): od: od: factor(det(subs({seq(S[i]=x[i],i=1..nops(S))}, op(M)))): end: #ProdS(A,B): the set of all products of elements of A #and elements of B ProdS:=proc(A,B) local i,j: {seq(seq(Prod(A[i],B[j]),i=1..nops(A)),j=1..nops(B))}: end: #InverseS(A): all the inverses of elements of A InverseS:=proc(A) local i: {seq(Inverse(A[i]),i=1..nops(A))}: end: IsGroup:=proc(A) evalb((ProdS(A,A) subset A) and evalb(InverseS(A) subset A) ) : end: #PowerS:= the set A^n (a1*a2*...*an, ai in A) PowerS:=proc(A,n): if n=1 then RETURN(A): fi: ProdS(PowerS(A,n-1),A): end: GenGp:=proc(A) local S,NewG: S:=A: NewG:=A: while NewG<>{} do NewG:= ProdS(S,A) minus S: S:=S union NewG: od: S: end: CheckCox:=proc(n) local G,i,A: G:=convert(permute(n),set): A:={seq(ein(i,n),i=1..n-1)}: evalb(GenGp(A)=G): end: #Finds all group-representations of dim. d #of S_n FindRep:=proc(n,d) local i,a,var: for i from 1 to n-1 do A[i]:=matrix(d,d,a[i]): od: var:={seq(seq(seq(a[i](j1,j2),j1=1..d),j2=1..d),i=1..n-1)}: end: