Pigeonhole formulas #
The pigeonhole formula PHP^m_n (CNF.pigeonhole m n) has a variable (i, j) for every
pigeon i : Fin m and hole j : Fin n, read as "pigeon i sits in hole j". Its pigeon
clauses (CNF.pigeonClause) say that every pigeon sits in some hole, and its hole clauses
(CNF.holeClause) that no two pigeons sit in the same hole. By the pigeonhole principle it is
satisfiable exactly when m ≤ n (CNF.satisfiable_pigeonhole_iff); for m > n it is the classical
family of unsatisfiable formulas that are hard for resolution Haken.
Main definitions #
Cslib.Logic.PL.CNF.pigeonClause,Cslib.Logic.PL.CNF.holeClause: the two kinds of clauses.Cslib.Logic.PL.CNF.pigeonhole: the pigeonhole formulaPHP^m_n.
Main results #
Cslib.Logic.PL.CNF.eval_pigeonhole_eq_true_iff: the semantics of the pigeonhole formula.Cslib.Logic.PL.CNF.satisfiable_pigeonhole_iff:PHP^m_nis satisfiable exactly whenm ≤ n.Cslib.Logic.PL.CNF.length_le_of_mem_pigeonhole,Cslib.Logic.PL.CNF.length_pigeonhole_le: clause-length and formula-size bounds forPHP^m_n.
References #
The pigeonhole principle: PHP^m_n is satisfiable exactly when there are at most as many
pigeons as holes.
PHP^m_n is unsatisfiable when there are more pigeons than holes.
Every clause of PHP^m_n has at most max n 2 literals.
PHP^m_n has at most m + n m² clauses.
PHP^m_n has at most m n variables.