{
  "step": "L-meta-9695",
  "role": "counterexample discovery; exhaustive search",
  "claim": "unchecked",
  "target": "lemma",
  "lean_path": "lean/PEqualNP/Outside/L_meta_9695_lemma.lean",
  "lean_text": "",
  "generator": "import json,hashlib,pathlib\nmod='PEqualNP.Outside.L_meta_9695_lemma'\nout=['import Mathlib','import PEqualNP.Defs','',f'namespace {mod}','','open PEqualNP.Search PEqualNP.ProofComplexity','']\ncerts={}\nlower=\"import Mathlib\\nimport PEqualNP.Defs\\n\\nnamespace PEqualNP.Outside.L_meta_9662\\n\\nopen PEqualNP.Search PEqualNP.ProofComplexity\\n\\n-- A lower bound for cutting planes refutations of any CNF F with N test points pt i and a\\n-- fractional point Y / s. Each clause line of F is false at no more than one test point, and\\n-- every clause line has deficiency at most 0 at the fractional point. Then every refutation has at\\n-- least 2 N + 1 lines: N clause lines (each test point is falsified by the final line, and a line\\n-- can only be false at a test point when an ancestor clause line is), N - 1 additions or\\n-- multiplications (a union count over sets of lines), one division (without one every line holds\\n-- at the fractional point), and one more line: with a single division every line has deficiency\\n-- below s, so the final line, whose deficiency is s, needs a further addition or a second division.\\n\\nsection Gen\\n\\nvariable {V : Type} [Fintype V] [DecidableEq V]\\n\\ndef lhs (a : V → Bool) (e : CPLine V) : ℤ := ∑ v, e.1 v * (if a v then 1 else 0)\\n\\ndef holdsB (a : V → Bool) (e : CPLine V) : Bool := decide (e.2 ≤ lhs a e)\\n\\ndef viol {ι : Type} [Fintype ι] (pt : ι → V → Bool) (e : CPLine V) : Finset ι :=\\n  Finset.univ.filter (fun i => holdsB (pt i) e = false)\\n\\ndef dfc (s : ℤ) (Y : V → ℤ) (e : CPLine V) : ℤ := s * e.2 - ∑ v, e.1 v * Y v\\n\\ntheorem mem_viol {ι : Type} [Fintype ι] (pt : ι → V → Bool) (e : CPLine V) (i : ι) :\\n    i ∈ viol pt e ↔ lhs (pt i) e < e.2 := by\\n  simp [viol, holdsB]\\n\\ntheorem lhs_add (a : V → Bool) (e e' : CPLine V) :\\n    lhs a (e.1 + e'.1, e.2 + e'.2) = lhs a e + lhs a e' := by\\n  simp only [lhs, Pi.add_apply, add_mul, Finset.sum_add_distrib]\\n\\ntheorem lhs_mul (a : V → Bool) (e : CPLine V) (k : ℕ) :\\n    lhs a ((k : ℤ) • e.1, (k : ℤ) * e.2) = k * lhs a e := by\\n  simp only [lhs, Pi.smul_apply, smul_eq_mul, Finset.mul_sum, mul_assoc]\\n\\ntheorem lhs_div (a : V → Bool) (e : CPLine V) (d : ℕ) (hd : ∀ v, (d : ℤ) ∣ e.1 v) :\\n    lhs a (fun v => e.1 v / (d : ℤ), -((-e.2) / (d : ℤ))) * d = lhs a e := by\\n  simp only [lhs, Finset.sum_mul]\\n  refine Finset.sum_congr rfl fun v _ => ?_\\n  rw [mul_right_comm, Int.ediv_mul_cancel (hd v)]\\n\\ntheorem viol_add {ι : Type} [Fintype ι] [DecidableEq ι] (pt : ι → V → Bool) (e e' : CPLine V) :\\n    viol pt (e.1 + e'.1, e.2 + e'.2) ⊆ viol pt e ∪ viol pt e' := by\\n  intro i hi\\n  rw [mem_viol, lhs_add] at hi\\n  rw [Finset.mem_union, mem_viol, mem_viol]\\n  by_contra h\\n  push_neg at h\\n  dsimp only at hi\\n  omega\\n\\ntheorem viol_mul {ι : Type} [Fintype ι] (pt : ι → V → Bool) (e : CPLine V) (k : ℕ) :\\n    viol pt ((k : ℤ) • e.1, (k : ℤ) * e.2) ⊆ viol pt e := by\\n  intro i hi\\n  rw [mem_viol, lhs_mul] at hi\\n  rw [mem_viol]\\n  by_contra h\\n  push_neg at h\\n  dsimp only at hi\\n  have := mul_le_mul_of_nonneg_left h (Int.natCast_nonneg k)\\n  omega\\n\\ntheorem viol_div {ι : Type} [Fintype ι] (pt : ι → V → Bool) (e : CPLine V) (d : ℕ) (hd0 : 0 < d)\\n    (hd : ∀ v, (d : ℤ) ∣ e.1 v) :\\n    viol pt (fun v => e.1 v / (d : ℤ), -((-e.2) / (d : ℤ))) ⊆ viol pt e := by\\n  intro i hi\\n  rw [mem_viol] at hi\\n  rw [mem_viol]\\n  by_contra h\\n  push_neg at h\\n  have hm := lhs_div (pt i) e d hd\\n  have hdz : (0 : ℤ) < d := by exact_mod_cast hd0\\n  have key : -(lhs (pt i) (fun v => e.1 v / (d : ℤ), -((-e.2) / (d : ℤ)))) ≤ (-e.2) / (d : ℤ) := by\\n    apply Int.le_ediv_of_mul_le hdz\\n    linarith\\n  dsimp only at hi\\n  omega\\n\\ntheorem viol_boolLo {ι : Type} [Fintype ι] (pt : ι → V → Bool) (v : V) :\\n    viol pt ((fun u => if u = v then 1 else 0, 0) : CPLine V) = ∅ := by\\n  refine Finset.eq_empty_of_forall_notMem fun i hi => ?_\\n  rw [mem_viol] at hi\\n  simp only [lhs, ite_mul, one_mul, zero_mul, Finset.sum_ite_eq', Finset.mem_univ, ite_true] at hi\\n  split at hi <;> omega\\n\\ntheorem viol_boolHi {ι : Type} [Fintype ι] (pt : ι → V → Bool) (v : V) :\\n    viol pt ((fun u => if u = v then -1 else 0, -1) : CPLine V) = ∅ := by\\n  refine Finset.eq_empty_of_forall_notMem fun i hi => ?_\\n  rw [mem_viol] at hi\\n  simp only [lhs, ite_mul, neg_one_mul, zero_mul, Finset.sum_ite_eq', Finset.mem_univ, ite_true] at hi\\n  split at hi <;> omega\\n\\ntheorem viol_bot {ι : Type} [Fintype ι] (pt : ι → V → Bool) :\\n    viol pt (((0 : V → ℤ), (1 : ℤ)) : CPLine V) = Finset.univ := by\\n  ext i\\n  simp [mem_viol, lhs]\\n\\ntheorem dfc_add (s : ℤ) (Y : V → ℤ) (e e' : CPLine V) :\\n    dfc s Y (e.1 + e'.1, e.2 + e'.2) = dfc s Y e + dfc s Y e' := by\\n  simp only [dfc, Pi.add_apply, add_mul, Finset.sum_add_distrib]\\n  ring\\n\\ntheorem dfc_mul (s : ℤ) (Y : V → ℤ) (e : CPLine V) (k : ℕ) :\\n    dfc s Y ((k : ℤ) • e.1, (k : ℤ) * e.2) = k * dfc s Y e := by\\n  simp only [dfc, Pi.smul_apply, smul_eq_mul, mul_assoc, ← Finset.mul_sum]\\n  ring\\n\\ntheorem dfc_div (s : ℤ) (hs : 0 < s) (Y : V → ℤ) (e : CPLine V) (d : ℕ) (hd0 : 0 < d)\\n    (hd : ∀ v, (d : ℤ) ∣ e.1 v) :\\n    (d : ℤ) * dfc s Y (fun v => e.1 v / (d : ℤ), -((-e.2) / (d : ℤ))) ≤ dfc s Y e + s * (d - 1) := by\\n  have hdz : (0 : ℤ) < d := by exact_mod_cast hd0\\n  have hsum : (d : ℤ) * ∑ v, e.1 v / (d : ℤ) * Y v = ∑ v, e.1 v * Y v := by\\n    rw [Finset.mul_sum]\\n    refine Finset.sum_congr rfl fun v _ => ?_\\n    rw [← mul_assoc, mul_comm (d : ℤ), Int.ediv_mul_cancel (hd v)]\\n  have hq := Int.mul_ediv_add_emod (-e.2) (d : ℤ)\\n  have hr0 := Int.emod_nonneg (-e.2) (ne_of_gt hdz)\\n  have hr1 := Int.emod_lt_of_pos (-e.2) hdz\\n  have hc : (d : ℤ) * (-((-e.2) / (d : ℤ))) ≤ e.2 + (d - 1) := by nlinarith\\n  simp only [dfc]\\n  rw [mul_sub, hsum]\\n  nlinarith\\n\\ntheorem dfc_bot (s : ℤ) (Y : V → ℤ) : dfc s Y (((0 : V → ℤ), (1 : ℤ)) : CPLine V) = s := by\\n  simp [dfc]\\n\\ntheorem ind_le_one {p : Prop} [Decidable p] : (if p then 1 else 0 : ℕ) ≤ 1 := by\\n  split_ifs <;> simp\\n\\ntheorem ind_mono {p q : Prop} [Decidable p] [Decidable q] (h : p → q) :\\n    (if p then 1 else 0 : ℕ) ≤ if q then 1 else 0 := by\\n  split_ifs <;> simp_all\\n\\ntheorem erase_mem {π : List (CPLine V)} {z : CPLine V} {E : Finset (CPLine V)}\\n    (hEm : ∀ f ∈ E, f ∈ z :: π) {f : CPLine V} (hf : f ∈ E.erase z) : f ∈ π := by\\n  rcases List.mem_cons.1 (hEm f (Finset.mem_of_mem_erase hf)) with h | h\\n  · exact absurd h (Finset.ne_of_mem_erase hf)\\n  · exact h\\n\\ntheorem sub_parents {ι : Type} [Fintype ι] [DecidableEq ι] (pt : ι → V → Bool) {z : CPLine V}\\n    {E P : Finset (CPLine V)} (hz : z ∈ E) (hv : viol pt z ⊆ P.biUnion (viol pt)) :\\n    E.biUnion (viol pt) ⊆ (E.erase z ∪ P).biUnion (viol pt) := by\\n  intro i hi\\n  obtain ⟨f, hf, hi⟩ := Finset.mem_biUnion.1 hi\\n  by_cases hfz : f = z\\n  · subst hfz\\n    obtain ⟨g, hg, hi⟩ := Finset.mem_biUnion.1 (hv hi)\\n    exact Finset.mem_biUnion.2 ⟨g, Finset.mem_union_right _ hg, hi⟩\\n  · exact Finset.mem_biUnion.2 ⟨f, Finset.mem_union_left _ (Finset.mem_erase.2 ⟨hfz, hf⟩), hi⟩\\n\\n-- A leaf line (a clause line or a Boolean bound): false at no more than one test point, deficiency <= 0.\\ntheorem leaf_step {ι : Type} [Fintype ι] [DecidableEq ι] (pt : ι → V → Bool) (s : ℤ) (Y : V → ℤ)\\n    (π : List (CPLine V)) (z : CPLine V) (a dv : ℕ)\\n    (hE : ∀ E : Finset (CPLine V), (∀ e ∈ E, e ∈ π) →\\n      (E.biUnion (viol pt)).card + (if dv ≤ 1 ∧ s ≤ ∑ e ∈ E, dfc s Y e then 1 else 0) ≤ E.card + a)\\n    (hz : (viol pt z).card ≤ 1) (hd : dfc s Y z ≤ 0) :\\n    ∀ E : Finset (CPLine V), (∀ e ∈ E, e ∈ z :: π) →\\n      (E.biUnion (viol pt)).card + (if dv ≤ 1 ∧ s ≤ ∑ e ∈ E, dfc s Y e then 1 else 0) ≤ E.card + a := by\\n  intro E hEm\\n  by_cases hzE : z ∈ E\\n  · have h0 := hE (E.erase z) fun f hf => erase_mem hEm hf\\n    have hu : E.biUnion (viol pt) ⊆ (E.erase z).biUnion (viol pt) ∪ viol pt z := by\\n      intro i hi\\n      obtain ⟨f, hf, hi⟩ := Finset.mem_biUnion.1 hi\\n      by_cases hfz : f = z\\n      · subst hfz; exact Finset.mem_union_right _ hi\\n      · exact Finset.mem_union_left _ (Finset.mem_biUnion.2 ⟨f, Finset.mem_erase.2 ⟨hfz, hf⟩, hi⟩)\\n    have hc := (Finset.card_le_card hu).trans (Finset.card_union_le _ _)\\n    have hs : ∑ e ∈ E, dfc s Y e ≤ ∑ e ∈ E.erase z, dfc s Y e := by\\n      rw [← Finset.sum_erase_add _ _ hzE]; linarith\\n    have hi : (if dv ≤ 1 ∧ s ≤ ∑ e ∈ E, dfc s Y e then 1 else 0) ≤\\n        (if dv ≤ 1 ∧ s ≤ ∑ e ∈ E.erase z, dfc s Y e then 1 else 0) :=\\n      ind_mono fun h => ⟨h.1, h.2.trans hs⟩\\n    have := Finset.card_erase_add_one hzE\\n    omega\\n  · exact hE E fun f hf => by\\n      rcases List.mem_cons.1 (hEm f hf) with rfl | h\\n      · exact absurd hf hzE\\n      · exact h\\n\\n-- The invariant, by induction on the derivation (newest line first).\\ntheorem inv {F : Set (Clause V)} {ι : Type} [Fintype ι] [DecidableEq ι] (pt : ι → V → Bool)\\n    (s : ℤ) (hs : 0 < s) (Y : V → ℤ) (hY : ∀ v, 0 ≤ Y v ∧ Y v ≤ s)\\n    (hax : ∀ C ∈ F, (viol pt (clauseCP C)).card ≤ 1) (hdf : ∀ C ∈ F, dfc s Y (clauseCP C) ≤ 0) :\\n    ∀ π : List (CPLine V), IsCPDerivation F π → ∃ nax a dv : ℕ, ∃ U : Finset ι,\\n      nax + a + dv ≤ π.length ∧ U.card ≤ nax ∧ (∀ e ∈ π, viol pt e ⊆ U) ∧\\n      (dv = 0 → ∀ e ∈ π, dfc s Y e ≤ 0) ∧\\n      ∀ E : Finset (CPLine V), (∀ e ∈ E, e ∈ π) →\\n        (E.biUnion (viol pt)).card + (if dv ≤ 1 ∧ s ≤ ∑ e ∈ E, dfc s Y e then 1 else 0)\\n          ≤ E.card + a := by\\n  intro π h\\n  induction h with\\n  | nil =>\\n    refine ⟨0, 0, 0, ∅, by simp, by simp, by simp, by simp, fun E hE => ?_⟩\\n    have : E = ∅ := Finset.eq_empty_of_forall_notMem fun e he => by simpa using hE e he\\n    subst this\\n    simpa using hs\\n  | @ax π C hπ hC ih =>\\n    obtain ⟨nax, a, dv, U, hlen, hU, hvU, hdv, hE⟩ := ih\\n    refine ⟨nax + 1, a, dv, U ∪ viol pt (clauseCP C), by simp; omega,\\n      (Finset.card_union_le _ _).trans (by have := hax C hC; omega), ?_, ?_,\\n      leaf_step pt s Y π _ a dv hE (hax C hC) (hdf C hC)⟩\\n    · intro e he\\n      rcases List.mem_cons.1 he with rfl | he\\n      · exact Finset.subset_union_right\\n      · exact (hvU e he).trans Finset.subset_union_left\\n    · intro h0 e he\\n      rcases List.mem_cons.1 he with rfl | he\\n      · exact hdf C hC\\n      · exact hdv h0 e he\\n  | @boolLo π v hπ ih =>\\n    obtain ⟨nax, a, dv, U, hlen, hU, hvU, hdv, hE⟩ := ih\\n    refine ⟨nax, a, dv, U, by simp; omega, hU, ?_, ?_,\\n      leaf_step pt s Y π _ a dv hE (by rw [viol_boolLo]; simp) (by simp [dfc]; exact (hY v).1)⟩\\n    · intro e he\\n      rcases List.mem_cons.1 he with rfl | he\\n      · rw [viol_boolLo]; exact Finset.empty_subset _\\n      · exact hvU e he\\n    · intro h0 e he\\n      rcases List.mem_cons.1 he with rfl | he\\n      · simp [dfc]; exact (hY v).1\\n      · exact hdv h0 e he\\n  | @boolHi π v hπ ih =>\\n    obtain ⟨nax, a, dv, U, hlen, hU, hvU, hdv, hE⟩ := ih\\n    refine ⟨nax, a, dv, U, by simp; omega, hU, ?_, ?_,\\n      leaf_step pt s Y π _ a dv hE (by rw [viol_boolHi]; simp) (by simp [dfc]; linarith [(hY v).2])⟩\\n    · intro e he\\n      rcases List.mem_cons.1 he with rfl | he\\n      · rw [viol_boolHi]; exact Finset.empty_subset _\\n      · exact hvU e he\\n    · intro h0 e he\\n      rcases List.mem_cons.1 he with rfl | he\\n      · simp [dfc]; linarith [(hY v).2]\\n      · exact hdv h0 e he\\n  | @add π e e' hπ he he' ih =>\\n    obtain ⟨nax, a, dv, U, hlen, hU, hvU, hdv, hE⟩ := ih\\n    refine ⟨nax, a + 1, dv, U, by simp; omega, hU, ?_, ?_, ?_⟩\\n    · intro f hf\\n      rcases List.mem_cons.1 hf with rfl | hf\\n      · exact (viol_add pt e e').trans (Finset.union_subset (hvU e he) (hvU e' he'))\\n      · exact hvU f hf\\n    · intro h0 f hf\\n      rcases List.mem_cons.1 hf with rfl | hf\\n      · rw [dfc_add]; linarith [hdv h0 e he, hdv h0 e' he']\\n      · exact hdv h0 f hf\\n    · intro E hEm\\n      by_cases hz : (e.1 + e'.1, e.2 + e'.2) ∈ E\\n      · set z : CPLine V := (e.1 + e'.1, e.2 + e'.2)\\n        have hsub := sub_parents pt hz (P := {e, e'}) (by\\n          intro i hi\\n          rcases Finset.mem_union.1 (viol_add pt e e' hi) with h | h\\n          · exact Finset.mem_biUnion.2 ⟨e, by simp, h⟩\\n          · exact Finset.mem_biUnion.2 ⟨e', by simp, h⟩)\\n        have hE' := hE (E.erase z ∪ {e, e'}) (by\\n          intro f hf\\n          rcases Finset.mem_union.1 hf with hf | hf\\n          · exact erase_mem hEm hf\\n          · rcases Finset.mem_insert.1 hf with rfl | hf\\n            · exact he\\n            · rw [Finset.mem_singleton.1 hf]; exact he')\\n        have hcU := Finset.card_le_card hsub\\n        have hcE : (E.erase z ∪ {e, e'}).card ≤ E.card + 1 := by\\n          have h1 := Finset.card_union_le (E.erase z) {e, e'}\\n          have h2 : ({e, e'} : Finset (CPLine V)).card ≤ 2 := Finset.card_le_two\\n          have h3 := Finset.card_erase_add_one hz\\n          omega\\n        by_cases hle : (E.erase z ∪ {e, e'}).card ≤ E.card\\n        · have := ind_le_one (p := dv ≤ 1 ∧ s ≤ ∑ f ∈ E, dfc s Y f)\\n          have := Nat.zero_le (if dv ≤ 1 ∧ s ≤ ∑ f ∈ E.erase z ∪ {e, e'}, dfc s Y f then 1 else 0)\\n          omega\\n        · have hsum : ∑ f ∈ E, dfc s Y f = ∑ f ∈ E.erase z ∪ {e, e'}, dfc s Y f := by\\n            have h1 := Finset.card_union_add_card_inter (E.erase z) {e, e'}\\n            have h2 : ({e, e'} : Finset (CPLine V)).card ≤ 2 := Finset.card_le_two\\n            have h3 := Finset.card_erase_add_one hz\\n            have hP : ({e, e'} : Finset (CPLine V)).card = 2 := by omega\\n            have hI : (E.erase z ∩ {e, e'}).card = 0 := by omega\\n            have hne : e ≠ e' := by\\n              intro h; rw [h] at hP; simp at hP\\n            rw [Finset.sum_union (Finset.disjoint_iff_inter_eq_empty.2 (Finset.card_eq_zero.1 hI)),\\n              Finset.sum_pair hne, ← Finset.sum_erase_add _ _ hz, dfc_add]\\n          rw [hsum]\\n          omega\\n      · have := hE E (fun f hf => by\\n          rcases List.mem_cons.1 (hEm f hf) with rfl | h\\n          · exact absurd hf hz\\n          · exact h)\\n        omega\\n  | @mul π e k hπ he ih =>\\n    obtain ⟨nax, a, dv, U, hlen, hU, hvU, hdv, hE⟩ := ih\\n    refine ⟨nax, a + 1, dv, U, by simp; omega, hU, ?_, ?_, ?_⟩\\n    · intro f hf\\n      rcases List.mem_cons.1 hf with rfl | hf\\n      · exact (viol_mul pt e k).trans (hvU e he)\\n      · exact hvU f hf\\n    · intro h0 f hf\\n      rcases List.mem_cons.1 hf with rfl | hf\\n      · rw [dfc_mul]; exact mul_nonpos_of_nonneg_of_nonpos (Int.natCast_nonneg k) (hdv h0 e he)\\n      · exact hdv h0 f hf\\n    · intro E hEm\\n      by_cases hz : ((k : ℤ) • e.1, (k : ℤ) * e.2) ∈ E\\n      · set z : CPLine V := ((k : ℤ) • e.1, (k : ℤ) * e.2)\\n        have hsub := sub_parents pt hz (P := {e}) (by\\n          intro i hi; exact Finset.mem_biUnion.2 ⟨e, by simp, viol_mul pt e k hi⟩)\\n        have hE' := hE (E.erase z ∪ {e}) (by\\n          intro f hf\\n          rcases Finset.mem_union.1 hf with hf | hf\\n          · exact erase_mem hEm hf\\n          · rw [Finset.mem_singleton.1 hf]; exact he)\\n        have hcU := Finset.card_le_card hsub\\n        have hcE : (E.erase z ∪ {e}).card ≤ E.card := by\\n          have h1 := Finset.card_union_le (E.erase z) {e}\\n          have h3 := Finset.card_erase_add_one hz\\n          rw [Finset.card_singleton] at h1; omega\\n        have := ind_le_one (p := dv ≤ 1 ∧ s ≤ ∑ f ∈ E, dfc s Y f)\\n        omega\\n      · have := hE E (fun f hf => by\\n          rcases List.mem_cons.1 (hEm f hf) with rfl | h\\n          · exact absurd hf hz\\n          · exact h)\\n        omega\\n  | @div π e d hπ he hd0 hd ih =>\\n    obtain ⟨nax, a, dv, U, hlen, hU, hvU, hdv, hE⟩ := ih\\n    refine ⟨nax, a, dv + 1, U, by simp; omega, hU, ?_, by simp, ?_⟩\\n    · intro f hf\\n      rcases List.mem_cons.1 hf with rfl | hf\\n      · exact (viol_div pt e d hd0 hd).trans (hvU e he)\\n      · exact hvU f hf\\n    · intro E hEm\\n      by_cases hz : ((fun v => e.1 v / (d : ℤ), -((-e.2) / (d : ℤ))) : CPLine V) ∈ E\\n      · set z : CPLine V := (fun v => e.1 v / (d : ℤ), -((-e.2) / (d : ℤ)))\\n        have hsub := sub_parents pt hz (P := {e}) (by\\n          intro i hi; exact Finset.mem_biUnion.2 ⟨e, by simp, viol_div pt e d hd0 hd hi⟩)\\n        have hE' := hE (E.erase z ∪ {e}) (by\\n          intro f hf\\n          rcases Finset.mem_union.1 hf with hf | hf\\n          · exact erase_mem hEm hf\\n          · rw [Finset.mem_singleton.1 hf]; exact he)\\n        have hcU := Finset.card_le_card hsub\\n        have hcE : (E.erase z ∪ {e}).card ≤ E.card := by\\n          have h1 := Finset.card_union_le (E.erase z) {e}\\n          have h3 := Finset.card_erase_add_one hz\\n          rw [Finset.card_singleton] at h1; omega\\n        have h0 : (if dv + 1 ≤ 1 ∧ s ≤ ∑ f ∈ E, dfc s Y f then 1 else 0) = 0 := by\\n          rw [if_neg]\\n          rintro ⟨h1, h2⟩\\n          have hdv0 : dv = 0 := by omega\\n          have hold : ∑ f ∈ E.erase z, dfc s Y f ≤ 0 :=\\n            Finset.sum_nonpos fun f hf => hdv hdv0 f (erase_mem hEm hf)\\n          have hdz := dfc_div s hs Y e d hd0 hd\\n          have hde := hdv hdv0 e he\\n          have hd1 : (1 : ℤ) ≤ d := by exact_mod_cast hd0\\n          have hlt : dfc s Y z < s := by\\n            by_contra hc\\n            push_neg at hc\\n            have : (d : ℤ) * s ≤ (d : ℤ) * dfc s Y z := mul_le_mul_of_nonneg_left hc (by omega)\\n            nlinarith\\n          rw [← Finset.sum_erase_add _ _ hz] at h2\\n          linarith\\n        rw [h0]\\n        have := Nat.zero_le (if dv ≤ 1 ∧ s ≤ ∑ f ∈ E.erase z ∪ {e}, dfc s Y f then 1 else 0)\\n        omega\\n      · have := hE E (fun f hf => by\\n          rcases List.mem_cons.1 (hEm f hf) with rfl | h\\n          · exact absurd hf hz\\n          · exact h)\\n        have : (if dv + 1 ≤ 1 ∧ s ≤ ∑ f ∈ E, dfc s Y f then 1 else 0) ≤\\n            (if dv ≤ 1 ∧ s ≤ ∑ f ∈ E, dfc s Y f then 1 else 0) :=\\n          ind_mono fun h => ⟨by omega, h.2⟩\\n        omega\\n\\ntheorem lower {F : Set (Clause V)} {ι : Type} [Fintype ι] [DecidableEq ι] (pt : ι → V → Bool)\\n    (s : ℤ) (hs : 0 < s) (Y : V → ℤ) (hY : ∀ v, 0 ≤ Y v ∧ Y v ≤ s)\\n    (hax : ∀ C ∈ F, (viol pt (clauseCP C)).card ≤ 1) (hdf : ∀ C ∈ F, dfc s Y (clauseCP C) ≤ 0)\\n    (π : List (CPLine V)) (h : IsCPRefutation F π) : 2 * Fintype.card ι + 1 ≤ π.length := by\\n  obtain ⟨nax, a, dv, U, hlen, hU, hvU, hdv, hE⟩ := inv pt s hs Y hY hax hdf π h.1\\n  have hf := h.2\\n  have h1 : Fintype.card ι ≤ U.card := by\\n    have := hvU _ hf\\n    rw [viol_bot] at this\\n    simpa using Finset.card_le_card this\\n  have h2 : dv ≠ 0 := by\\n    intro h0\\n    have := hdv h0 _ hf\\n    rw [dfc_bot] at this\\n    omega\\n  have h3 := hE {((0 : V → ℤ), (1 : ℤ))} (by simpa using hf)\\n  rw [Finset.singleton_biUnion, viol_bot, Finset.sum_singleton, dfc_bot] at h3\\n  simp only [Finset.card_univ, Finset.card_singleton, le_refl, and_true] at h3\\n  split_ifs at h3 with hc <;> omega\\n\\nend Gen\\n\\n-- The instance: one test point per clause of PHP (2 + 1) 2, falsifying that clause only (bit\\n-- 2 * i + j: pigeon i sits in hole j; the point of a pigeon clause leaves that pigeon out and puts\\n-- the others one per hole; the point of a hole clause puts both pigeons in that hole and the\\n-- others one per remaining hole), and the fractional point 1 / 2 everywhere (Y = 1, s = 2).\\n\\ndef codes : List ℕ := [36, 33, 9, 37, 25, 22, 26, 38, 41]\\n\\ndef pt (i : Fin 9) (v : Fin (2 + 1) × Fin 2) : Bool := (codes.getD i 0).testBit (2 * v.1.val + v.2.val)\\n\\ntheorem hax : ∀ C ∈ PHP (2 + 1) 2, (viol pt (clauseCP C)).card ≤ 1 := by\\n  rintro C (⟨i, rfl⟩ | ⟨i, i', j, hne, rfl⟩)\\n  · revert i\\n    decide +kernel\\n  · revert i i' j hne\\n    decide +kernel\\n\\ntheorem hdf : ∀ C ∈ PHP (2 + 1) 2, dfc 2 (fun _ => 1) (clauseCP C) ≤ 0 := by\\n  rintro C (⟨i, rfl⟩ | ⟨i, i', j, hne, rfl⟩)\\n  · revert i\\n    decide +kernel\\n  · revert i i' j hne\\n    decide +kernel\\n\\nend PEqualNP.Outside.L_meta_9662\\n\\ntheorem PEqualNP.Outside.L_meta_9662 : ¬ (∃ π : List (PEqualNP.Search.CPLine (Fin (2 + 1) × Fin 2)), PEqualNP.Search.IsCPRefutation (PEqualNP.ProofComplexity.PHP (2 + 1) 2) π ∧ π.length ≤ 18) := by\\n  rintro ⟨π, h, hl⟩\\n  have := PEqualNP.Outside.L_meta_9662.lower PEqualNP.Outside.L_meta_9662.pt 2 (by norm_num) (fun _ => 1)\\n    (fun _ => by norm_num) PEqualNP.Outside.L_meta_9662.hax PEqualNP.Outside.L_meta_9662.hdf π h\\n  simp only [Fintype.card_fin] at this\\n  omega\\n\"\nlower=lower.split('namespace PEqualNP.Outside.L_meta_9662',1)[1]\nlower='namespace SmallLower'+lower\nlower=lower.replace('end PEqualNP.Outside.L_meta_9662','end SmallLower')\nlower=lower.replace('theorem PEqualNP.Outside.L_meta_9662 :','lemma smallLower :')\nlower=lower.replace('PEqualNP.Outside.L_meta_9662.',mod+'.SmallLower.')\nout.extend(lower.splitlines())\nfor n in [2,3,4]:\n m=n+1; lines=[];code=[]; hole=[]\n def emit(c,vec,rhs,expr):\n  i=len(lines);lines.append((vec,rhs));code.append(c)\n  out.append(f'def n{n}l{i} : CPLine (Fin {m} × Fin {n}) := {expr}')\n  return i\n def axedge(p,q,h):\n  vec=[-int(i in [p*n+h,q*n+h]) for i in range(m*n)]\n  return emit(['edge',p,q,h],vec,-1,f'clauseCP {{(({p}, {h}), false), (({q}, {h}), false)}}')\n def axrow(p):\n  return emit(['row',p],[int(i//n==p) for i in range(m*n)],1,f'clauseCP (Finset.univ.image (fun j : Fin {n} => (({p}, j), true)))')\n def add(p,q):\n  a,b=lines[p],lines[q]\n  return emit(['add',p,q],[x+y for x,y in zip(a[0],b[0])],a[1]+b[1],f'(n{n}l{p}.1 + n{n}l{q}.1, n{n}l{p}.2 + n{n}l{q}.2)')\n def mul(p,k):\n  a=lines[p]\n  return emit(['mul',p,k],[x*k for x in a[0]],a[1]*k,f'(({k} : ℤ) • n{n}l{p}.1, ({k} : ℤ) * n{n}l{p}.2)')\n def div(p,d):\n  a=lines[p];assert all(x%d==0 for x in a[0])\n  return emit(['div',p,d],[x//d for x in a[0]],-((-a[1])//d),f'((fun v => n{n}l{p}.1 v / {d}), -((-n{n}l{p}.2) / {d}))')\n def asum(xs):\n  x=xs[0]\n  for y in xs[1:]:x=add(x,y)\n  return x\n for h in range(n):\n  c=div(asum([axedge(0,1,h),axedge(0,2,h),axedge(1,2,h)]),2)\n  for k in range(3,m):\n   c=mul(c,k-1)\n   for p in range(k):c=add(c,axedge(p,k,h))\n   c=div(c,k)\n  hole.append(c)\n rows=asum([axrow(p) for p in range(m)])\n caps=asum(hole);last=add(rows,caps)\n assert lines[last]==([0]*(m*n),1)\n certs[str(n)]={'length':len(lines),'instructions':code,'lines':lines}\n out+=['',f'lemma n{n}valid : IsCPDerivation (PHP {m} {n}) ['+', '.join(f'n{n}l{i}' for i in reversed(range(len(lines))))+'] := by',f'  have h0 : IsCPDerivation (PHP {m} {n}) [] := .nil']\n def mem(p,i):return f'(by exact List.getElem_mem (l := _) (n := {i-1-p}) (by decide))'\n for i,c in enumerate(code):\n  prev=f'h{i}';name=f'h{i+1}'\n  if c[0]=='row':\n   out.append(f'  have {name} := IsCPDerivation.ax (Finset.univ.image (fun j : Fin {n} => (({c[1]}, j), true))) {prev} (Or.inl ⟨{c[1]}, rfl⟩)')\n  elif c[0]=='edge':\n   _,p,q,h=c\n   out.append(f'  have {name} := IsCPDerivation.ax {{(({p}, {h}), false), (({q}, {h}), false)}} {prev} (Or.inr ⟨{p}, {q}, {h}, by decide, rfl⟩)')\n  elif c[0]=='add':out.append(f'  have {name} := IsCPDerivation.add {prev} {mem(c[1],i)} {mem(c[2],i)}')\n  elif c[0]=='mul':out.append(f'  have {name} := IsCPDerivation.mul {c[2]} {prev} {mem(c[1],i)}')\n  elif c[0]=='div':out.append(f'  have {name} := IsCPDerivation.div {c[2]} {prev} {mem(c[1],i)} (by decide) (by decide +kernel)')\n out.append(f'  exact h{len(lines)}')\n out+=['',f'lemma n{n}zero : n{n}l{last} = ((0 : (Fin {m} × Fin {n}) → ℤ), (1 : ℤ)) := by','  apply Prod.ext','  · funext v','    rcases v with ⟨i, j⟩','    fin_cases i <;> fin_cases j <;> rfl','  · rfl','']\nout += [f'end {mod}','']\nupper_stmt=' ∧ '.join(f'(∃ π : List (PEqualNP.Search.CPLine (Fin {n+1} × Fin {n})), PEqualNP.Search.IsCPRefutation (PEqualNP.ProofComplexity.PHP {n+1} {n}) π ∧ π.length = {certs[str(n)][\"length\"]})' for n in [2,3,4])\nparts=upper_stmt.split(' ∧ (∃ π')\nsmall_lower='(∀ π : List (PEqualNP.Search.CPLine (Fin 3 × Fin 2)), PEqualNP.Search.IsCPRefutation (PEqualNP.ProofComplexity.PHP 3 2) π → 19 ≤ π.length)'\nstmt=parts[0]+' ∧ '+small_lower+' ∧ (∃ π'+parts[1]+' ∧ (∃ π'+parts[2]\nout += ['set_option maxRecDepth 16384 in','set_option maxHeartbeats 0 in',f'theorem {mod} : {stmt} := by',f'  open {mod} in']\nout+=['  refine ⟨?_, ?_, ?_, ?_⟩']\nfor n in [2,3,4]:\n if n==3:out += ['  · intro π h', '    by_contra hn', '    have hl : π.length ≤ 18 := by omega', f'    exact {mod}.smallLower ⟨π, h, hl⟩']\n length=certs[str(n)]['length'];ls='['+', '.join(f'{mod}.n{n}l{i}' for i in reversed(range(length)))+']'\n out += [f'  · refine ⟨{ls}, ⟨{mod}.n{n}valid, ?_⟩, rfl⟩',f'    rw [← {mod}.n{n}zero]', '    exact List.mem_cons_self']\ntext='\\n'.join(out)+'\\n'\nprint(text, end='')\n",
  "generator_language": "python3",
  "lean_sha256": "8656234fd5ec50de539a203a0c978dca1e80a2b40143fb30fc913d444f6153e2",
  "lean_bytes": 69524,
  "posted_statement": "∃ π : List (PEqualNP.Search.CPLine (Fin (4 + 1) × Fin 4)), PEqualNP.Search.IsCPRefutation (PEqualNP.ProofComplexity.PHP (4 + 1) 4) π ∧ π.length ≤ 108",
  "lemma_statement": "(∃ π : List (PEqualNP.Search.CPLine (Fin 3 × Fin 2)), PEqualNP.Search.IsCPRefutation (PEqualNP.ProofComplexity.PHP 3 2) π ∧ π.length = 19) ∧ (∀ π : List (PEqualNP.Search.CPLine (Fin 3 × Fin 2)), PEqualNP.Search.IsCPRefutation (PEqualNP.ProofComplexity.PHP 3 2) π → 19 ≤ π.length) ∧ (∃ π : List (PEqualNP.Search.CPLine (Fin 4 × Fin 3)), PEqualNP.Search.IsCPRefutation (PEqualNP.ProofComplexity.PHP 4 3) π ∧ π.length = 52) ∧ (∃ π : List (PEqualNP.Search.CPLine (Fin 5 × Fin 4)), PEqualNP.Search.IsCPRefutation (PEqualNP.ProofComplexity.PHP 5 4) π ∧ π.length = 109)",
  "check_log": {
    "qualification": "The complete partial-lemma file built here. The independent checker did not print ACCEPTED; unchecked denotes that missing independent verdict, not a successful check of the posted step.",
    "repository_commit": "10ced1520b98c8a58ca0052973dcfcba6d59616a",
    "toolchain": "Lean 4.36.0, installed from the official leanprover/lean4 release asset; pinned Mathlib fc4f59e577feb1a4956671bc04ac18aaaf8cd842.",
    "commands": [
      {
        "command": "lake exe cache get (in the scratch clone lean/ directory; never lake update)",
        "last_lines": [
          "Decompressed 9117 file(s)",
          "Already decompressed 9117 file(s)"
        ],
        "exit": 0
      },
      {
        "command": "lake build PEqualNP.Outside.L_meta_9695_lemma (in the scratch clone lean/ directory)",
        "last_lines": [
          "Build completed successfully (18425 jobs)."
        ],
        "exit": 0
      },
      {
        "command": "lake env lean ../../Axioms.lean (scratch diagnostic only; the delivered Lean file contains no diagnostic commands)",
        "last_lines": [
          "'PEqualNP.Outside.L_meta_9695_lemma' depends on axioms: [propext, Classical.choice, Quot.sound]"
        ],
        "exit": 0
      },
      {
        "command": "node test/scratch/cp4-cd/repo/tools/check-lean.mjs test/scratch/cp4-cd/repo/lean/PEqualNP/Outside/L_meta_9695_lemma.lean test/scratch/cp4-cd/statement.txt check",
        "last_lines": [
          "checker stage: building the file and the definitions root t=2s",
          "checker stage: verifier reading the built file t=8s",
          "",
          "CHECKER FAULT: the verifier ended without a verdict (exit 137)."
        ],
        "exit": 3,
        "verifier_exit": 137
      },
      {
        "command": "python3 (inline independent integer replay of certificates.json)",
        "last_lines": [
          "PHP(3,2): 19 lines; 9 axioms, 8 additions, 2 divisions.",
          "PHP(4,3): 52 lines; 22 axioms, 21 additions, 3 multiplications, 6 divisions.",
          "PHP(5,4): 109 lines; 45 axioms, 44 additions, 8 multiplications, 12 divisions.",
          "Every parent precedes its child, every divisor divides every coefficient, and each final line is exactly 0 >= 1."
        ],
        "exit": 0
      },
      {
        "command": "python3 deliver-generator.py (captured and compared byte for byte with the built file)",
        "last_lines": [
          "69524 bytes; SHA256 8656234fd5ec50de539a203a0c978dca1e80a2b40143fb30fc913d444f6153e2; exact match"
        ],
        "exit": 0
      }
    ],
    "axioms": [
      "propext",
      "Classical.choice",
      "Quot.sound"
    ],
    "checker_integrity": "The repository checker, definitions, lakefile, manifest and toolchain pin were not changed. All project execution and setup were confined to the scratch clone. No sign-in, lease, renewal, release or submission was performed."
  },
  "discoveries": [
    "PHP(3,2) has exact minimum 19 lines: the delivered Lean theorem proves a 19-line witness and the unrestricted lower bound 19. The lower-bound proof is adapted with attribution from the pinned repository L_meta_9662, not claimed as an original discovery.",
    "The full-formula exhaustive read-once search for PHP(3,2) found no positive constant with zero coefficients at unary budget 1 (18 total lines); at budget 2 (19 lines) it found 0 >= 1. This search has coefficient and multiplier/divisor bounds and no Boolean-bound leaves.",
    "For a single hole with 3, 4 or 5 pigeons, exhaustive bounded read-once tree search gives capacity-proof minima 6, 14 and 24 lines respectively. All pair axioms are used once; intermediate coefficients and RHS are in 0..24 in the <= orientation; multipliers and divisors range over 2..24. Exact divisions are included.",
    "For the five-pigeon hole, four unary operations were insufficient: the strongest all-one-coefficient line had RHS 2, not 1. The DP retained 45140447 support/coefficient states at sum budget 3. A five-unary, 24-line witness is included in the Lean certificate.",
    "The bounded hole-separable construction therefore has full refutation minima 19, 52 and 109 lines: n times the local capacity length plus 3*n+1 lines to insert and combine pigeon rows and hole capacities.",
    "PHP(4,3) exact minimum remains undetermined. Our complete certificate has 52 lines; the brief reports 51 for L-meta-9679, but we did not reproduce or verify that 51-line run.",
    "PHP(5,4) has a Lean-built 109-line refutation here. Neither an at-most-108-line refutation nor a global lower bound of 109 was established. The bounded negative search does not prove L-meta-9698.",
    "No P versus NP separation or equality follows from these finite proof-length calculations."
  ],
  "dead_ends": [
    "The unrestricted CP definition permits unbounded integer coefficients, arbitrary natural multipliers and divisors, Boolean bounds and shared ancestors; the finite read-once search does not exhaust that system.",
    "A Z3 search for an 18-line bounded read-once PHP(3,2) proof returned unknown after 300 seconds. Larger fixed-triangle PHP(4,3) and clique SAT searches were interrupted without a verdict; no interrupted search is reported as UNSAT.",
    "The standard per-hole lifting construction gives 52 rather than the brief’s 51 at three holes, and 109 rather than the requested 108 at four holes.",
    "The independent checker reached the compiled-file verifier and that process exited 137. The wrapper exited 3 with CHECKER FAULT, not ACCEPTED or REJECTED. The same resource termination also affected the independent check of the original lower-bound file."
  ],
  "counterexamples": [],
  "next": [
    "Search derivation DAGs with shared ancestors and mixed-hole cuts, and admit Boolean-bound leaves; do not infer unrestricted optimality from the hole-separable model.",
    "Reproduce the brief’s proposed 51-line PHP(4,3) run with exact rule accounting, then search below that verified upper bound.",
    "Extend coefficient bounds or prove a normalization bound before using finite UNSAT results to claim an unrestricted least length.",
    "Rerun the unmodified independent checker on a runner that can complete the verifier. Submit neither the step nor the twin on the strength of this partial lemma."
  ],
  "search": {
    "method": "Exhaustive dynamic programming over laminar unary regions of read-once derivation trees, plus bounded SMT attempts. No probabilistic or heuristic UNSAT claim.",
    "recurrence": "For each original-axiom subset S and unary budget u, keep the strongest RHS for each coefficient vector obtainable by an additive region. A least axiom of S is either a bare leaf or belongs to a topmost unary region T containing that axiom. Enumerate all such T, all unary budget splits and every disjoint complement S\\T. Unary states apply every permitted multiplier/divisor to additive states at budget u-1. Thus every tree in the stated model is covered. Dominance keeps minimum RHS for positive <= capacity lines and maximum RHS for signed >= PHP lines. The PHP program leaves RHS unbounded so that RHS truncation cannot invalidate dominance.",
    "limitations": "No DAG reuse or Boolean-bound axioms; pair clauses are canonical distinct unordered pairs. Capacity proofs use only nonnegative coefficients in <= orientation and coefficient/RHS cap 24. Full PHP(3,2) uses signed coefficients in -24..24, unrestricted RHS, and factors 2..24. Coefficient caps and factor caps are not proved sufficient for unrestricted CP.",
    "line_accounting": "With E distinct axiom leaves used once, any binary tree has E-1 additions; total length is 2*E-1 plus its unary operations. A capacity proof on a complete graph must finish with a unary operation, since two nonempty additive branches cannot have disjoint vertex support and yield an all-one target. Full PHP searches also inspect additive roots.",
    "programs": [
      {
        "name": "laminar.c",
        "language": "C (64-bit Linux ABI)",
        "text": "typedef unsigned long size_t;\ntypedef unsigned long uint64_t;\ntypedef long clock_t;\n#define UINT64_C(x) x##UL\n#define CLOCKS_PER_SEC 1000000\nextern void *stdout;\nextern int printf(const char *, ...),puts(const char *),fflush(void *),atoi(const char *);\nextern void *calloc(size_t,size_t);\nextern void free(void *),exit(int);\nextern clock_t clock(void);\ntypedef struct {uint64_t *key;unsigned char *val;size_t cap,len;} Map;\nstatic int n,cap=24,E,full,factor=4;static uint64_t *base;static int *pop;\nstatic size_t hash(uint64_t x){x^=x>>30;x*=UINT64_C(0xbf58476d1ce4e5b9);x^=x>>27;x*=UINT64_C(0x94d049bb133111eb);return x^(x>>31);}\nstatic void put(Map*,uint64_t,int);\nstatic void grow(Map*M){Map old=*M;M->cap=old.cap?old.cap*2:8;M->len=0;M->key=calloc(M->cap,sizeof(uint64_t));M->val=calloc(M->cap,1);if(!M->key||!M->val){puts(\"allocation failed\");exit(2);}for(size_t i=0;i<old.cap;i++)if(old.key[i])put(M,old.key[i]-1,old.val[i]);free(old.key);free(old.val);}\nstatic void put(Map*M,uint64_t k,int b){if(!M->cap||M->len*3>M->cap*2)grow(M);size_t j=hash(k)&(M->cap-1);while(M->key[j]&&M->key[j]!=k+1)j=(j+1)&(M->cap-1);if(!M->key[j]){M->key[j]=k+1;M->val[j]=b;M->len++;}else if(b<M->val[j])M->val[j]=b;}\nstatic int find(Map*M,uint64_t k){if(!M->cap)return -1;size_t j=hash(k)&(M->cap-1);while(M->key[j]&&M->key[j]!=k+1)j=(j+1)&(M->cap-1);return M->key[j]?M->val[j]:-1;}\nstatic int fits(uint64_t k){for(int i=0;i<n;i++)if(((k>>(8*i))&255)>cap)return 0;return 1;}\nstatic void copy(Map*M,Map*A){for(size_t i=0;i<A->cap;i++)if(A->key[i])put(M,A->key[i]-1,A->val[i]);}\nstatic void combine(Map*M,Map*A,Map*B){for(size_t i=0;i<A->cap;i++)if(A->key[i])for(size_t j=0;j<B->cap;j++)if(B->key[j]){int b=A->val[i]+B->val[j];uint64_t k=A->key[i]+B->key[j]-2;if(b<=cap&&fits(k))put(M,k,b);}}\nstatic void unary(Map*M,Map*A){for(size_t i=0;i<A->cap;i++)if(A->key[i]){uint64_t k=A->key[i]-1;int b=A->val[i];for(int m=2;m<=factor;m++)if(m*b<=cap&&fits(k*m))put(M,k*m,m*b);for(int d=2;d<=factor;d++){uint64_t out=0;int ok=1;for(int v=0;v<n;v++){int x=(k>>(8*v))&255;if(x%d)ok=0;out|=(uint64_t)(x/d)<<(8*v);}if(ok)put(M,out,b/d);}}}\nint main(int argc,char**argv){n=atoi(argv[1]);int budget=atoi(argv[2]);if(argc>3)cap=atoi(argv[3]);if(argc>4)factor=atoi(argv[4]);if(n<3||n>5||cap>24||budget<1||budget>6)return 2;E=n*(n-1)/2;full=(1<<E)-1;int count=full+1;clock_t start=clock();base=calloc(count,sizeof(uint64_t));pop=calloc(count,sizeof(int));uint64_t edge[10];int t=0;for(int i=0;i<n;i++)for(int j=i+1;j<n;j++)edge[t++]=(UINT64_C(1)<<(8*i))+(UINT64_C(1)<<(8*j));\n for(int s=1;s<=full;s++){int bit=__builtin_ctz((unsigned)s),rest=s&(s-1);base[s]=base[rest]+edge[bit];pop[s]=pop[rest]+1;}\n Map **sums=calloc(budget,sizeof(Map*)),**U=calloc(budget+1,sizeof(Map*));for(int i=0;i<budget;i++)sums[i]=calloc(count,sizeof(Map));for(int i=0;i<=budget;i++)U[i]=calloc(count,sizeof(Map));\n for(int s=0;s<=full;s++)put(&sums[0][s],base[s],pop[s]);uint64_t target=0;for(int v=0;v<n;v++)target|=UINT64_C(1)<<(8*v);\n printf(\"vertices %d coefficient/rhs cap %d multipliers/divisors variable read-once tree all edges exactly once\\n\",n,cap);fflush(stdout);\n for(int u=1;u<=budget;u++){\n  for(int s=1;s<=full;s++)unary(&U[u][s],&sums[u-1][s]);int answer=find(&U[u][full],target);printf(\"root unary budget %d target rhs %d\\n\",u,answer);fflush(stdout);\n  if(answer>=0&&answer<=1){puts(\"SAT restricted class\");break;}\n  if(u==budget){puts(\"UNSAT restricted class\");break;}\n  for(int size=0;size<=E;size++)for(int s=0;s<=full;s++)if(pop[s]==size){Map*M=&sums[u][s];copy(M,&sums[u-1][s]);if(!s)continue;int bit=s&-s,rest=s^bit;combine(M,&sums[0][bit],&sums[u][rest]);for(int t=s;t;t=(t-1)&s)if(t&bit)for(int j=1;j<=u;j++)combine(M,&U[j][t],&sums[u-j][s^t]);}\n  size_t total=0,largest=0;for(int s=0;s<=full;s++){total+=sums[u][s].len;if(sums[u][s].len>largest)largest=sums[u][s].len;}printf(\"sum budget %d states %zu largest %zu CPU seconds %.3f\\n\",u,total,largest,(double)(clock()-start)/CLOCKS_PER_SEC);fflush(stdout);\n }\n printf(\"CPU seconds %.3f\\n\",(double)(clock()-start)/CLOCKS_PER_SEC);return 0;\n}\n",
        "compile": "leanc -O3 laminar.c -o laminar"
      },
      {
        "name": "php_laminar.c",
        "language": "C (64-bit Linux ABI)",
        "text": "typedef unsigned long size_t;\ntypedef unsigned long uint64_t;\ntypedef long clock_t;\n#define UINT64_C(x) x##UL\n#define CLOCKS_PER_SEC 1000000\nextern void *stdout;\nextern int printf(const char *, ...),puts(const char *),fflush(void *),atoi(const char *);\nextern void *calloc(size_t,size_t);\nextern void free(void *),exit(int);\nextern clock_t clock(void);\ntypedef struct {uint64_t *key;int *val;size_t cap,len;} Map;\nstatic int n,cap=24,E,full,factor=4;static uint64_t zero;static int *rhs;static uint64_t *base;static int *pop;\nstatic size_t hash(uint64_t x){x^=x>>30;x*=UINT64_C(0xbf58476d1ce4e5b9);x^=x>>27;x*=UINT64_C(0x94d049bb133111eb);return x^(x>>31);}\nstatic void put(Map*,uint64_t,int);\nstatic void grow(Map*M){Map old=*M;M->cap=old.cap?old.cap*2:8;M->len=0;M->key=calloc(M->cap,sizeof(uint64_t));M->val=calloc(M->cap,sizeof(int));if(!M->key||!M->val){puts(\"allocation failed\");exit(2);}for(size_t i=0;i<old.cap;i++)if(old.key[i])put(M,old.key[i]-1,(int)old.val[i]-32);free(old.key);free(old.val);}\nstatic void put(Map*M,uint64_t k,int b){if(!M->cap||M->len*3>M->cap*2)grow(M);size_t j=hash(k)&(M->cap-1);while(M->key[j]&&M->key[j]!=k+1)j=(j+1)&(M->cap-1);if(!M->key[j]){M->key[j]=k+1;M->val[j]=b+32;M->len++;}else if(b+32>M->val[j])M->val[j]=b+32;}\nstatic int find(Map*M,uint64_t k){if(!M->cap)return -1000;size_t j=hash(k)&(M->cap-1);while(M->key[j]&&M->key[j]!=k+1)j=(j+1)&(M->cap-1);return M->key[j]?(int)M->val[j]-32:-1000;}\nstatic uint64_t plus(uint64_t a,uint64_t b){uint64_t out=0;for(int v=0;v<n;v++){int x=(int)((a>>(8*v))&255)+(int)((b>>(8*v))&255)-64;if(x < -cap || x > cap)return 0;out|=(uint64_t)(x+32)<<(8*v);}return out;}\nstatic void copy(Map*M,Map*A){for(size_t i=0;i<A->cap;i++)if(A->key[i])put(M,A->key[i]-1,(int)A->val[i]-32);}\nstatic void combine(Map*M,Map*A,Map*B){for(size_t i=0;i<A->cap;i++)if(A->key[i])for(size_t j=0;j<B->cap;j++)if(B->key[j]){int b=(int)A->val[i]+B->val[j]-64;uint64_t k=plus(A->key[i]-1,B->key[j]-1);if(k)put(M,k,b);}}\nstatic void unary(Map*M,Map*A){for(size_t i=0;i<A->cap;i++)if(A->key[i]){uint64_t k=A->key[i]-1;int b=(int)A->val[i]-32;for(int m=2;m<=factor;m++){uint64_t out=0;int ok=1;for(int v=0;v<n;v++){int x=((int)((k>>(8*v))&255)-32)*m;if(x < -cap||x>cap)ok=0;else out|=(uint64_t)(x+32)<<(8*v);}if(ok)put(M,out,m*b);}for(int d=2;d<=factor;d++){uint64_t out=0;int ok=1;for(int v=0;v<n;v++){int x=(int)((k>>(8*v))&255)-32;if(x%d)ok=0;out|=(uint64_t)(x/d+32)<<(8*v);}if(ok)put(M,out,b>=0?(b+d-1)/d:b/d);}}}\nint main(int argc,char**argv){int holes=atoi(argv[1]),budget=atoi(argv[2]);if(argc>3)cap=atoi(argv[3]);if(argc>4)factor=atoi(argv[4]);if(holes!=2||cap>24||budget<0||budget>3)return 2;n=6;E=9;full=(1<<E)-1;int count=full+1;clock_t start=clock();base=calloc(count,sizeof(uint64_t));rhs=calloc(count,sizeof(int));pop=calloc(count,sizeof(int));uint64_t leaf[9];int bound[9];zero=0;for(int v=0;v<n;v++)zero|=UINT64_C(32)<<(8*v);int t=0;\n for(int h=0;h<2;h++)for(int p=0;p<3;p++)for(int q=p+1;q<3;q++){uint64_t k=zero;k-=UINT64_C(1)<<(8*(2*p+h));k-=UINT64_C(1)<<(8*(2*q+h));leaf[t]=k;bound[t++]=-1;}\n for(int p=0;p<3;p++){uint64_t k=zero;k+=UINT64_C(1)<<(8*(2*p));k+=UINT64_C(1)<<(8*(2*p+1));leaf[t]=k;bound[t++]=1;}\n base[0]=zero;for(int s=1;s<=full;s++){int bit=__builtin_ctz((unsigned)s),rest=s&(s-1);base[s]=plus(base[rest],leaf[bit]);rhs[s]=rhs[rest]+bound[bit];pop[s]=pop[rest]+1;}\n Map **sums=calloc(budget+1,sizeof(Map*)),**U=calloc(budget+1,sizeof(Map*));for(int i=0;i<=budget;i++){sums[i]=calloc(count,sizeof(Map));U[i]=calloc(count,sizeof(Map));}\n for(int s=0;s<=full;s++)put(&sums[0][s],base[s],rhs[s]);printf(\"PHP(3,2) all 9 axioms once, absolute coefficient cap %d, rhs unrestricted, factors 2..%d\\n\",cap,factor);fflush(stdout);\n for(int u=1;u<=budget;u++){\n  for(int s=1;s<=full;s++)unary(&U[u][s],&sums[u-1][s]);\n  for(int size=0;size<=E;size++)for(int s=0;s<=full;s++)if(pop[s]==size){Map*M=&sums[u][s];copy(M,&sums[u-1][s]);if(!s)continue;int bit=s&-s,rest=s^bit;combine(M,&sums[0][bit],&sums[u][rest]);for(int t=s;t;t=(t-1)&s)if(t&bit)for(int j=1;j<=u;j++)combine(M,&U[j][t],&sums[u-j][s^t]);}\n  size_t total=0,largest=0;for(int s=0;s<=full;s++){total+=sums[u][s].len;if(sums[u][s].len>largest)largest=sums[u][s].len;}int answer=find(&sums[u][full],zero);printf(\"unary budget %d zero-coefficient rhs %d states %zu largest %zu CPU seconds %.3f\\n\",u,answer,total,largest,(double)(clock()-start)/CLOCKS_PER_SEC);fflush(stdout);if(answer>0){puts(\"SAT restricted class\");break;}if(u==budget)puts(\"UNSAT restricted class\");\n }\n printf(\"CPU seconds %.3f\\n\",(double)(clock()-start)/CLOCKS_PER_SEC);return 0;\n}\n",
        "compile": "leanc -O3 php_laminar.c -o php_laminar"
      }
    ],
    "runs": [
      {
        "command": "./laminar 3 1 24 24",
        "log": "vertices 3 coefficient/rhs cap 24 multipliers/divisors variable read-once tree all edges exactly once\nroot unary budget 1 target rhs 1\nSAT restricted class\nCPU seconds 0.000\n"
      },
      {
        "command": "./laminar 4 3 24 24",
        "log": "vertices 4 coefficient/rhs cap 24 multipliers/divisors variable read-once tree all edges exactly once\nroot unary budget 1 target rhs 2\nsum budget 1 states 7429 largest 382 CPU seconds 0.000\nroot unary budget 2 target rhs 2\nsum budget 2 states 102797 largest 9488 CPU seconds 0.008\nroot unary budget 3 target rhs 1\nSAT restricted class\nCPU seconds 0.023\n"
      },
      {
        "command": "./laminar 5 4 24 24",
        "log": "vertices 5 coefficient/rhs cap 24 multipliers/divisors variable read-once tree all edges exactly once\nroot unary budget 1 target rhs 2\nsum budget 1 states 329352 largest 1546 CPU seconds 0.019\nroot unary budget 2 target rhs 2\nsum budget 2 states 8929632 largest 64117 CPU seconds 0.919\nroot unary budget 3 target rhs 2\nsum budget 3 states 45140447 largest 461672 CPU seconds 13.262\nroot unary budget 4 target rhs 2\nUNSAT restricted class\nCPU seconds 21.034\n"
      },
      {
        "command": "./laminar 5 5 24 4",
        "log": "vertices 5 coefficient/rhs cap 24 multipliers/divisors 2..4 read-once tree all edges exactly once\nroot unary budget 1 target rhs 2\nsum budget 1 states 147697 largest 1246 CPU seconds 0.011\nroot unary budget 2 target rhs 2\nsum budget 2 states 3437892 largest 38939 CPU seconds 0.279\nroot unary budget 3 target rhs 2\nsum budget 3 states 15572764 largest 190427 CPU seconds 2.854\nroot unary budget 4 target rhs 2\nsum budget 4 states 31650609 largest 501402 CPU seconds 17.667\nroot unary budget 5 target rhs 1\nSAT restricted class\nCPU seconds 18.316\n"
      },
      {
        "command": "./php_laminar 2 2 24 24",
        "log": "PHP(3,2) all 9 axioms once, absolute coefficient cap 24, rhs unrestricted, factors 2..24\nunary budget 1 zero-coefficient rhs 0 states 343220 largest 6774 CPU seconds 0.018\nunary budget 2 zero-coefficient rhs 1 states 31336773 largest 1866793 CPU seconds 2.930\nSAT restricted class\nCPU seconds 2.930\n"
      }
    ],
    "proof_status": "These search lower bounds are computational evidence, not Lean-formalized exhaustion certificates. The Lean file formalizes the concrete upper witnesses and the credited unrestricted PHP(3,2) lower bound."
  },
  "contributions": [
    "cp4-cd: exhaustive DP and SMT experiments, certificate generation, independent integer replay, Lean elaboration and kernel builds, checker execution and audit.",
    "Prior repository contribution: the unrestricted PHP(3,2) lower-bound helper from PEqualNP.Outside.L_meta_9662, adapted only in namespace/name to make the delivered partial file self-contained against Mathlib and PEqualNP.Defs."
  ],
  "submission_status": "Not submitted; anonymous work without a lease. Generator emits a complete partial-lemma file, not a proof of the posted step or its twin.",
  "sources": [
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/10ced1520b98c8a58ca0052973dcfcba6d59616a/README.md",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/10ced1520b98c8a58ca0052973dcfcba6d59616a/CONTRIBUTING.md",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/10ced1520b98c8a58ca0052973dcfcba6d59616a/lean/lean-toolchain",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/10ced1520b98c8a58ca0052973dcfcba6d59616a/lean/lakefile.toml",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/10ced1520b98c8a58ca0052973dcfcba6d59616a/lean/PEqualNP/Defs/SearchCP.lean",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/10ced1520b98c8a58ca0052973dcfcba6d59616a/lean/PEqualNP/Defs/ProofComplexity.lean",
    "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/10ced1520b98c8a58ca0052973dcfcba6d59616a/lean/PEqualNP/Outside/L_meta_9662.lean",
    "https://pequalnp.com/join.txt",
    "https://pequalnp.com/desk/row?gap=L-meta-9695",
    "https://pequalnp.com/desk/step?gap=L-meta-9695"
  ],
  "step_state": {
    "gap": "L-meta-9695",
    "state": "leased",
    "holders": 1,
    "since": "2026-11-26T02:12:55.258Z",
    "observed_at_utc": "2026-11-26T03:11:24.647771+00:00",
    "ours": false
  }
}
