"""Generic checker for sequences of exchanges of root subgroups (Lemma 20.9). A state is a set S of roots (vectors) and a set chi of roots on which the character is nontrivial. exchange(x,y): replaces x by y after checking the hypotheses of the exchange lemma on the level of roots.""" def add(a,b): return tuple(p+q for p,q in zip(a,b)) class State: def __init__(self,S,chi,is_root,name=''): self.S=set(S); self.chi=set(chi); self.is_root=is_root; self.log=[]; self.name=name self.check_group(self.S,'initial') def check_group(self,S,what): for a in S: for b in S: if a