#
# Determine the list of locally short dominant positive roots, including
#  the "exceptional" root in G2.
# A positive root r has this property if it is both short and dominant
#  relative to the root subsystem generated by the simple roots that
#  occur in the support of r. In G2, the sum of the two simple roots does
#  not have this property, but is part of the list by convention.
# If u and v are dominant weights such that u < v (i.e., v - u is a sum
#  of positive roots), then there must be a locally short dominant root r
#  such that v-r is dominant and u <= v-r.
#
# Reference: The partial order of dominant weights,
#  Adv. Math 136 (1998), 340--364.
#
`weyl/lsdpr`:=proc(R) local S,S0;
  S:=coxeter['base'](R);
  if nops(S)>0 then S0:=op(subsop(1=NULL,S));
    [`weyl/lsdpr/sub`(S[1],[S[1]],{S0}),op(procname([S0]))]
  else [] fi
end:
#
# Find all lsdpr's that include S1 in their support, where r is the unique
# lsdpr with support S1, and S2 is the complementary set of simple roots.
#
`weyl/lsdpr/sub`:=proc(r,S1,S2) local r0,c,s,S0;
  for s in S2 do
    c:=coxeter['iprod'](r,s);
    if c<0 then
      c:=2*c/coxeter['iprod'](s,s);
      if c<-1 then r0:=coxeter['vec2fc'](s,[op(S1),s])
        else r0:=coxeter['vec2fc'](r,[s,op(S1)]) fi;
      S0:=S2 minus {s};
      RETURN(procname(r,S1,S0),procname(r0,[s,op(S1)],S0))
    fi
  od;
  if nops(S1)=2 and r<>S1[1]+S1[2] then r,S1[1]+S1[2] else r fi
end:
#
save `weyl/lsdpr`, `weyl/lsdpr/sub`, cat(HomeLib,`/weyl/lsdpr.m`);
quit;

