ThreeSATToClique.getLitAt
defimported Lean
Given a 3-CNF formula $f$ and a vertex $v : \mathtt{CliqueVertex}\,f.\mathtt{length}$, returns the literal at position $v.l\_idx$ within clause $f[v.c\_idx]$. The type of $v$ guarantees the index is always in bounds.
Statement
set_option relaxedAutoImplicit false in set_option autoImplicit false in def ThreeSATToClique.getLitAt {V : Type} (f : Formula3 V) (v : CliqueVertex f.length) : Literal V
- Defined in
- TCSlib, `ThreeSATToClique.getLitAt`
- 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.ThreeSATToClique.getLitAt← ThreeSATToClique.getLitAt (TCSlib/Complexity/NPReductions/ThreeSATToClique.lean:134): verbatim
- Verified
- 07 Oct 2026
- Axioms
- none listed
- Built on 4
- 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.LiteralA literal for switching-lemma formulas: a variable $\mathtt{var} : \mathrm{Fin}\,n$ with a negation flag $\mathtt{neg} : \mathrm{Bool}$…
- 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$…
- Used by 5
- ThreeSATToClique.clique_vertices_choose_one_per_clauseOne clique vertex per clause. Let $f$ be a 3-CNF formula with $m$ clauses, and let $s$ be a set of vertices of the conflict graph of $f$.…
- ThreeSATToClique.ThreeSAT_to_Clique_soundnessSoundness of the 3-SAT to clique reduction. Let $f$ be a 3-CNF formula consisting of $m$ clauses. If the conflict graph of $f$ has an…
- ThreeSATToClique.getLitAt_mem_clauseVertex 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…
- ThreeSATToClique.ThreeSAT_to_Clique_completenessCompleteness of the 3-SAT to clique reduction. Let $f$ be a 3-CNF formula consisting of $m$ clauses, and let its conflict graph be the…
- ThreeSATToClique.toCliqueGraphThe conflict graph of a 3-CNF formula $f$ is the simple graph on vertex set $\mathtt{CliqueVertex}\,f.\mathtt{length}$ in which two…
Lean source view module on GitHub
set_option relaxedAutoImplicit false in set_option autoImplicit false in /-- The literal named by vertex `v` in formula `f`. The type of `v` carries `f.length` so the index is always in bounds. -/ def ThreeSATToClique.getLitAt {V : Type} (f : Formula3 V) (v : CliqueVertex f.length) : Literal V := getLitInClause (f.get v.c_idx) v.l_idx