AFTD Auto-Formalizing Theoretical Domains

SATtoColor.OutputVertex

inductiveimported Lean

The vertex set of the reduction graph is the inductive type $\mathrm{OutputVertex}(V)$ with three constructors:
• $\mathrm{palette}(p)$ for $p : \mathrm{Fin}\,3$ --- the three special palette nodes (Base $= 0$, True $= 1$, False $= 2$) forming a triangle that fixes color semantics;
• $\mathrm{literalNode}(\ell)$ --- one node per literal over $V$ (positive and negative occurrences are separate nodes);
• $\mathrm{clauseGadget}(c, k)$ for $k : \mathrm{Fin}\,6$ --- six internal nodes per clause $c$ encoding the OR constraint.

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
inductive SATtoColor.OutputVertex (V : Type)
Defined in
TCSlib, `SATtoColor.OutputVertex`
Lean proof
By CS 294-268 course staff (UC Berkeley, Spring 2026), from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Copyright (c) 2026 UC Berkeley CS 294. 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
none listed
Built on 2
  • SATtoColor.LiteralA literal for switching-lemma formulas: a variable $\mathtt{var} : \mathrm{Fin}\,n$ with a negation flag $\mathtt{neg} : \mathrm{Bool}$…
  • SATtoColor.ClauseA clause over a variable type $V$ is a structure bundling exactly three literals $\ell_1, \ell_2, \ell_3 : \mathrm{Literal}\,V$.…
Used by 7
  • SATtoColor.EdgeRelation$\mathrm{EdgeRelation}(f, u, v)$ defines the (undirected) adjacency structure of the reduction graph. The edges are: all pairs of distinct…
  • SATtoColor.SATtoColorReductionCorrectness of the 3-SAT to 3-coloring reduction. Let $f$ be a 3-SAT instance over a variable type $V$: a list of clauses, each clause an…
  • SATtoColor.sat3Coloring_litNodeColor of a literal node. Fix a variable type $V$ and a Boolean assignment $\alpha : V \to \{\text{true}, \text{false}\}$, and consider the…
  • SATtoColor.SATtoColorSoundnessSoundness of the 3-SAT to 3-colouring reduction. Let $f$ be a 3-SAT instance over a variable type $V$, that is, a list of clauses, each…
  • SATtoColor.SATtoColorCompletenessCompleteness of the 3-SAT to 3-coloring reduction. Let $f$ be a 3-SAT instance over a variable type $V$, that is, a list of clauses, each…
  • SATtoColor.ReductionGraphGiven a 3-SAT instance $f$ over variables $V$, the reduction graph $\mathrm{ReductionGraph}(f)$ is the SimpleGraph on…
  • SATtoColor.sat3ColoringGiven a satisfying assignment $\mathrm{assign} : V \to \mathrm{Bool}$, the function $\mathrm{sat3Coloring}(\mathrm{assign})$ maps every…

Lean source view module on GitHub

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
/-- Vertex set for reduction from 3-SAT to 3-COLORING. • palette – the special triangle fixing color semantics (Base=0, T=1, F=2). • literalNode – one node per literal (pos and neg are separate nodes). • clauseGadget – six internal nodes per clause encoding the OR constraint. -/
inductive SATtoColor.OutputVertex (V : Type) | palette (p : Fin 3)
| literalNode (l : Literal V)
| clauseGadget (c : Clause V) (idx : Fin 6)
See it in the graphDiscuss this resultChallenge it