P versus NP: audited encodings and tableau frontier
DefinitionPvsNPFrontierFixed Boolean languages, complement classes, finite-alphabet normalization predicates, canonical CNF parsing, sparse assignment verification, explicit local tableau constraints and intermediate encoding, and same-model EXPTIME. None of these definitions asserts its own correctness or polynomial efficiency.
import Definitions.Def_PvsNP
namespace PvsNP
abbrev DecisionProblem := Language Bool
def inputLength (w : Str) : ℕ := w.length
def PolynomialBound (t : ℕ → ℕ) : Prop :=
∃ p : Polynomial ℕ, ∀ n, t n ≤ p.eval n
def coP : Set DecisionProblem := {L | Lᶜ ∈ P}
def coNP : Set DecisionProblem := {L | Lᶜ ∈ NP}
def NPHard (L : DecisionProblem) : Prop := ∀ A ∈ NP, PReducible A L
def FiniteWorkAlphabets (M : Turing.FinTM2) : Prop :=
∀ k, Finite (M.Γ k)
def FinitePolyTime {α β U V : Type} (ei : α → List U) (eo : β → List V)
(f : α → β) : Prop :=
∃ M : Turing.TM2ComputableInPolyTime ei eo f, FiniteWorkAlphabets M.tm
def parseData : ℕ → Str → Option (Str × Str)
| 0, _ => none
| _ + 1, true :: false :: rest => some ([], rest)
| fuel + 1, false :: b :: rest =>
(parseData fuel rest).map fun p => (b :: p.1, p.2)
| _ + 1, _ => none
def bitsValue : Str → ℕ
| [] => 0
| b :: rest => Nat.bit b (bitsValue rest)
def parseLiteral (w : Str) : Option (Literal × Str) :=
match w with
| false :: sign :: rest =>
(parseData (rest.length + 1) rest).bind fun p =>
let i := bitsValue p.1
if Nat.bits i = p.1 then some ((sign, i), p.2) else none
| _ => none
def parseClauseAux : ℕ → Str → Option (Clause × Str)
| 0, _ => none
| _ + 1, true :: true :: rest => some ([], rest)
| fuel + 1, w =>
(parseLiteral w).bind fun p =>
(parseClauseAux fuel p.2).map fun q => (p.1 :: q.1, q.2)
def parseCNFAux : ℕ → Str → Option CNF
| _, [] => some []
| 0, _ :: _ => none
| fuel + 1, w@(_ :: _) =>
(parseClauseAux (w.length + 1) w).bind fun p =>
(parseCNFAux fuel p.2).map (p.1 :: ·)
def parseCNF (w : Str) : Option CNF := parseCNFAux (w.length + 1) w
def variableNames (F : CNF) : List ℕ := (F.flatten.map Prod.snd).eraseDups
def certificateAssignment (F : CNF) (y : Str) (i : ℕ) : Bool :=
(((variableNames F).zip y).lookup i).getD false
def satVerifier (wy : Str × Str) : Bool :=
match parseCNF wy.1 with
| none => false
| some F =>
if wy.2.length = (variableNames F).length then
evalCNF (certificateAssignment F wy.2) F
else false
structure TableauSpec where
steps : ℕ
interior : ℕ
symbols : ℕ
initialAllowed : List (List ℕ)
acceptingSymbols : List ℕ
allowedWindows : List (List ℕ)
def tableauWidth (S : TableauSpec) : ℕ := S.interior + 2
def tableauAlphabet (S : TableauSpec) : ℕ := S.symbols + 1
def tableauVar (S : TableauSpec) (t c a : ℕ) : ℕ :=
(t * tableauWidth S + c) * tableauAlphabet S + a
def cellClauses (S : TableauSpec) (t c : ℕ) : CNF :=
let as := List.range (tableauAlphabet S)
[as.map fun a => (true, tableauVar S t c a)] ++
as.flatMap fun a =>
(as.filter fun b => a < b).map fun b =>
[(false, tableauVar S t c a), (false, tableauVar S t c b)]
def cellsCNF (S : TableauSpec) : CNF :=
(List.range (S.steps + 1)).flatMap fun t =>
(List.range (tableauWidth S)).flatMap fun c => cellClauses S t c
def initialCNF (S : TableauSpec) : CNF :=
(List.range (tableauWidth S)).flatMap fun c =>
((List.range (tableauAlphabet S)).filter fun a =>
!(S.initialAllowed[c]?.getD []).contains a).map fun a =>
[(false, tableauVar S 0 c a)]
def boundaryCNF (S : TableauSpec) : CNF :=
(List.range (S.steps + 1)).flatMap fun t =>
[[(true, tableauVar S t 0 0)],
[(true, tableauVar S t (S.interior + 1) 0)]]
def acceptingCNF (S : TableauSpec) : CNF :=
[(List.range (tableauWidth S)).flatMap fun c =>
((List.range (tableauAlphabet S)).filter fun a =>
S.acceptingSymbols.contains a).map fun a =>
(true, tableauVar S S.steps c a)]
def wordsOfLength (alphabet : ℕ) : ℕ → List (List ℕ)
| 0 => [[]]
| n + 1 => (List.range alphabet).flatMap fun a =>
(wordsOfLength alphabet n).map (a :: ·)
def windowValues (T : ℕ → ℕ → ℕ) (t c : ℕ) : List ℕ :=
[T t c, T t (c+1), T t (c+2),
T (t+1) c, T (t+1) (c+1), T (t+1) (c+2)]
def forbiddenWindowClause (S : TableauSpec) (t c : ℕ) (v : List ℕ) : Clause :=
[(t,c), (t,c+1), (t,c+2), (t+1,c), (t+1,c+1), (t+1,c+2)].zipWith
(fun pos a => (false, tableauVar S pos.1 pos.2 a)) v
def transitionCNF (S : TableauSpec) : CNF :=
(List.range S.steps).flatMap fun t =>
(List.range S.interior).flatMap fun c =>
((wordsOfLength (tableauAlphabet S) 6).filter fun v =>
!S.allowedWindows.contains v).map (forbiddenWindowClause S t c)
def tableauCNF (S : TableauSpec) : CNF :=
cellsCNF S ++ initialCNF S ++ boundaryCNF S ++
acceptingCNF S ++ transitionCNF S
def TableauEncoding (S : TableauSpec) (τ : ℕ → Bool) (T : ℕ → ℕ → ℕ) : Prop :=
(∀ t ≤ S.steps, ∀ c < tableauWidth S, T t c < tableauAlphabet S) ∧
∀ t ≤ S.steps, ∀ c < tableauWidth S, ∀ a < tableauAlphabet S,
τ (tableauVar S t c a) = true ↔ T t c = a
def ValidTableau (S : TableauSpec) (T : ℕ → ℕ → ℕ) : Prop :=
(∀ t ≤ S.steps, ∀ c < tableauWidth S, T t c < tableauAlphabet S) ∧
(∀ c < tableauWidth S, T 0 c ∈ (S.initialAllowed[c]?.getD [])) ∧
(∀ t ≤ S.steps, T t 0 = 0 ∧ T t (S.interior + 1) = 0) ∧
(∃ c < tableauWidth S, T S.steps c ∈ S.acceptingSymbols) ∧
(∀ t < S.steps, ∀ c < S.interior,
windowValues T t c ∈ S.allowedWindows)
def encodeTableauSpec (S : TableauSpec) : Str :=
encodeCNF
([List.replicate S.steps (true, 0), List.replicate S.interior (true, 0),
List.replicate S.symbols (true, 0),
List.replicate S.initialAllowed.length (true, 0)] ++
S.initialAllowed.map (fun xs => xs.map (fun a => (true, a))) ++
[S.acceptingSymbols.map (fun a => (true, a))] ++
S.allowedWindows.map (fun xs => xs.map (fun a => (true, a))))
def MachineTableauSpec (S : TableauSpec) : Prop :=
0 < S.steps ∧ 0 < S.interior ∧ 0 ∉ S.acceptingSymbols ∧
S.initialAllowed.length = tableauWidth S ∧
(∀ xs ∈ S.initialAllowed, ∀ a ∈ xs, a < tableauAlphabet S) ∧
(∀ a ∈ S.acceptingSymbols, a < tableauAlphabet S) ∧
(∀ xs ∈ S.allowedWindows, xs.length = 6 ∧ ∀ a ∈ xs, a < tableauAlphabet S)
def EXPTIME : Set DecisionProblem :=
{L | ∃ χ : Str → Bool,
(∃ M : Turing.TM2ComputableInTime (id : Str → Str) Computability.encodeBool χ,
∃ p : Polynomial ℕ, ∀ n, M.time n ≤ 2 ^ p.eval n) ∧
∀ w, w ∈ L ↔ χ w = true}
end PvsNP
Read-back
What the Lean code literally says, in plain math · gpt-6-astra
PvsNP.DecisionProblem
A decision problem is a language over the Boolean alphabet, that is, an arbitrary set of finite Boolean lists, with no decidability, finiteness, or complexity requirement. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.inputLength
For every finite Boolean list , its input length is defined to be , the number of list entries; in particular the empty list has input length zero. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.PolynomialBound
For any function , having a polynomial bound means that there exists a polynomial with natural-number coefficients such that . The inequality is non-strict, includes , and is required for all inputs rather than only eventually; constant and zero polynomials are permitted.
PvsNP.coP
The set consists of all languages whose complement belongs to ; equivalently there exists satisfying and . Here , is the set of all finite Boolean lists, including the empty list, and is list length. Write for existence of such a machine and a polynomial that, for every , compute the singleton output from input in at most steps. A machine in these assertions is a Mathlib TM2 stack machine with finitely many stack indices, instruction labels, and control states, a finite input-stack alphabet, designated input and output stacks, a program, and initial label and control state; its other stack alphabets need not be finite. Input and output alphabet bijections transport the specified encoded lists to the corresponding stack alphabets. Computation starts with only the input stack populated, and reaches a halted configuration with the specified output on the output stack, all other stacks empty, and the control state reset to its initial value. Time counts executions of whole TM2 statements, each of which may contain several stack operations.
PvsNP.coNP
The set consists of all languages for which there exist and satisfying and . Thus the complement is taken within all finite Boolean lists, including malformed encodings for any separate encoding scheme; and for . Here , is the set of all finite Boolean lists, including the empty list, and is list length. Write for existence of such a machine and a polynomial that, for all , compute in at most steps from the list obtained by tagging every bit of with the left injection into , tagging every bit of with the right injection, and concatenating those two lists. A machine in these assertions is a Mathlib TM2 stack machine with finitely many stack indices, instruction labels, and control states, a finite input-stack alphabet, designated input and output stacks, a program, and initial label and control state; its other stack alphabets need not be finite. Input and output alphabet bijections transport the specified encoded lists to the corresponding stack alphabets. Computation starts with only the input stack populated, and reaches a halted configuration with the specified output on the output stack, all other stacks empty, and the control state reset to its initial value. Time counts executions of whole TM2 statements, each of which may contain several stack operations.
PvsNP.NPHard
For every language , being NP-hard is defined to mean ; the definition does not additionally require . Here , is the set of all finite Boolean lists, including the empty list, and is list length. The set consists exactly of languages for which there exist and satisfying and . This includes and empty input: , whereas for . Write for existence of such a machine and a polynomial that, for all , compute in at most steps from the list obtained by tagging every bit of with the left injection into , tagging every bit of with the right injection, and concatenating those two lists. For languages , write to mean that there exists satisfying and . Write for existence of such a machine and a polynomial that, for every , compute output list from input list in at most steps. Different existential computation witnesses may use different machines and polynomials. A machine in these assertions is a Mathlib TM2 stack machine with finitely many stack indices, instruction labels, and control states, a finite input-stack alphabet, designated input and output stacks, a program, and initial label and control state; its other stack alphabets need not be finite. Input and output alphabet bijections transport the specified encoded lists to the corresponding stack alphabets. Computation starts with only the input stack populated, and reaches a halted configuration with the specified output on the output stack, all other stacks empty, and the control state reset to its initial value. Time counts executions of whole TM2 statements, each of which may contain several stack operations.
PvsNP.FiniteWorkAlphabets
For every machine , having finite work alphabets is defined to mean is a finite type. This quantifies over every stack, including the designated input and output stacks, and asks for propositional finiteness rather than a supplied enumeration. Here is a TM2 machine with a finite type of stack indices and decidable equality on , designated input and output indices , stack-symbol types , a finite type of program labels with a main label, a finite type of control states with an initial state, a finite input alphabet , and a statement for each label . No finiteness of for other is assumed. A tagged symbol has and ; tags from different stacks remain distinct.
PvsNP.FinitePolyTime
For arbitrary types , arbitrary maps and , and arbitrary , finite-alphabet polynomial-time computability is defined to mean that there exists a machine with input and output alphabet bijections to and a polynomial such that, for every , it computes the encoded output from encoded input in at most steps, and every stack alphabet of that machine is finite. The encodings are not assumed injective and the domain types are not assumed nonempty; the input/output alphabet bijections and the finiteness requirements still apply if no inputs exist. A machine in these assertions is a Mathlib TM2 stack machine with finitely many stack indices, instruction labels, and control states, a finite input-stack alphabet, designated input and output stacks, a program, and initial label and control state; its other stack alphabets need not be finite. Input and output alphabet bijections transport the specified encoded lists to the corresponding stack alphabets. Computation starts with only the input stack populated, and reaches a halted configuration with the specified output on the output stack, all other stacks empty, and the control state reset to its initial value. Time counts executions of whole TM2 statements, each of which may contain several stack operations.
PvsNP.parseData
For any fuel and Boolean word , this partial parser returns either failure or a pair of Boolean words. At fuel zero it fails on every input. At positive fuel, an initial is consumed and yields the empty decoded word paired with the suffix. Otherwise an initial is consumed, the suffix is parsed with fuel decreased by one, and on success is prepended to the returned decoded word while the returned suffix is kept. Every other input shape fails, as does any recursive failure. Thus a terminating delimiter must be reached while fuel is positive; an empty or one-bit input fails. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.bitsValue
The value of a finite Boolean digit list is defined recursively by and . Equivalently, for digits it is , so the least significant digit comes first. This definition accepts noncanonical lists as well: appending false high digits does not change the value. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.parseLiteral
For any Boolean word , literal parsing fails unless followed by a suffix . It then parses a digit sequence from with fuel : at zero fuel fail; with positive fuel consume as the terminator, or consume as the next digit and continue with one less fuel; all other shapes and recursive failures fail. If the decoded digit list is and the remaining suffix is , let . Parsing succeeds with exactly when is the canonical little-endian binary digit list of ; otherwise it fails. The canonical digit list for zero is empty, so extra false high digits are rejected. No condition is placed on the suffix . Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.parseClauseAux
For any natural fuel and Boolean input word, this partial clause parser fails at zero fuel, including on an empty input or a clause delimiter. With positive fuel, a leading returns the empty clause and the suffix after that pair. In every other case it parses a literal by the procedure described here; after success with literal and suffix , it parses the remainder of the clause from with fuel decreased by one and, on success, prepends to the resulting clause and retains the resulting suffix. Any failure propagates. The returned clause is a list of sign/index pairs and the suffix is unconstrained. Here , is the set of all finite Boolean lists, including the empty list, and is list length. The parser works as follows. Its outer recursion starts with fuel , returns the empty formula on an empty remainder even at fuel zero, and otherwise fails at fuel zero; with positive fuel it parses one clause from the current nonempty remainder using clause fuel equal to that remainder’s length plus one, then recurses on the returned suffix with outer fuel reduced by one. Clause parsing fails at fuel zero; with positive fuel it consumes as the end of an empty remaining clause, or parses one literal and recurses on its suffix with clause fuel reduced by one. Literal parsing requires an initial pair for the sign. On the remainder it starts data fuel : zero data fuel fails; with positive data fuel ends the digit sequence, while contributes digit and decreases fuel by one; all other cases fail. The collected digits are interpreted little-endian and accepted only if they equal the canonical binary digits of the resulting natural number. A parsed literal is that sign/index pair together with the suffix after its delimiter; any failed subparse makes the containing parse fail. Success of the outer parse requires consuming the complete input.
PvsNP.parseCNFAux
For every natural fuel and Boolean input word, this partial formula parser returns the empty formula on the empty input regardless of fuel, fails on nonempty input at zero fuel, and at positive fuel on a nonempty word parses a clause with fuel , then parses the returned suffix with outer fuel decreased by one. If both succeed, it prepends the parsed clause to the returned formula; otherwise it fails. Consequently there is no unconsumed suffix in a successful result, and at most the supplied number of clauses can be parsed from a nonempty input. Here , is the set of all finite Boolean lists, including the empty list, and is list length. The parser works as follows. Its outer recursion starts with fuel , returns the empty formula on an empty remainder even at fuel zero, and otherwise fails at fuel zero; with positive fuel it parses one clause from the current nonempty remainder using clause fuel equal to that remainder’s length plus one, then recurses on the returned suffix with outer fuel reduced by one. Clause parsing fails at fuel zero; with positive fuel it consumes as the end of an empty remaining clause, or parses one literal and recurses on its suffix with clause fuel reduced by one. Literal parsing requires an initial pair for the sign. On the remainder it starts data fuel : zero data fuel fails; with positive data fuel ends the digit sequence, while contributes digit and decreases fuel by one; all other cases fail. The collected digits are interpreted little-endian and accepted only if they equal the canonical binary digits of the resulting natural number. A parsed literal is that sign/index pair together with the suffix after its delimiter; any failed subparse makes the containing parse fail. Success of the outer parse requires consuming the complete input.
PvsNP.parseCNF
For every Boolean word , this formula parser is the outer parsing procedure described here, initialized with fuel ; it returns either a list of clauses of sign/index literals or failure. In particular it returns the empty formula on the empty word. Here , is the set of all finite Boolean lists, including the empty list, and is list length. The parser works as follows. Its outer recursion starts with fuel , returns the empty formula on an empty remainder even at fuel zero, and otherwise fails at fuel zero; with positive fuel it parses one clause from the current nonempty remainder using clause fuel equal to that remainder’s length plus one, then recurses on the returned suffix with outer fuel reduced by one. Clause parsing fails at fuel zero; with positive fuel it consumes as the end of an empty remaining clause, or parses one literal and recurses on its suffix with clause fuel reduced by one. Literal parsing requires an initial pair for the sign. On the remainder it starts data fuel : zero data fuel fails; with positive data fuel ends the digit sequence, while contributes digit and decreases fuel by one; all other cases fail. The collected digits are interpreted little-endian and accepted only if they equal the canonical binary digits of the resulting natural number. A parsed literal is that sign/index pair together with the suffix after its delimiter; any failed subparse makes the containing parse fail. Success of the outer parse requires consuming the complete input.
PvsNP.variableNames
For every finite formula , the variable-name list is obtained by concatenating its clause lists, extracting the natural-number index from each sign/index literal in that order, and deleting duplicate occurrences while retaining the first occurrence of each index. It has one entry for each index appearing anywhere in , regardless of sign, and is empty when no literals occur; no numerical sorting is performed. A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.certificateAssignment
For every formula , Boolean word , and natural index , the assigned Boolean value is obtained by zipping the list with , looking up key in that list of pairs, and defaulting to false if no pair has that key. Zipping stops when either list ends, so extra bits of are ignored, and variables whose position exceeds a short are assigned false. The index may be any natural number, including one absent from ; no length equality is required by this definition. Here , is the set of all finite Boolean lists, including the empty list, and is list length. A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true. The variable list is obtained by reading the indices of all literals in the flattened clause list in order and deleting duplicate occurrences while retaining the first occurrence of each index.
PvsNP.satVerifier
For every ordered pair of finite Boolean words, the verifier is the Boolean function defined by the parsing, length check, and formula evaluation described here. It accepts the pair of empty words because the empty word parses as the empty formula, whose variable list is empty and whose evaluation is true. Here , is the set of all finite Boolean lists, including the empty list, and is list length. The parser works as follows. Its outer recursion starts with fuel , returns the empty formula on an empty remainder even at fuel zero, and otherwise fails at fuel zero; with positive fuel it parses one clause from the current nonempty remainder using clause fuel equal to that remainder’s length plus one, then recurses on the returned suffix with outer fuel reduced by one. Clause parsing fails at fuel zero; with positive fuel it consumes as the end of an empty remaining clause, or parses one literal and recurses on its suffix with clause fuel reduced by one. Literal parsing requires an initial pair for the sign. On the remainder it starts data fuel : zero data fuel fails; with positive data fuel ends the digit sequence, while contributes digit and decreases fuel by one; all other cases fail. The collected digits are interpreted little-endian and accepted only if they equal the canonical binary digits of the resulting natural number. A parsed literal is that sign/index pair together with the suffix after its delimiter; any failed subparse makes the containing parse fail. Success of the outer parse requires consuming the complete input. The variable list is obtained by reading the indices of all literals in the flattened clause list in order and deleting duplicate occurrences while retaining the first occurrence of each index. The Boolean verifier on first applies this parser to , returning false on failure. For a parsed formula , it returns false unless ; if the lengths agree, it evaluates under the assignment that gives the th variable in the th bit of , and gives every unlisted index false. More generally this assignment is formed by zipping with , looking up an index in that truncated list of pairs, and using false when it is absent. A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true.
PvsNP.TableauSpec
The structure consists of exactly six fields: a natural number named steps, a natural number named interior, a natural number named symbols, a list of lists of natural numbers named initialAllowed, a list of natural numbers named acceptingSymbols, and a list of lists of natural numbers named allowedWindows. It contains no equations, inequalities, length requirements, distinctness conditions, alphabet-membership requirements, or other proof fields; in particular all three natural numbers may be zero, all lists may be empty, and entries may be arbitrary natural numbers.
PvsNP.tableauWidth
For every six-field specification , its width is defined to be , so there are always at least two columns, even when the interior field is zero. Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing.
PvsNP.tableauAlphabet
For every six-field specification , its alphabet bound is defined to be , so it is always positive, including when the symbols field is zero. Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing.
PvsNP.tableauVar
For every six-field specification and every , the variable index is defined to be . The arguments are unrestricted: the definition does not require , , or , and does not assert injectivity on all triples. Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing.
PvsNP.cellClauses
For every specification and all , the returned formula starts with the single clause of positive literals for in increasing order, then contains the two-negative-literal clause for each , ordered first by and then by . No bounds on are required. Since , the first clause is never empty; when , there are no two-literal clauses. Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.cellsCNF
For every specification , this definition returns the cell formula described here, concatenating the clause lists for all of the indicated cells. It covers one row when and still covers two columns when . Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. The cell formula consists, in increasing and then increasing , of the clause of all positive literals for , followed by every two-literal clause with , ordered first by and then by . A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.initialCNF
For every specification , this definition returns the initial formula described here. A missing list is treated as empty and therefore generates a negative unit clause for every at that column; duplicate allowed entries have no extra effect, entries outside generate no positive permission in this construction, and lists beyond the first columns are ignored. Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. The initial formula has, in increasing and then increasing , the negative unit clause exactly when . A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.boundaryCNF
For every specification , this definition returns the boundary formula described here: the list of two unit clauses per row asserting symbol zero at the first and last columns. It includes row zero even when ; since , the two designated boundary columns are distinct even when . Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. The boundary formula has, for each in order, the two positive unit clauses at and , in that order. A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.acceptingCNF
For every specification , this definition returns the accepting formula described here. Membership in is tested as list membership, so duplicate entries do not duplicate literals for a fixed cell/symbol pair, and entries at least are ignored. Boundary columns are included among the eligible columns, and acceptance is tested at row , including row zero when . Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. The accepting formula is a list containing one clause; its literals are for every and with , ordered first by and then by . If no such exists, this is an empty clause rather than an empty formula. A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.wordsOfLength
For every natural alphabet bound and natural length , this definition returns a list of lists: at it is the singleton list containing the empty word; at it concatenates, for in order, the lists formed by prepending to every previously constructed length- word. Thus it enumerates, in increasing lexicographic order, exactly the words of length with entries below . For it still returns the singleton empty word at length zero and returns the empty list at every positive length.
PvsNP.windowValues
For every function and all , this definition returns the six-entry list , in the displayed order. There are no bounds on the arguments or values and no reference to a tableau specification.
PvsNP.forbiddenWindowClause
For every specification , all , and every natural-number list , the clause is obtained by pairing the ordered position list with , truncating to the shorter list, and replacing each pair by the negative literal . Hence the clause has literals, is empty for , and ignores entries of after the sixth. Neither nor any bounds on are assumed. Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.transitionCNF
For every specification , this definition returns the transition formula described here. Every generated clause has exactly six literals, since only six-entry words are enumerated; allowed-window lists of other lengths or containing entries at least cannot match an enumerated word, and repetitions in have no additional effect. Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. The transition formula ranges in increasing order over , , and lexicographically over all six-tuples absent from the list . For each such tuple it has the clause of the six negative literals at positions with symbol indices given by the corresponding entries of , in that order. If or , the transition formula is empty. A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.tableauCNF
For every specification , the returned formula is the five-part concatenation described here, with no extra clauses, tests, or hypotheses on . Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. The full tableau formula is the concatenation, in order, of the cell, initial, boundary, accepting, and transition formulas described here. The cell formula consists, in increasing and then increasing , of the clause of all positive literals for , followed by every two-literal clause with , ordered first by and then by . The initial formula has, in increasing and then increasing , the negative unit clause exactly when . The boundary formula has, for each in order, the two positive unit clauses at and , in that order. The accepting formula is a list containing one clause; its literals are for every and with , ordered first by and then by . If no such exists, this is an empty clause rather than an empty formula. The transition formula ranges in increasing order over , , and lexicographically over all six-tuples absent from the list . For each such tuple it has the clause of the six negative literals at positions with symbol indices given by the corresponding entries of , in that order. If or , the transition formula is empty. A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.TableauEncoding
For every specification , Boolean assignment , and natural-valued two-argument function , this predicate is exactly the encoding condition described here. The row bound is non-strict and the column and symbol bounds are strict, so row zero is always included and even when the symbols field is zero. Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. The encoding condition for and is the conjunction of and . Values of outside this rectangle and Boolean values not constrained by these displayed indices are unrestricted. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.ValidTableau
For every specification and function , this predicate is exactly the five conjuncts of the validity condition described here. It makes no additional connection between the allowed-window lists and any machine program, includes boundary cells as possible accepting cells, and imposes no requirement that acceptance first occur at the final row. Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. The validity condition for is the conjunction of: ; ; ; ; and . Values outside the rectangle are unrestricted; the last condition is vacuous for or , and a missing required or an empty makes the condition unsatisfiable.
PvsNP.encodeTableauSpec
For every specification , this definition returns the Boolean word described here. The first four counts are represented by lengths of clauses of repeated positive variable-zero literals, rather than by binary numeral fields. No restriction on the six specification fields is assumed. Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. The specification encoding is , where is the following clause list: first a clause of copies of , then a clause of copies, then a clause of copies, then a clause of copies; next, for each list in in order, the clause ; next one clause formed in the same way from ; finally one such clause for each list in in order. These are raw formula encodings: no satisfiability condition is part of . Empty lists and zero replication counts give empty clauses, which still have their clause delimiters. Write for this Boolean-list encoding of a formula : for each literal , take followed by the little-endian canonical binary digits of (the digits of form the empty list), replace each bit by , and append ; concatenate these literal encodings within each clause and append ; then concatenate the clause encodings in formula order. In particular . A formula is a finite list of clauses, each clause a finite list of literals . Under an assignment , the literal is true exactly when , a clause is true exactly when some literal in it is true, and a formula is true exactly when every clause is true. Thus an empty clause is false and an empty formula is true. Here , is the set of all finite Boolean lists, including the empty list, and is list length.
PvsNP.MachineTableauSpec
For every specification , this predicate is the conjunction of the additional specification conditions described here. In particular it requires positive steps and interior, exactly initial lists, nonzero accepting symbols, and length-six allowed windows with in-range entries; it does not impose transition consistency with a separately given machine, require satisfiability, or require the listed choices to be nonempty. Here has , a list of lists of natural numbers, a list of natural numbers, and a list of lists of natural numbers, with no validity restrictions on these fields. Put , , and . The list is the zero-based th list of , or the empty list when that entry is missing. The additional specification condition is exactly , , , , every entry of every list in is below , every entry of is below , and every list in has length exactly six and every one of its entries is below . It imposes no nonemptiness condition on an individual list in , on , or on , and allows ; in that case and the accepting list must be empty.
PvsNP.EXPTIME
This definition gives the class of languages described here, using an everywhere-valid upper bound of the form on a chosen time-bound function. A witness consists of the Boolean decider, the time-bounded machine, and the natural-coefficient polynomial; it need not specify finite alphabets for all non-input stacks. Here , is the set of all finite Boolean lists, including the empty list, and is list length. The set consists exactly of languages for which there are a Boolean function , a machine with a natural-valued time bound computing from within steps for every , and with , such that . The bound includes . A machine in these assertions is a Mathlib TM2 stack machine with finitely many stack indices, instruction labels, and control states, a finite input-stack alphabet, designated input and output stacks, a program, and initial label and control state; its other stack alphabets need not be finite. Input and output alphabet bijections transport the specified encoded lists to the corresponding stack alphabets. Computation starts with only the input stack populated, and reaches a halted configuration with the specified output on the output stack, all other stacks empty, and the control state reset to its initial value. Time counts executions of whole TM2 statements, each of which may contain several stack operations.