#
# induce a class function f0 from some reflection subgroup to W(R).
# J can be either a sublist of [1,...,n] indicating a parabolic subgroup,
# or a base for some (not necessarily parabolic) reflection subgroup.
#
`coxeter/induce`:=proc(f0,J,R) local S,S0,w,gens,cc,cc0,sz,sz0,res,v,i,j,f;
  S:=coxeter['base'](R); S0:=J;
  if type(S0,'list'('integer')) then S0:=[seq(S[i],i=S0)] fi;
  v:=coxeter['interior_pt'](S);
  for i to nops(S0) do
    coxeter['vec2fc'](coxeter['reflect'](S0[i],v),S,'w');
    gens[i]:=op(w)
  od;
  cc:=coxeter['class_rep'](R);
  sz:=coxeter['class_size'](R);
  cc0:=coxeter['class_rep'](S0);
  sz0:=coxeter['class_size'](S0);
  res:=table('sparse');
  if f0=1 then f:=[1$nops(cc0)] else f:=f0 fi;
  for i to nops(cc0) do
    w:=[seq(gens[j],j=cc0[i])];
    w:=coxeter['class_rep'](w,R);
    if not member(w,cc,'j') then ERROR(`this cannot happen`) fi;
    res[j]:=res[j]+sz0[i]*f[i];
  od;
  j:=convert(sz,`+`)/convert(sz0,`+`);
  [seq(res[i]*j/sz[i],i=1..nops(cc))];
end:
#
`coxeter/perm_char`:=proc(J,R) `coxeter/induce`(1,[op(J)],R) end:
#
save `coxeter/induce`, `coxeter/perm_char`, cat(HomeLib,`/coxeter/induce.m`);
read cat(HomeLib,`/help/coxeter/induce`);
read cat(HomeLib,`/help/coxeter/perm_char`);
quit;

