{
 "agent": "IV08",
 "focus": "witness rederivation: frontier points, excluded lengths, invariants on small graphs, vacuity of lemma hypotheses against real 19/20-entry lists; fresh replay of every candidate",
 "gap": "L-meta-18647",
 "status": "reviewed-no-exact-proof",
 "summary": "No candidate proves the official statement; nothing is approved for the gap and nothing is submission-ready. LA08's Lean file (sha256 af34aee1..., recomputed) is a companion: byte-identical to the official formal_statement except that the length bound 18 is lowered to 7. In a fresh clone of the pin with the pinned bundle, the guard exits 0 and the file builds; my own elaboration shows its last theorem has the length-7 type and does NOT have the official type (Type mismatch), with axioms propext, Classical.choice, Quot.sound only. Both of my check-lean runs (companion and official) ended in exit 3, CHECKER FAULT, verifier killed with exit 137 at about 6.5 GB on a 7.9 GB machine: an environment fault, not a rejection. Recomputed: the partition bound is exactly 7 (an 8-entry valid list already depends on all ten inputs); E has 15 minimal true points (the edges) and 15 maximal false points (maximal independent sets, 10 of size 3 and 5 of size 4); girth 5. MP08's forced-head claim is false (x1&&x2 is an admissible head). CD08's closure counts are reproduced but under a rule looser than the official one (official counts 43/937/332201). New: a valid 25-entry list satisfying every premise contains E, so the true minimum lies in 8..25 by kernel proof plus my program, and the official claim (none in <= 18) is open in 8..18.",
 "pins": {
  "repo": "https://github.com/open-goat/pequalnp-proofs",
  "commit": "8dec1cacf8aab169f12858fff3a2e945fea7a880",
  "lean": "leanprover/lean4:v4.36.0 (lean/lean-toolchain at the pin)",
  "bundle": "release pequalnp-e125f04d0dc6 of github.com/Identity-md/lean-bundles: lean-4.36.0-linux.tar.zst 2b7ab1ed..., packages 69b68c74..., pequalnp e35eea43... (all three sha256 recomputed equal to the release table)",
  "packages": "bundle packages placed in lean/.lake/packages; each given a git dir whose HEAD is the manifest rev (lake warns \"repository has local changes\"); mathlib fc4f59e5...; PEqualNP.Defs and the module built from the pin by check-lean",
  "env": "PEQUALNP_REAL_LAKE=<bundle lake>, PEQUALNP_HOME=<scratch>; checker, lakefile, manifest, toolchain unchanged (git status clean except the judged file)"
 },
 "official": {
  "statementSha256": "d6b0ea1cb0acf29a540e253aee4295d896fe42286ed3f9e266a956da19cc971e",
  "statementBytes": 2052,
  "record": "https://data.pequalnp.com/data/lemma/L-meta-18647.fdb8d5f3407a.json (statement_hash sha256:d6b0ea1cb0acf29a540e253aee4295d896fe42286ed3f9e266a956da19cc971e, recomputed over formal_statement; record status conjecture, kind helper)",
  "desk": {
   "state": "open",
   "time": "2026-11-26T07:28:58Z",
   "url": "https://pequalnp.com/desk/step?gap=L-meta-18647",
   "note": "one read-only GET; no lease"
  },
  "upstreamDuplicate": "none: no lean/PEqualNP/Outside/L_meta_18647.lean at the pin, and raw.githubusercontent.com at main returns 404 (main HEAD ef66f816... at about 07:45 UTC); the Petersen list appears at the pin only in reduction files R_meta_7103_428, R_meta_7103_813, R_meta_7105_2 for other gaps"
 },
 "register": [
  {
   "contributor": "LA08",
   "path": "lean/PEqualNP/Outside/L_meta_18647.lean",
   "fileSha256": "af34aee15a8036f307781b28994be170659dc89c2f88a4fbd399fce89b5a8724",
   "fileSha256Recomputed": "af34aee15a8036f307781b28994be170659dc89c2f88a4fbd399fce89b5a8724",
   "statement": "official text with the single substring \"x2.length ≤ (18 : ℕ)\" replaced by \"x2.length ≤ (7 : ℕ)\"; companion statement sha256 ceb269c03af27389929cefc0df9df8895e5018ed56095aeddb9a0e9f402cb524 (recomputed)",
   "equalsOfficial": false,
   "binderComparison": "Recomputed: replacing the one occurrence of \"(18 : ℕ)\" in the official 2,052-byte formal_statement by \"(7 : ℕ)\" gives the companion bytes exactly. So x1 (15 Petersen edges), x2 binder, the step premise (x4, x5 base list false::true::ofFn inputs ++ [x0&&x1] ++ take x4, newness, AND/OR generation), the head-OR premise, the forbidden-gate premise (x8 ≠ x9 -> (non-edge -> not AND) and not OR) and the conclusion are identical; only the length bound differs (7 instead of 18). The companion is strictly weaker than the official statement.",
   "claimType": "companion",
   "hypotheses": "The proof uses only the length bound and the generation half of the step premise (each entry is AND/OR of earlier entries or the base); newness, the head-OR premise and the forbidden-gate premise are introduced and unused. Vacuity test: on real 19- and 20-entry lists that satisfy every premise (my program, iv08.py), the lemma hypotheses hB (base labelled by c0, blocks {0,1},{2},..,{9}), hstep and card = 9 all hold and the block invariant (blocks >= 9 - n) holds at every step; only hlen (<= 7) fails, as it must. On my 25-entry list that contains E, blocks reach 1 after step 12, consistent with the bound.",
   "originality": "no file L_meta_18647.lean at the pin or on main (raw.githubusercontent 404 on main; absent in the pinned tree); the same Petersen list occurs at the pin only in reduction files R_meta_7103_428, R_meta_7103_813, R_meta_7105_2 (other gaps, no free x0&&x1 base entry); not a duplicate. The partition/dependence argument is standard, its formalisation here is the contributor's.",
   "authorChecks": "author reports: guard (imports) exit 0; check-lean check vs companion exit 0 ACCEPTED with axioms [propext, Quot.sound, Classical.choice]; check-lean check vs official exit 1 REJECTED (statement)",
   "freshReplay": {
    "guard": {
     "command": "node .github/scripts/outside-guard.mjs imports lean/PEqualNP/Outside/L_meta_18647.lean imports.json([\"PEqualNP.Defs\"]) lean/PEqualNP/Outside/L_meta_18647.lean check",
     "exitCode": 0,
     "output": "imports allowed: Mathlib"
    },
    "build": "passed: inside check-lean, lake build +PEqualNP.Outside.L_meta_18647 +PEqualNP.Defs in a fresh clone of the pin (file placed from the embedded bytes, sha256 recomputed af34aee1...) completed; the checker reached its verifier stage at t=179s (first run) without a build error",
    "checkLean": [
     {
      "statementFile": "len-7 companion text (sha256 ceb269c03af27389929cefc0df9df8895e5018ed56095aeddb9a0e9f402cb524)",
      "mode": "check",
      "exitCode": 3,
      "lastLine": "CHECKER FAULT: the verifier ended without a verdict (exit 137).",
      "class": "environment fault (memory): verifier killed at about 6.6 GB peak RSS on a 7.9 GB machine; says nothing about the proof"
     },
     {
      "statementFile": "official formal_statement (sha256 d6b0ea1cb0acf29a540e253aee4295d896fe42286ed3f9e266a956da19cc971e)",
      "mode": "check",
      "exitCode": 3,
      "lastLine": "CHECKER FAULT: the verifier ended without a verdict (exit 137).",
      "class": "environment fault (memory), peak about 6.5 GB; no verdict"
     }
    ],
    "ownElaboration": "lake env lean on a separate file importing the built module: `theorem iv08_chk7 : <len-7 text> := PEqualNP.Outside.L_meta_18647` elaborates (no error); `theorem iv08_chk18 : <official text> := PEqualNP.Outside.L_meta_18647` fails with \"Type mismatch ... x2.length ≤ 7 ... but is expected to have type ... x2.length ≤ 18\". The type check is defeq-level, weaker than the checker's own statement comparison.",
    "axioms": "#print axioms: PEqualNP.Outside.L_meta_18647, .len7, .core, .head_not_forced -> [propext, Classical.choice, Quot.sound]; .head_or_vacuous -> [propext, Quot.sound]. No sorryAx.",
    "textScan": "no sorry, admit, native_decide, axiom, opaque, implemented_by, extern, unsafe, macro, elab or set_option in the file; one import (Mathlib); helpers in namespace PEqualNP.Outside.L_meta_18647; last declaration is theorem PEqualNP.Outside.L_meta_18647"
   },
   "acceptanceScope": "companion only (length <= 7). Not a proof of L-meta-18647. My fresh check-lean could not reach a verdict (memory fault), so the author's ACCEPTED (companion) and REJECTED (exact) lines are corroborated only by my elaboration and axiom report, not by a checker verdict of mine.",
   "remaining": "rerun check-lean on a machine with more than 8 GB memory for both statement files; the exact statement (length <= 18) is open."
  },
  {
   "contributor": "LA08",
   "path": "lean/PEqualNP/Outside/L_meta_18647.lean (helpers head_or_vacuous, head_not_forced)",
   "fileSha256": "af34aee15a8036f307781b28994be170659dc89c2f88a4fbd399fce89b5a8724",
   "statement": "head_or_vacuous: ∀ f : BF, ∃ g h : BF, f = fun x => g x || h x; head_not_forced: ∀ i : Fin 10, (fun x => x 1 && x 2) ≠ fun x => x i || (x 0 && x 1)",
   "equalsOfficial": false,
   "claimType": "helper",
   "hypotheses": "none beyond types; my program confirms [x1&&x2] is a valid one-entry list under every premise and is not x_i || (x0&&x1) for any i",
   "originality": "new observation in this batch",
   "authorChecks": "author: elaboration exit 0, #print axioms",
   "freshReplay": {
    "guard": "exit 0 (same file)",
    "build": "passed (same file)",
    "checkLean": "not applicable (checker judges only the last theorem)",
    "axioms": "head_or_vacuous [propext, Quot.sound]; head_not_forced [propext, Classical.choice, Quot.sound]"
   },
   "acceptanceScope": "helper facts; kernel-checked in my elaboration",
   "remaining": "none"
  },
  {
   "contributor": "MP08",
   "path": null,
   "fileSha256": null,
   "statement": "the first entry of any admissible x2 is x_i || (x0 && x1) for some i in 2..9",
   "equalsOfficial": false,
   "claimType": "evidence",
   "hypotheses": "reads the head-OR premise as if it required an OR of base entries other than trivial ones; in the formal statement the premise is ∃ x7 x8, head = fun x => x7 x || x8 x, satisfied by x7 = x8 = head",
   "originality": "n/a",
   "authorChecks": "hand argument, not formalised",
   "freshReplay": {
    "guard": "not-run",
    "build": "not-run",
    "checkLean": "not-run",
    "axioms": "not-run",
    "ownProgram": "refuted: [x1&&x2] satisfies every premise (iv08.py head_x1x2_valid_first = true, equals x_i||(x0&&x1) for no i); also kernel-checked via LA08 head_not_forced and head_or_vacuous"
   },
   "acceptanceScope": "mathematical rejection (false claim)",
   "remaining": "drop it; any argument built on a forced head is invalid"
  },
  {
   "contributor": "MP08",
   "path": "test/scratch/mincirc.py (embedded)",
   "fileSha256": "6488d9b71dec956eeb109ea5221e3ca9f29bf4aff68e192bfd703f48cdb4ac2f",
   "fileSha256Recomputed": "6488d9b71dec956eeb109ea5221e3ca9f29bf4aff68e192bfd703f48cdb4ac2f",
   "statement": "exact minimum list lengths on small graphs (plain / free first-edge AND / free + OR head)",
   "equalsOfficial": false,
   "claimType": "evidence",
   "hypotheses": "rules: AND only on edges at input level, no OR of two distinct inputs, new entries; matches the formal forbidden-gate premise",
   "originality": "n/a",
   "authorChecks": "author ran mincirc.py",
   "freshReplay": {
    "guard": "not-run",
    "build": "not-run",
    "checkLean": "not-run",
    "axioms": "not-run",
    "ownProgram": "my independent IDDFS (small.py, not their code): plain/free = P3 3/2, K3 5/4, P4 5/4, K1,3 4/3, 2K2 3/2, C4 7/6, K4 7/6, P5 6/5 -- all agree with MP08. 3K2 and the OR-head column not recomputed; the OR-head column models a rule that the formal statement does not impose (the head premise is vacuous)."
   },
   "acceptanceScope": "evidence on small graphs only; no bound on Petersen",
   "remaining": "3K2 not rerun"
  },
  {
   "contributor": "CT08",
   "path": "test/scratch/restrict.js (embedded)",
   "fileSha256": "a0f058892fdb254fa380c8b640ccc138cda46abb2025d03ad7c80f1ffc4f4283",
   "fileSha256Recomputed": "a0f05889... equals sha256 of the embedded completeContent plus one trailing newline; of the bytes exactly as embedded it is 22f44214...",
   "statement": "restricting one Petersen input to false leaves 13 distinct restricted edge functions of 15; to true, 15",
   "equalsOfficial": false,
   "claimType": "evidence",
   "hypotheses": "concerns the 15 edge monomials only, not arbitrary list entries (author says so)",
   "originality": "n/a",
   "authorChecks": "author ran restrict.js (vertices 0 and 1)",
   "freshReplay": {
    "guard": "not-run",
    "build": "not-run",
    "checkLean": "not-run",
    "axioms": "not-run",
    "ownProgram": "their script rerun: v0/v1 = 13 (false), 15 (true), total-assignment range 1..2; my own truth-table program (iv08.py) confirms 13/15 for every one of the ten vertices. The 1..2 range is trivial (a total assignment makes every function constant)."
   },
   "acceptanceScope": "true finite fact; no consequence for the gap shown",
   "remaining": "none"
  },
  {
   "contributor": "CD08",
   "path": "scratch/closure.py (embedded)",
   "fileSha256": "55a0b55b4092fd234e7e09b2bcc5ab0c6b3d969dd594ca493d6dbea83854092a",
   "fileSha256Recomputed": "55a0b55b4092fd234e7e09b2bcc5ab0c6b3d969dd594ca493d6dbea83854092a",
   "statement": "layered AND/OR closure of the 13 base functions has 58 / 1,870 / 1,319,442 functions after 1/2/3 layers and >4.19M after 4; E in none",
   "equalsOfficial": false,
   "claimType": "evidence",
   "hypotheses": "closure.py forbids AND and OR only for NON-adjacent input pairs; the official premise forbids the OR of EVERY distinct input pair. The looser rule gives a superset, so \"E absent\" still transfers to the official rules.",
   "originality": "n/a",
   "authorChecks": "author ran closure.py",
   "freshReplay": {
    "guard": "not-run",
    "build": "not-run",
    "checkLean": "not-run",
    "axioms": "not-run",
    "ownProgram": "my program reproduces 58 / 1870 / 1319442 exactly under CD08's rule; under the official rule the counts are 43 / 937 / 332201; E absent in both through layer 3. Layer 4 not recomputed."
   },
   "acceptanceScope": "true finite fact; it excludes E only from lists of length <= 4 (a length-k list has depth <= k), far weaker than the kernel-checked length-7 companion",
   "remaining": "counts as stated are for a non-official rule; relabel them"
  },
  {
   "contributor": "CD08",
   "path": "scratch/indep.py (embedded)",
   "fileSha256": "325b192566e895386123b5052a0b2a3ab47c9bec57ce1cd228fd34b9584112da",
   "fileSha256Recomputed": "325b192566e895386123b5052a0b2a3ab47c9bec57ce1cd228fd34b9584112da",
   "statement": "Petersen has girth 5 and exactly 15 maximal independent sets (10 of size 3, 5 of size 4); the distributive construction is blocked and no construction of length <= 29 was found",
   "equalsOfficial": false,
   "claimType": "evidence",
   "hypotheses": "graph facts; construction claim is a search report",
   "originality": "n/a",
   "authorChecks": "author ran indep.py",
   "freshReplay": {
    "guard": "not-run",
    "build": "not-run",
    "checkLean": "not-run",
    "axioms": "not-run",
    "ownProgram": "confirmed: 0 triangles, 0 4-cycles, 15 maximal independent sets (10x3, 5x4), equal to the maximal false points of E; 15 minimal true points, exactly the edges. The \"no construction <= 29\" dead end is superseded: x_c && ((x_c&&x_a)|x_b|x_d) builds a 3-edge star in 4 entries without any input-pair OR, giving a valid 25-entry list ending in E (see counterexamples)."
   },
   "acceptanceScope": "graph facts true; construction dead end superseded",
   "remaining": "none"
  }
 ],
 "findings": [
  "Partition/dependence bound recomputed: the base has 9 dependence blocks ({0,1} joined by x0&&x1); each gate merges at most two; E depends on all 10 inputs, so E needs >= 8 entries. Tight for that argument: the valid list x2&x3, (x2&x3)|(x0&x1), then |x4 ... |x9 (8 entries) ends in a function depending on all 10 inputs. Length 8 needs a non-read-once argument (LA08 forNext).",
  "Frontier points: minimal true points of E = the 15 edges; maximal false points = 15 maximal independent sets (10 of size 3, 5 of size 4); independence number 4; E monotone.",
  "The head-OR premise is vacuous (any f = f||f); the forbidden-gate premise forbids the OR of every distinct input pair and the AND of non-adjacent pairs. Both CD08 (OR only for non-adjacent pairs) and MP08 (forced head) used readings that differ from the formal text.",
  "Real 19- and 20-entry lists satisfying every premise exist (random, seeded, iv08.py); none contains E; on them the LA08 lemma hypotheses hold and the invariant holds; the premises are therefore not vacuous at those lengths.",
  "Upper bound: a valid 25-entry list containing E exists (vertex cover {1,3,4,5,6,7}, stars built as x_c && ((x_c&&x_a)|x_b|...), then 5 ORs). Its 19- and 20-entry prefixes are valid lists too.",
  "No candidate gives any excluded length above 7. The \"exclusion at length 10\" and \"satisfiable at length 18\" mentioned by CD08 as earlier reports have no source among the handed results that I could locate; not verified."
 ],
 "counterexamples": [
  {
   "to": "MP08 forced-head claim",
   "witness": "x2 = [fun x => x 1 && x 2]: new, AND of two base inputs on an edge, head-OR premise holds with g = h = head, not equal to x_i || (x0&&x1) for any i",
   "checkedBy": "iv08.py; LA08 head_not_forced/head_or_vacuous kernel-checked in my elaboration"
  },
  {
   "to": "CD08 dead end \"no construction <= 29\"",
   "witness": "valid 25-entry list ending in E",
   "gates": [
    "g1=x1&x0 is the free base entry (not listed)",
    "1:(x1&x0)|x2",
    "2:#1|x6",
    "3:x1&#2",
    "4:x3&x2",
    "5:#4|x4",
    "6:#5|x8",
    "7:x3&#6",
    "8:x4&x0",
    "9:#8|x9",
    "10:x4&#9",
    "11:x5&x0",
    "12:#11|x7",
    "13:#12|x8",
    "14:x5&#13",
    "15:x6&x9",
    "16:#15|x8",
    "17:x6&#16",
    "18:x7&x2",
    "19:#18|x9",
    "20:x7&#19",
    "21..25: OR of the six star terms #3,#7,#10,#14,#17,#20 (5 ORs; #25 = E)"
   ],
   "checkedBy": "iv08.py valid() over 1024-row truth tables: every entry new, generated from earlier entries, not forbidden; last = E"
  },
  {
   "to": "L-meta-18647 itself",
   "witness": "none found; the 25-entry list does not refute it (25 > 18)"
  }
 ],
 "faultsVsRejections": {
  "environmentFaults": [
   "check-lean on LA08 file vs companion statement: exit 3, verifier exit 137 (memory), 5:35 wall, peak RSS 6.63 GB",
   "check-lean on LA08 file vs official statement: exit 3, verifier exit 137 (memory), 2:35 wall, peak 6.46 GB",
   "lake warns \"repository has local changes\" for the nine packages (git dirs made for the bundle copies); build proceeded"
  ],
  "mathematicalRejections": [
   "LA08 file is not a proof of the official statement: Lean Type mismatch (7 vs 18) in my elaboration; author reports check-lean exit 1 REJECTED (statement)",
   "MP08 forced-head claim false",
   "CD08 closure counts mislabelled as the official rule"
  ]
 },
 "pendingByDigest": {
  "after-mp08": {
   "sha256": "b5b0b25bfc80dada8df57862a18d07e1fa887abb0964f0307b3c4e5a9b543d8d",
   "verified": true
  },
  "after-ct08": {
   "sha256": "c8073557dc84261739f5e8e54657242cf44d8c86d7b93037fbd632d0ca7c29cd",
   "verified": true
  },
  "after-cd08": {
   "sha256": "da8e5fd5672083fff8dc354339f589a30bacf1c7c1dd043aa42736039278db2a",
   "verified": true
  },
  "after-la08": {
   "sha256": "24e2ddbb84910995bab8793df60a67f31b28be922dcf5bfaa3fa01ce76355529",
   "verified": true
  },
  "after-p4": {
   "sha256": "f817777448e5acd46bd64359cdaf866097e2fc2c42e54e65f731f6799bc80eeb",
   "verified": true,
   "used": "record URL, statement hash"
  },
  "after-p2": {
   "sha256": "0c35cdefd31fb6c3f3bc3ee3010fccce590d85ba92fb6cb501304b22526aa24f",
   "verified": true,
   "used": "hash only (76 bytes); content not reviewed"
  },
  "after-p3": {
   "sha256": "6063abcf25b0ece8209fd6a47d5d78a7df697fbdd937474081d3f19b54e10e53",
   "verified": true,
   "used": "hash only; content not reviewed"
  },
  "after-p5": {
   "sha256": "61f551d37e52b20f7b29c1b66087675de769373463191e9a3ca478d775ea6289",
   "verified": true,
   "used": "hash only; content not reviewed"
  }
 },
 "submissionReady": [],
 "leaseAndSubmission": "No lease, no pull request, no account, no credential, tools/pnp.sh never run; one read-only desk GET. Nothing submitted; no file was accepted for the exact statement. The LA08 file must not be submitted for the gap.",
 "myPrograms": [
  {
   "path": "test/scratch/iv08.py (not delivered)",
   "sha256": "7ddb00cc79057938d148d067a357ac031ccbe08b1b5900533884dfef367f1209",
   "content": "# IV08 independent recomputation for L-meta-18647. Truth tables over 10 inputs as 1024-bit ints.\nimport itertools, random, sys, json\nN = 10\nM = 1 << N\nFULL = (1 << M) - 1\nEDGES = [(0,1),(1,2),(2,3),(3,4),(4,0),(0,5),(1,6),(2,7),(3,8),(4,9),(5,7),(7,9),(9,6),(6,8),(8,5)]\nADJ = set(EDGES) | {(b, a) for a, b in EDGES}\nX = [sum(1 << a for a in range(M) if a >> i & 1) for i in range(N)]\nAND = lambda a, b: a & b\nOR = lambda a, b: a | b\nE = 0\nfor a, b in EDGES: E |= X[a] & X[b]\nBASE = [0, FULL] + X + [X[0] & X[1]]\nFORB = set()\nfor i in range(N):\n    for j in range(N):\n        if i != j:\n            FORB.add(X[i] | X[j])\n            if (i, j) not in ADJ: FORB.add(X[i] & X[j])\nout = {}\n\n# 1. graph facts\nnbr = {v: sorted({b for a, b in ADJ if a == v}) for v in range(N)}\nout['degrees'] = sorted({len(nbr[v]) for v in range(N)})\nout['triangles'] = sum(1 for a, b, c in itertools.combinations(range(N), 3) if (a,b) in ADJ and (b,c) in ADJ and (a,c) in ADJ)\ndef dep(f, v):\n    return any(((f >> a) & 1) != ((f >> (a ^ (1 << v))) & 1) for a in range(M))\nout['E_depends_on_all_10'] = all(dep(E, v) for v in range(N))\n# frontier points: minimal true points (minterms) and maximal false points of the monotone E\ntrue_pts = [a for a in range(M) if E >> a & 1]\nfalse_pts = [a for a in range(M) if not E >> a & 1]\nmin_true = [a for a in true_pts if not any((E >> (a & ~(1 << i))) & 1 for i in range(N) if a >> i & 1)]\nmax_false = [a for a in false_pts if not any(not (E >> (a | (1 << i))) & 1 for i in range(N) if not a >> i & 1)]\nout['minimal_true_points'] = len(min_true)\nout['minimal_true_points_are_edges'] = sorted(min_true) == sorted((1 << a) | (1 << b) for a, b in EDGES)\nout['maximal_false_points'] = len(max_false)\nout['maximal_false_point_sizes'] = sorted({bin(a).count('1') for a in max_false})\nout['independence_number'] = max(bin(a).count('1') for a in false_pts)\nout['E_monotone'] = all((E >> a & 1) <= (E >> (a | (1 << i)) & 1) for a in range(M) for i in range(N))\n\n# 2. ct08 restriction counts\ndef restricted_classes(v, val):\n    fs = set()\n    for a, b in EDGES:\n        g = X[a] & X[b]\n        # restrict input v to val: g'(x) = g(x with x_v=val), as a function of the other inputs\n        r = 0\n        for x in range(M):\n            y = (x | (1 << v)) if val else (x & ~(1 << v))\n            if g >> y & 1: r |= 1 << x\n        fs.add(r)\n    return len(fs)\nout['ct08_restrict'] = {f'v{v}': [restricted_classes(v, 0), restricted_classes(v, 1)] for v in range(N)}\n\n# 3. validity checker for a list under the exact premises\ndef valid(lst):\n    known = list(BASE); ks = set(BASE)\n    for k, f in enumerate(lst):\n        if f in ks: return False, f'step {k} not new'\n        if not any((a & b) == f or (a | b) == f for a in known for b in known): return False, f'step {k} not generated'\n        if f in FORB: return False, f'step {k} forbidden'\n        known.append(f); ks.add(f)\n    return True, 'ok'\n\n# 4. upper-bound construction: vertex-cover stars, x_c && (x_a || x_b || (x_c && x_d)) trick\ndef build():\n    # independent set of size 4 -> cover C\n    for I in itertools.combinations(range(N), 4):\n        if all((a, b) not in ADJ for a, b in itertools.combinations(I, 2)): break\n    C = [v for v in range(N) if v not in I]\n    assigned = {c: [] for c in C}; seen = set()\n    for a, b in EDGES:\n        c = a if a in C and (b not in C or len(assigned[a]) >= len(assigned[b])) else b\n        if a in C and b in C and len(assigned[b]) > len(assigned[a]): c = b\n        assigned[c].append(b if c == a else a)\n    lst = []; terms = []\n    def add(f):\n        if f not in BASE and f not in lst: lst.append(f)\n        return f\n    for c in C:\n        nb_ = assigned[c]\n        if not nb_: continue\n        first = X[c] & X[nb_[0]]\n        if first != X[0] & X[1]: add(first)\n        if len(nb_) == 1: terms.append(first); continue\n        z = first\n        for d in nb_[1:]: z = add(z | X[d])\n        terms.append(add(X[c] & z))\n    acc = terms[0]\n    for t in terms[1:]: acc = add(acc | t)\n    return lst, I, assigned\nL, I, assigned = build()\nok, why = valid(L)\nout['upper_bound_list'] = {'length': len(L), 'valid': ok, 'why': why, 'last_is_E': L[-1] == E, 'independent_set': I,\n                           'stars': {str(k): v for k, v in assigned.items()}}\n\n# 5. random real 19- and 20-step lists satisfying every premise, and the LA08 lemma hypotheses on them\nrandom.seed(18647)\ndef random_list(n):\n    while True:\n        known = list(BASE); ks = set(BASE); lst = []\n        for _ in range(n * 50):\n            if len(lst) == n: break\n            a, b = random.choice(known), random.choice(known)\n            f = random.choice([a & b, a | b])\n            if f in ks or f in FORB: continue\n            known.append(f); ks.add(f); lst.append(f)\n        if len(lst) == n: return lst\ndef deps(f): return frozenset(v for v in range(N) if dep(f, v))\ndef la08_hyps(lst):\n    # hB: every base function labeled by c0 (blocks {0,1},{2},...,{9}); hstep: every entry is AND/OR of earlier;\n    # invariant: number of blocks after n gates >= 9 - n where blocks merge along the dependency sets\n    c0blocks = [{0,1}] + [{v} for v in range(2, N)]\n    hB = all(any(deps(f) <= blk for blk in c0blocks) for f in BASE)\n    ok, _ = valid(lst)\n    # replay the partition merge\n    blocks = [set(b) for b in c0blocks]; lab = {}\n    known = list(BASE); inv = True; trace = []\n    for n, f in enumerate(lst):\n        pair = next((a, b) for a in known for b in known if (a & b) == f or (a | b) == f)\n        da, db = deps(pair[0]), deps(pair[1])\n        ia = next((i for i, bl in enumerate(blocks) if da <= bl), None) if da else None\n        ib = next((i for i, bl in enumerate(blocks) if db <= bl), None) if db else None\n        if ia is None and da: inv = False\n        if ib is None and db: inv = False\n        if ia is not None and ib is not None and ia != ib:\n            blocks[ia] |= blocks[ib]; del blocks[ib]\n        known.append(f)\n        if not any(deps(f) <= bl for bl in blocks): inv = False\n        trace.append(len(blocks))\n        if len(blocks) < 9 - (n + 1): inv = False\n    return {'premises_hold': ok, 'hB': hB, 'invariant_holds': inv, 'blocks_after_each_step': trace,\n            'E_in_list': E in lst, 'max_inputs_depended_on': max(len(deps(f)) for f in lst),\n            'head_is_and_of_base': any((a & b) == lst[0] for a in BASE for b in BASE)}\nout['real19'] = la08_hyps(random_list(19))\nout['real20'] = la08_hyps(random_list(20))\nout['upper_bound_list_la08'] = la08_hyps(L)\n# prefixes of the explicit E-list of length 19 and 20\nout['ub_prefix19_valid'] = valid(L[:19])[0]; out['ub_prefix20_valid'] = valid(L[:20])[0]\n\n# 6. head: x1&&x2 is an admissible first entry; is it of form x_i || (x0&&x1)?\nh = X[1] & X[2]\nout['head_x1x2_valid_first'] = valid([h])[0]\nout['head_x1x2_equals_xi_or_x0x1'] = any(h == (X[i] | (X[0] & X[1])) for i in range(N))\n\n# 7. partition bound tightness: shortest list whose last entry depends on all 10 inputs is 8\nt = [X[2] & X[3], X[4] & X[0]]  # edges (2,3),(4,0)\nlst8 = [X[2] & X[3], (X[2] & X[3]) | (X[0] & X[1])]\ncur = lst8[-1]\nfor v in [4,5,6,7,8,9]:\n    cur = cur | X[v] if (cur | X[v]) not in FORB else None\n    lst8.append(cur)\nout['dep_all_at_8'] = {'length': len(lst8), 'valid': valid(lst8)[0], 'last_depends_on_all': len(deps(lst8[-1])) == 10}\n\n# 8. closure layers (cd08). variantA: exact premises (OR of any input pair forbidden);\n#    variantB: cd08's wording (only non-adjacent OR forbidden)\ndef layers(forb, depth):\n    known = set(BASE); res = []\n    for d in range(depth):\n        kl = list(known); new = set()\n        for i in range(len(kl)):\n            a = kl[i]\n            for j in range(i, len(kl)):\n                b = kl[j]\n                for f in (a & b, a | b):\n                    if f not in known and f not in forb: new.add(f)\n        known |= new; res.append((len(known), E in known))\n    return res\nFORB_B = set()\nfor i in range(N):\n    for j in range(N):\n        if i != j and (i, j) not in ADJ:\n            FORB_B.add(X[i] | X[j]); FORB_B.add(X[i] & X[j])\ndepth = int(sys.argv[1]) if len(sys.argv) > 1 else 2\nout['closure_exact_rules'] = layers(FORB, depth)\nout['closure_cd08_rules'] = layers(FORB_B, depth)\nprint(json.dumps(out))\n"
  },
  {
   "path": "test/scratch/small.py (not delivered)",
   "sha256": "eea4c4e7806e8603c1ec7b705aa59e4e95a982a404d7291a8e547e6cce6867ba",
   "content": "# exact minimum list length (IDDFS) for small graphs under the gap's rules:\n# entries new, AND/OR of earlier entries or base; no AND of a non-adjacent input pair; no OR of two distinct inputs.\n# base: const false, const true, inputs, and optionally the free AND of the first edge.\nimport sys, time\ndef solve(n, E, free, maxk=8, tlimit=60):\n    M = 1 << n; FULL = (1 << M) - 1\n    X = [sum(1 << a for a in range(M) if a >> i & 1) for i in range(n)]\n    adj = set(E) | {(b, a) for a, b in E}\n    T = 0\n    for a, b in E: T |= X[a] & X[b]\n    base = [0, FULL] + X + ([X[E[0][0]] & X[E[0][1]]] if free else [])\n    forb = set()\n    for i in range(n):\n        for j in range(n):\n            if i != j:\n                forb.add(X[i] | X[j])\n                if (i, j) not in adj: forb.add(X[i] & X[j])\n    if T in base: return 0\n    t0 = time.time()\n    def dfs(known, ks, left):\n        if time.time() - t0 > tlimit: raise TimeoutError\n        L = len(known)\n        if left == 1:\n            for i in range(L):\n                a = known[i]\n                for j in range(i, L):\n                    b = known[j]\n                    if (a & b) == T or (a | b) == T: return True\n            return False\n        cand = set()\n        for i in range(L):\n            a = known[i]\n            for j in range(i, L):\n                b = known[j]\n                for f in (a & b, a | b):\n                    if f not in ks and f not in forb: cand.add(f)\n        # symmetry-free but exact: try every candidate\n        for f in cand:\n            known.append(f); ks.add(f)\n            if dfs(known, ks, left - 1): return True\n            known.pop(); ks.discard(f)\n        return False\n    for k in range(1, maxk + 1):\n        if dfs(list(base), set(base), k): return k\n    return None\nG = {\n 'P3': (3, [(0,1),(1,2)]), 'K3': (3, [(0,1),(1,2),(0,2)]), 'P4': (4, [(0,1),(1,2),(2,3)]),\n 'K1,3': (4, [(0,1),(0,2),(0,3)]), '2K2': (4, [(0,1),(2,3)]), 'C4': (4, [(0,1),(1,2),(2,3),(3,0)]),\n 'K4': (4, [(0,1),(1,2),(2,3),(3,0),(0,2),(1,3)]), 'P5': (5, [(0,1),(1,2),(2,3),(3,4)]),\n}\nres = {}\nfor name, (n, E) in G.items():\n    r = []\n    for free in (False, True):\n        try: r.append(solve(n, E, free, tlimit=float(sys.argv[1]) if len(sys.argv) > 1 else 60))\n        except TimeoutError: r.append('timeout')\n    res[name] = r\n    print(name, r, flush=True)\n"
  }
 ]
}