{
  "step": "L-pcx-132",
  "role": "complexity theory",
  "claim": "checked",
  "target": "lemma",
  "lean_path": "lean/PEqualNP/Outside/L_pcx_132_simulation.lean",
  "lean_text": "",
  "generator": "from itertools import combinations\nimport json\ndef axioms(mode):\n    return {tuple(sorted(((1<<(2*p+b)) if mode=='q' else 2*p+b, 1-(h>>b&1))\n            for p in (i,j) for b in range(2))):(i,j,h)\n            for i,j in combinations(range(5),2) for h in range(4)}\ndef replay(data,mode):\n    ax=axioms(mode)\n    def is_valid_sat(c,s):\n        return any(((s&f).bit_count()&1)==v for f,v in c)\n    for n,(code,r) in enumerate(data):\n        c=frozenset(map(tuple,code))\n        if not r:\n            assert tuple(sorted(c)) in ax\n        elif len(r)==1:\n            assert mode=='q' and 0<=r[0]<n\n            a=data[r[0]][0]\n            assert all(not is_valid_sat(a,s) or is_valid_sat(c,s) for s in range(1024))\n        else:\n            i,j,f=r\n            assert 0<=i<n and 0<=j<n\n            a,b=(frozenset(map(tuple,data[k][0])) for k in (i,j))\n            assert (f,0) in a and (f,1) in b\n            assert (a-{(f,0)})|(b-{(f,1)})==c\n    assert not data[-1][0]\n\ndef emit(data,mode):\n    replay(data,mode)\n    fn,ty,der,form=('ordinary','Clause V','IsDerivation','BPHP 5 2') if mode=='p' else ('linear','LC','IsLinDerivation','M')\n    text=[f'def {mode}0 : List ({ty}) := []', f'lemma {mode}d0 : {der} ({form}) {mode}0 := .nil']\n    for n,(code,r) in enumerate(data,1):\n        cname=f'{mode}c{n}'\n        code_s='['+', '.join('(%d, %s)'%(f,('true' if s else 'false')) for f,s in code)+']'\n        ax=axioms(mode)\n        text+= [f'def {cname} : Code := {code_s}',\n                f'def {mode}{n} : List ({ty}) := {fn} {cname} :: {mode}{n-1}',\n                f'lemma {mode}d{n} : {der} ({form}) {mode}{n} := by']\n        if not r:\n            i,j,h=ax[tuple(sorted(map(tuple,code)))]\n            text.append(f'  apply {der}.ax {mode}d{n-1}')\n            if mode=='p':\n                text += [f'  rw [show ordinary {cname} = base {i} {j} {h} by decide +kernel]',\n                         f'  exact base_mem {i} {j} {h} (by decide)']\n            else:\n                text.append(f'  exact ⟨base {i} {j} {h}, base_mem {i} {j} {h} (by decide), by decide +kernel⟩')\n        elif len(r)==1:\n            j=r[0]\n            text.extend([f'  refine IsLinDerivation.weak {mode}d{n-1} (lineAt {mode}{n-1} {n-2-j} (by decide +kernel)) ?_',\n                         f'  exact validWeak {mode}c{j+1} {cname} (by decide +kernel)'])\n        else:\n            i,j,f=r\n            if mode=='p':\n                i,j=j,i\n                fs=f'({f//2}, {f%2})'\n            else:fs=f'support {f}'\n            text.extend([f'  refine {der}.res {mode}d{n-1} (lineAt {mode}{n-1} {n-2-i} (by decide +kernel))',\n                         f'    (lineAt {mode}{n-1} {n-2-j} (by decide +kernel)) ?_',\n                         f'  exact ⟨{fs}, by decide +kernel, by decide +kernel, by decide +kernel⟩'])\n        text.append('')\n    return '\\n'.join(text)\n\ndef finish(plain, parity):\n    return f'''\nend PEqualNP.Outside.L_pcx_132_simulation\n\nopen PEqualNP.ProofComplexity PEqualNP.Outside.L_pcx_132_simulation\n\ntheorem PEqualNP.Outside.L_pcx_132_simulation :\n    (∀ (W : Type) [DecidableEq W] (F : Set (Clause W)) (p : List (Clause W)),\n      IsRefutation F p → IsLinRefutation F (p.map linOfClause) ∧ (p.map linOfClause).length = p.length) ∧\n    (∃ p : List (Clause (Fin 5 × Fin 2)), IsRefutation (BPHP 5 2) p ∧ p.length = {plain}) ∧\n    (∃ p : List (LinClause (Fin 5 × Fin 2)), IsLinRefutation (BPHP 5 2) p ∧ p.length = {parity}) := by\n  refine ⟨fun _ _ F p h => simulation F p h, ⟨p{plain}, ⟨pd{plain}, ?_⟩, by decide +kernel⟩,\n    ⟨q{parity}, ⟨qd{parity}, ?_⟩, by decide +kernel⟩⟩\n  · exact List.Mem.head _\n  · exact List.Mem.head _\n'''\n\n\nHELPERS = \"import PEqualNP.Defs\\n\\nnamespace PEqualNP.Outside.L_pcx_132_simulation\\n\\nopen PEqualNP.ProofComplexity\\n\\nabbrev V := Fin 5 × Fin 2\\nabbrev LC := LinClause V\\nabbrev M := (fun C => linOfClause C) '' BPHP 5 2\\nabbrev Code := List (Nat × Bool)\\n\\nlemma literal_inj {W : Type} :\\n    Function.Injective (fun l : Literal W => (({l.1} : Finset W), l.2)) := by\\n  rintro ⟨v, x⟩ ⟨w, y⟩ h\\n  simp only [Prod.mk.injEq, Finset.singleton_inj] at h\\n  exact Prod.ext h.1 h.2\\n\\nlemma simulation_derivation {W : Type} [DecidableEq W] {F : Set (Clause W)}\\n    {p : List (Clause W)} (h : IsDerivation F p) :\\n    IsLinDerivation ((fun C => linOfClause C) '' F) (p.map linOfClause) := by\\n  induction h with\\n  | nil => exact IsLinDerivation.nil\\n  | ax _ hC ih => exact IsLinDerivation.ax ih ⟨_, hC, rfl⟩\\n  | res _ hC hD hR ih =>\\n    refine IsLinDerivation.res ih (List.mem_map_of_mem hD) (List.mem_map_of_mem hC) ?_\\n    obtain ⟨v, hvC, hvD, rfl⟩ := hR\\n    refine ⟨{v}, Finset.mem_image.mpr ⟨_, hvD, rfl⟩,\\n      Finset.mem_image.mpr ⟨_, hvC, rfl⟩, ?_⟩\\n    unfold linOfClause\\n    rw [Finset.image_union, Finset.image_erase literal_inj,\\n      Finset.image_erase literal_inj, Finset.union_comm]\\n\\nlemma simulation {W : Type} [DecidableEq W] (F : Set (Clause W)) (p : List (Clause W))\\n    (h : IsRefutation F p) : IsLinRefutation F (p.map linOfClause) ∧\\n      (p.map linOfClause).length = p.length := by\\n  refine ⟨⟨simulation_derivation h.1, ?_⟩, List.length_map _⟩\\n  simpa [linOfClause] using List.mem_map_of_mem (f := linOfClause) h.2\\n\\ndef base (i j : Fin 5) (h : Nat) : Clause V :=\\n  Finset.univ.image (fun b : Fin 2 => ((i,b), !h.testBit b.val)) ∪\\n    Finset.univ.image (fun b : Fin 2 => ((j,b), !h.testBit b.val))\\n\\nlemma base_mem (i j : Fin 5) (h : Nat) (hij : i ≠ j) : base i j h ∈ BPHP 5 2 :=\\n  ⟨i, j, fun b => h.testBit b.val, hij, rfl⟩\\n\\ndef support (m : Nat) : Finset V :=\\n  Finset.univ.filter (fun v => m.testBit (2*v.1.val + v.2.val) = true)\\n\\ndef linear (c : Code) : LC :=\\n  (c.map (fun q => (support q.1, q.2))).toFinset\\n\\ndef ordinary (c : Code) : Clause V :=\\n  (c.map (fun q => ((Fin.ofNat 5 (q.1 / 2), Fin.ofNat 2 (q.1 % 2)), q.2))).toFinset\\n\\nlemma sat_eq {a : V → Bool} {q : LinEq V} :\\n    LinEqSat a q ↔ ((q.1.filter (fun v => a v = true)).card % 2 == q.2.toNat) = true := by\\n  rcases q with ⟨f, b⟩\\n  cases b <;> simp [LinEqSat, Nat.odd_iff, Nat.mod_two_not_eq_one]\\n\\ndef assignOn : List V → List (V → Bool)\\n  | [] => [fun _ => false]\\n  | v :: vs => (assignOn vs).flatMap\\n      (fun a => [Function.update a v false, Function.update a v true])\\n\\nlemma assignOn_complete (vs : List V) (a : V → Bool) :\\n    ∃ b ∈ assignOn vs, ∀ v ∈ vs, b v = a v := by\\n  induction vs with\\n  | nil => exact ⟨fun _ => false, by simp [assignOn], by simp⟩\\n  | cons v vs ih =>\\n    obtain ⟨b, hb, hagree⟩ := ih\\n    refine ⟨Function.update b v (a v), ?_, ?_⟩\\n    · apply List.mem_flatMap.mpr\\n      refine ⟨b, hb, ?_⟩\\n      cases a v <;> simp\\n    · intro w hw\\n      by_cases he : w = v\\n      · subst w\\n        simp\\n      · exact (Function.update_of_ne he _ _).trans\\n          (hagree w ((List.mem_cons.mp hw).resolve_left he))\\n\\ndef test (a : V → Bool) (c : Code) : Bool :=\\n  c.any (fun q => ((support q.1).filter (fun v => a v = true)).card % 2 == q.2.toNat)\\n\\nlemma test_iff (a : V → Bool) (c : Code) : test a c = true ↔ LinClauseSat a (linear c) := by\\n  simp only [test, List.any_eq_true, LinClauseSat, linear, List.mem_toFinset, List.mem_map]\\n  constructor\\n  · rintro ⟨q, hq, hs⟩\\n    exact ⟨(support q.1, q.2), ⟨q, hq, rfl⟩, sat_eq.mpr hs⟩\\n  · rintro ⟨_, ⟨q, hq, rfl⟩, hs⟩\\n    exact ⟨q, hq, sat_eq.mp hs⟩\\n\\ndef vars : List V :=\\n  (List.finRange 5).flatMap (fun i => (List.finRange 2).map (fun j => (i,j)))\\n\\nlemma mem_vars (v : V) : v ∈ vars := by\\n  obtain ⟨i,j⟩ := v\\n  simp [vars]\\n\\ndef visible (c d : Code) : List V :=\\n  vars.filter (fun v =>\\n    (c ++ d).any (fun q => q.1.testBit (2*v.1.val + v.2.val)))\\n\\nlemma test_congr (c d : Code) (a b : V → Bool)\\n    (hab : ∀ v ∈ visible c d, a v = b v) :\\n    test a c = test b c ∧ test a d = test b d := by\\n  have hs : ∀ q ∈ c ++ d,\\n      (support q.1).filter (fun v => a v = true) =\\n        (support q.1).filter (fun v => b v = true) := by\\n    intro q hq\\n    exact Finset.filter_congr (fun v hv => by\\n      rw [hab v]\\n      have hbit := (Finset.mem_filter.mp hv).2\\n      simp only [visible, List.mem_filter, mem_vars, true_and]\\n      exact List.any_eq_true.mpr ⟨q, hq, hbit⟩)\\n  have hl (l : Code) (h : ∀ q ∈ l, q ∈ c ++ d) : test a l = test b l := by\\n    induction l with\\n    | nil => rfl\\n    | cons q qs ih =>\\n      have hc := hs q (h q (List.Mem.head _))\\n      have hr := ih (fun z hz => h z (List.mem_cons_of_mem _ hz))\\n      simp only [test, List.any_cons]\\n      change (_ || test a qs) = (_ || test b qs)\\n      rw [hc, hr]\\n  exact ⟨hl c (fun q hq => List.mem_append_left _ hq),\\n    hl d (fun q hq => List.mem_append_right _ hq)⟩\\n\\ndef checkWeak (c d : Code) : Bool :=\\n  (assignOn (visible c d)).all (fun a => !test a c || test a d)\\n\\nlemma validWeak (c d : Code) (h : checkWeak c d = true)\\n    (a : V → Bool) (hc : LinClauseSat a (linear c)) : LinClauseSat a (linear d) := by\\n  obtain ⟨b, hb, hab⟩ := assignOn_complete (visible c d) a\\n  have ht := (test_iff a c).mpr hc\\n  have hw := List.all_eq_true.mp h _ hb\\n  obtain ⟨ec, ed⟩ := test_congr c d b a hab\\n  rw [ec, ed, ht] at hw\\n  exact (test_iff _ _).mp (by simpa using hw)\\n\\nlemma lineAt {A : Type} (l : List A) (k : Nat) (h : k < l.length) : l[k] ∈ l :=\\n  List.getElem_mem h\\n\"\nPLAIN = json.loads('[[[[2,0],[3,0],[8,0],[9,0]],[]],[[[0,0],[1,0],[8,0],[9,0]],[]],[[[0,1],[1,0],[2,1],[3,0]],[]],[[[1,0],[2,1],[3,0],[8,0],[9,0]],[1,2,0]],[[[6,0],[7,0],[8,0],[9,0]],[]],[[[2,1],[3,0],[6,1],[7,0]],[]],[[[2,1],[3,0],[7,0],[8,0],[9,0]],[4,5,6]],[[[4,0],[5,0],[8,0],[9,0]],[]],[[[2,1],[3,0],[4,1],[5,0]],[]],[[[2,1],[3,0],[5,0],[8,0],[9,0]],[7,8,4]],[[[4,0],[5,1],[6,0],[7,1]],[]],[[[0,0],[1,1],[4,0],[5,1]],[]],[[[0,1],[1,1],[6,1],[7,1]],[]],[[[1,1],[4,0],[5,1],[6,1],[7,1]],[11,12,0]],[[[1,1],[4,0],[5,1],[7,1]],[10,13,6]],[[[0,0],[1,1],[6,0],[7,1]],[]],[[[0,1],[1,1],[4,1],[5,1]],[]],[[[1,1],[4,1],[5,1],[6,0],[7,1]],[15,16,0]],[[[4,1],[5,1],[6,1],[7,1]],[]],[[[1,1],[4,1],[5,1],[7,1]],[17,18,6]],[[[1,1],[5,1],[7,1]],[14,19,4]],[[[1,1],[2,1],[3,0],[7,1],[8,0],[9,0]],[9,20,5]],[[[1,1],[2,1],[3,0],[8,0],[9,0]],[6,21,7]],[[[2,1],[3,0],[8,0],[9,0]],[3,22,1]],[[[3,0],[8,0],[9,0]],[0,23,2]],[[[2,0],[3,0],[4,0],[5,0]],[]],[[[4,1],[5,0],[8,1],[9,0]],[]],[[[2,0],[3,0],[5,0],[8,1],[9,0]],[25,26,4]],[[[2,0],[3,0],[6,0],[7,0]],[]],[[[6,1],[7,0],[8,1],[9,0]],[]],[[[2,0],[3,0],[7,0],[8,1],[9,0]],[28,29,6]],[[[0,0],[1,0],[2,0],[3,0]],[]],[[[0,1],[1,0],[8,1],[9,0]],[]],[[[1,0],[2,0],[3,0],[8,1],[9,0]],[31,32,0]],[[[2,0],[3,0],[5,1],[7,1],[8,1],[9,0]],[33,20,1]],[[[2,0],[3,0],[5,1],[8,1],[9,0]],[30,34,7]],[[[2,0],[3,0],[8,1],[9,0]],[27,35,5]],[[[2,1],[3,0],[8,1],[9,0]],[]],[[[3,0],[8,1],[9,0]],[36,37,2]],[[[3,0],[9,0]],[24,38,8]],[[[0,1],[1,0],[4,1],[5,0]],[]],[[[1,0],[4,1],[5,0],[8,0],[9,0]],[1,40,0]],[[[4,1],[5,0],[6,1],[7,0]],[]],[[[4,1],[5,0],[7,0],[8,0],[9,0]],[4,42,6]],[[[0,0],[1,1],[2,0],[3,1]],[]],[[[2,1],[3,1],[6,1],[7,1]],[]],[[[0,0],[1,1],[3,1],[6,1],[7,1]],[44,45,2]],[[[0,0],[1,1],[3,1],[7,1]],[15,46,6]],[[[2,0],[3,1],[6,0],[7,1]],[]],[[[0,1],[1,1],[2,0],[3,1],[7,1]],[48,12,6]],[[[0,1],[1,1],[2,1],[3,1]],[]],[[[0,1],[1,1],[3,1],[7,1]],[49,50,2]],[[[1,1],[3,1],[7,1]],[47,51,0]],[[[1,1],[3,1],[4,1],[5,0],[8,0],[9,0]],[43,52,7]],[[[3,1],[4,1],[5,0],[8,0],[9,0]],[41,53,1]],[[[3,1],[5,0],[8,0],[9,0]],[7,54,4]],[[[4,0],[5,0],[6,0],[7,0]],[]],[[[4,0],[5,0],[7,0],[8,1],[9,0]],[56,29,6]],[[[0,0],[1,0],[4,0],[5,0]],[]],[[[1,0],[4,0],[5,0],[8,1],[9,0]],[58,32,0]],[[[3,1],[4,0],[5,0],[7,1],[8,1],[9,0]],[59,52,1]],[[[3,1],[4,0],[5,0],[8,1],[9,0]],[57,60,7]],[[[3,1],[5,0],[8,1],[9,0]],[61,26,4]],[[[3,1],[5,0],[9,0]],[55,62,8]],[[[2,0],[3,1],[4,0],[5,1]],[]],[[[0,0],[1,0],[6,0],[7,0]],[]],[[[0,0],[1,0],[6,1],[7,0],[9,0]],[1,29,8]],[[[0,0],[1,0],[7,0],[9,0]],[65,66,6]],[[[0,1],[1,0],[6,1],[7,0]],[]],[[[0,1],[1,0],[7,0],[8,0],[9,0]],[4,68,6]],[[[0,1],[1,0],[7,0],[9,0]],[69,32,8]],[[[1,0],[7,0],[9,0]],[67,70,0]],[[[2,0],[3,1],[4,1],[5,1],[7,1]],[48,18,6]],[[[1,0],[2,0],[3,1],[4,1],[5,1],[9,0]],[71,72,7]],[[[1,1],[2,0],[3,1],[4,1],[5,1]],[44,16,0]],[[[2,0],[3,1],[4,1],[5,1],[9,0]],[73,74,1]],[[[2,0],[3,1],[5,1],[9,0]],[64,75,4]],[[[2,1],[3,1],[4,0],[5,1],[7,1]],[10,45,6]],[[[1,0],[2,1],[3,1],[4,0],[5,1],[9,0]],[71,77,7]],[[[1,1],[2,1],[3,1],[4,0],[5,1]],[11,50,0]],[[[2,1],[3,1],[4,0],[5,1],[9,0]],[78,79,1]],[[[2,1],[3,1],[4,1],[5,1]],[]],[[[2,1],[3,1],[5,1],[9,0]],[80,81,4]],[[[3,1],[5,1],[9,0]],[76,82,2]],[[[3,1],[9,0]],[63,83,5]],[[[9,0]],[39,84,3]],[[[0,0],[1,0],[4,1],[5,0],[7,0]],[65,42,6]],[[[0,0],[1,0],[3,0],[4,1],[5,0]],[31,8,2]],[[[6,0],[7,1],[8,0],[9,1]],[]],[[[2,1],[3,1],[8,1],[9,1]],[]],[[[3,1],[6,0],[7,1],[8,1],[9,1]],[48,89,2]],[[[3,1],[6,0],[7,1],[9,1]],[88,90,8]],[[[2,0],[3,1],[8,0],[9,1]],[]],[[[6,1],[7,1],[8,1],[9,1]],[]],[[[2,0],[3,1],[6,1],[7,1],[9,1]],[92,93,8]],[[[3,1],[6,1],[7,1],[9,1]],[94,45,2]],[[[3,1],[7,1],[9,1]],[91,95,6]],[[[0,0],[1,0],[4,1],[5,0],[7,1],[9,1]],[87,96,3]],[[[0,0],[1,0],[4,1],[5,0],[9,1]],[86,97,7]],[[[0,0],[1,0],[5,0],[9,1]],[58,98,4]],[[[0,1],[1,0],[3,0],[4,0],[5,0]],[25,2,2]],[[[0,1],[1,0],[4,0],[5,0],[7,0]],[56,68,6]],[[[0,1],[1,0],[3,1],[4,0],[5,0],[9,1]],[101,96,7]],[[[0,1],[1,0],[4,0],[5,0],[9,1]],[100,102,3]],[[[0,1],[1,0],[5,0],[9,1]],[103,40,4]],[[[1,0],[5,0],[9,1]],[99,104,0]],[[[2,0],[3,0],[5,0],[6,1],[7,0]],[25,42,4]],[[[2,0],[3,0],[5,0],[7,0]],[28,106,6]],[[[0,1],[1,1],[8,1],[9,1]],[]],[[[0,1],[1,1],[2,0],[3,1],[9,1]],[92,108,8]],[[[1,1],[2,0],[3,1],[9,1]],[44,109,0]],[[[1,1],[2,0],[5,0],[7,0],[9,1]],[107,110,3]],[[[2,1],[3,0],[5,0],[6,0],[7,0]],[56,8,4]],[[[2,1],[3,0],[5,0],[7,0]],[112,5,6]],[[[0,0],[1,1],[8,0],[9,1]],[]],[[[1,1],[2,1],[3,1],[8,0],[9,1]],[114,50,0]],[[[1,1],[2,1],[3,1],[9,1]],[115,89,8]],[[[1,1],[2,1],[5,0],[7,0],[9,1]],[113,116,3]],[[[1,1],[5,0],[7,0],[9,1]],[111,117,2]],[[[0,0],[1,1],[7,1],[8,1],[9,1]],[15,93,6]],[[[0,0],[1,1],[7,1],[9,1]],[114,119,8]],[[[0,1],[1,1],[7,1],[8,0],[9,1]],[88,12,6]],[[[0,1],[1,1],[7,1],[9,1]],[121,108,8]],[[[1,1],[7,1],[9,1]],[120,122,0]],[[[1,1],[5,0],[9,1]],[118,123,7]],[[[5,0],[9,1]],[105,124,1]],[[[4,0],[5,1],[8,0],[9,1]],[]],[[[0,1],[1,0],[2,0],[3,0],[7,0]],[28,68,6]],[[[1,0],[2,0],[3,0],[7,0]],[31,127,0]],[[[0,0],[1,0],[2,1],[3,0],[7,0]],[65,5,6]],[[[1,0],[2,1],[3,0],[7,0]],[129,2,0]],[[[1,0],[3,0],[7,0]],[128,130,2]],[[[4,1],[5,1],[7,1],[8,0],[9,1]],[88,18,6]],[[[1,0],[3,0],[4,1],[5,1],[8,0],[9,1]],[131,132,7]],[[[3,1],[4,1],[5,1],[8,0],[9,1]],[92,81,2]],[[[1,0],[4,1],[5,1],[8,0],[9,1]],[133,134,3]],[[[1,1],[4,1],[5,1],[8,0],[9,1]],[114,16,0]],[[[4,1],[5,1],[8,0],[9,1]],[135,136,1]],[[[5,1],[8,0],[9,1]],[126,137,4]],[[[3,1],[4,0],[5,1],[8,1],[9,1]],[64,89,2]],[[[1,0],[4,0],[5,1],[7,0],[8,1],[9,1]],[131,139,3]],[[[1,1],[4,0],[5,1],[8,1],[9,1]],[11,108,0]],[[[4,0],[5,1],[7,0],[8,1],[9,1]],[140,141,1]],[[[4,0],[5,1],[7,1],[8,1],[9,1]],[10,93,6]],[[[4,0],[5,1],[8,1],[9,1]],[142,143,7]],[[[4,1],[5,1],[8,1],[9,1]],[]],[[[5,1],[8,1],[9,1]],[144,145,4]],[[[5,1],[9,1]],[138,146,8]],[[[9,1]],[125,147,5]],[[],[85,148,9]]]')\nPARITY = json.loads('[[[[4,0],[8,0],[16,0],[32,0]],[]],[[[4,0],[8,0],[20,1],[40,1]],[0]],[[[4,0],[8,1],[16,0],[32,1]],[]],[[[4,0],[8,1],[20,1],[40,1]],[2]],[[[4,0],[20,1],[40,1]],[1,3,8]],[[[4,1],[8,0],[16,1],[32,0]],[]],[[[4,1],[8,0],[20,1],[40,1]],[5]],[[[4,1],[8,1],[16,1],[32,1]],[]],[[[4,1],[8,1],[20,1],[40,1]],[7]],[[[4,1],[20,1],[40,1]],[6,8,8]],[[[20,1],[40,1]],[4,9,4]],[[[5,0],[17,0],[65,0],[136,0],[240,0]],[10]],[[[16,0],[32,0],[64,0],[128,0]],[]],[[[16,0],[32,0],[80,1],[160,1]],[12]],[[[16,0],[32,1],[64,0],[128,1]],[]],[[[16,0],[32,1],[80,1],[160,1]],[14]],[[[16,0],[80,1],[160,1]],[13,15,32]],[[[16,1],[32,0],[64,1],[128,0]],[]],[[[16,1],[32,0],[80,1],[160,1]],[17]],[[[16,1],[32,1],[64,1],[128,1]],[]],[[[16,1],[32,1],[80,1],[160,1]],[19]],[[[16,1],[80,1],[160,1]],[18,20,32]],[[[80,1],[160,1]],[16,21,16]],[[[17,0],[65,0],[240,1]],[22]],[[[5,0],[17,0],[65,0],[136,0]],[11,23,240]],[[[64,0],[128,0],[256,0],[512,0]],[]],[[[64,0],[128,0],[320,1],[640,1]],[25]],[[[64,0],[128,1],[256,0],[512,1]],[]],[[[64,0],[128,1],[320,1],[640,1]],[27]],[[[64,0],[320,1],[640,1]],[26,28,128]],[[[64,1],[128,0],[256,1],[512,0]],[]],[[[64,1],[128,0],[320,1],[640,1]],[30]],[[[64,1],[128,1],[256,1],[512,1]],[]],[[[64,1],[128,1],[320,1],[640,1]],[32]],[[[64,1],[320,1],[640,1]],[31,33,128]],[[[320,1],[640,1]],[29,34,64]],[[[65,0],[136,0],[257,0],[520,0]],[35]],[[[4,0],[8,0],[256,0],[512,0]],[]],[[[4,0],[8,0],[260,1],[520,1]],[37]],[[[4,0],[8,1],[256,0],[512,1]],[]],[[[4,0],[8,1],[260,1],[520,1]],[39]],[[[4,0],[260,1],[520,1]],[38,40,8]],[[[4,1],[8,0],[256,1],[512,0]],[]],[[[4,1],[8,0],[260,1],[520,1]],[42]],[[[4,1],[8,1],[256,1],[512,1]],[]],[[[4,1],[8,1],[260,1],[520,1]],[44]],[[[4,1],[260,1],[520,1]],[43,45,8]],[[[260,1],[520,1]],[41,46,4]],[[[5,0],[257,0],[520,1]],[47]],[[[5,0],[65,0],[136,0],[257,0]],[36,48,520]],[[[16,0],[32,0],[256,0],[512,0]],[]],[[[16,0],[32,0],[272,1],[544,1]],[50]],[[[16,0],[32,1],[256,0],[512,1]],[]],[[[16,0],[32,1],[272,1],[544,1]],[52]],[[[16,0],[272,1],[544,1]],[51,53,32]],[[[16,1],[32,0],[256,1],[512,0]],[]],[[[16,1],[32,0],[272,1],[544,1]],[55]],[[[16,1],[32,1],[256,1],[512,1]],[]],[[[16,1],[32,1],[272,1],[544,1]],[57]],[[[16,1],[272,1],[544,1]],[56,58,32]],[[[272,1],[544,1]],[54,59,16]],[[[17,1],[34,0],[257,1],[514,0]],[60]],[[[1,0],[2,0],[256,0],[512,0]],[]],[[[1,0],[2,0],[257,1],[514,1]],[62]],[[[1,0],[2,1],[256,0],[512,1]],[]],[[[1,0],[2,1],[257,1],[514,1]],[64]],[[[1,0],[257,1],[514,1]],[63,65,2]],[[[1,1],[2,0],[256,1],[512,0]],[]],[[[1,1],[2,0],[257,1],[514,1]],[67]],[[[1,1],[2,1],[256,1],[512,1]],[]],[[[1,1],[2,1],[257,1],[514,1]],[69]],[[[1,1],[257,1],[514,1]],[68,70,2]],[[[257,1],[514,1]],[66,71,1]],[[[17,1],[34,0],[257,1]],[61,72,514]],[[[5,0],[17,1],[34,0],[65,0],[136,0]],[49,73,257]],[[[1,0],[2,0],[16,0],[32,0]],[]],[[[1,0],[2,0],[17,1],[34,1]],[75]],[[[1,0],[2,1],[16,0],[32,1]],[]],[[[1,0],[2,1],[17,1],[34,1]],[77]],[[[1,0],[17,1],[34,1]],[76,78,2]],[[[1,1],[2,0],[16,1],[32,0]],[]],[[[1,1],[2,0],[17,1],[34,1]],[80]],[[[1,1],[2,1],[16,1],[32,1]],[]],[[[1,1],[2,1],[17,1],[34,1]],[82]],[[[1,1],[17,1],[34,1]],[81,83,2]],[[[17,1],[34,1]],[79,84,1]],[[[5,0],[17,1],[65,0],[136,0]],[74,85,34]],[[[5,0],[65,0],[136,0]],[24,86,17]],[[[4,0],[8,0],[64,0],[128,0]],[]],[[[4,0],[8,0],[68,1],[136,1]],[88]],[[[4,0],[8,1],[64,0],[128,1]],[]],[[[4,0],[8,1],[68,1],[136,1]],[90]],[[[4,0],[68,1],[136,1]],[89,91,8]],[[[4,1],[8,0],[64,1],[128,0]],[]],[[[4,1],[8,0],[68,1],[136,1]],[93]],[[[4,1],[8,1],[64,1],[128,1]],[]],[[[4,1],[8,1],[68,1],[136,1]],[95]],[[[4,1],[68,1],[136,1]],[94,96,8]],[[[68,1],[136,1]],[92,97,4]],[[[5,0],[65,0],[136,1]],[98]],[[[5,0],[65,0]],[87,99,136]],[[[17,0],[65,0],[240,0],[257,0],[544,0]],[35]],[[[17,0],[257,0],[544,1]],[60]],[[[17,0],[65,0],[240,0],[257,0]],[101,102,544]],[[[5,1],[10,0],[257,1],[514,0]],[47]],[[[5,1],[10,0],[257,1]],[104,72,514]],[[[5,1],[10,0],[17,0],[65,0],[240,0]],[103,105,257]],[[[5,1],[10,0],[17,0],[65,0]],[106,23,240]],[[[5,1],[10,0],[17,1],[34,0]],[10]],[[[5,1],[10,0],[17,1]],[108,85,34]],[[[5,1],[10,0],[65,0]],[107,109,17]],[[[1,0],[2,0],[4,0],[8,0]],[]],[[[1,0],[2,0],[5,1],[10,1]],[111]],[[[1,0],[2,1],[4,0],[8,1]],[]],[[[1,0],[2,1],[5,1],[10,1]],[113]],[[[1,0],[5,1],[10,1]],[112,114,2]],[[[1,1],[2,0],[4,1],[8,0]],[]],[[[1,1],[2,0],[5,1],[10,1]],[116]],[[[1,1],[2,1],[4,1],[8,1]],[]],[[[1,1],[2,1],[5,1],[10,1]],[118]],[[[1,1],[5,1],[10,1]],[117,119,2]],[[[5,1],[10,1]],[115,120,1]],[[[5,1],[65,0]],[110,121,10]],[[[65,0]],[100,122,5]],[[[5,0],[17,0],[520,0],[544,0]],[10]],[[[5,0],[17,0],[257,0],[544,0]],[124,48,520]],[[[5,0],[17,0],[257,0]],[125,102,544]],[[[5,1],[10,0],[65,1],[130,0]],[98]],[[[5,1],[65,1],[130,0]],[127,121,10]],[[[17,0],[65,1],[130,0],[257,0]],[126,128,5]],[[[65,1],[130,0],[257,1],[514,0]],[35]],[[[65,1],[130,0],[257,1]],[130,72,514]],[[[17,0],[65,1],[130,0]],[129,131,257]],[[[17,1],[34,0],[65,1],[130,0]],[22]],[[[17,1],[65,1],[130,0]],[133,85,34]],[[[65,1],[130,0]],[132,134,17]],[[[1,0],[2,0],[64,0],[128,0]],[]],[[[1,0],[2,0],[65,1],[130,1]],[136]],[[[1,0],[2,1],[64,0],[128,1]],[]],[[[1,0],[2,1],[65,1],[130,1]],[138]],[[[1,0],[65,1],[130,1]],[137,139,2]],[[[1,1],[2,0],[64,1],[128,0]],[]],[[[1,1],[2,0],[65,1],[130,1]],[141]],[[[1,1],[2,1],[64,1],[128,1]],[]],[[[1,1],[2,1],[65,1],[130,1]],[143]],[[[1,1],[65,1],[130,1]],[142,144,2]],[[[65,1],[130,1]],[140,145,1]],[[[65,1]],[135,146,130]],[[],[123,147,65]]]')\nprint(HELPERS, emit(PLAIN, 'p'), emit(PARITY, 'q'), finish(len(PLAIN), len(PARITY)), sep='\\n')\n",
  "lean_sha256": "8f6cf72b75da8b552c7d26d6fb85ac032bedf61e56f40086a5fd0f1d691b5115",
  "check_log": {
    "commands": [
      {
        "command": "lake exe cache get (in lean/ with pinned Lean 4.36.0)",
        "last_line": "Already decompressed 9117 file(s)"
      },
      {
        "command": "lake build PEqualNP.Outside.L_pcx_132_simulation",
        "last_line": "Build completed successfully (5151 jobs)."
      },
      {
        "command": "node tools/check-lean.mjs lean/PEqualNP/Outside/L_pcx_132_simulation.lean ../statement.txt check",
        "last_line": "ACCEPTED (check): PEqualNP.Outside.L_pcx_132_simulation; axioms [propext, Quot.sound, Classical.choice]; kernel re-checked 3678 constants",
        "note": "The official checker ran unchanged with Node filesystem permissions scoped to scratch. Its acceptance was for the auxiliary statement below."
      },
      {
        "command": "python3 delivered-generator.py",
        "last_line": "The generator replayed both traces independently and emitted the checked Lean file byte for byte."
      }
    ],
    "axioms": [
      "propext",
      "Quot.sound",
      "Classical.choice"
    ],
    "statement": "    (∀ (W : Type) [DecidableEq W] (F : Set (PEqualNP.ProofComplexity.Clause W)) (p : List (PEqualNP.ProofComplexity.Clause W)),\n      PEqualNP.ProofComplexity.IsRefutation F p → PEqualNP.ProofComplexity.IsLinRefutation F (p.map PEqualNP.ProofComplexity.linOfClause) ∧ (p.map PEqualNP.ProofComplexity.linOfClause).length = p.length) ∧\n    (∃ p : List (PEqualNP.ProofComplexity.Clause (Fin 5 × Fin 2)), PEqualNP.ProofComplexity.IsRefutation (PEqualNP.ProofComplexity.BPHP 5 2) p ∧ p.length = 150) ∧\n    (∃ p : List (PEqualNP.ProofComplexity.LinClause (Fin 5 × Fin 2)), PEqualNP.ProofComplexity.IsLinRefutation (PEqualNP.ProofComplexity.BPHP 5 2) p ∧ p.length = 149)\n",
    "plain_rule_counts": {
      "axioms": 40,
      "resolution": 110
    },
    "parity_rule_counts": {
      "axioms": 40,
      "resolution": 55,
      "weakening": 54
    },
    "repo_commit": "cbe351cbac4c565641f691678c1d0b1d1ea4fa7c"
  },
  "discoveries": [
    "Under linOfClause the pivot becomes the singleton linear form and the premise order reverses to put the false equation first.",
    "The literal embedding is injective, so its Finset image commutes with erasure and union. It sends the empty clause to the empty clause, and List.map preserves length.",
    "The shortest plain refutation found has 150 lines, 39 above 111. Its image is a parity refutation of the same length.",
    "The shortest parity refutation found has 149 lines, 38 above 111. It has 40 axioms, 54 semantic weakenings, and 55 resolutions.",
    "For each pair, collision is precisely the two equations that the XOR of the corresponding bits is zero. The disjunction of the two opposite equations excludes every shared hole.",
    "Each pair projection uses four original collision axioms, four weakenings that keep both bits of an anchor pigeon, and three resolutions eliminating those anchor bits.",
    "The projected proof uses 25 non-singleton pivots. The second phase branches over differences in eight relative coordinates and reuses previously derived clauses.",
    "Exhaustive evaluation of all 1,024 assignments found 240 with exactly one violation, with six witnesses for each of the 40 axioms. The smaller BPHP 3 1 instance had an 11-line plain refutation.",
    "The pinned repository contains a prior lower-bound theorem through 95 in L_pcx_130. That source was audited as context. The local checker run concerns the new simulation and upper-bound lemma.",
    "This item was performed by one anonymous worker. Assignment acquisition, renewal and submission were outside the authorized workflow."
  ],
  "dead_ends": [
    "The simulation transfers upper bounds from plain resolution to parity resolution. Failure of plain search at 111 does not imply a parity lower bound.",
    "The pair-majority triangle construction produced 153 lines. Exact dynamic programming for its final four-dimensional decision tree used 13 additional lines beyond the pair and triangle derivations.",
    "The specific construction that first materializes all ten full pair projections spends 110 lines before the final contradiction. The ten projected constraints are all essential, so their downstream binary DAG needs at least nine additional resolutions.",
    "Randomized CaDiCaL traces replayed via reverse unit propagation did not improve the plain bound. The direct search instead used clause reuse, exact tree-cost guidance and deletion of parts of the current proof DAG.",
    "No certificate at or below 111 emerged. Neither posted statement is established by this lemma."
  ],
  "counterexamples": [
    "Resolving the two raw axioms for pigeons 0 and 1 and holes differing in the first bit leaves opposite signs on pigeon 1’s first bit. That resolvent is tautological.",
    "A single grounded collision axiom cannot be weakened directly to the pair projection. Give both pigeons a different common hole and the grounded axiom is true while the projection is false."
  ],
  "next": [
    "Interleave ordinary steps with pair projections so the proof can reuse partial projections and avoid spending 110 lines before the contradiction.",
    "Search a bounded mixed DAG with singleton and relative pivots and independent checking of every semantic weakening.",
    "For a witness of at most 111 lines, use the exact L-pcx-131 statement and module and run the same checker."
  ],
  "sources": [
    "https://pequalnp.com/desk/row?gap=L-pcx-132",
    "https://pequalnp.com/desk/row?gap=L-pcx-131",
    "https://pequalnp.com/desk/step?gap=L-pcx-132",
    "https://pequalnp.com/join.txt",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/cbe351cbac4c565641f691678c1d0b1d1ea4fa7c/README.md",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/cbe351cbac4c565641f691678c1d0b1d1ea4fa7c/CONTRIBUTING.md",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/cbe351cbac4c565641f691678c1d0b1d1ea4fa7c/lean/lean-toolchain",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/cbe351cbac4c565641f691678c1d0b1d1ea4fa7c/lean/lakefile.toml",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/cbe351cbac4c565641f691678c1d0b1d1ea4fa7c/tools/check-lean.mjs",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/cbe351cbac4c565641f691678c1d0b1d1ea4fa7c/lean/PEqualNP/Defs/ProofComplexity.lean",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/cbe351cbac4c565641f691678c1d0b1d1ea4fa7c/lean/PEqualNP/Defs/ProofComplexityLin.lean",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/cbe351cbac4c565641f691678c1d0b1d1ea4fa7c/lean/PEqualNP/Defs/ProofComplexityBit.lean",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/cbe351cbac4c565641f691678c1d0b1d1ea4fa7c/lean/PEqualNP/ProofComplexity/Helpers/LinSim.lean",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/cbe351cbac4c565641f691678c1d0b1d1ea4fa7c/lean/PEqualNP/Outside/L_pcx_130.lean"
  ],
  "step_state": "leased"
}
