"""Fresh exact checks of proved structural identities and a false strengthening.""" from collections import Counter from fractions import Fraction from itertools import combinations, permutations from math import factorial,comb,prod from functools import lru_cache import json from certify import context,kernels,gap,orbit_shapes,multiset_permutations def maximal_rhs(capacity,ell): n=2*capacity+1;ctx=context(n);p=ctx.gens();out=ctx.constant(0) for r in range(1,capacity+1): parts=[t-1 for t in range(1,capacity+1) if t!=r for _ in range(2)] for i in range(ell): for j in range(ell,n): for z in range(n): if z in (i,j):continue V=[v for v in range(n) if v not in (i,j,z)] J=ctx.constant(0) for labels in permutations(V): J+=prod((p[v]**b for v,b in zip(labels,parts)),start=ctx.constant(1)) out+=J*(r*(p[i]*p[j])**(r-1)*(p[i]-p[j])+p[z]**(r-1)*(p[i]**r-p[j]**r)) return out def direct_value(p,c,k): def value(parts): a=b=0 for labels in permutations(range(len(p)),len(parts)): w=prod(p[i]**e for i,e in zip(labels,parts)) a+=w;b+=w*sum(e for i,e in zip(labels,parts) if i=2: for a in range(1,m): for b in range(a,m): e=[0]*m;e[a-1]+=1;e[b-1]+=1;e[-1]=D-2 formula=kap*((tau-1)*L(a)+(D-tau)*Fraction((b-2)*L(a)+a*L(b),m-2))/(1+(a==b)) assert int(gd.get(tuple(e),0))==formula,(c,m,ell,a,b,str(gd.get(tuple(e),0)),str(formula));quadratic+=1 if m==2*c+1: assert q==maximal_rhs(c,ell);maximal+=1 lifts=[] for c,n,k in [(1,6,2),(2,6,3),(2,7,5),(3,7,2),(3,8,4),(3,9,7)]: p=list(range(n,0,-1));lifted=0 for m in range(c+1,min(n,2*c+1)+1): for U in combinations(range(n),m): ell=sum(i