{
 "agentId": "MP01",
 "group": "mathematical proofs",
 "strategyId": "MP01-structural-induction-size-parameter",
 "status": "no-progress",
 "capsule": {
  "source": "artifacts/goal/batches/e1-audit-capsule/items/la01/result.json",
  "capsuleSha256": "4fe04e442366241302299cfa515df0cbf37848cfd8692502de1c9ea556529159",
  "pilot": "P1",
  "targetId": "L-meta-18367",
  "statement": "let x1 : SimpleGraph (Fin (11 : ℕ)) := PEqualNP.EdgeOwnership.edgeGraph (11 : ℕ) [((0 : ℕ), (9 : ℕ)), ((0 : ℕ), (10 : ℕ)), ((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 : ℕ))]; ∀ (x2 : PEqualNP.CircuitLowerBounds.Circuit), PEqualNP.TopForm.IsAO2 (10 : ℕ) x2 → (∀ (x4 : Fin (10 : ℕ) → Bool), PEqualNP.MetaComplexity.circuitFun (10 : ℕ) x2 x4 = PEqualNP.MetaComplexity.NestedCover.graphFun x1 ∅ (Fin.insertNth (0 : Fin (11 : ℕ)) Bool.false x4)) → (19 : ℕ) ≤ x2.size",
  "statementUtf8Sha256": "9c8662943df407b07492b78a3ba2d6d036b1c592694d93afce0f264b602535b2",
  "statementBytes": 785,
  "imports": [
   "PEqualNP.Defs"
  ],
  "module": "PEqualNP.Outside.L_meta_18367",
  "file": "lean/PEqualNP/Outside/L_meta_18367.lean",
  "kind": "check",
  "repository": "https://github.com/open-goat/pequalnp-proofs",
  "commit": "8dec1cacf8aab169f12858fff3a2e945fea7a880",
  "lean": "leanprover/lean4:v4.36.0",
  "mathlibRevision": "fc4f59e577feb1a4956671bc04ac18aaaf8cd842",
  "auditedRecipe": {
   "checkerInvocation": "node tools/check-lean.mjs <lean file> <exact statement file> [check|refute|reduce]",
   "formatInvocation": [
    "node .github/scripts/outside-guard.mjs gap <row.json> <gap-id> <path> <output-directory> <kind>",
    "node .github/scripts/outside-guard.mjs imports <proof.lean> <output-directory>/imports.json <path> <kind>",
    "node .github/scripts/outside-guard.mjs closure . <output-directory>/imports.json <path> <output-directory> <kind>"
   ],
   "checkerExitMeaning": {
    "0": "accepted",
    "1": "rejected",
    "3": "checker fault",
    "137": "detected memory termination"
   }
  },
  "keyFileHashes": {
   "tools/pnp.sh": "acc99e865dc8d5fbffe07b3f896035e7e28c8acfd180c588e78ce3374eb1d207",
   "tools/build.sh": "0ddbc90616593ec69d54a4154be17af1f79b876db03cb3f0f16f691e3ca693a3",
   "tools/bin/lake": "cb93d28f2d24e6fbff5fcd5bd408b54184119040b254a5e25c11cfb9e41a1cac",
   "tools/check-lean.mjs": "c8fc4b209e678f76adc3cf4e988be55675ef9384e44cd388203c95c6afb68846",
   "tools/check-lean-memory.mjs": "830f1cd590480fee8ee79157d1e3c3f275159e7d826d8bc726917cecebd42da8",
   "lean/CheckLemma.lean": "86997b026ef2b80d738df77f4c214166cf5b0b2ea8cc98d4bd3c8b5e420dbdd5",
   "lean/lean-toolchain": "582a63f8f9c5128067b688778c1051cf1464c3ca9d57b9325025c051c29b774a",
   "lean/lakefile.toml": "ee756ab61cf24d2fd5f561d89080cf162e34f35b06d9b6101bc680ef1619a7bf",
   "lean/lake-manifest.json": "d0af863cde532caaef1b1bee0d63ec47100208e33e488309cb80abc88b8f1509",
   ".github/scripts/outside-guard.mjs": "738adeb889cb829a2dc359d970249e7723d5698d87ccd6819b2f82c6a83bf535"
  },
  "definitionFilesRefetchedAndHashMatched": {
   "lean/PEqualNP/Defs/CircuitLowerBounds.lean": "695e454d3e424e2cae4fa4677741681eac11de0462d0d9bc087a0e6a6ba03f69",
   "lean/PEqualNP/Defs/TopForm.lean": "8a8ddba048b66d46a1bdf0a3e8aaedfad821b582149544bfd1ff49f970ad7058",
   "lean/PEqualNP/Defs/MetaComplexityMinimal.lean": "d2d1cce5cd4a6b25815147cdf37d09436c2b50e6a528bb4b4bb687b6f4ffaabc",
   "lean/PEqualNP/Defs/NestedCoverCircuit.lean": "caee1d86e772be38b0354924e9ebb682285f602b4946b1592fd661fd2fe69571",
   "lean/PEqualNP/Defs/EdgeOwnership.lean": "0322df743719c32de60a30b67ae1b9eab7996392e6928581c1b4b25dcb083d97"
  }
 },
 "derivation": {
  "setting": "f = graphFun x1 ∅ ∘ Fin.insertNth 0 false on 10 inputs; input i is original vertex i+1. Restricted graph H: 14 edges (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); min degree 2, no leaves; tau(H)=6 (capsule). Model IsAO2: AND/OR only, reads earlier wires, exactly 2 inputs; size = gates.length; output may be any wire.",
  "sizeParameter": "Induct on the number of essential variables of a monotone function g (natural size parameter), proving size(C) >= LB(g) for every IsAO2 circuit C computing g. Because restriction x_v:=1 turns graphFun K A into graphFun (K-v) (A ∪ N(v)), the hypothesis must range over the closed family of all restrictions (the A-parameter of graphFun), not over graphFun K ∅ alone.",
  "normalization": "WLOG C is size-minimal for g. Then (N1) no dead gate other than the output path, (N2) no gate reads the same wire twice (AND/OR(w,w)=w can be bypassed), (N3) every essential variable has fan-out >= 1. Each normalization only lowers size, so a lower bound for minimal circuits is a lower bound for all.",
  "baseLemma": "(B0) If g is constant or a projection x_i, LB=0 (an IsAO2 circuit may output an input wire). (B1) If g is neither, size >= 1: the output must be a gate. In particular a single edge x_u∧x_v needs >= 1 gate, matching the upper bound 1.",
  "sizeReductionLemma": "(R) For essential v with fan-out k in a minimal C and c∈{0,1}: setting x_v:=c makes all k distinct readers constant or pass-through, so after constant propagation and bypassing, an IsAO2 circuit (or a constant, when g|v=c is constant) for g|v=c remains with size <= size(C)-k. Refinements for k=1 with reader r: (R-AND) r=AND(x_v,h) not output: x_v:=0 makes r≡0, and r's reader (exists by N1, distinct from r) is also eliminated: size >= 2+LB(g|v=0); and x_v:=1 gives size >= 1+LB(g|v=1). (R-OR) dual with roles of 0/1 swapped. (R-outAND) r is the output AND: forces g|v=0 ≡ 0, size >= 1+LB(g|v=1). (R-outOR) forces g|v=1 ≡ 1, size >= 1+LB(g|v=0). Hence LB(g) = max(1, max_v min_cases) with cases {2+max(L0,L1); max(2+L0,1+L1); max(2+L1,1+L0); 1+L1 if g|v=0≡0; 1+L0 if g|v=1≡1} is a valid lower bound by induction on the number of essential variables (each restriction strictly reduces it).",
  "computedResult": "Evaluating this recursion exactly over all reachable restrictions of the target (3797 distinct functions, memoized on 1024-entry truth tables) gives LB(target)=12. For every first variable v: LB(f|v=0)=11, LB(f|v=1)=10, step bound 12. Soundness regression: on all 203 nonempty induced 4-vertex subgraphs, LB <= exact AO2 cost (exact by BFS as in LA01) with 0 violations; LB equals the exact cost in 182 cases and is 1 short in 21.",
  "obstruction": "Structural induction with one-variable gate elimination, using only the case analysis (R), cannot certify the target: its best certified value on this exact function is 12, which is 7 short of 19. 19 = |E|+tau-1 = 14+6-1 is the star-form cost, and the upper witness meets it. Reason: each elimination step can only be charged about 2 gates per variable (fan-out >= 2, or one reader plus its cascade). Ten variables then give about 2n-O(1) at best, and the x_v:=1 branch removes N(v) as OR-absorbed variables, which ends the recursion early. To reach 19, a reduction step must charge deg_H(v) + (tau(H) - tau(H-v)) gates to a vertex. That needs a structural count of the AND gates that carry the edges at v (an edge-ownership/cone argument), not fan-out counting."
 },
 "novelty": {
  "priorSources": [
   "LA01 capsule: star-class inference (19 within the OR-of-stars class only), 4-vertex exact search, 18-gate one-witness-neighbourhood search (0 hits), monotone boundary reduction",
   "pinned PEqualNP.Defs (graphFun with A-parameter, IsAO2)"
  ],
  "comparison": "LA01's 19 holds only inside a restricted circuit class, and its searches cover finite neighbourhoods and 4-vertex subgraphs. Neither gives an unconditional bound for all IsAO2 circuits on 10 inputs. The trivial essential-variable bound is n-1=9.",
  "claim": "New: an explicit, all-circuit gate-elimination induction (base B0/B1, reduction R over the restriction-closed graphFun K A family). Derived informally, not Lean-formalized. Exact evaluation on the target shows it certifies 12 >= 9 trivial and is capped at 12, so the gap of 7 to the target is a precise obstruction for this strategy. This is not a proof of the target, and nothing here bears on P vs NP."
 },
 "artifacts": [
  {
   "path": "test/scratch/exp/ge.mjs (exploratory, not a submission file)",
   "content": "// Gate-elimination lower bound LB(f) for minimal IsAO2 circuits (exploratory, not a proof file).\n// Restricted target: original vertex 0 := false, inputs i=0..9 are original vertices i+1.\nconst E0=[[0,9],[0,10],[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 E=E0.filter(([u,v])=>u&&v).map(([u,v])=>[u-1,v-1]);\nconst N=10, M=1<<N;\nconst base=new Uint8Array(M); for(let x=0;x<M;x++) base[x]=E.some(([u,v])=>(x>>u&1)&&(x>>v&1))?1:0;\nconst memo=new Map(); let calls=0;\nfunction restrictTT(tt,v,c){const r=new Uint8Array(M);for(let x=0;x<M;x++){const y=c?(x|1<<v):(x&~(1<<v));r[x]=tt[y];}return r;}\nfunction key(tt){let s='';for(let i=0;i<M;i+=8){let b=0;for(let j=0;j<8;j++)b|=tt[i+j]<<j;s+=String.fromCharCode(b);}return s;}\nfunction ess(tt,v){for(let x=0;x<M;x++) if(!(x>>v&1) && tt[x]!==tt[x|1<<v]) return true; return false;}\nfunction isConst(tt,c){for(let x=0;x<M;x++) if(tt[x]!==c) return false; return true;}\nfunction LB(tt){\n  const k=key(tt); if(memo.has(k)) return memo.get(k); calls++;\n  const es=[]; for(let v=0;v<N;v++) if(ess(tt,v)) es.push(v);\n  let res;\n  if(es.length===0) res=0;\n  else if(es.length===1 && tt.every((b,x)=>b===(x>>es[0]&1))) res=0; // projection: size 0 possible\n  else {\n    res=1;\n    for(const v of es){\n      const f0=restrictTT(tt,v,0), f1=restrictTT(tt,v,1);\n      const l0=LB(f0), l1=LB(f1);\n      const cases=[2+Math.max(l0,l1), Math.max(2+l0,1+l1), Math.max(2+l1,1+l0)];\n      if(isConst(f0,0)) cases.push(1+l1);\n      if(isConst(f1,1)) cases.push(1+l0);\n      res=Math.max(res,Math.min(...cases));\n    }\n  }\n  memo.set(k,res); return res;\n}\nconst t0=Date.now(); const r=LB(base);\nconsole.log(JSON.stringify({edges:E.length,LB_target:r,distinctFunctions:memo.size,ms:Date.now()-t0}));\n// witness check (from capsule upperWitness), all 1024 inputs\nconst 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],['and',6,17],['or',3,8],['and',7,19],['or',1,3],['or',21,5],['and',9,22],['or',11,13],['or',24,16],['or',25,18],['or',26,20],['or',27,23]];\nlet ok=true; for(let x=0;x<M;x++){const w=[];for(let i=0;i<N;i++)w.push(x>>i&1);for(const[o,a,b]of W)w.push(o==='and'?w[a]&w[b]:w[a]|w[b]); if(w[28]!==base[x]) ok=false;}\nconsole.log(JSON.stringify({witnessGates:W.length,witnessMatches1024:ok}));\n// per-vertex first-step bound\nfor(let v=0;v<N;v++){const l0=LB(restrictTT(base,v,0)),l1=LB(restrictTT(base,v,1));console.log(JSON.stringify({input:v,origVertex:v+1,LB_f0:l0,LB_f1:l1,stepBound:Math.min(2+Math.max(l0,l1),Math.max(2+l0,1+l1),Math.max(2+l1,1+l0))}));}\n",
   "sha256": "273fdb0427ac9ed1a12868dabe7b658538600c37afec7d69d3d564c630e1c801",
   "role": "exploratory-program",
   "statement": "Computes gate-elimination recursion LB on the restricted target; checks the capsule's 19-gate witness on 1024 inputs",
   "relationToTarget": "Certifies the obstruction value 12 for this strategy; not a Lean proof"
  },
  {
   "path": "test/scratch/exp/small.mjs (exploratory, not a submission file)",
   "content": "// Soundness regression: LB (same recursion, n=4) <= exact AO2 cost (BFS, as in LA01) on every nonempty induced 4-vertex subgraph.\nconst E=[[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 n=4,M=1<<n,FULL=(1<<M)-1;\nconst inputs=[...Array(n)].map((_,v)=>{let t=0;for(let x=0;x<M;x++)if(x>>v&1)t|=1<<x;return t;});\nfunction tt(es){let t=0;for(let x=0;x<M;x++)if(es.some(([u,v])=>(x>>u&1)&&(x>>v&1)))t|=1<<x;return t;}\nconst memo=new Map();\nfunction restrict(t,v,c){let r=0;for(let x=0;x<M;x++){const y=c?(x|1<<v):(x&~(1<<v));if(t>>y&1)r|=1<<x;}return r>>>0;}\nfunction LB(t){t>>>=0;if(memo.has(t))return memo.get(t);const es=[...Array(n).keys()].filter(v=>restrict(t,v,0)!==restrict(t,v,1));let r;\n if(!es.length)r=0;else if(es.length===1&&t===inputs[es[0]])r=0;else{r=1;for(const v of es){const f0=restrict(t,v,0),f1=restrict(t,v,1),l0=LB(f0),l1=LB(f1);const c=[2+Math.max(l0,l1),Math.max(2+l0,1+l1),Math.max(2+l1,1+l0)];if(f0===0)c.push(1+l1);if(f1===(FULL>>>0))c.push(1+l0);r=Math.max(r,Math.min(...c));}}\n memo.set(t,r);return r;}\n// exact BFS\nconst want=new Map();const combos=[];const vs=[...Array(10)].map((_,i)=>i+1);\nfunction* comb(a,k,s=0,p=[]){if(p.length===k){yield p.slice();return;}for(let i=s;i<a.length;i++){p.push(a[i]);yield* comb(a,k,i+1,p);p.pop();}}\nfor(const S of comb(vs,4)){const es=E.filter(([u,v])=>S.includes(u)&&S.includes(v)).map(([u,v])=>[S.indexOf(u),S.indexOf(v)]);if(es.length)combos.push(tt(es)>>>0);}\nconst missing=new Set(combos);const cost=new Map();let frontier=new Map([[inputs.slice().sort((a,b)=>a-b).join(','),inputs]]);\nfor(let d=1;missing.size&&d<=6;d++){const next=new Map();for(const fs of frontier.values()){for(let i=0;i<fs.length;i++)for(let j=i+1;j<fs.length;j++)for(const c of [(fs[i]&fs[j])>>>0,(fs[i]|fs[j])>>>0]){if(fs.includes(c))continue;if(missing.has(c)){cost.set(c,d);missing.delete(c);}const nf=[...fs,c].sort((a,b)=>a-b);next.set(nf.join(','),nf);}}frontier=next;}\nlet viol=0;const gap={};for(const t of combos){const ex=cost.get(t),lb=LB(t);if(lb>ex)viol++;const g=ex-lb;gap[g]=(gap[g]||0)+1;}\nconsole.log(JSON.stringify({samples:combos.length,unresolved:missing.size,violations:viol,gapExactMinusLB:gap}));\n",
   "sha256": "04ada7e9dc20f040da5fb44bec5e3845754dc4a259f72c3bb977ac6c23e31a78",
   "role": "exploratory-program",
   "statement": "Soundness regression LB <= exact AO2 cost on all 203 nonempty induced 4-vertex subgraphs",
   "relationToTarget": "Finite sanity check of the recursion only; proves nothing about 10 inputs"
  }
 ],
 "experiments": [
  {
   "program": "ge.mjs",
   "range": "all reachable restrictions of the 10-input target (3797 distinct functions); all 1024 inputs for witness",
   "seed": null,
   "command": "node ge.mjs",
   "exitCode": 0,
   "observedOutput": "{\"edges\":14,\"LB_target\":12,\"distinctFunctions\":3797,\"ms\":289} {\"witnessGates\":19,\"witnessMatches1024\":true}; every input v: LB_f0=11, LB_f1=10, stepBound=12"
  },
  {
   "program": "small.mjs",
   "range": "203 nonempty induced 4-vertex subgraphs of H",
   "seed": null,
   "command": "node small.mjs",
   "exitCode": 0,
   "observedOutput": "{\"samples\":203,\"unresolved\":0,\"violations\":0,\"gapExactMinusLB\":{\"0\":182,\"1\":21}}"
  }
 ],
 "verification": [],
 "verificationNote": "No Lean artifact was produced, so the format guard, tools/check-lean.mjs and lake build were not run. The Lean/Mathlib toolchain was not installed in this run: LA01 recorded multi-minute checker timeouts (exit 124/130), and this run's whole budget was 54 minutes. The definition files were refetched from the pinned commit and their hashes match the capsule.",
 "unresolved": [
  "Lean formalization of base lemma B1 and reduction lemma R (constant propagation/bypass preserving IsAO2 and circuitFun) under the pinned defs",
  "The 19-gate lower bound itself: open; this strategy certifies only 12",
  "Whether a stronger per-vertex charge deg(v)+Δtau holds for minimal IsAO2 circuits of graphFun K A"
 ],
 "usefulLemmas": [
  "Restriction closure: graphFun K A |x_v=1 = graphFun (K-v) (A∪N_K(v)), and |x_v=0 = graphFun (K-v) (A\\{v}). Induction must use the A-parameter",
  "Minimal IsAO2 circuits WLOG have no duplicate-operand gates and no dead gates",
  "Reduction R: size(C) >= fanout(v) + L(g|v=c), with the k=1 AND/OR cascade refinements"
 ],
 "failedApproaches": [
  "Unit gate elimination (x_v:=0 removes >=1 gate): gives 9",
  "Full single-variable case analysis R: gives 12 (exact evaluation), not 19"
 ],
 "nextExperiment": "Strengthen R with a cone/ownership charge: for each edge uv, the first AND gate whose cone contains both x_u and x_v. Show that x_v:=0 eliminates at least deg_H(v) such gates plus tau-drop OR joins in minimal IsAO2 circuits, and test it by computing exact minima on 5-vertex induced subgraphs. Then formalize B1 and R in Lean against PEqualNP.Defs as a separate supporting module.",
 "leaseStatus": "not-acquired",
 "submissionStatus": "not-submitted"
}