Documentation

DescriptiveComplexity.Problems.Machine.AltVerdict

The check phase decides the matrix #

DescriptiveComplexity.accepts_from_chk_cnf and its disjunctive twin build an accepting run when the matrix holds. This is the converse: if the check phase accepts, the matrix holds. Together they say that the tape the sweeps leave behind is tested exactly.

The check phase is deterministic, so no read-off is needed: acceptance descends along its unique run whatever the polarity of the block it sits in (DescriptiveComplexity.StepForced), and each sweep can only end in one of the two turns. The turn that accepts fires at the flag cnf – set for a conjunctive matrix, where it means the clause is satisfied, clear for a disjunctive one, where it means no literal of the term is violated – and that is precisely the semantic conclusion. The turn that moves on fires at the flag true, and hands the argument to the next clause.

The induction is therefore over the clauses, upwards, exactly as in the two forward lemmas: DescriptiveComplexity.ChkOk is what the run from a clause proves about that clause and every clause above it.

What a check sweep proves #

def DescriptiveComplexity.AltQbf.QChkGood (k : ) {A : Type} [(FirstOrder.Language.qbf k).Structure A] (cnf : Bool) (νs : Fin kAProp) (c : A) :

Some literal of the clause c is good: satisfied, for a conjunctive matrix; violated, for a disjunctive one.

Equations
Instances For
    Dependency graph
    def DescriptiveComplexity.AltQbf.ChkOk (k : ) {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] (cnf : Bool) (νs : Fin kAProp) (c : A) :

    What the check phase has left to prove when it reaches the clause c: that every clause from c up is satisfied, or that some term from c up has no violated literal.

    Equations
    Instances For
      Dependency graph

      Elementary facts about check configurations #

      theorem DescriptiveComplexity.AltQbf.not_acc_stChk {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {cnf f d : Bool} {c : A} :
      ¬(altMachine k A cnf).Acc (stChk f d c)

      A checking state is not accepting.

      Dependency graph
      theorem DescriptiveComplexity.AltQbf.stChk_eq_iff {k : } {A : Type} [LinearOrder A] [Finite A] [Nonempty A] {f d f' d' : Bool} {c c' : A} :
      stChk f d c = stChk f' d' c' f = f' d = d' c = c'

      Checking states are told apart by their flag, their direction and their clause.

      Dependency graph
      theorem DescriptiveComplexity.AltQbf.inCheck_confChkR {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {νs : Fin kAProp} (cnf : Bool) (c : A) (p : AltV k A) :
      InCheck (confChkR cnf νs c p)
      Dependency graph
      theorem DescriptiveComplexity.AltQbf.inCheck_confChkL {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {νs : Fin kAProp} (cnf : Bool) (c : A) (p : AltV k A) :
      InCheck (confChkL cnf νs c p)
      Dependency graph
      theorem DescriptiveComplexity.AltQbf.stepForced_of_inCheck {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {cnf start : Bool} {c c' : Config (AltV k A)} (hP : InCheck c) (hnacc : ¬(altMachine k A cnf).Acc c.state) (hstep : (altMachine k A cnf).Step c c') :
      StepForced (altMachine k A cnf) start c c'

      Every step of the check phase is forced: it is the only one available, so acceptance descends along it whatever the polarity of the block.

      Dependency graph
      theorem DescriptiveComplexity.AltQbf.exists_step_of_altAcc {k : } {A : Type} {M : ATMData (AltV k A)} {start : Bool} {n : } {c : Config (AltV k A)} (hnacc : ¬M.Acc c.state) (hacc : M.AltAcc start n c) :
      ∃ (c' : Config (AltV k A)) (m : ), M.Step c c' M.AltAcc start m c'

      A configuration that accepts and is not accepting outright has an accepting successor, whichever player owns it.

      Dependency graph

      Descending a check sweep #

      theorem DescriptiveComplexity.AltQbf.altAcc_chkR_posEnd {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {νs : Fin kAProp} {cnf start : Bool} {c : A} (hc : QbfCl k c) {n : } (hacc : (altMachine k A cnf).AltAcc start n (confChkR cnf νs c (posCell qbotA))) :
      ∃ (m : ), (altMachine k A cnf).AltAcc start m (confChkR cnf νs c posEnd)

      A rightward check sweep reaches the right marker.

      Dependency graph
      theorem DescriptiveComplexity.AltQbf.altAcc_chkL_posStart {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {νs : Fin kAProp} {cnf start : Bool} {c : A} (hc : QbfCl k c) {n : } (hacc : (altMachine k A cnf).AltAcc start n (confChkL cnf νs c (posCell qtopA))) :
      ∃ (m : ), (altMachine k A cnf).AltAcc start m (confChkL cnf νs c posStart)

      A leftward check sweep reaches the left marker.

      Dependency graph

      What the turn says #

      theorem DescriptiveComplexity.AltQbf.turn_of_step_chkR {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {νs : Fin kAProp} {cnf : Bool} {c : A} {c' : Config (AltV k A)} (hstep : (altMachine k A cnf).Step (confChkR cnf νs c posEnd) c') :
      (QChkGood k cnf νs c ∃ (e : A), QbfNextCl k c e c' = confChkL cnf νs e (posCell qtopA)) chkFlagR cnf νs c posEnd = cnf (cnf = trueQbfMaxCl k c)

      The turn at the right marker, read backwards. Either the clause has a good literal and the run moves on to the next one, or the flag settles the run and the semantics of the matrix is decided on the spot.

      Dependency graph
      theorem DescriptiveComplexity.AltQbf.turn_of_step_chkL {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {νs : Fin kAProp} {cnf : Bool} {c : A} {c' : Config (AltV k A)} (hstep : (altMachine k A cnf).Step (confChkL cnf νs c posStart) c') :
      (QChkGood k cnf νs c ∃ (e : A), QbfNextCl k c e c' = confChkR cnf νs e (posCell qbotA)) chkFlagL cnf νs c posStart = cnf (cnf = trueQbfMaxCl k c)

      The turn at the left marker, read backwards.

      Dependency graph

      Putting the clauses together #

      theorem DescriptiveComplexity.AltQbf.chkOk_of_flag {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {νs : Fin kAProp} {cnf : Bool} {c : A} (hc : QbfCl k c) (hmax : cnf = trueQbfMaxCl k c) (hgood : QChkGood k cnf νs c cnf = true) :
      ChkOk k cnf νs c

      What the accepting turn says: the clause settles the run, so it is the last one that matters.

      Dependency graph
      theorem DescriptiveComplexity.AltQbf.chkOk_of_next {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {νs : Fin kAProp} {cnf : Bool} {c e : A} (hnext : QbfNextCl k c e) (hgood : QChkGood k cnf νs c) (hok : ChkOk k cnf νs e) :
      ChkOk k cnf νs c

      What the turn to the next clause says: this clause is good, and the run goes on to settle the ones above it.

      Dependency graph
      theorem DescriptiveComplexity.AltQbf.chkOk_of_altAcc {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {νs : Fin kAProp} {cnf start : Bool} (c : A) :
      QbfCl k c(∀ (n : ), (altMachine k A cnf).AltAcc start n (confChkR cnf νs c (posCell qbotA))ChkOk k cnf νs c) ∀ (n : ), (altMachine k A cnf).AltAcc start n (confChkL cnf νs c (posCell qtopA))ChkOk k cnf νs c

      The check phase decides the matrix. Whichever sweep it is on and whichever clause it has reached, an accepting run proves that clause and every clause above it settled.

      Dependency graph

      The check's literal test is the matrix's #

      Dependency graph
      Dependency graph
      theorem DescriptiveComplexity.AltQbf.chkVal_eq_true {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] {νs : Fin kAProp} {x : A} :
      chkVal νs x = true qbfVal νs x
      Dependency graph
      theorem DescriptiveComplexity.AltQbf.chkVal_eq_false {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] {νs : Fin kAProp} {x : A} :
      chkVal νs x = false ¬qbfVal νs x
      Dependency graph
      theorem DescriptiveComplexity.AltQbf.qChkGood_true_iff {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] {νs : Fin kAProp} {c : A} :
      QChkGood k true νs c ∃ (x : A), QbfPos k c x qbfVal νs x QbfNeg k c x ¬qbfVal νs x

      A conjunctive clause is good exactly when the assignment satisfies one of its literals.

      Dependency graph
      theorem DescriptiveComplexity.AltQbf.not_qChkGood_false_iff {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] {νs : Fin kAProp} {c : A} :
      ¬QChkGood k false νs c ∀ (x : A), (QbfPos k c xqbfVal νs x) (QbfNeg k c x¬qbfVal νs x)

      A disjunctive term has no violated literal exactly when the assignment satisfies all of them.

      Dependency graph
      theorem DescriptiveComplexity.AltQbf.chkOk_iff_qbfMatrix {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {νs : Fin kAProp} {cnf : Bool} {c₀ : A} (hmin : QbfMinCl k c₀) :
      ChkOk k cnf νs c₀ QbfMatrix cnf νs

      What the check phase tests is the matrix.

      Dependency graph

      The check phase, both ways #

      What the last round hands over: from the entry of the check phase the machine accepts exactly when the matrix holds of the tape the sweeps have written.

      noncomputable def DescriptiveComplexity.AltQbf.chkLen (k : ) (A : Type) [LinearOrder A] [Finite A] [Nonempty A] :

      A generous bound on the length of the check phase: one sweep per clause.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Dependency graph
        theorem DescriptiveComplexity.AltQbf.qbfMatrix_of_altAcc {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {νs : Fin kAProp} {cnf start : Bool} {c₀ : A} (hmin : QbfMinCl k c₀) {n : } (hacc : (altMachine k A cnf).AltAcc start n (confChkR cnf νs c₀ (posCell qbotA))) :
        QbfMatrix cnf νs

        The check phase proves the matrix.

        Dependency graph
        theorem DescriptiveComplexity.AltQbf.altAcc_of_qbfMatrix {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {νs : Fin kAProp} {cnf start : Bool} {c₀ : A} (hmin : QbfMinCl k c₀) (hmat : QbfMatrix cnf νs) {n : } (hn : chkLen k A n) :
        (altMachine k A cnf).AltAcc start n (confChkR cnf νs c₀ (posCell qbotA))

        The matrix makes the check phase accept, at either polarity of the block it sits in, since the phase is deterministic.

        Dependency graph