{
  "agent": "LA06",
  "group": "Lean 4 automation",
  "gap": "L-meta-17390",
  "strategy": "Witness reconstruction from an explicit AND/OR gate list.",
  "status": "partial",
  "summary": "The generator reconstructed LA05's 14-gate witness. The full-import module compiled and passed the guard. Lean separately kernel-checked the identical proof body with narrowed imports. The official checker timed out during its verifier stage. The 13-gate gap remains unresolved.",
  "desk": {
    "state": "open",
    "time": "2026-11-26T06:27:32Z",
    "url": "https://pequalnp.com/desk/step?gap=L-meta-17390",
    "http": 200,
    "main": {
      "path": "lean/PEqualNP/Outside/L_meta_17390.lean",
      "http": 404,
      "url": "https://api.github.com/repos/open-goat/pequalnp-proofs/contents/lean/PEqualNP/Outside/L_meta_17390.lean?ref=main"
    }
  },
  "statementSha256": "3a6b7a3a820272375169fb191a04fd1ac8594fdc1849ed746eaaf0eefe286e6a",
  "claims": [
    {
      "statement": "∃ C : PEqualNP.CircuitLowerBounds.Circuit, PEqualNP.MetaComplexity.Monotone2 C ∧ C.size ≤ 14 ∧ ∀ x : Fin 9 → Bool, C.eval (List.ofFn x) = ((x 0 && x 4 && x 8) || (x 0 && x 5 && x 7) || (x 1 && x 3 && x 8) || (x 1 && x 5 && x 6) || (x 2 && x 3 && x 7) || (x 2 && x 4 && x 6))",
      "statementSha256": "c337dd9bfedb93aadabb1c93056d473329d1826993e26f396d278668e009b5df",
      "kind": "companion",
      "path": "lean/PEqualNP/Outside/L_meta_17390.lean",
      "sha256": "704359304fecf01e5d241bd429eed048f7713455ba789b38448ad6d892534b2a",
      "elaboration": {
        "status": "pass",
        "exitCode": 0,
        "scope": "Canonical module in the official build"
      },
      "guard": {
        "status": "pass",
        "exitCode": 0,
        "gap": 0,
        "imports": 0,
        "closure": 0,
        "detail": "The gap subcommand used a local row fixture from the exact public statement and the capsule's import allowlist. Imports and closure were checked on the generated module. These guard checks do not compare statement types."
      },
      "check-lean": {
        "status": "fail",
        "mode": "check",
        "exitCode": 3,
        "statementPath": "companion.txt",
        "verdict": "CHECKER FAULT: the verifier could not run: spawnSync <pinned repo>/tools/bin/lake ETIMEDOUT",
        "outcome": "The pinned checker timed out at its 30-minute verifier replay limit."
      },
      "axioms": "pass"
    }
  ],
  "artifacts": [
    {
      "path": "reconstruct.py",
      "sha256": "53047e7df1d3b306d355dcf3316005c32230665de7f804ee8f0246132bb46e02",
      "content": "\"\"\"Generate the P3 Lean module from a JSON circuit on standard input.\n\nRun python3 reconstruct.py [--bound 13|14] < circuit.json > L_meta_17390.lean.\nThe JSON object has keys \"gates\" and \"output\". Each gate is\n[\"and\", [wire, ...]] or [\"or\", [wire, ...]], with at most two inputs.\nThe first nine wires are input bits; gate j writes wire 9+j.\nMissing wires read false, as in PEqualNP.CircuitLowerBounds.Circuit.\n\"\"\"\nimport argparse\nfrom itertools import permutations\nimport json\nimport sys\n\nMODULE = \"PEqualNP.Outside.L_meta_17390\"\nVARIABLES = \"a b c d e f g h i\".split()\nMATCHINGS = ((0, 4, 8), (0, 5, 7), (1, 3, 8), (1, 5, 6), (2, 3, 7), (2, 4, 6))\nROW_COUNT = 512\n\n\ndef formula(variables):\n    return \" || \".join(\n        \"(\" + \" && \".join(variables[index] for index in matching) + \")\"\n        for matching in MATCHINGS\n    )\n\n\ndef statement(bound):\n    inputs = [f\"x {index}\" for index in range(9)]\n    return (\n        \"∃ C : PEqualNP.CircuitLowerBounds.Circuit, \"\n        f\"PEqualNP.MetaComplexity.Monotone2 C ∧ C.size ≤ {bound} ∧ \"\n        f\"∀ x : Fin 9 → Bool, C.eval (List.ofFn x) = ({formula(inputs)})\"\n    )\n\n\ndef validate(candidate, bound):\n    if not isinstance(candidate, dict) or candidate.keys() != {\"gates\", \"output\"}:\n        raise ValueError('expected a JSON object with exactly \"gates\" and \"output\"')\n    gates, output = candidate[\"gates\"], candidate[\"output\"]\n    if not isinstance(gates, list) or len(gates) > bound:\n        raise ValueError(f\"expected a gate list of length at most {bound}\")\n    if type(output) is not int or output < 0:\n        raise ValueError(\"output must be a natural number\")\n    for gate in gates:\n        if not isinstance(gate, list) or len(gate) != 2:\n            raise ValueError(\"expected a gate pair of operation and input list\")\n        op, inputs = gate\n        if op not in (\"and\", \"or\") or not isinstance(inputs, list) or len(inputs) > 2:\n            raise ValueError(\"expected an AND or OR with at most two inputs\")\n        if any(type(wire) is not int or wire < 0 for wire in inputs):\n            raise ValueError(\"gate inputs must be natural numbers\")\n    return gates, output\n\n\ndef preflight(gates, output):\n    \"\"\"Evaluate every row and compare with the six permutations of the columns.\"\"\"\n    match_masks = [\n        sum(1 << (3 * row + col) for row, col in enumerate(columns))\n        for columns in permutations(range(3))\n    ]\n    for row in range(ROW_COUNT):\n        wires = [bool(row & (1 << bit)) for bit in range(9)]\n        for op, inputs in gates:\n            values = [wires[wire] if wire < len(wires) else False for wire in inputs]\n            wires.append(all(values) if op == \"and\" else any(values))\n        actual = wires[output] if output < len(wires) else False\n        expected = any(row & mask == mask for mask in match_masks)\n        if actual != expected:\n            raise ValueError(f\"truth-table mismatch at input mask {row}: {actual} != {expected}\")\n\n\ndef generate(candidate, bound):\n    gates, output = validate(candidate, bound)\n    preflight(gates, output)\n    gate_list = \",\\n    \".join(\n        f\"⟨.{op}, [{', '.join(map(str, inputs))}]⟩\" for op, inputs in gates\n    )\n    variable_list = \", \".join(VARIABLES)\n    arguments = \" \".join(VARIABLES)\n    x_list = \", \".join(f\"x {index}\" for index in range(9))\n    return f\"\"\"import Mathlib\nimport PEqualNP.Defs\n\nnamespace {MODULE}\n\nopen PEqualNP.CircuitLowerBounds\n\ndef circuit : Circuit :=\n  ⟨[{gate_list}], {output}⟩\n\ntheorem monotone : PEqualNP.MetaComplexity.Monotone2 circuit := by\n  simp [PEqualNP.MetaComplexity.Monotone2, circuit, List.forall_mem_cons]\n\ntheorem ofFnNine (x : Fin 9 → Bool) : List.ofFn x = [{x_list}] := by\n  simp [List.ofFn_succ]\n\ntheorem evaluates : ∀ {arguments} : Bool,\n    circuit.eval [{variable_list}] =\n      ({formula(VARIABLES)}) := by\n  decide +kernel\n\nend {MODULE}\n\ntheorem {MODULE} : {statement(bound)} := by\n  refine ⟨{MODULE}.circuit, {MODULE}.monotone, by decide, fun x => ?_⟩\n  rw [{MODULE}.ofFnNine x]\n  exact {MODULE}.evaluates {' '.join('_' for _ in VARIABLES)}\n\"\"\"\n\n\ndef main():\n    parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])\n    parser.add_argument(\"--bound\", type=int, choices=(13, 14), default=13)\n    parser.add_argument(\"--statement\", action=\"store_true\", help=\"print only the statement bytes\")\n    args = parser.parse_args()\n    if args.statement:\n        sys.stdout.write(statement(args.bound))\n        return\n    try:\n        sys.stdout.write(generate(json.load(sys.stdin), args.bound))\n    except ValueError as error:\n        parser.exit(1, f\"{error}\\n\")\n\n\nif __name__ == \"__main__\":\n    main()\n"
    },
    {
      "path": "check_reconstruction.py",
      "sha256": "f3291ef8e92b616eb74f64273a3acd91d2ce2b01bb14815976739176ec719f94",
      "content": "\"\"\"Check the CLI against supplied witness, Lean module and recorded statement.\"\"\"\nimport copy\nimport json\nfrom pathlib import Path\nimport subprocess\nimport sys\n\n\ndef check(module_path, statement_path):\n    fixture = json.loads(Path(\"la05.json\").read_text())\n\n    def run(circuit, *args):\n        return subprocess.run(\n            [sys.executable, \"reconstruct.py\", *args],\n            input=json.dumps(circuit),\n            text=True,\n            capture_output=True,\n        )\n\n    generated = run(fixture, \"--bound\", \"14\")\n    assert generated.returncode == 0, generated.stderr\n    assert generated.stdout == module_path.read_text()\n    assert run(fixture, \"--bound\", \"14\").stdout == generated.stdout\n\n    exact = run(fixture, \"--statement\")\n    assert exact.returncode == 0, exact.stderr\n    assert exact.stdout == statement_path.read_text()\n\n    oversized = run(fixture)\n    assert oversized.returncode == 1 and not oversized.stdout\n    assert \"length at most 13\" in oversized.stderr\n\n    too_wide = copy.deepcopy(fixture)\n    too_wide[\"gates\"][0] = [\"and\", [0, 1, 2]]\n    bad_width = run(too_wide, \"--bound\", \"14\")\n    assert bad_width.returncode == 1 and not bad_width.stdout\n    assert \"at most two inputs\" in bad_width.stderr\n\n    changed = copy.deepcopy(fixture)\n    changed[\"gates\"][-1][0] = \"and\"\n    bad_table = run(changed, \"--bound\", \"14\")\n    assert bad_table.returncode == 1 and not bad_table.stdout\n    assert \"truth-table mismatch at input mask 84\" in bad_table.stderr\n\n\nif __name__ == \"__main__\":\n    check(*(Path(argument) for argument in sys.argv[1:]))\n    print(\"Reconstruction checks passed.\")\n"
    },
    {
      "path": "la05.json",
      "sha256": "09e9a51f2bd4cc09c7fd43a487542f7372492d748c33a7f676ec18c5623a9bb7",
      "content": "{\n  \"gates\": [\n    [\n      \"and\",\n      [\n        1,\n        5\n      ]\n    ],\n    [\n      \"and\",\n      [\n        2,\n        4\n      ]\n    ],\n    [\n      \"and\",\n      [\n        0,\n        5\n      ]\n    ],\n    [\n      \"or\",\n      [\n        9,\n        10\n      ]\n    ],\n    [\n      \"and\",\n      [\n        2,\n        3\n      ]\n    ],\n    [\n      \"and\",\n      [\n        0,\n        4\n      ]\n    ],\n    [\n      \"and\",\n      [\n        1,\n        3\n      ]\n    ],\n    [\n      \"or\",\n      [\n        14,\n        15\n      ]\n    ],\n    [\n      \"and\",\n      [\n        6,\n        12\n      ]\n    ],\n    [\n      \"and\",\n      [\n        8,\n        16\n      ]\n    ],\n    [\n      \"or\",\n      [\n        11,\n        13\n      ]\n    ],\n    [\n      \"and\",\n      [\n        7,\n        19\n      ]\n    ],\n    [\n      \"or\",\n      [\n        18,\n        20\n      ]\n    ],\n    [\n      \"or\",\n      [\n        17,\n        21\n      ]\n    ]\n  ],\n  \"output\": 22\n}\n"
    },
    {
      "path": "lean/PEqualNP/Outside/L_meta_17390.lean",
      "sha256": "704359304fecf01e5d241bd429eed048f7713455ba789b38448ad6d892534b2a",
      "content": "import Mathlib\nimport PEqualNP.Defs\n\nnamespace PEqualNP.Outside.L_meta_17390\n\nopen PEqualNP.CircuitLowerBounds\n\ndef circuit : Circuit :=\n  ⟨[⟨.and, [1, 5]⟩,\n    ⟨.and, [2, 4]⟩,\n    ⟨.and, [0, 5]⟩,\n    ⟨.or, [9, 10]⟩,\n    ⟨.and, [2, 3]⟩,\n    ⟨.and, [0, 4]⟩,\n    ⟨.and, [1, 3]⟩,\n    ⟨.or, [14, 15]⟩,\n    ⟨.and, [6, 12]⟩,\n    ⟨.and, [8, 16]⟩,\n    ⟨.or, [11, 13]⟩,\n    ⟨.and, [7, 19]⟩,\n    ⟨.or, [18, 20]⟩,\n    ⟨.or, [17, 21]⟩], 22⟩\n\ntheorem monotone : PEqualNP.MetaComplexity.Monotone2 circuit := by\n  simp [PEqualNP.MetaComplexity.Monotone2, circuit, List.forall_mem_cons]\n\ntheorem ofFnNine (x : Fin 9 → Bool) : List.ofFn x = [x 0, x 1, x 2, x 3, x 4, x 5, x 6, x 7, x 8] := by\n  simp [List.ofFn_succ]\n\ntheorem evaluates : ∀ a b c d e f g h i : Bool,\n    circuit.eval [a, b, c, d, e, f, g, h, i] =\n      ((a && e && i) || (a && f && h) || (b && d && i) || (b && f && g) || (c && d && h) || (c && e && g)) := by\n  decide +kernel\n\nend PEqualNP.Outside.L_meta_17390\n\ntheorem PEqualNP.Outside.L_meta_17390 : ∃ C : PEqualNP.CircuitLowerBounds.Circuit, PEqualNP.MetaComplexity.Monotone2 C ∧ C.size ≤ 14 ∧ ∀ x : Fin 9 → Bool, C.eval (List.ofFn x) = ((x 0 && x 4 && x 8) || (x 0 && x 5 && x 7) || (x 1 && x 3 && x 8) || (x 1 && x 5 && x 6) || (x 2 && x 3 && x 7) || (x 2 && x 4 && x 6)) := by\n  refine ⟨PEqualNP.Outside.L_meta_17390.circuit, PEqualNP.Outside.L_meta_17390.monotone, by decide, fun x => ?_⟩\n  rw [PEqualNP.Outside.L_meta_17390.ofFnNine x]\n  exact PEqualNP.Outside.L_meta_17390.evaluates _ _ _ _ _ _ _ _ _\n"
    },
    {
      "path": "exact.txt",
      "sha256": "3a6b7a3a820272375169fb191a04fd1ac8594fdc1849ed746eaaf0eefe286e6a",
      "content": "∃ C : PEqualNP.CircuitLowerBounds.Circuit, PEqualNP.MetaComplexity.Monotone2 C ∧ C.size ≤ 13 ∧ ∀ x : Fin 9 → Bool, C.eval (List.ofFn x) = ((x 0 && x 4 && x 8) || (x 0 && x 5 && x 7) || (x 1 && x 3 && x 8) || (x 1 && x 5 && x 6) || (x 2 && x 3 && x 7) || (x 2 && x 4 && x 6))"
    },
    {
      "path": "companion.txt",
      "sha256": "c337dd9bfedb93aadabb1c93056d473329d1826993e26f396d278668e009b5df",
      "content": "∃ C : PEqualNP.CircuitLowerBounds.Circuit, PEqualNP.MetaComplexity.Monotone2 C ∧ C.size ≤ 14 ∧ ∀ x : Fin 9 → Bool, C.eval (List.ofFn x) = ((x 0 && x 4 && x 8) || (x 0 && x 5 && x 7) || (x 1 && x 3 && x 8) || (x 1 && x 5 && x 6) || (x 2 && x 3 && x 7) || (x 2 && x 4 && x 6))"
    },
    {
      "path": "verification/ReducedImports.lean",
      "sha256": "7411b7b1f712d998bae182d0feac5f51ecb01a0dfc95ef07860672d0b5d977b1",
      "content": "import PEqualNP.Defs.MetaComplexityLgpMono\nimport Mathlib.Data.Fintype.Basic\nimport Mathlib.Data.Fintype.Pi\n\nnamespace PEqualNP.Outside.L_meta_17390\n\nopen PEqualNP.CircuitLowerBounds\n\ndef circuit : Circuit :=\n  ⟨[⟨.and, [1, 5]⟩,\n    ⟨.and, [2, 4]⟩,\n    ⟨.and, [0, 5]⟩,\n    ⟨.or, [9, 10]⟩,\n    ⟨.and, [2, 3]⟩,\n    ⟨.and, [0, 4]⟩,\n    ⟨.and, [1, 3]⟩,\n    ⟨.or, [14, 15]⟩,\n    ⟨.and, [6, 12]⟩,\n    ⟨.and, [8, 16]⟩,\n    ⟨.or, [11, 13]⟩,\n    ⟨.and, [7, 19]⟩,\n    ⟨.or, [18, 20]⟩,\n    ⟨.or, [17, 21]⟩], 22⟩\n\ntheorem monotone : PEqualNP.MetaComplexity.Monotone2 circuit := by\n  simp [PEqualNP.MetaComplexity.Monotone2, circuit, List.forall_mem_cons]\n\ntheorem ofFnNine (x : Fin 9 → Bool) : List.ofFn x = [x 0, x 1, x 2, x 3, x 4, x 5, x 6, x 7, x 8] := by\n  simp [List.ofFn_succ]\n\ntheorem evaluates : ∀ a b c d e f g h i : Bool,\n    circuit.eval [a, b, c, d, e, f, g, h, i] =\n      ((a && e && i) || (a && f && h) || (b && d && i) || (b && f && g) || (c && d && h) || (c && e && g)) := by\n  decide +kernel\n\nend PEqualNP.Outside.L_meta_17390\n\ntheorem PEqualNP.Outside.L_meta_17390 : ∃ C : PEqualNP.CircuitLowerBounds.Circuit, PEqualNP.MetaComplexity.Monotone2 C ∧ C.size ≤ 14 ∧ ∀ x : Fin 9 → Bool, C.eval (List.ofFn x) = ((x 0 && x 4 && x 8) || (x 0 && x 5 && x 7) || (x 1 && x 3 && x 8) || (x 1 && x 5 && x 6) || (x 2 && x 3 && x 7) || (x 2 && x 4 && x 6)) := by\n  refine ⟨PEqualNP.Outside.L_meta_17390.circuit, PEqualNP.Outside.L_meta_17390.monotone, by decide, fun x => ?_⟩\n  rw [PEqualNP.Outside.L_meta_17390.ofFnNine x]\n  exact PEqualNP.Outside.L_meta_17390.evaluates _ _ _ _ _ _ _ _ _\n\n#print axioms PEqualNP.Outside.L_meta_17390\n"
    }
  ],
  "experiments": [
    {
      "range": "LA05 witness, input masks 0–511",
      "outcome": "All 512 rows passed Python evaluation against the six column permutations. The generated Lean source uses decide +kernel and List.ofFn_succ."
    },
    {
      "range": "Independent structural review of LA05's 14 gates",
      "outcome": "Output wire 22 is the OR of 17 and 21, with 21 the OR of 18 and 20. Wire 17 computes x6 AND ((x1 AND x5) OR (x2 AND x4)); 18 computes x8 AND ((x0 AND x4) OR (x1 AND x3)); 20 computes x7 AND ((x0 AND x5) OR (x2 AND x3)). Distributing each outer AND gives exactly the six matching triples."
    },
    {
      "range": "Generator repeatability and rejection tests",
      "outcome": "Repeated generation was byte-identical. The default bound rejected LA05 on size. A three-input gate was rejected. Changing the last OR to AND was rejected with the first mismatch at mask 84."
    },
    {
      "range": "Pinned environment",
      "outcome": "Verified the downloaded repository archive and both runtime bundle SHA-256 digests. Restored the repository and nine dependency Git revisions in scratch, with tracked source files matching their pins. Lean 4.36.0 started, and lake build PEqualNP.Defs exited 0 (5149 jobs). The unmodified pinned guard and checker ran locally.",
      "repoCommit": "8dec1cacf8aab169f12858fff3a2e945fea7a880",
      "leanVersion": "4.36.0"
    },
    {
      "range": "First official checker attempt",
      "outcome": "The checker reached its 30-minute build limit (exit 3). The canonical Lean module emitted its compiled artifact, and an unchanged retry reused it and reached kernel replay."
    },
    {
      "range": "Scratch recheck with narrowed imports and identical theorem body",
      "outcome": "Lean 4.36.0 exited 0. 'PEqualNP.Outside.L_meta_17390' depends on axioms: [propext, Quot.sound]",
      "elaborationExitCode": 0,
      "note": "Lean reported one unused simp argument. The reported axioms are both allowed by the pinned checker."
    }
  ],
  "deadEnds": [
    "LA05's known circuit has 14 gates and cannot instantiate the exact existential bound. This reconstruction attempt did not perform circuit search or produce a lower-bound proof."
  ],
  "handed": [
    {
      "batch": "e2-px-capsule",
      "key": "after-p3",
      "sha256": "6063abcf25b0ece8209fd6a47d5d78a7df697fbdd937474081d3f19b54e10e53",
      "used": "LA05 gate list in Le14.lean, benchmark proof technique, pin and import metadata.",
      "witnessSha256": "c77f1dc0963842c7c07cde7420abeed6370c91cf974c70c0092d5525a1df28f2"
    }
  ],
  "forNext": "For a candidate of at most 13 gates in la05.json's format, use python3 reconstruct.py < candidate.json to produce the official module. Use python3 reconstruct.py --statement for the exact statement bytes and pass them to the pinned guard/checker workflow. To reproduce the companion, use --bound 14 for both invocations and check against companion.txt.",
  "submission": "Local companion only. No lease, desk write, account, or submission."
}
