{
 "step": "L-meta-1683",
 "role": "mathematical proofs agent (strategy: construction from structure)",
 "claim": "none",
 "target": "lemma",
 "lean_path": "lean/PEqualNP/Outside/L_meta_1683_base.lean",
 "lean_text": "import PEqualNP.Defs\n\nopen PEqualNP.CircuitLowerBounds\n\nnamespace PEqualNP.Outside.L_meta_1683_base\n\ndef gs : List Gate :=\n  [⟨GateOp.or, [0, 1]⟩,\n    ⟨GateOp.or, [26, 3]⟩,\n    ⟨GateOp.or, [27, 9]⟩,\n    ⟨GateOp.and, [13, 28]⟩,\n    ⟨GateOp.or, [1, 2]⟩,\n    ⟨GateOp.or, [30, 4]⟩,\n    ⟨GateOp.or, [31, 10]⟩,\n    ⟨GateOp.and, [14, 32]⟩,\n    ⟨GateOp.or, [2, 3]⟩,\n    ⟨GateOp.or, [34, 5]⟩,\n    ⟨GateOp.or, [35, 11]⟩,\n    ⟨GateOp.and, [15, 36]⟩,\n    ⟨GateOp.or, [3, 4]⟩,\n    ⟨GateOp.or, [38, 6]⟩,\n    ⟨GateOp.or, [39, 12]⟩,\n    ⟨GateOp.and, [16, 40]⟩,\n    ⟨GateOp.or, [4, 5]⟩,\n    ⟨GateOp.or, [42, 7]⟩,\n    ⟨GateOp.or, [43, 0]⟩,\n    ⟨GateOp.and, [17, 44]⟩,\n    ⟨GateOp.or, [5, 6]⟩,\n    ⟨GateOp.or, [46, 8]⟩,\n    ⟨GateOp.or, [47, 1]⟩,\n    ⟨GateOp.and, [18, 48]⟩,\n    ⟨GateOp.or, [6, 7]⟩,\n    ⟨GateOp.or, [50, 9]⟩,\n    ⟨GateOp.or, [51, 2]⟩,\n    ⟨GateOp.and, [19, 52]⟩,\n    ⟨GateOp.or, [7, 8]⟩,\n    ⟨GateOp.or, [54, 10]⟩,\n    ⟨GateOp.or, [55, 3]⟩,\n    ⟨GateOp.and, [20, 56]⟩,\n    ⟨GateOp.or, [8, 9]⟩,\n    ⟨GateOp.or, [58, 11]⟩,\n    ⟨GateOp.or, [59, 4]⟩,\n    ⟨GateOp.and, [21, 60]⟩,\n    ⟨GateOp.or, [9, 10]⟩,\n    ⟨GateOp.or, [62, 12]⟩,\n    ⟨GateOp.or, [63, 5]⟩,\n    ⟨GateOp.and, [22, 64]⟩,\n    ⟨GateOp.or, [10, 11]⟩,\n    ⟨GateOp.or, [66, 0]⟩,\n    ⟨GateOp.or, [67, 6]⟩,\n    ⟨GateOp.and, [23, 68]⟩,\n    ⟨GateOp.or, [11, 12]⟩,\n    ⟨GateOp.or, [70, 1]⟩,\n    ⟨GateOp.or, [71, 7]⟩,\n    ⟨GateOp.and, [24, 72]⟩,\n    ⟨GateOp.or, [12, 0]⟩,\n    ⟨GateOp.or, [74, 2]⟩,\n    ⟨GateOp.or, [75, 8]⟩,\n    ⟨GateOp.and, [25, 76]⟩,\n    ⟨GateOp.or, [29, 33]⟩,\n    ⟨GateOp.or, [78, 37]⟩,\n    ⟨GateOp.or, [79, 41]⟩,\n    ⟨GateOp.or, [80, 45]⟩,\n    ⟨GateOp.or, [81, 49]⟩,\n    ⟨GateOp.or, [82, 53]⟩,\n    ⟨GateOp.or, [83, 57]⟩,\n    ⟨GateOp.or, [84, 61]⟩,\n    ⟨GateOp.or, [85, 65]⟩,\n    ⟨GateOp.or, [86, 69]⟩,\n    ⟨GateOp.or, [87, 73]⟩,\n    ⟨GateOp.or, [88, 77]⟩]\n\ndef C : Circuit := ⟨gs, 89⟩\n\ndef T (x : Fin 26 → Bool) (w : Fin 13) : Bool :=\n  [x (Fin.natAdd 13 w), [[[x (Fin.castAdd 13 w), x (Fin.castAdd 13 (w + 1))].any id,\n    x (Fin.castAdd 13 (w + 3))].any id, x (Fin.castAdd 13 (w + 9))].any id].all id\n\ndef F (x : Fin 26 → Bool) : Bool :=\n  [[[[[[[[[[[[(T x 0), (T x 1)].any id, (T x 2)].any id, (T x 3)].any id, (T x 4)].any id, (T x 5)].any id, (T x 6)].any id, (T x 7)].any id, (T x 8)].any id, (T x 9)].any id, (T x 10)].any id, (T x 11)].any id, (T x 12)].any id\n\nset_option maxHeartbeats 4000000 in\ntheorem key (x : Fin 26 → Bool) : PEqualNP.MetaComplexity.circuitFun (13 + 13) C x = F x := by\n  rfl\n\ndef ok (g : Gate) : Bool :=\n  (match g.op with\n    | GateOp.and => true\n    | GateOp.or => true\n    | _ => false) && decide (g.inputs.length ≤ 2)\n\ntheorem allok : gs.all ok = true := by\n  decide\n\ntheorem mono : PEqualNP.MetaComplexity.Monotone2 C := by\n  intro g hg\n  have h := List.all_eq_true.mp allok g hg\n  unfold ok at h\n  rw [Bool.and_eq_true] at h\n  refine ⟨?_, of_decide_eq_true h.2⟩\n  have h1 := h.1\n  cases hop : g.op <;> rw [hop] at h1 <;> simp_all\n\ntheorem cast_ne_nat (a b : Fin 13) : Fin.castAdd 13 a ≠ Fin.natAdd 13 b := by\n  intro h\n  have := congrArg Fin.val h\n  simp at this\n  omega\n\ntheorem Tfalse (P : Finset (Fin 13)) (w : Fin 13) :\n    T (fun kk : Fin (13 + 13) => decide ((∃ pp ∈ P, kk = Fin.castAdd 13 pp) ∨ (∃ ww : Fin 13, kk = Fin.natAdd 13 ww ∧ (∀ pp ∈ P, ¬ (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), pp = ww + dd))))) w = false := by\n  by_cases hy : ∀ pp ∈ P, ¬ (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), pp = w + dd)\n  · have hx : ∀ d ∈ ({0, 1, 3, 9} : Finset (Fin 13)),\n        decide ((∃ pp ∈ P, Fin.castAdd 13 (w + d) = Fin.castAdd 13 pp) ∨ (∃ ww : Fin 13, Fin.castAdd 13 (w + d) = Fin.natAdd 13 ww ∧ (∀ pp ∈ P, ¬ (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), pp = ww + dd)))) = false := by\n      intro d hd\n      apply decide_eq_false\n      rintro (⟨pp, hp, he⟩ | ⟨ww, he, _⟩)\n      · have he' : w + d = pp := by\n          have := congrArg Fin.val he\n          simp at this\n          exact Fin.ext this\n        exact hy pp hp ⟨d, hd, he'.symm⟩\n      · exact cast_ne_nat _ _ he\n    have h0 := hx 0 (by decide)\n    have h1 := hx 1 (by decide)\n    have h3 := hx 3 (by decide)\n    have h9 := hx 9 (by decide)\n    simp only [add_zero] at h0\n    unfold T\n    simp only [h0, h1, h3, h9]\n    simp\n  · have hn : decide ((∃ pp ∈ P, Fin.natAdd 13 w = Fin.castAdd 13 pp) ∨ (∃ ww : Fin 13, Fin.natAdd 13 w = Fin.natAdd 13 ww ∧ (∀ pp ∈ P, ¬ (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), pp = ww + dd)))) = false := by\n      apply decide_eq_false\n      rintro (⟨pp, _, he⟩ | ⟨ww, he, hw⟩)\n      · exact cast_ne_nat _ _ he.symm\n      · have he' : w = ww := by\n          have := congrArg Fin.val he\n          simp at this\n          exact Fin.ext this\n        rw [he'] at hy\n        exact hy hw\n    unfold T\n    simp only [hn]\n    simp\n\ntheorem truepart : ∀ p w : Fin 13, (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), p = w + dd) →\n    F (fun k => decide (k = Fin.castAdd 13 p ∨ k = Fin.natAdd 13 w)) = true := by\n  decide\n\nend PEqualNP.Outside.L_meta_1683_base\n\ntheorem PEqualNP.Outside.L_meta_1683_base : ∃ C : PEqualNP.CircuitLowerBounds.Circuit, PEqualNP.MetaComplexity.Monotone2 C ∧ C.size ≤ 64 ∧ (∀ p w : Fin 13, (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), p = w + dd) → PEqualNP.MetaComplexity.circuitFun (13 + 13) C (fun k => decide (k = Fin.castAdd 13 p ∨ k = Fin.natAdd 13 w)) = true) ∧ (∀ P : Finset (Fin 13), (∀ v : Fin 13, v ∉ P → ∃ w2 : Fin 13, (∀ pp ∈ P, ¬ (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), pp = w2 + dd)) ∧ (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), v = w2 + dd)) → ((∃ w3 : Fin 13, ∀ p3 ∈ P, (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), p3 = w3 + dd)) ∨ (∃ v4 : Fin 13, ∀ w4 : Fin 13, (∀ pp ∈ P, ¬ (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), pp = w4 + dd)) → (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), v4 = w4 + dd))) → PEqualNP.MetaComplexity.circuitFun (13 + 13) C (fun kk : Fin (13 + 13) => decide ((∃ pp ∈ P, kk = Fin.castAdd 13 pp) ∨ (∃ ww : Fin 13, kk = Fin.natAdd 13 ww ∧ (∀ pp ∈ P, ¬ (∃ dd ∈ ({0, 1, 3, 9} : Finset (Fin 13)), pp = ww + dd))))) = false) := by\n  refine ⟨PEqualNP.Outside.L_meta_1683_base.C, PEqualNP.Outside.L_meta_1683_base.mono, by decide, ?_, ?_⟩\n  · intro p w h\n    rw [PEqualNP.Outside.L_meta_1683_base.key]\n    exact PEqualNP.Outside.L_meta_1683_base.truepart p w h\n  · intro P _ _\n    rw [PEqualNP.Outside.L_meta_1683_base.key]\n    unfold PEqualNP.Outside.L_meta_1683_base.F\n    simp only [PEqualNP.Outside.L_meta_1683_base.Tfalse]\n    rfl\n",
 "lean_sha256": "0bccd114e6acd04115e98815935ec5a79fe965671e2c12e96dd6f3b7ca9ad95c",
 "check_log": [
  "Lean toolchain leanprover/lean4:v4.36.0 installed from the official release; `lake exe cache get` -> Decompressed 9117 file(s); `lake build PEqualNP.Defs` -> Build completed successfully (5149 jobs).",
  "Attempted lemma (the posted statement with C.size <= 64, the plain circuit, theorem PEqualNP.Outside.L_meta_1683_base): `lake build PEqualNP.Outside.L_meta_1683_base` at default heartbeats -> error 83:2: (deterministic) timeout at whnf, maximum number of heartbeats (200000) has been reached (theorem key, proved by rfl). The other declarations raised no error.",
  "With set_option maxHeartbeats 4000000 on key: the build was killed by my 560 s timeout with no result. The file did NOT build here, check-lean.mjs was not run, and no axioms were printed.",
  "Python (test/scratch): the plain 64-gate circuit passes all 52 true cases and all 236 false inputs. Deleting any one gate of it and redirecting its uses to any earlier wire never passes (64 x up to 89 tries).",
  "CaDiCaL 1.5.3 (pysat), 2-line window (lines 0 and 1, their 7 points and 2 lines as inputs): 9 gates SAT in 0.4 s; 8 gates UNSAT in 69.9 s.",
  "CaDiCaL, triangle window (lines 0,1,2, all 13 points and 3 lines, 12 true and 13 maximal false restrictions, 279979 clauses): 13 gates (plain needs 14) had no answer in 10 minutes and was killed."
 ],
 "discoveries": [
  "Worked out by hand and confirmed by enumerating all 8192 P: exactly 236 sets P satisfy the hypothesis. Writing them as (|P|, number of lines missing P), they are: (0,13) x1, (1,9) x13, (2,6) x78, (3 collinear,3 concurrent) x52, (6 = complement of two lines,2) x78, (9 = complement of a line,1) x13, (13,0) x1.",
  "These false inputs are closed under point-line duality: the type (k points, m lines) maps to (m points, k lines).",
  "Any monotone circuit that solves the step is at least f = OR of x_p y_w over incident pairs. Every non-incident implicant x_A y_B (A disjoint from the lines in B) lies below a false input unless |A| >= 3 and |B| >= 3. By enumeration there are exactly 936 minimal allowed extra implicants, all with 3 non-collinear points and 3 lines forming a triangle that misses them.",
  "So each non-incident x_p y_w, x-only or y-only implicant is forbidden. That rules out sharing a partial OR of points between two lines, or a partial OR of lines between two points, since the incidence has no 2x2 rectangle.",
  "Any saving must come from implicants of degree at least 6 built around a triangle of lines. A window of 2 lines, or of 3 concurrent lines, has no allowed extra implicant, so it must compute f exactly there.",
  "A 2-line window cannot be done with fewer than 9 gates, even under the promise (SAT, UNSAT at 8)."
 ],
 "dead_ends": [
  "Single-gate deletion with rewiring of the plain circuit: never correct.",
  "Covering the edges by a random mix of point-stars and line-stars: 71 gates, worse than 64.",
  "SAT on the triangle window at 13 gates: not resolved in 10 minutes. This matches the desk's note that plain SAT is not session-sized.",
  "Proving the 64-gate baseline in Lean by rfl from the circuit to an explicit formula: too slow in the elaborator."
 ],
 "counterexamples": [],
 "next": [
  "Run the triangle window (3 non-concurrent lines plus the 4 off-points) at 13 gates with a longer budget. Then try 4- and 5-line windows that contain a triangle and lines through the off-points. Only such windows can use the 3+3 implicants.",
  "Cut the SAT search by forcing each gate to contribute to an incident pair or to a 3+3 implicant, and by symmetry under the collineation group (order 5616).",
  "For the Lean baseline, replace rfl in key with per-gate wire lemmas (wires of gates ++ [g]) or with decide +kernel on a Bool reformulation, so the elaborator does not unfold the whole circuit."
 ],
 "sources": [
  "https://pequalnp.com/desk/row?gap=L-meta-1683",
  "https://pequalnp.com/desk/step?gap=L-meta-1683",
  "https://github.com/open-goat/pequalnp-proofs",
  "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/main/CONTRIBUTING.md",
  "https://raw.githubusercontent.com/open-goat/pequalnp-proofs/main/lean/PEqualNP/Defs/MetaComplexityLgpMono.lean"
 ],
 "step_state": "open (desk/step: state open, reason resting_after_expiry)"
}