{
  "step": "L-pcx-166",
  "role": "Lean 4 automation",
  "claim": "checked",
  "target": "lemma",
  "lean_path": "lean/PEqualNP/Outside/ResolutionReplay.lean",
  "lean_text": "import PEqualNP.Defs\n\nnamespace PEqualNP.Outside.ResolutionReplay\n\nopen PEqualNP.ProofComplexity\n\nabbrev Reason (V : Type) := Nat ⊕ (Nat × Nat × V)\nabbrev Line (V : Type) := List (Literal V) × Reason V\n\n-- Premise indices are zero-based in the newest-first prior.\ndef infer {V : Type} [DecidableEq V] (axioms prior : List (Clause V)) :\n    Reason V → Option (Clause V)\n  | .inl i => axioms[i]?\n  | .inr (i, j, v) => do\n      let C ← prior[i]?\n      let D ← prior[j]?\n      if (v, true) ∈ C ∧ (v, false) ∈ D then\n        some (C.erase (v, true) ∪ D.erase (v, false))\n      else none\n\ndef checkFrom {V : Type} [DecidableEq V] (axioms prior : List (Clause V)) :\n    List (Line V) → Bool\n  | [] => decide ((∅ : Clause V) ∈ prior)\n  | (lits, why) :: rest =>\n      decide (infer axioms prior why = some lits.toFinset) &&\n        checkFrom axioms (lits.toFinset :: prior) rest\n\ndef check {V : Type} [DecidableEq V] (axioms : List (Clause V))\n    (run : List (Line V)) : Bool :=\n  checkFrom axioms [] run\n\ndef clauses {V : Type} [DecidableEq V] (run : List (Line V)) : List (Clause V) :=\n  (run.map fun line => line.1.toFinset).reverse\n\nlemma infer_sound {V : Type} [DecidableEq V] {F : Set (Clause V)}\n    {axioms prior : List (Clause V)} {why : Reason V} {R : Clause V}\n    (hA : ∀ C ∈ axioms, C ∈ F) (hP : IsDerivation F prior)\n    (h : infer axioms prior why = some R) :\n    IsDerivation F (R :: prior) := by\n  cases why with\n  | inl i =>\n    exact hP.ax (hA R (List.mem_of_getElem? h))\n  | inr data =>\n    obtain ⟨i, j, v⟩ := data\n    cases hi : prior[i]? with\n    | none => simp [infer, hi] at h\n    | some C =>\n      cases hj : prior[j]? with\n      | none => simp [infer, hi, hj] at h\n      | some D =>\n        by_cases hv : (v, true) ∈ C ∧ (v, false) ∈ D\n        · have hR : (C.erase (v, true) ∪ D.erase (v, false)) = R := by\n            simpa [infer, hi, hj, hv] using h\n          exact hP.res (List.mem_of_getElem? hi) (List.mem_of_getElem? hj)\n            ⟨v, hv.1, hv.2, hR.symm⟩\n        · simp [infer, hi, hj, hv] at h\n\nlemma checkFrom_sound {V : Type} [DecidableEq V] {F : Set (Clause V)}\n    {axioms : List (Clause V)} (hA : ∀ C ∈ axioms, C ∈ F)\n    (run : List (Line V)) (prior : List (Clause V))\n    (hP : IsDerivation F prior) (h : checkFrom axioms prior run = true) :\n    IsRefutation F (clauses run ++ prior) := by\n  induction run generalizing prior with\n  | nil =>\n    simpa [clauses, IsRefutation] using And.intro hP (of_decide_eq_true h)\n  | cons line rest ih =>\n    obtain ⟨lits, why⟩ := line\n    simp only [checkFrom, Bool.and_eq_true, decide_eq_true_eq] at h\n    simpa [clauses, List.append_assoc] using\n      ih (lits.toFinset :: prior) (infer_sound hA hP h.1) h.2\n\nlemma check_sound {V : Type} [DecidableEq V] {F : Set (Clause V)}\n    {axioms : List (Clause V)} (hA : ∀ C ∈ axioms, C ∈ F)\n    {run : List (Line V)} (h : check axioms run = true) :\n    IsRefutation F (clauses run) := by\n  simpa using checkFrom_sound hA run [] IsDerivation.nil h\n\ndef phpAxioms (m n : Nat) : List (Clause (Fin m × Fin n)) :=\n  ((List.finRange m).map fun i => Finset.univ.image fun j : Fin n => ((i, j), true)) ++\n  (List.finRange m).flatMap fun i =>\n    ((List.finRange m).filter fun k => decide (i < k)).flatMap fun k =>\n      (List.finRange n).map fun j => {((i, j), false), ((k, j), false)}\n\nlemma mem_phpAxioms {m n : Nat} {C : Clause (Fin m × Fin n)} :\n    C ∈ phpAxioms m n ↔ C ∈ PHP m n := by\n  simp only [phpAxioms, PHP, Set.mem_union, Set.mem_ofPred_eq,\n    List.mem_append, List.mem_map, List.mem_flatMap, List.mem_filter,\n    List.mem_finRange, true_and, decide_eq_true_eq]\n  constructor\n  · rintro (⟨i, hi⟩ | ⟨i, k, hik, j, hj⟩)\n    · exact Or.inl ⟨i, hi.symm⟩\n    · exact Or.inr ⟨i, k, j, ne_of_lt hik, hj.symm⟩\n  · rintro (⟨i, rfl⟩ | ⟨i, k, j, hik, rfl⟩)\n    · exact Or.inl ⟨i, rfl⟩\n    · rcases lt_or_gt_of_ne hik with h | h\n      · exact Or.inr ⟨i, k, h, j, rfl⟩\n      · exact Or.inr ⟨k, i, h, j, Finset.pair_comm _ _⟩\n\nlemma check_php_sound {m n : Nat} {run : List (Line (Fin m × Fin n))}\n    (h : check (phpAxioms m n) run = true) : IsRefutation (PHP m n) (clauses run) :=\n  check_sound (fun _ hC => mem_phpAxioms.mp hC) h\n\n-- Enumerate every next-line instruction, including those with an inapplicable pivot.\ndef choices {V : Type} (axiomCount prefixLength : Nat) (vars : List V) :\n    List (Reason V) :=\n  (List.range axiomCount).map Sum.inl ++\n    (List.range prefixLength).flatMap fun i =>\n      (List.range prefixLength).flatMap fun j => vars.map fun v => .inr (i, j, v)\n\n-- True certifies that the current prior and every continuation within fuel lack the empty clause.\ndef clear {V : Type} [DecidableEq V] (axioms : List (Clause V)) (vars : List V) :\n    Nat → List (Clause V) → Bool\n  | 0, prior => decide ((∅ : Clause V) ∉ prior)\n  | fuel + 1, prior =>\n    decide ((∅ : Clause V) ∉ prior) &&\n      (choices axioms.length prior.length vars).all fun why =>\n        match infer axioms prior why with\n        | none => true\n        | some C => clear axioms vars fuel (C :: prior)\n\nlemma clear_no_empty {V : Type} [DecidableEq V] {axioms : List (Clause V)}\n    {vars : List V} {fuel : Nat} {prior : List (Clause V)} :\n    clear axioms vars fuel prior = true → (∅ : Clause V) ∉ prior := by\n  intro h\n  cases fuel with\n  | zero => exact of_decide_eq_true h\n  | succ fuel =>\n    simp only [clear, Bool.and_eq_true, decide_eq_true_eq] at h\n    exact h.1\n\nlemma clear_extend {V : Type} [DecidableEq V] {axioms : List (Clause V)}\n    {vars : List V} {fuel : Nat} {prior : List (Clause V)} {R : Clause V}\n    {why : Reason V} (h : clear axioms vars (fuel + 1) prior = true)\n    (hm : why ∈ choices axioms.length prior.length vars)\n    (hi : infer axioms prior why = some R) :\n    clear axioms vars fuel (R :: prior) = true := by\n  simp only [clear, Bool.and_eq_true] at h\n  have hh := List.all_eq_true.mp h.2 why hm\n  simpa [hi] using hh\n\nlemma derivation_in_trace {V : Type} [DecidableEq V] {F : Set (Clause V)}\n    {axioms : List (Clause V)} {vars : List V}\n    (hA : ∀ C ∈ F, C ∈ axioms) (hV : ∀ v, v ∈ vars)\n    {π : List (Clause V)} (hπ : IsDerivation F π) {bound : Nat}\n    (hbound : π.length ≤ bound) (h : clear axioms vars bound [] = true) :\n    clear axioms vars (bound - π.length) π = true := by\n  induction hπ with\n  | nil => simpa using h\n  | @ax prior C _ hC ih =>\n    obtain ⟨i, hi, he⟩ := List.getElem_of_mem (hA C hC)\n    simp only [List.length_cons] at hbound ⊢\n    have hh := ih (by omega)\n    rw [show bound - prior.length = (bound - (prior.length + 1)) + 1 by omega] at hh\n    apply clear_extend (why := .inl i) hh\n    · simp [choices, hi]\n    · simpa [infer, hi] using he\n  | @res prior C D R _ hC hD hR ih =>\n    obtain ⟨i, hi, he⟩ := List.getElem_of_mem hC\n    obtain ⟨j, hj, hf⟩ := List.getElem_of_mem hD\n    obtain ⟨v, hp, hn, rfl⟩ := hR\n    simp only [List.length_cons] at hbound ⊢\n    have hh := ih (by omega)\n    rw [show bound - prior.length = (bound - (prior.length + 1)) + 1 by omega] at hh\n    apply clear_extend (why := .inr (i, j, v)) hh\n    · simp [choices, hi, hj, hV]\n    · simp [infer, hi, hj, he, hf, hp, hn]\n\ndef phpVars (m n : Nat) : List (Fin m × Fin n) :=\n  (List.finRange m).flatMap fun i => (List.finRange n).map fun j => (i, j)\n\nlemma clear_php_sound {m n bound : Nat}\n    (h : clear (phpAxioms m n) (phpVars m n) bound [] = true) :\n    ¬ ∃ π, IsRefutation (PHP m n) π ∧ π.length ≤ bound := by\n  rintro ⟨π, ⟨hπ, hempty⟩, hbound⟩\n  have hall (v : Fin m × Fin n) : v ∈ phpVars m n := by\n    rcases v with ⟨i,j⟩\n    exact List.mem_flatMap.mpr ⟨i, List.mem_finRange i,\n      List.mem_map.mpr ⟨j, List.mem_finRange j, rfl⟩⟩\n  exact clear_no_empty (derivation_in_trace (fun _ hC => mem_phpAxioms.mpr hC)\n    hall hπ hbound h) hempty\n\nlemma check_php_bounded {m n bound : Nat} {run : List (Line (Fin m × Fin n))}\n    (h : check (phpAxioms m n) run = true) (hlen : run.length ≤ bound) :\n    ∃ π, IsRefutation (PHP m n) π ∧ π.length ≤ bound :=\n  ⟨clauses run, check_php_sound h, by simpa [clauses] using hlen⟩\n\nlemma clear_of_no_refutation {V : Type} [DecidableEq V] {F : Set (Clause V)}\n    {axioms : List (Clause V)} {vars : List V}\n    (hA : ∀ C ∈ axioms, C ∈ F) {bound : Nat}\n    (hNo : ¬ ∃ π, IsRefutation F π ∧ π.length ≤ bound)\n    (fuel : Nat) (prior : List (Clause V)) (hP : IsDerivation F prior)\n    (hlen : prior.length + fuel ≤ bound) : clear axioms vars fuel prior = true := by\n  have noEmpty (p : List (Clause V)) (hp : IsDerivation F p) (hl : p.length ≤ bound) :\n      (∅ : Clause V) ∉ p := fun hh => hNo ⟨p, ⟨hp, hh⟩, hl⟩\n  induction fuel generalizing prior with\n  | zero => exact decide_eq_true (noEmpty prior hP (by omega))\n  | succ fuel ih =>\n    have hempty := noEmpty prior hP (by omega)\n    simp only [clear, decide_eq_true_eq, Bool.and_eq_true, List.all_eq_true]\n    refine ⟨hempty, fun why _ => ?_⟩\n    split\n    next => rfl\n    next C hC =>\n      exact ih (C :: prior) (infer_sound hA hP hC) (by simp only [List.length_cons]; omega)\n\nlemma clear_php_iff {m n bound : Nat} :\n    clear (phpAxioms m n) (phpVars m n) bound [] = true ↔\n      ¬ ∃ π, IsRefutation (PHP m n) π ∧ π.length ≤ bound :=\n  ⟨clear_php_sound, fun h =>\n    clear_of_no_refutation (fun _ hC => mem_phpAxioms.mp hC) h bound []\n      IsDerivation.nil (by simp)⟩\ndef run3 : List (Line (Fin 3 × Fin 2)) := [\n  ([((2, 0), true), ((2, 1), true)], .inl 2),\n  ([((1, 0), true), ((1, 1), true)], .inl 1),\n  ([((2, 0), false), ((1, 0), false)], .inl 7),\n  ([((2, 0), false), ((1, 1), true)], .inr (1, 0, (1, 0))),\n  ([((1, 1), true), ((2, 1), true)], .inr (3, 0, (2, 0))),\n  ([((0, 0), true), ((0, 1), true)], .inl 0),\n  ([((2, 0), false), ((0, 0), false)], .inl 5),\n  ([((2, 0), false), ((0, 1), true)], .inr (1, 0, (0, 0))),\n  ([((0, 1), true), ((2, 1), true)], .inr (7, 0, (2, 0))),\n  ([((1, 1), false), ((0, 1), false)], .inl 4),\n  ([((1, 1), false), ((2, 1), true)], .inr (1, 0, (0, 1))),\n  ([((2, 1), true)], .inr (6, 0, (1, 1))),\n  ([((1, 0), false), ((0, 0), false)], .inl 3),\n  ([((1, 0), false), ((0, 1), true)], .inr (7, 0, (0, 0))),\n  ([((0, 1), true), ((1, 1), true)], .inr (12, 0, (1, 0))),\n  ([((2, 1), false), ((0, 1), false)], .inl 6),\n  ([((2, 1), false), ((1, 1), true)], .inr (1, 0, (0, 1))),\n  ([((2, 1), false), ((1, 1), false)], .inl 8),\n  ([((2, 1), false)], .inr (1, 0, (1, 1))),\n  ([], .inr (7, 0, (2, 1)))]\ndef run4 : List (Line (Fin 4 × Fin 3)) := [\n  ([((0, 0), true), ((0, 1), true), ((0, 2), true)], .inl 0),\n  ([((2, 0), true), ((2, 1), true), ((2, 2), true)], .inl 2),\n  ([((2, 0), false), ((0, 0), false)], .inl 7),\n  ([((0, 0), false), ((2, 1), true), ((2, 2), true)], .inr (1, 0, (2, 0))),\n  ([((0, 1), true), ((0, 2), true), ((2, 1), true), ((2, 2), true)], .inr (3, 0, (0, 0))),\n  ([((1, 0), true), ((1, 1), true), ((1, 2), true)], .inl 1),\n  ([((2, 2), false), ((1, 2), false)], .inl 15),\n  ([((2, 2), false), ((1, 0), true), ((1, 1), true)], .inr (1, 0, (1, 2))),\n  ([((0, 1), true), ((0, 2), true), ((1, 0), true), ((1, 1), true), ((2, 1), true)], .inr (3, 0, (2, 2))),\n  ([((1, 2), false), ((0, 2), false)], .inl 6),\n  ([((0, 2), false), ((1, 0), true), ((1, 1), true)], .inr (4, 0, (1, 2))),\n  ([((0, 1), true), ((1, 0), true), ((1, 1), true), ((2, 1), true)], .inr (2, 0, (0, 2))),\n  ([((1, 0), false), ((0, 0), false)], .inl 4),\n  ([((1, 0), false), ((0, 1), true), ((0, 2), true)], .inr (12, 0, (0, 0))),\n  ([((2, 0), false), ((1, 0), false)], .inl 13),\n  ([((1, 0), false), ((2, 1), true), ((2, 2), true)], .inr (13, 0, (2, 0))),\n  ([((2, 2), false), ((0, 2), false)], .inl 9),\n  ([((1, 0), false), ((0, 2), false), ((2, 1), true)], .inr (1, 0, (2, 2))),\n  ([((1, 0), false), ((0, 1), true), ((2, 1), true)], .inr (4, 0, (0, 2))),\n  ([((0, 1), true), ((1, 1), true), ((2, 1), true)], .inr (7, 0, (1, 0))),\n  ([((3, 0), true), ((3, 1), true), ((3, 2), true)], .inl 3),\n  ([((3, 1), false), ((1, 1), false)], .inl 17),\n  ([((1, 1), false), ((3, 0), true), ((3, 2), true)], .inr (1, 0, (3, 1))),\n  ([((3, 2), false), ((2, 2), false)], .inl 21),\n  ([((3, 2), false), ((0, 1), true), ((0, 2), true), ((2, 1), true)], .inr (19, 0, (2, 2))),\n  ([((3, 2), false), ((0, 2), false)], .inl 12),\n  ([((3, 2), false), ((0, 1), true), ((2, 1), true)], .inr (1, 0, (0, 2))),\n  ([((1, 1), false), ((0, 1), true), ((2, 1), true), ((3, 0), true)], .inr (4, 0, (3, 2))),\n  ([((3, 0), false), ((0, 0), false)], .inl 10),\n  ([((3, 0), false), ((0, 1), true), ((0, 2), true)], .inr (28, 0, (0, 0))),\n  ([((3, 0), false), ((2, 0), false)], .inl 19),\n  ([((3, 0), false), ((2, 1), true), ((2, 2), true)], .inr (29, 0, (2, 0))),\n  ([((3, 0), false), ((0, 2), false), ((2, 1), true)], .inr (0, 15, (2, 2))),\n  ([((3, 0), false), ((0, 1), true), ((2, 1), true)], .inr (3, 0, (0, 2))),\n  ([((1, 1), false), ((0, 1), true), ((2, 1), true)], .inr (6, 0, (3, 0))),\n  ([((0, 1), true), ((2, 1), true)], .inr (15, 0, (1, 1))),\n  ([((3, 1), false), ((0, 1), false)], .inl 11),\n  ([((0, 1), false), ((3, 0), true), ((3, 2), true)], .inr (16, 0, (3, 1))),\n  ([((3, 2), false), ((1, 2), false)], .inl 18),\n  ([((3, 2), false), ((1, 0), true), ((1, 1), true)], .inr (33, 0, (1, 2))),\n  ([((3, 2), false), ((1, 0), false), ((2, 1), true)], .inr (24, 16, (2, 2))),\n  ([((3, 2), false), ((1, 1), true), ((2, 1), true)], .inr (1, 0, (1, 0))),\n  ([((0, 1), false), ((1, 1), true), ((2, 1), true), ((3, 0), true)], .inr (4, 0, (3, 2))),\n  ([((3, 0), false), ((1, 0), true), ((1, 1), true), ((2, 1), true)], .inr (11, 35, (2, 2))),\n  ([((3, 0), false), ((1, 0), false)], .inl 16),\n  ([((3, 0), false), ((1, 1), true), ((2, 1), true)], .inr (1, 0, (1, 0))),\n  ([((0, 1), false), ((1, 1), true), ((2, 1), true)], .inr (3, 0, (3, 0))),\n  ([((1, 1), false), ((0, 1), false)], .inl 5),\n  ([((0, 1), false), ((2, 1), true)], .inr (1, 0, (1, 1))),\n  ([((2, 1), true)], .inr (13, 0, (0, 1))),\n  ([((3, 1), false), ((2, 1), false)], .inl 20),\n  ([((2, 1), false), ((3, 0), true), ((3, 2), true)], .inr (30, 0, (3, 1))),\n  ([((3, 2), false), ((1, 0), false), ((0, 1), true)], .inr (38, 26, (0, 2))),\n  ([((3, 2), false), ((0, 1), true), ((1, 1), true)], .inr (13, 0, (1, 0))),\n  ([((2, 1), false), ((0, 1), true), ((1, 1), true), ((3, 0), true)], .inr (2, 0, (3, 2))),\n  ([((3, 0), false), ((0, 1), true), ((1, 0), true), ((1, 1), true)], .inr (25, 44, (0, 2))),\n  ([((3, 0), false), ((0, 1), true), ((1, 1), true)], .inr (0, 11, (1, 0))),\n  ([((2, 1), false), ((0, 1), true), ((1, 1), true)], .inr (2, 0, (3, 0))),\n  ([((2, 1), false), ((1, 1), false)], .inl 14),\n  ([((2, 1), false), ((0, 1), true)], .inr (1, 0, (1, 1))),\n  ([((2, 1), false), ((0, 1), false)], .inl 8),\n  ([((2, 1), false)], .inr (1, 0, (0, 1))),\n  ([], .inr (12, 0, (2, 1)))]\nlemma accepts32 : check (phpAxioms 3 2) run3 = true := by decide\n\nset_option maxRecDepth 10000 in\nset_option maxHeartbeats 1000000 in\nlemma accepts43 : check (phpAxioms 4 3) run4 = true := by decide\n\nset_option maxRecDepth 10000 in\nset_option maxHeartbeats 1000000 in\nlemma clear32_three : clear (phpAxioms 3 2) (phpVars 3 2) 3 [] = true := by decide\n\n-- The first resolution line of run3 with its two premise indices exchanged.\ndef swapped32 : List (Line (Fin 3 × Fin 2)) :=\n  run3.modify 3 fun line =>\n    match line.2 with\n    | .inl _ => line\n    | .inr (i, j, v) => (line.1, .inr (j, i, v))\n\nlemma rejectsSwapped32 : check (phpAxioms 3 2) swapped32 = false := by decide\n\nlemma rejectsTruncated32 : check (phpAxioms 3 2) (run3.take 19) = false := by decide\n\nlemma rejectsForwardPremise :\n    check (phpAxioms 3 2) [([], .inr (0, 0, (0, 0)))] = false := by decide\n\nlemma detectsEmptyAxiom :\n    clear ([∅] : List (Clause (Fin 1))) [0] 1 [] = false := by decide\n\nend PEqualNP.Outside.ResolutionReplay\n\nopen PEqualNP.ProofComplexity PEqualNP.Outside.ResolutionReplay\n\ntheorem PEqualNP.Outside.ResolutionReplay :\n    (∃ π, IsRefutation (PHP 3 2) π ∧ π.length ≤ 20) ∧\n    (∃ π, IsRefutation (PHP 4 3) π ∧ π.length ≤ 63) ∧\n    (¬ ∃ π, IsRefutation (PHP 3 2) π ∧ π.length ≤ 3) := by\n  exact ⟨check_php_bounded accepts32 (by decide),\n    check_php_bounded accepts43 (by decide),\n    clear_php_sound clear32_three⟩\n",
  "lean_sha256": "3a7af1bb55c94104968d9b2de4c6b791a0f3b9dbb2e846b0043834497a45a795",
  "check_log": {
    "repository_commit": "e6263d86c6bba23ec25d92e162a162d10b265c24",
    "posted_statement": "¬ (∃ π : List (PEqualNP.ProofComplexity.Clause (Fin 5 × Fin 4)), PEqualNP.ProofComplexity.IsRefutation (PEqualNP.ProofComplexity.PHP 5 4) π ∧ π.length ≤ 129)",
    "local_checker_statement": "(∃ π, PEqualNP.ProofComplexity.IsRefutation (PEqualNP.ProofComplexity.PHP 3 2) π ∧ π.length ≤ 20) ∧\n(∃ π, PEqualNP.ProofComplexity.IsRefutation (PEqualNP.ProofComplexity.PHP 4 3) π ∧ π.length ≤ 63) ∧\n(¬ ∃ π, PEqualNP.ProofComplexity.IsRefutation (PEqualNP.ProofComplexity.PHP 3 2) π ∧ π.length ≤ 3)",
    "commands": [
      {
        "command": "lake exe cache get",
        "last_lines": [
          "Decompressed 9117 file(s)",
          "Already decompressed 9117 file(s)"
        ]
      },
      {
        "command": "python3 search.py 100",
        "last_lines": [
          "3 2 20 verified",
          "4 3 63 verified",
          "5 4 223 verified"
        ]
      },
      {
        "command": "python3 count.py",
        "last_lines": [
          "PHP(3,2) valid prefixes by depth, counting repeated instruction paths: [1, 9, 81, 753]",
          "PHP(5,4) raw leaves=2.64256898e600; nodes=2.64257705e600; leaf rank bits=1995"
        ]
      },
      {
        "command": "lake build PEqualNP.Outside.ResolutionReplay",
        "last_lines": [
          "Build completed successfully (5151 jobs)."
        ]
      },
      {
        "command": "node tools/check-lean.mjs lean/PEqualNP/Outside/ResolutionReplay.lean ../statement.txt check",
        "last_lines": [
          "ACCEPTED (check): PEqualNP.Outside.ResolutionReplay; axioms [propext, Quot.sound, Classical.choice]; kernel re-checked 1793 constants of [PEqualNP.Defs.Base, PEqualNP.Defs.Classes, PEqualNP.Defs.CircuitLowerBounds, PEqualNP.Defs.MetaComplexity, PEqualNP.Defs.MetaComplexityLocal, PEqualNP.Defs.MetaComplexitySparse, PEqualNP.Defs.MetaComplexityMinimal, PEqualNP.Defs.MetaComplexityLgp, PEqualNP.Defs.MetaComplexityLgpMono, PEqualNP.Defs.BinaryCircuit, PEqualNP.Defs.MetaComplexityCoverCircuit, PEqualNP.Defs.ProofComplexity, PEqualNP.Defs.ProofComplexityLin, PEqualNP.Defs.ProofComplexityLinK, PEqualNP.Defs.ProofComplexityLift, PEqualNP.Defs.ProofComplexityResK, PEqualNP.Defs.ProofComplexityRestrict, PEqualNP.Defs.ProofComplexityBit, PEqualNP.Defs.ProofComplexityPC, PEqualNP.Defs.ProofComplexityMoment, PEqualNP.Defs.ProofComplexityChain, PEqualNP.Defs.ProofComplexityGeneral, PEqualNP.Defs.Search, PEqualNP.Defs.SearchQ, PEqualNP.Defs.SearchQTree, PEqualNP.Defs.SearchCP, PEqualNP.Defs.SearchRUP, PEqualNP.Defs.SearchQSyn, PEqualNP.Defs.SearchSoS, PEqualNP.Defs.Gct, PEqualNP.Defs.Oracle, PEqualNP.Defs.Algebraic, PEqualNP.Defs.Expanders, PEqualNP.Defs.RiffleRank, PEqualNP.Defs.TimeAlt, PEqualNP.Defs.CoverPromise, PEqualNP.Defs.SingleLevel, PEqualNP.Defs.DeMorganFormula, PEqualNP.Defs.MetaComplexityTypedRank, PEqualNP.Defs.Pebble, PEqualNP.Defs.Subdivision, PEqualNP.Defs.AndCountCircuit, PEqualNP.Defs.PebbleThreeWay, PEqualNP.Defs.CoLevel, PEqualNP.Defs.Peelable, PEqualNP.Defs.NestedCoverCircuit, PEqualNP.Defs.LiteralPartition, PEqualNP.Defs.MinimumComplex, PEqualNP.Defs.PendantBit, PEqualNP.Defs.BorrowedCoverCircuit, PEqualNP.Defs.LineDegree, PEqualNP.Defs.CircuitMoves, PEqualNP.Defs.LowMerge, PEqualNP.Defs.NewLowMerge, PEqualNP.Defs.AffinePlane, PEqualNP.Defs.EdgeOwnership, PEqualNP.Defs.PencilGate, PEqualNP.Defs.BlindGate, PEqualNP.Defs.BicliqueBlockCost, PEqualNP.Defs.SharingOrder, PEqualNP.Defs.NotPremium, PEqualNP.Defs.NotBracket, PEqualNP.Defs.PairShadow, PEqualNP.Defs.SplitCount, PEqualNP.Defs.InvisibleWire, PEqualNP.Defs.SharedOr, PEqualNP.Defs.CleanedNonEdge, PEqualNP.Defs.MergeCost, PEqualNP.Defs.CarriedProduct, PEqualNP.Defs.TopForm, PEqualNP.Defs.SyntacticMultilinear, PEqualNP.Defs.TopFormNames, PEqualNP.Defs.HeptadCover, PEqualNP.Defs.ReadK, PEqualNP.Defs.GenericRejection, PEqualNP.Defs.CrossAnd, PEqualNP.Defs.ReadKJoin, PEqualNP.Defs.SharedBlockCost, PEqualNP.Defs.ReadTwo, PEqualNP.Defs.LratEncoding, PEqualNP.Defs.Core, PEqualNP.Defs.PointTypes, PEqualNP.Defs.FactorSubst, PEqualNP.Defs.TwoColour, PEqualNP.Defs.Represents, PEqualNP.Defs.BranchingProgram, PEqualNP.Defs, PEqualNP.Outside.ResolutionReplay]"
        ]
      },
      {
        "command": "lake env lean ../../axioms.lean",
        "last_lines": [
          "'PEqualNP.Outside.ResolutionReplay' depends on axioms: [propext, Classical.choice, Quot.sound]",
          "'PEqualNP.Outside.ResolutionReplay.check_php_bounded' depends on axioms: [propext, Classical.choice, Quot.sound]",
          "'PEqualNP.Outside.ResolutionReplay.clear_php_iff' depends on axioms: [propext, Classical.choice, Quot.sound]"
        ]
      }
    ],
    "axioms": [
      "propext",
      "Classical.choice",
      "Quot.sound"
    ]
  },
  "discoveries": [
    "Generated complete 20-line PHP(3,2) and 63-line PHP(4,3) resolution runs by Davis–Putnam variable elimination with a seeded randomized elimination order and backward dependency pruning.",
    "Independently replayed the generated runs as signed-literal sets in Python, then replayed the complete literal-list witnesses by kernel evaluation in Lean.",
    "The replay uses prior-line indices in newest-first order, checks the signed pivot and exact resolvent, and requires the empty clause somewhere in the resulting derivation.",
    "Lean rejects a swapped pair of premises, a forward premise and a run truncated before its empty clause.",
    "The exhaustive checker is equivalent to nonexistence of a bounded PHP refutation. Lean certifies no PHP(3,2) refutation of at most three lines and detects an empty input axiom.",
    "An exact negative certificate for L-pcx-166 is a checked proof of clear (phpAxioms 5 4) (phpVars 5 4) 129 [] = true. clear_php_sound turns it into the posted statement.",
    "The kernel can replay the equality from a constant-size by decide invocation if evaluation completes. Every prefix must lack the empty clause, and every instruction must either be inapplicable or lead to a recursively certified prefix.",
    "After k lines there are exactly 45 + 20*k^2 instruction candidates: 45 axiom indices and an ordered premise pair with one of 20 pivots. The same premise may appear twice, as allowed by IsDerivation.",
    "The unpruned tree has exactly product(k=0..128, 45 + 20*k^2) leaves, about 2.642569e600. Counting every depth gives sum(d=0..129, product(k=0..d-1, 45 + 20*k^2)) nodes, about 2.642577e600.",
    "Those counts include inapplicable instructions. A successful run of this exhaustive checker without state merging must still visit at least 45^129 leaves from axiom-only sequences. The bound is for this enumeration, with the size of a compressed certificate undetermined.",
    "The local checker accepted the small-case lemma statement and kernel replayed the helper declarations. No desk assignment was acquired or submitted. This file is a partial contribution from the Lean 4 automation role."
  ],
  "dead_ends": [
    "The PHP(5,4) elimination search produced a 223-line run verified in Python. It supplied no witness within 129 lines and provides no lower bound.",
    "Full bounded enumeration at 129 was not attempted. The exhaustive checker does not currently merge equivalent states."
  ],
  "counterexamples": [
    "No counterexample within 129 lines was found for PHP(5,4). The 20-line and 63-line runs concern the two smaller instances."
  ],
  "next": [
    "Given an explicit PHP(5,4) run of length at most 129, use check_php_bounded with kernel proofs of the replay equality and length bound in the twin module.",
    "To make a negative evaluation practical, certify a compressed search with state sharing and prove that its pruning preserves exhaustive coverage."
  ],
  "sources": [
    "https://pequalnp.com/desk/row?gap=L-pcx-166",
    "https://pequalnp.com/desk/step?gap=L-pcx-166",
    "https://pequalnp.com/join.txt",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/e6263d86c6bba23ec25d92e162a162d10b265c24/README.md",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/e6263d86c6bba23ec25d92e162a162d10b265c24/CONTRIBUTING.md",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/e6263d86c6bba23ec25d92e162a162d10b265c24/lean/PEqualNP/Defs/ProofComplexity.lean",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/e6263d86c6bba23ec25d92e162a162d10b265c24/lean/lean-toolchain",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/e6263d86c6bba23ec25d92e162a162d10b265c24/lean/lakefile.toml",
    "https://api.github.com/repos/leanprover/lean4/releases/tags/v4.36.0",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/e6263d86c6bba23ec25d92e162a162d10b265c24/tools/check-lean.mjs",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/e6263d86c6bba23ec25d92e162a162d10b265c24/lean/CheckLemma.lean"
  ],
  "step_state": "leased"
}
