def _is_minimal_bsgs(base, gens):
 base1 = []
 sgs1 = gens[:]
 size = gens[0].size
 for i in range(size):
  if (not all(((h._array_form[i] == i) for h in sgs1))):
   base1.append(i)
   sgs1 = [h for h in sgs1 if (h._array_form[i] == i)]
 return (base1 == base)

def _is_minimal_bsgs ( base , gens ) : base1 = [ ] sgs1 = gens [ : ] size = gens [ 0 ] . size for i in range ( size ) : if ( not all ( ( ( h . _array_form [ i ] == i ) for h in sgs1 ) ) ) : base1 . append ( i ) sgs1 = [ h for h in sgs1 if ( h . _array_form [ i ] == i ) ] return ( base1 == base )
check if the bsgs has minimal base under lexigographic order .