# Apply the two reflection words of the run (left to right) in the R^8 model and confirm both end at rho - omega_4.
import sys; sys.path.insert(0, '/private/tmp/claude-501/-Users-miltonlin-Projects-Trees/75c2c3d9-ef06-4644-b59b-d12583740b0c/scratchpad/anim/work/G5/scripts')
from e6model import *
L1 = sub(sub(rho, sc(9, om[1])), sc(3, om[6])); L2 = sub(rho, sc(9, om[1]))
w1 = [1,3,4,2,5,4,3,1,6,5,4,2,3,1,4,3,5,6]; w2 = [1,3,4,2,5,4,3,1,6,5,4,2,3]
def run(v, word):
    for j in word: v = refl(al[j], v)
    return v
print(len(w1), len(w2), fund(run(L1, w1)), fund(run(L2, w2)), run(L1, w1) == sub(rho, om[4]) == run(L2, w2))
# m_mu(x1) == m_mu(x2) for small dominant mu as exact Laurent polynomials (consequence check)
from collections import Counter
def orbit(v):
    seen = {v}; fr = [v]
    while fr:
        nf = []
        for x in fr:
            for j in range(1, 7):
                y = refl(al[j], x)
                if y not in seen: seen.add(y); nf.append(y)
        fr = nf
    return seen
ok = True
for mu in [om[1], om[6], om[2], add(om[1], om[6]), om[3], om[4], sc(3, om[1]), add(om[1], om[3])]:
    a = Counter(dot(L1, nu) for nu in orbit(mu)); b = Counter(dot(L2, nu) for nu in orbit(mu))
    ok = ok and a == b
print('m_mu(x1) == m_mu(x2) for 8 test coweights:', ok)
