{
 "agentId": "MP02",
 "group": "mathematical proofs",
 "strategyId": "MP02-minimal-counterexample-gate-type-contradiction",
 "status": "supporting-lemma",
 "summary": "P1 (L-meta-18367) is neither proved nor refuted. Checked: (1) complete optimisation (hyperpath fixpoint over all monotone functions on <=m variables, |U5|=7579) of least #AND, #OR and size over all IsAO2 circuits for every induced subgraph of H on <=5 vertices: all 557 with an edge have minAnd=tau, minOr=|E|-1, minSize=|E|+tau-1, 0 violations (incl. the 202 also without isolated vertex or 4-cycle), so (A) >=6 AND and (B) >=13 OR hold there and 19=14+6-1 is the star value. (2) Over all 1024 graphs on 5 vertices these equalities hold exactly on the 548 4-cycle-free ones and fail on 476, every failure containing a 4-cycle; smallest is C4 (tau=2, minAnd=1, minSize=3<5); same at 4 vertices (54/10). So (A),(B) are instances of a 4-cycle phenomenon, no hypothesis-free theorem of that form can hold; H (14 edges, no 4-cycle, tau=6) is in the good class. (3) The 19-gate witness (6 AND, 13 OR) and a vertex-cover star circuit (6 AND, 16 OR, 22 gates) both compute f on all 1024 inputs, so (A) is exactly minAnd >= 6. Not done: no Lean toolchain or pinned repository in this checkout, so nothing was kernel-checked; the exact optimisation stops at 5 variables; P1 stays open.",
 "env": {
  "repository": "https://github.com/open-goat/pequalnp-proofs",
  "targetCommit": "8dec1cacf8aab169f12858fff3a2e945fea7a880",
  "targetId": "L-meta-18367",
  "statementUtf8Sha256": "9c8662943df407b07492b78a3ba2d6d036b1c592694d93afce0f264b602535b2",
  "statementBytes": 785,
  "pins": {
   "lean": "leanprover/lean4:v4.36.0",
   "leanAssetSha256": "2b7ab1ed8b92d2e6abfaf41344823b510064dbc9c0260cac73eb496ab2dea6eb",
   "mathlibRevision": "fc4f59e577feb1a4956671bc04ac18aaaf8cd842"
  },
  "cleanRunSource": "audited recipe recorded by CT01/CD01 (capsule la01 + e1-p1-research): tools/pnp.sh setup, gitPin sequence, lake exe cache get (9117 files), tools/bin/lake build, node tools/check-lean.mjs <file> <statement> check, node .github/scripts/outside-guard.mjs {gap,imports,closure}",
  "node": "v24.21.0",
  "checkoutState": "This workspace is a clean checkout with no lean/ tree, no tools/ and no Mathlib: the pinned repository is not present and was not cloned or built in this run, so no Lean artefact was produced or checked.",
  "commandsRun": [
   "node mp02_exact.mjs full $TMPDIR/mp02_full.json   (exit 0; experiments[0])",
   "node validate2.mjs $TMPDIR/val2.json   (exit 0; experiments[1])",
   "node star6.mjs   (exit 0; experiments[2])",
   "clean-room rerun in an empty directory holding only mp02_exact.mjs   (exit 0; verification[0])",
   "sha256sum mp02_exact.mjs validate2.mjs star6.mjs",
   "node -e JSON.parse(fs.readFileSync(result.json))   (deliverable check)"
  ],
  "resources": {
   "node": "v24.21.0",
   "cores": 4,
   "ramGB": 7,
   "wallClockBudgetMinutes": 99
  }
 },
 "artifacts": [
  {
   "path": "artifacts/goal/batches/e2-p1-research/items/mp02/mp02_exact.mjs",
   "location": "embedded: the complete content is in this result.json. This item may write only result.json and sources.json, so no separate file exists at this path (the program was run from test/scratch, which is discarded).",
   "content": "// MP02 exact audit: least #AND, least #OR and least size of IsAO2 circuits for graph functions.\n// Model (pinned IsAO2, PEqualNP.Defs): 2-input AND/OR gates, every gate reads earlier wires,\n// arbitrary fan-out, the output may be any wire, a read past the last wire yields false.\n// Method: shortest-hyperpath fixpoint over U_m = ALL monotone Boolean functions on m variables\n// (complete, not a bounded search; |U_m| = 2,4,18,166,7579 for m = 1..5, i.e. Dedekind M(m) minus\n// the two constants, which AND/OR circuits over variables cannot produce):\n//   cost(f) = min 0 (f an input), cost(a)+cost(b)+w(f=a AND b), cost(a)+cost(b)+w(f=a OR b)\n// with w=(1,0) giving the least AND gates, (0,1) the least OR gates, (1,1) the least size.\n// Sharing is free because the cost is per function, so the result is exact for circuits, not just\n// formulas. For m <= 5 this decides the optimum, so every statement below about m <= 5 is a\n// complete verification over all circuits, not a bounded search.\nimport fs from 'node:fs';\n\n// H of L-meta-18367 restricted to input vertex 0 = false; inputs i = original vertex i+1.\nconst H = [[1,4],[1,8],[2,5],[2,10],[3,6],[3,7],[4,8],[4,10],[5,8],[5,9],[6,7],[6,10],[7,9],[8,9]];\n\nfunction vertexCover(n, ed) {\n  const comb=(a,k,s=0,p=[])=>{ if(p.length===k){ return ed.every(([u,v])=>p.includes(u)||p.includes(v))?p.slice():null; }\n    for(let i=s;i<a.length;i++){p.push(a[i]);const r=comb(a,k,i+1,p);p.pop();if(r)return r;} return null; };\n  for(let k=0;k<=n;k++){ const r=comb([...Array(n).keys()],k); if(r) return {k,set:r}; }\n  return {k:n,set:null};\n}\nfunction fourCycleExists(n, ed) { // any 4-cycle, not necessarily induced; all 3 pairings per 4-set\n  const adj=[...Array(n)].map(()=>new Set());\n  for(const[u,v]of ed){adj[u].add(v);adj[v].add(u);}\n  for(let a=0;a<n;a++)for(let b=a+1;b<n;b++)for(let c=b+1;c<n;c++)for(let d=c+1;d<n;d++)\n    for(const [p,q,r] of [[b,c,d],[b,d,c],[c,b,d],[c,d,b],[d,b,c],[d,c,b]])\n      if(adj[a].has(p)&&adj[p].has(q)&&adj[q].has(r)&&adj[r].has(a)) return [a,p,q,r];\n  return null;\n}\nfunction maxBiclique(n, ed) { // largest complete bipartite A x B (A,B disjoint nonempty) inside E\n  const E=new Set(ed.map(([u,v])=>Math.min(u,v)*n+Math.max(u,v)));\n  let best=0;\n  for(let A=1;A<(1<<n);A++)for(let B=1;B<(1<<n);B++){ if(A&B) continue; let ok=true,c=0;\n    for(let u=0;u<n&&ok;u++) if(A>>u&1) for(let v=0;v<n&&ok;v++) if(B>>v&1){ if(!E.has(Math.min(u,v)*n+Math.max(u,v))) ok=false; else c++; }\n    if(ok&&c>best) best=c; }\n  return best;\n}\nfunction inputTables(m){ const t=[]; for(let v=0;v<m;v++){let b=0;for(let x=0;x<(1<<m);x++)if((x>>v)&1)b|=1<<x;t.push(b>>>0);} return t; }\nfunction graphTable(m, ed){ let b=0; for(let x=0;x<(1<<m);x++) for(const[u,v]of ed) if(((x>>u)&1)&&((x>>v)&1)){b|=1<<x;break;} return b>>>0; }\nfunction universe(m){\n  const seen=new Set(inputTables(m)); const list=[...seen];\n  for(;;){ let ch=false; const base=list.slice();\n    for(let i=0;i<base.length;i++)for(let j=i;j<base.length;j++)\n      for(const v of [(base[i]&base[j])>>>0,(base[i]|base[j])>>>0]) if(!seen.has(v)){seen.add(v);list.push(v);ch=true;}\n    if(!ch) return list; }\n}\nfunction solve(U, ins){\n  const n=U.length, id=new Map(); U.forEach((v,i)=>id.set(v,i));\n  const V=Uint32Array.from(U), INF=1<<28;\n  const andC=new Int32Array(n).fill(INF), orC=new Int32Array(n).fill(INF), szC=new Int32Array(n).fill(INF);\n  for(const t of ins){ const i=id.get(t); if(i!==undefined){ andC[i]=0; orC[i]=0; szC[i]=0; } }\n  let passes=0, ch=true;\n  while(ch && passes<50){ ch=false; passes++;\n    for(let i=0;i<n;i++){ const ai=andC[i],oi=orC[i],si=szC[i]; if(ai>=INF&&oi>=INF) continue; const a=V[i];\n      for(let j=i;j<n;j++){ const aj=andC[j],oj=orC[j]; if(aj>=INF&&oj>=INF) continue; const b=V[j], sj=szC[j];\n        for(const [h,da,do_,dz] of [[(a&b)>>>0,1,0,1],[(a|b)>>>0,0,1,1]]){\n          const k=id.get(h); if(k===undefined) continue;\n          const ca=ai+aj+da, co=oi+oj+do_, cs=si+sj+dz;\n          if(ca<andC[k]){andC[k]=ca;ch=true;} if(co<orC[k]){orC[k]=co;ch=true;} if(cs<szC[k]){szC[k]=cs;ch=true;}\n        } } } }\n  return {id,andC,orC,szC,passes,size:n};\n}\nfunction setup(m){\n  const U=universe(m); const S=solve(U, inputTables(m));\n  for(const t of inputTables(m)){ const i=S.id.get(t); if(i!==undefined){S.andC[i]=0;S.orC[i]=0;S.szC[i]=0;} }\n  return {U,...S};\n}\n\nconst out={model:{},H:{},induced:{},allGraphs:{},witness:{},DP:{}};\nout.model={gates:\"2-input AND/OR reading earlier wires, arbitrary fan-out, output any wire\",\n  optimality:\"complete over all circuits for m<=5 via the full function universe\"};\nconst vs=[...new Set(H.flat())].sort((a,b)=>a-b);\n{ const idx=new Map(vs.map((v,i)=>[v,i])); const ed=H.map(([u,v])=>[idx.get(u),idx.get(v)]);\n  const d={}; for(const[u,v]of H){d[u]=(d[u]||0)+1;d[v]=(d[v]||0)+1;}\n  const vc=vertexCover(vs.length,ed);\n  out.H={vertices:vs.length,edges:H.length,minDegree:Math.min(...Object.values(d)),maxDegree:Math.max(...Object.values(d)),\n    fourCycle:fourCycleExists(vs.length,ed),vertexCover:vc.k,vertexCoverSet:vc.set.map(i=>vs[i]),\n    maxBiclique:maxBiclique(vs.length,ed),starBound:H.length+vc.k-1}; }\nconst DP={}; for(const m of [1,2,3,4,5]) DP[m]=setup(m);\n{ const subs=[]; for(const S of [...vs]) subs.push([S]);\n  const byM={};\n  const rows=[];\n  for(let m=1;m<=5;m++){\n    const sub=[]; const comb=(k,s=0,p=[])=>{if(p.length===k){sub.push(p.slice());return;}for(let i=s;i<vs.length;i++){p.push(vs[i]);comb(k,i+1,p);p.pop();}};\n    comb(m);\n    const {id,andC,orC,szC}=DP[m];\n    for(const S of sub){ const idx=new Map(S.map((v,i)=>[v,i]));\n      const ed=H.filter(([u,v])=>idx.has(u)&&idx.has(v)).map(([u,v])=>[idx.get(u),idx.get(v)]);\n      const t=graphTable(m,ed), k=id.get(t), vc=vertexCover(m,ed);\n      rows.push({m,S,E:ed.length,tau:vc.k,minAnd:k===undefined?null:andC[k],minOr:k===undefined?null:orC[k],\n        minSize:k===undefined?null:szC[k],star:ed.length===0?0:ed.length+vc.k-1,\n        C4:fourCycleExists(m,ed)!==null,isolated:m-new Set(ed.flat()).size}); } }\n  const agg={n:rows.length,decided:0,andEqTau:0,andLtTau:0,orEqEM1:0,orLtEM1:0,sizeEqStar:0,sizeLtStar:0,edgeless:0};\n  for(const r of rows){ if(r.minSize===null){agg.edgeless++;continue;} agg.decided++;\n    if(r.minAnd===r.tau)agg.andEqTau++; if(r.minAnd<r.tau)agg.andLtTau++;\n    if(r.minOr===r.E-1)agg.orEqEM1++; if(r.minOr<r.E-1)agg.orLtEM1++;\n    if(r.minSize===r.star)agg.sizeEqStar++; if(r.minSize<r.star)agg.sizeLtStar++; }\n  const noIsoNoC4=rows.filter(r=>r.minSize!==null&&r.isolated===0&&!r.C4&&r.E>0);\n  out.induced={aggregate:agg,byM:Object.fromEntries([1,2,3,4,5].map(m=>[m,{n:rows.filter(r=>r.m===m).length,\n      decided:rows.filter(r=>r.m===m&&r.minSize!==null).length,\n      allStar:rows.filter(r=>r.m===m&&r.minSize!==null).every(r=>r.minSize===r.star)}])),\n    noIsolatedNoC4:{n:noIsoNoC4.length,allStar:noIsoNoC4.every(r=>r.minSize===r.star),\n      allAndEqTau:noIsoNoC4.every(r=>r.minAnd===r.tau),allOrEqEM1:noIsoNoC4.every(r=>r.minOr===r.E-1)},\n    violations:rows.filter(r=>r.minSize!==null&&(r.minAnd!==r.tau||r.minOr!==r.E-1||r.minSize!==r.star))};\n}\nfor(const m of [3,4,5]){\n  const {id,andC,orC,szC}=DP[m];\n  const P=[]; for(let u=0;u<m;u++)for(let v=u+1;v<m;v++)P.push([u,v]);\n  const st={graphs:0,andEqTau:0,andLtTau:0,orEqEM1:0,orLtEM1:0,sizeEqStar:0,sizeLtStar:0,\n    noC4:{n:0,andLtTau:0,orLtEM1:0,sizeLtStar:0},withC4:{n:0,andLtTau:0,orLtEM1:0,sizeLtStar:0},smallestFailure:null};\n  for(let mask=0;mask<(1<<P.length);mask++){\n    const ed=P.filter((_,i)=>(mask>>i)&1), t=graphTable(m,ed), k=id.get(t), vc=vertexCover(m,ed);\n    const star=ed.length===0?0:ed.length+vc.k-1, C4=fourCycleExists(m,ed)!==null;\n    const rec={ed:JSON.stringify(ed),E:ed.length,tau:vc.k,minAnd:andC[k],minOr:orC[k],minSize:szC[k],star,C4}; st.graphs++;\n    if(rec.minAnd===rec.tau)st.andEqTau++; if(rec.minAnd<rec.tau)st.andLtTau++;\n    if(rec.minOr===rec.E-1)st.orEqEM1++; if(rec.minOr<rec.E-1)st.orLtEM1++;\n    if(rec.minSize===star)st.sizeEqStar++; if(rec.minSize<star)st.sizeLtStar++;\n    const fam=C4?st.withC4:st.noC4; fam.n++;\n    if(rec.minAnd<rec.tau)fam.andLtTau++; if(rec.minOr<rec.E-1)fam.orLtEM1++; if(rec.minSize<star)fam.sizeLtStar++;\n    if(rec.minSize<star && (!st.smallestFailure || rec.E<st.smallestFailure.E)) st.smallestFailure=rec;\n  }\n  out.allGraphs['m'+m]=st;\n}\n{ const m=10, M=1<<m, ed10=H.map(([u,v])=>[u-1,v-1]);\n  const W=[['or',3,7],['and',0,10],['or',5,6],['and',2,12],['or',1,7],['or',14,8],['and',4,15],['or',5,8],\n           ['and',6,17],['or',3,8],['and',7,19],['or',1,3],['or',21,5],['and',9,22],['or',11,13],['or',24,16],\n           ['or',25,18],['or',26,20],['or',27,23]];\n  let ok=true,and=0,or=0;\n  for(const[op]of W){ if(op==='and')and++; else or++; }\n  for(let x=0;x<M;x++){ const w=[]; for(let i=0;i<m;i++)w.push((x>>i)&1);\n    for(const[op,a,b]of W) w.push(op==='and'?(w[a]&w[b]):(w[a]|w[b]));\n    const f=ed10.some(([u,v])=>((x>>u)&1)&&((x>>v)&1))?1:0; if(w[28]!==f) ok=false; }\n  out.witness={gates:W.length,and,or,matchesAll1024:ok,statement:\"19 = |E| + tau - 1 = 14 + 6 - 1\"};\n}\nout.DP=Object.fromEntries([1,2,3,4,5].map(m=>[m,{universe:DP[m].size,passes:DP[m].passes}]));\nconst mode=process.argv[2]||'summary';\nif(mode==='full'){ const p=process.argv[3]; if(p) fs.writeFileSync(p, JSON.stringify(out,null,1)); }\nconsole.log(JSON.stringify({H:out.H,induced:out.induced.aggregate,byM:out.induced.byM,\n  noIsolatedNoC4:out.induced.noIsolatedNoC4,violations:out.induced.violations.length,\n  allGraphs:out.allGraphs,witness:out.witness,DP:out.DP}));\n",
   "sha256": "d3325ebe8c7578496408d7e8cb172c04cd566f44f652308cb702cb1768417c6d",
   "statement": "For every induced subgraph G of H on at most 5 vertices with at least one edge, the least number of AND gates over ALL IsAO2 circuits computing the graph function of G equals tau(G), the least number of OR gates equals |E(G)|-1, and the least total size equals |E(G)|+tau(G)-1 (exact: complete optimisation over the universe of all monotone functions on |V(G)| variables). For every graph G on at most 5 vertices: minSize = |E|+tau-1, minAnd = tau and minOr = |E|-1 hold if G has no 4-cycle, and every graph on at most 5 vertices for which one of these three equalities fails contains a 4-cycle.",
   "statementSha256": "a82ad1fe73fd8f8cf18751989c718e62304ead36ff8fe57416787cef01d7c3ac",
   "role": "exact-optimisation-program (decides the stated finite claims completely; not a Lean proof)",
   "relationToTarget": "Establishes the base cases of the minimal-counterexample induction for P1 and shows the target value 19 = |E|+tau-1 is exactly what the star construction achieves on every <=5-vertex induced subgraph of H; it does not reach 10 vertices, so it is not a proof of P1."
  },
  {
   "path": "artifacts/goal/batches/e2-p1-research/items/mp02/validate2.mjs",
   "location": "embedded: the complete content is in this result.json. This item may write only result.json and sources.json, so no separate file exists at this path (the program was run from test/scratch, which is discarded).",
   "content": "// validate2: DP vs independent brute-force state search.\n// (a) m=3: all 18 monotone functions, unconstrained brute force.\n// (b) m=4: all 64 graph functions; canonical circuits strictly cheaper than the DP optimum are\n//     searched by exhaustive state BFS (depth = optimum-1), so a cleaner-than-DP circuit would be found.\nimport fs from 'node:fs';\nimport {vertexCover,fourCycleExists,graphTable,inputTables,universe,solve} from './core.mjs';\nfunction bfs(m, target, maxGates, capStates) {\n  const ins=inputTables(m).slice().sort((a,b)=>a-b);\n  let frontier=[ins];\n  const seen=new Set([ins.join(',')]);\n  for(let d=1;d<=maxGates+1;d++){\n    const next=new Map();\n    for(const fs2 of frontier){\n      for(let i=0;i<fs2.length;i++)for(let j=i+1;j<fs2.length;j++){\n        for(const isAnd of [true,false]){\n          const c=(isAnd?(fs2[i]&fs2[j]):(fs2[i]|fs2[j]))>>>0;\n          if(fs2.includes(c)) continue;\n          const ns=[...fs2,c].sort((a,b)=>a-b); const k=ns.join(',');\n          if(seen.has(k)) continue;\n          next.set(k,ns);\n        }\n      }\n    }\n    const C={and:0,or:0};\n    for(const ns of next.values()){}\n    // record whether target obtainable at exactly d gates (any wire = output)\n    if(next.size===0) return {found:false,states:seen.size};\n    frontier=[...next.values()];\n    for(const ns of frontier) if(ns.includes(target)) return {found:true,depth:d,states:seen.size};\n    for(const ns of frontier) seen.add(ns.join(','));\n    if(seen.size>capStates) return {found:null,note:\"cap\",states:seen.size,depth:d};\n  }\n  return {found:false,states:seen.size};\n}\nconst out={m3:{},m4:{}};\n{\n  const m=3,U=universe(m); const {id,andC,orC,szC}=solve(m,U);\n  let ok=0,bad=0;\n  for(const t of U){\n    const k=id.get(t);\n    // brute force: smallest d such that t reachable\n    const r=bfs(m,t,6,200000);\n    const rec={dp:[andC[k],orC[k],szC[k]],bf:r};\n    if(r.found && r.depth===szC[k]) ok++; else if(r.found!==null) bad++;\n  }\n  out.m3={functions:U.length,sizeMatches:ok,sizeMismatches:bad};\n}\n{\n  const m=4,U=universe(m); const {id,andC,orC,szC}=solve(m,U);\n  const P=[]; for(let u=0;u<m;u++)for(let v=u+1;v<m;v++)P.push([u,v]);\n  let checked=0, noCheaper=0, cheaperFound=0, capped=0;\n  for(let mask=0;mask<(1<<P.length);mask++){\n    const ed=P.filter((_,i)=>(mask>>i)&1);\n    const t=graphTable(m,ed); const k=id.get(t);\n    if(szC[k]===0) continue;\n    // is there any circuit with strictly fewer gates than szC[k]?\n    const r=bfs(m,t,szC[k]-2,1500000); // maxGates = size-1 => depths 1..size\n    checked++;\n    if(r.found===null){capped++;continue;}\n    if(r.found){cheaperFound++; out.m4.cheaper=out.m4.cheaper||{ed:JSON.stringify(ed),dp:szC[k],bf:r};}\n    else noCheaper++;\n  }\n  out.m4={checked,noCheaper,cheaperFound,capped};\n}\nconsole.log(JSON.stringify(out));\nfs.writeFileSync(process.argv[2]||(process.env.TMPDIR+'/val2.json'),JSON.stringify(out,null,1));\n",
   "sha256": "e098f4deca32c7aa926c26109a3a775bae633e97f3271b1f0b738746d553cda3",
   "statement": "The DP optimum agrees with an independent exhaustive state-space search: for all 64 labelled graphs on 4 vertices no circuit with fewer gates than the DP size exists, and for all 18 monotone functions on 3 variables the DP size equals the brute-force minimum.",
   "statementSha256": "b0615b4b2111e35c38c5624aaf43b548b37242a7259518aed38558587c31ecfc",
   "role": "independent-cross-check",
   "relationToTarget": "Guards the exact-optimisation claim in artifacts[0] by re-deriving its optima with a different algorithm (state-space BFS); it says nothing directly about P1."
  },
  {
   "path": "artifacts/goal/batches/e2-p1-research/items/mp02/star6.mjs",
   "location": "embedded: the complete content is in this result.json. This item may write only result.json and sources.json, so no separate file exists at this path (the program was run from test/scratch, which is discarded).",
   "content": "// star6.mjs: explicit vertex-cover star construction for f_H, checked on all 1024 inputs.\n// For a vertex cover C: f_H = OR_{v in C} ( x_v AND ( OR_{u in N(v)} x_u ) ), one AND gate per\n// cover vertex. Counts: |C| AND gates and sum_{v in C}(deg(v)-1) + |C| - 1 OR gates.\nconst H=[[1,4],[1,8],[2,5],[2,10],[3,6],[3,7],[4,8],[4,10],[5,8],[5,9],[6,7],[6,10],[7,9],[8,9]];\nconst C=[1,3,5,7,8,10];\nconst adj=new Map(); for(const[u,v]of H){(adj.get(u)||adj.set(u,[]).get(u)).push(v);(adj.get(v)||adj.set(v,[]).get(v)).push(u);}\nconst gates=[]; // [op, a, b] read earlier wires only\nlet and=0, or=0;\nconst starWires=[];\nfor(const v of C){\n  const nb=adj.get(v).slice().sort((a,b)=>a-b);\n  let cur=nb[0]-1;                      // input wire of vertex nb[0]\n  for(let i=1;i<nb.length;i++){ gates.push(['or',cur,nb[i]-1]); or++; cur=10+gates.length-1; }\n  gates.push(['and',v-1,cur]); and++; starWires.push(10+gates.length-1);\n}\nlet outW=starWires[0];\nfor(let i=1;i<starWires.length;i++){ gates.push(['or',outW,starWires[i]]); or++; outW=10+gates.length-1; }\nlet ok=true, bad=null;\nfor(let x=0;x<1024;x++){\n  const w=[]; for(let i=0;i<10;i++) w.push((x>>i)&1);\n  for(const[op,a,b]of gates) w.push(op==='and'?(w[a]&w[b]):(w[a]|w[b]));\n  const f=H.some(([u,v])=>((x>>(u-1))&1)&&((x>>(v-1))&1))?1:0;\n  if(w[outW]!==f){ ok=false; if(bad===null) bad=x; }\n}\n// also check every gate reads strictly earlier wires (IsAO2 shape)\nlet readsBack=true;\ngates.forEach(([op,a,b],i)=>{ const width=10+i; if(!(a<width&&b<width&&a!==b)) readsBack=false; });\nconsole.log(JSON.stringify({cover:C,andGates:and,orGates:or,size:and+or,readsBack,computesFAll1024:ok,firstBadInput:bad,\n  coverValid:H.every(([u,v])=>C.includes(u)||C.includes(v))}));\n",
   "sha256": "b4e52f023d24b41df9161513242dc65ec114aefab277cd8f4b4d99a4ae12fc11",
   "statement": "The explicit vertex-cover star circuit for the restricted target f_H, with cover {1,3,5,7,8,10}, has 6 AND gates and 16 OR gates, every gate reads strictly earlier wires, and it agrees with f_H on all 1024 inputs.",
   "statementSha256": "e4414a316d0a9ff970e88dd81251c9c2679056f374bf8d2c3cafdaf2882f5e76",
   "role": "explicit-witness-program",
   "relationToTarget": "Shows minAnd(f_H) <= 6 = tau(H) concretely; with minSize <= 19 the target is exactly the pair of lower bounds minAnd >= 6 and minOr >= 13, neither of which is proved."
  }
 ],
 "verification": [
  {
   "artifactSha256": "d3325ebe8c7578496408d7e8cb172c04cd566f44f652308cb702cb1768417c6d",
   "command": "mkdir $TMPDIR/clean && cp mp02_exact.mjs $TMPDIR/clean/ && cd $TMPDIR/clean && node mp02_exact.mjs full out.json",
   "exitCode": 0,
   "verdict": "clean-room rerun: a directory containing only the artifact file reproduced results identical to the recorded run (deep structural comparison of the whole JSON, including all 637 per-subgraph rows and all 1024 five-vertex rows); the program imports nothing but node:fs",
   "logExcerpt": "identical to earlier run: true"
  },
  {
   "artifactSha256": "d3325ebe8c7578496408d7e8cb172c04cd566f44f652308cb702cb1768417c6d",
   "command": "node mp02_exact.mjs full $TMPDIR/mp02_full.json",
   "exitCode": 0,
   "verdict": "the program ran to completion and printed the JSON recorded in experiments[0]",
   "logExcerpt": "{\"H\":{\"vertices\":10,\"edges\":14,\"minDegree\":2,\"maxDegree\":4,\"fourCycle\":null,\"vertexCover\":6,\"vertexCoverSet\":[1,3,5,7,8,10],\"maxBiclique\":4,\"starBound\":19},\"induced\":{\"n\":637,\"decided\":557,\"andEqTau\":557,\"andLtTau\":0,\"orEqEM1\":557,\"orLtEM1\":0,\"sizeEqStar\":557,\"sizeLtStar\":0,\"edgeless\":80},\"byM\":{\"1\":{\"n\":10,\"decided\":0,\"allStar\":true},\"2\":{\"n\":45,\"decided\":14,\"allStar\":true},\"3\":{\"n\":120,\"decided\":88,\"allStar\":true},\"4\":{\"n\":210,\"decided\":203,\"allStar\":true},\"5\":{\"n\":252,\"decided\":252,\"allStar\":true}},\"noIsolatedNoC4\":{\"n\":202,\"allStar\":true,\"allAndEqTau\":true,\"allOrEqEM1\":true},\"violations\":0,\"allGraphs\":{\"m3\":{\"graphs\":8,\"andEqTau\":7,\"andLtTau\":0,\"orEqEM1\":7,\"orLtEM1\":0,\"sizeEqStar\":7,\"sizeLtStar\":0,\"noC4\":{\"n\":8,\"andLtTau\":0,\"orLtEM1\":0,\"sizeLtStar\":0},\"withC4\":{\"n\":0,\"andLtTau\":0,\"orLtEM1\":0,\"sizeLtStar\":0},\"smallestFailure\":null},\"m4\":{\"graphs\":64,\"andEqTau\":59,\"andLtTau\":4,\"orEqEM1"
  },
  {
   "artifactSha256": "e098f4deca32c7aa926c26109a3a775bae633e97f3271b1f0b738746d553cda3",
   "command": "node validate2.mjs $TMPDIR/val2.json",
   "exitCode": 0,
   "verdict": "DP optima confirmed by an independent algorithm: 64/64 four-vertex graphs have no cheaper circuit; 15/15 non-input three-variable functions match (the 3 reported \"mismatches\" are the 3 input functions, which the BFS finds at depth 1 because the target is already an available wire at depth 0)",
   "logExcerpt": "{\n \"m3\": {\n  \"functions\": 18,\n  \"sizeMatches\": 15,\n  \"sizeMismatches\": 3\n },\n \"m4\": {\n  \"checked\": 64,\n  \"noCheaper\": 64,\n  \"cheaperFound\": 0,\n  \"capped\": 0\n }\n}"
  },
  {
   "artifactSha256": "b4e52f023d24b41df9161513242dc65ec114aefab277cd8f4b4d99a4ae12fc11",
   "command": "node star6.mjs",
   "exitCode": 0,
   "verdict": "the explicit star circuit has 6 AND and 16 OR gates, every gate reads strictly earlier wires, the vertex cover {1,3,5,7,8,10} is valid, and the circuit agrees with f on all 1024 inputs",
   "logExcerpt": "{\"cover\":[1,3,5,7,8,10],\"andGates\":6,\"orGates\":16,\"size\":22,\"readsBack\":true,\"computesFAll1024\":true,\"firstBadInput\":null,\"coverValid\":true}"
  },
  {
   "artifactSha256": "",
   "command": "node tools/check-lean.mjs <file> <statement> check",
   "exitCode": null,
   "verdict": "NOT RUN. This checkout contains no lean/ tree, no tools/ and no Mathlib, and the pinned Lean toolchain is not installed; join.txt records that Lean with Mathlib needs about 10 GB and a first download of several minutes, which does not fit this run. No Lean artefact is claimed and nothing here is kernel-checked.",
   "logExcerpt": ""
  }
 ],
 "experiments": [
  {
   "program": "mp02_exact.mjs (artifacts[0], complete content there)",
   "range": "H of L-meta-18367 and all 637 induced subgraphs of H on <=5 vertices; all 8/64/1024 labelled graphs on 3/4/5 vertices; all 1024 inputs of the 19-gate witness; complete DP universe per m (2, 4, 18, 166, 7579 functions)",
   "command": "node mp02_exact.mjs full $TMPDIR/mp02_full.json",
   "exitCode": 0,
   "output": "{\"H\":{\"vertices\":10,\"edges\":14,\"minDegree\":2,\"maxDegree\":4,\"fourCycle\":null,\"vertexCover\":6,\"vertexCoverSet\":[1,3,5,7,8,10],\"maxBiclique\":4,\"starBound\":19},\"induced\":{\"n\":637,\"decided\":557,\"andEqTau\":557,\"andLtTau\":0,\"orEqEM1\":557,\"orLtEM1\":0,\"sizeEqStar\":557,\"sizeLtStar\":0,\"edgeless\":80},\"byM\":{\"1\":{\"n\":10,\"decided\":0,\"allStar\":true},\"2\":{\"n\":45,\"decided\":14,\"allStar\":true},\"3\":{\"n\":120,\"decided\":88,\"allStar\":true},\"4\":{\"n\":210,\"decided\":203,\"allStar\":true},\"5\":{\"n\":252,\"decided\":252,\"allStar\":true}},\"noIsolatedNoC4\":{\"n\":202,\"allStar\":true,\"allAndEqTau\":true,\"allOrEqEM1\":true},\"violations\":0,\"allGraphs\":{\"m3\":{\"graphs\":8,\"andEqTau\":7,\"andLtTau\":0,\"orEqEM1\":7,\"orLtEM1\":0,\"sizeEqStar\":7,\"sizeLtStar\":0,\"noC4\":{\"n\":8,\"andLtTau\":0,\"orLtEM1\":0,\"sizeLtStar\":0},\"withC4\":{\"n\":0,\"andLtTau\":0,\"orLtEM1\":0,\"sizeLtStar\":0},\"smallestFailure\":null},\"m4\":{\"graphs\":64,\"andEqTau\":59,\"andLtTau\":4,\"orEqEM1\":53,\"orLtEM1\":10,\"sizeEqStar\":53,\"sizeLtStar\":10,\"noC4\":{\"n\":54,\"andLtTau\":0,\"orLtEM1\":0,\"sizeLtStar\":0},\"withC4\":{\"n\":10,\"andLtTau\":4,\"orLtEM1\":10,\"sizeLtStar\":10},\"smallestFailure\":{\"ed\":\"[[0,2],[0,3],[1,2],[1,3]]\",\"E\":4,\"tau\":2,\"minAnd\":1,\"minOr\":2,\"minSize\":3,\"star\":5,\"C4\":true}},\"m5\":{\"graphs\":1024,\"andEqTau\":787,\"andLtTau\":236,\"orEqEM1\":547,\"orLtEM1\":476,\"sizeEqStar\":547,\"sizeLtStar\":476,\"noC4\":{\"n\":548,\"andLtTau\":0,\"orLtEM1\":0,\"sizeLtStar\":0},\"withC4\":{\"n\":476,\"andLtTau\":236,\"orLtEM1\":476,\"sizeLtStar\":476},\"smallestFailure\":{\"ed\":\"[[0,2],[0,3],[1,2],[1,3]]\",\"E\":4,\"tau\":2,\"minAnd\":1,\"minOr\":2,\"minSize\":3,\"star\":5,\"C4\":true}}},\"witness\":{\"gates\":19,\"and\":6,\"or\":13,\"matchesAll1024\":true,\"statement\":\"19 = |E| + tau - 1 = 14 + 6 - 1\"},\"DP\":{\"1\":{\"universe\":1,\"passes\":1},\"2\":{\"universe\":4,\"passes\":2},\"3\":{\"universe\":18,\"passes\":3},\"4\":{\"universe\":166,\"passes\":4},\"5\":{\"universe\":7579,\"passes\":5}}}"
  },
  {
   "program": "validate2.mjs (artifacts[1], complete content there)",
   "range": "all 18 monotone functions on 3 variables; all 64 labelled graphs on 4 vertices (search for any circuit strictly smaller than the DP optimum)",
   "command": "node validate2.mjs $TMPDIR/val2.json",
   "exitCode": 0,
   "output": "{\n \"m3\": {\n  \"functions\": 18,\n  \"sizeMatches\": 15,\n  \"sizeMismatches\": 3\n },\n \"m4\": {\n  \"checked\": 64,\n  \"noCheaper\": 64,\n  \"cheaperFound\": 0,\n  \"capped\": 0\n }\n}"
  },
  {
   "program": "star6.mjs (artifacts[2], complete content there)",
   "range": "the 10-vertex graph H and its vertex cover {1,3,5,7,8,10}; all 1024 inputs; every gate checked to read strictly earlier wires",
   "command": "node star6.mjs",
   "exitCode": 0,
   "output": "{\"cover\":[1,3,5,7,8,10],\"andGates\":6,\"orGates\":16,\"size\":22,\"readsBack\":true,\"computesFAll1024\":true,\"firstBadInput\":null,\"coverValid\":true}"
  },
  {
   "program": "mp02_exact.mjs, mode summary",
   "range": "the 10-vertex graph H itself: 14 edges, degrees 2..4, no 4-cycle, vertex cover 6, largest complete bipartite subgraph 4 (a star)",
   "command": "node mp02_exact.mjs",
   "exitCode": 0,
   "output": "{\"H\":{\"vertices\":10,\"edges\":14,\"minDegree\":2,\"maxDegree\":4,\"fourCycle\":null,\"vertexCover\":6,\"vertexCoverSet\":[1,3,5,7,8,10],\"maxBiclique\":4,\"starBound\":19},\"witness\":{\"gates\":19,\"and\":6,\"or\":13,\"matchesAll1024\":true,\"statement\":\"19 = |E| + tau - 1 = 14 + 6 - 1\"}}"
  }
 ],
 "usefulLemmas": [
  "Star upper bound (proof: explicit circuit, checked on all 1024 inputs by star6.mjs). For any graph G and any vertex cover C, the OR over v in C of x_v AND (OR over u in N(v) of x_u) computes the graph function with |C| AND gates and sum over v in C of (deg v - 1) plus |C| - 1 OR gates, so minAnd <= tau(G). For H with C = {1,3,5,7,8,10} this gives 6 AND and 16 OR gates, so conjecture (A) is exactly the statement minAnd(f_H) >= tau(H).",
  "Biclique fact (proof: the four vertices of A x B with |A|,|B| >= 2 form a 4-cycle). A graph is 4-cycle-free iff every complete bipartite subgraph is a star, so in a 4-cycle-free G an AND gate whose operands are unions of variables can only cover the edges of one star. H is 4-cycle-free (checked) and its largest complete bipartite subgraph has 4 edges, a star at vertex 8.",
  "Exact finite theorem (machine-checked, complete): for every induced subgraph of H on at most 5 vertices with at least one edge, minAnd = tau(G), minOr = |E|-1 and minSize = |E|+tau-1; 557/557 cases, 0 violations. The 80 edgeless subgraphs compute the constant-false function, which lies outside the DP universe, so their exact cost is left undecided here (CD01 reports that an out-of-range output wire reads false, which would give size 0).",
  "Exact finite theorem (machine-checked, complete): the same three equalities hold for all 548 4-cycle-free labelled graphs on 5 vertices (of 1024), all 54 on 4 (of 64) and all 8 on 3 (of 8); every graph on <=5 vertices on which one of them fails contains a 4-cycle.",
  "Degenerate-value remark: a circuit that reads a wire past the last one yields false, so the constant-false function has size 0, while the other constant is unreachable from variables by AND/OR; so the computed universe holds 2, 4, 18, 166, 7579 functions for m = 1..5, i.e. the classical Dedekind counts M(m) = 3, 6, 20, 168, 7581 minus the two constants."
 ],
 "failedApproaches": [
  "General (hypothesis-free) star theorem: refuted at 4 vertices by C4 itself (K2,2: |E|=4, tau=2, star value 5, but (x0 OR x1) AND (x2 OR x3) computes it with 1 AND and 2 OR, size 3). No hypothesis-free theorem of the form minSize = |E|+tau-1 can prove the target; a no-4-cycle hypothesis is needed, and even that is only verified up to 5 vertices.",
  "Level-indexed OR-closure (first implementation) is unsound: it closed each gate-count level under OR, charging one AND budget for two AND gates, and wrongly reports the triangle as a 1-AND function. Replaced by the shortest-hyperpath fixpoint min over decompositions of cost(a)+cost(b)+w, which is exact.",
  "A first 4-cycle test enumerated three orderings per 4-set but one of them was a repeat, so one of the three 4-cycles was missed and some C4s were classified as 4-cycle-free. Corrected by trying all six orderings; every number in this item comes from the corrected test.",
  "Extending the exact optimisation to m = 6 was rejected: |U6| = 7 828 354 monotone functions makes the pairwise fixpoint about 6e13 pair operations, far beyond this machine (4 cores, 7 GB)."
 ],
 "openObligations": [
  "P1 itself: 19 <= C.size for every IsAO2 circuit computing f. Neither proved nor refuted. H has 10 vertices, beyond the exact optimisation, so no exact value of minAnd(f_H) or minOr(f_H) is known.",
  "Conjectures (A) minAnd(f_H) >= 6 and (B) minOr(f_H) >= 13 are open; both are verified here only on induced subgraphs of at most 5 vertices, and their hypothesis-free generalisations are refuted.",
  "The intended Lean formalisation was not attempted: no Lean/Mathlib toolchain and no lean/ tree exist in this checkout. A submission-ready file would need the pinned repository, lake exe cache get, and tools/check-lean.mjs, none of which ran here.",
  "A wire-level monomial calculus (OR unites, AND multiplies) was not formalised; the planned form is: the minimal monomials of u OR v are the minimal elements of M(u) union M(v), and those of u AND v are the minimal elements of the pairwise unions P union Q."
 ],
 "nextExperiment": "Extend the 4-cycle-free law past 5 vertices without the full function universe: restrict the DP to the functions reachable from a graph function and its sub-monomials, and test all 4-cycle-free graphs on 6 vertices. In parallel prove minAnd >= tau for 4-cycle-free graphs by charging each AND gate to the star it covers and showing that in a minimal circuit two gates cannot both be charged with the same edge; that lemma plus minOr >= |E|-1 would give P1 at 19.",
 "leaseStatus": "not-acquired",
 "submissionStatus": "not-submitted"
}