from research import *
s=begin(885,'Close the fixed three-distinct-Key inventory','Does the P/J order condition persist in all six finite orders?',{'inventory':'permutations of E,P,J only'},['C880–882'])
from itertools import permutations
from math import lcm
keys={'E':E,'P':P,'J':J};out=[]
for word in permutations(keys):
 c=F(1);prefix=[]
 for name in word:c*=keys[name];prefix.append(c)
 d=lcm(*(x.denominator for x in prefix))
 out.append({'order':'→'.join(word),'prefixes':[str(x) for x in prefix],'domain':d,'P_before_J':word.index('P')<word.index('J')})
a=artifact('model/three_distinct_key_domains.json',json.dumps(out,indent=2)+'\n')
finish(s,{'finite_inventory':a,'domains':sorted({r['domain'] for r in out})},'All six orders share final coefficient175000/158171. Stagewise domains split only by P/J order:158171Z with J before P and474513Z with P before J. This bounded confirmation closes the word test; no unlimited route search follows.','Separate grid-based order effects from different-anchor affine order.',{'six':len(out)==6,'common_final':len({r['prefixes'][-1] for r in out})==1,'classification':all(r['domain']==158171*(3 if r['P_before_J'] else 1) for r in out)})
