AFTD Auto-Formalizing Theoretical Domains

ThreeSATToClique.getLitAt_mem_clause

theoremverifiedimported Lean

Vertex literal lies among its clause's three literals. Let $f$ be a 3-CNF formula, let $v$ be a vertex of the conflict graph of $f$, and let $i$ be a clause index of $f$ such that the clause component of $v$ equals $i$. Then the literal named by $v$ is one of the three literals $l_1, l_2, l_3$ of the clause $f[i]$.

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
lemma ThreeSATToClique.getLitAt_mem_clause {V : Type} (f : Formula3 V) (v : CliqueVertex f.length)
    (i : Fin f.length) (h : v.c_idx = i) :
    getLitAt f v ∈ [(f.get i).l1, (f.get i).l2, (f.get i).l3]
Source
TCSlib, `ThreeSATToClique.getLitAt_mem_clause`
Lean proof
By Yangshuo Zou, from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Copyright (c) 2026 Yangshuo Zou. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 5
  • ThreeSATToClique.getLitInClauseGiven a 3-clause $c$ and a position $p : \mathrm{Fin}\,3$, returns the $p$-th literal of $c$: $c.l_1$ at position $0$, $c.l_2$ at position…
  • ThreeSATToClique.getLitAtGiven a 3-CNF formula $f$ and a vertex $v : \mathtt{CliqueVertex}\,f.\mathtt{length}$, returns the literal at position $v.l\_idx$ within…
  • ThreeSATToClique.Formula3A 3-CNF formula over $V$ is a list of 3-clauses, representing their conjunction.
  • ThreeSATToClique.CliqueVertexA vertex of the conflict graph for a formula with $m$ clauses is a pair $\langle c\_idx, l\_idx \rangle$ where $c\_idx : \mathrm{Fin}\,m$…
  • ThreeSATToClique.Clause3A 3-clause over $V$ is a structure with exactly three literals $l_1, l_2, l_3 : \mathtt{Literal}\,V$, representing a disjunction of…
Used by 1

Lean source view module on GitHub

set_option relaxedAutoImplicit false inset_option autoImplicit false in/-- The literal named by vertex `v` with `v.c_idx = i` is one of the three literals of clause `f.get i`. This is used in the soundness proof to route the clique's chosen literal back to the original clause. -/lemma ThreeSATToClique.getLitAt_mem_clause {V : Type} (f : Formula3 V) (v : CliqueVertex f.length)    (i : Fin f.length) (h : v.c_idx = i) :    getLitAt f v ∈ [(f.get i).l1, (f.get i).l2, (f.get i).l3] := by  subst h  dsimp [getLitAt]  rcases hl : v.l_idx with ⟨val, isLt⟩  rcases val with _ | _ | _ | n  · simp [getLitInClause]  · simp [getLitInClause]  · simp [getLitInClause]  · omega-- =============================================================-- Section 5. Main theorems-- =============================================================
See it in the graphDiscuss this resultChallenge it