Documentation

DescriptiveComplexity.Problems.FinSat.Kernel

Reading the kernel of an ∃SO[new] definition, position by position #

The encoded sentence the RE-hardness reduction produces has one node per (subformula position, polarity) of the kernel φ, so the defining formulas of the interpretation have to answer two questions about a position:

Both are computed by recursion on φ, which is what a defining formula must do: the positions of a variable formula cannot be matched on directly (the litF/isClauseF idiom of DescriptiveComplexity.Problems.Sat.TseitinFormulas). Neither mentions the instance, so both are pure syntax – the reduction reads the instance only in the tuple coordinates of its tags.

DescriptiveComplexity.FinSat.nodeSize_lt_of_kidOf is what this buys for well-formedness: a child position carries a strictly smaller subformula, so the parse DAG of the image descends along the order of its syntax.

Levels are , not Fin of anything: an argument at a position of context length m has level below m ≤ maxCtx φ, and the tag dbvar l carries l : Fin (maxCtx φ), so comparing the two as naturals is exactly right and needs no cast through the changing bound of a recursion.

The children of a position #

The children of a position, with the polarity flip: some true at the premise of an implication – where negation normal form turns f₁ → f₂ into ¬f₁ ∨ f₂some false at its conclusion and at the body of a quantifier, and none when q is not a child of p at all.

Equations
Instances For
    Dependency graph

    The three children the translation actually uses.

    Dependency graph
    Dependency graph
    Dependency graph

    The children of a position of a subformula stay inside that subformula: what lets an induction over subformulas see all the children a node of the whole kernel has.

    theorem DescriptiveComplexity.FinSat.kidOf_imp_left_range {L' : FirstOrder.Language} {n : } {f₁ f₂ : L'.BoundedFormula Empty n} {m : } {p₁ : Tseitin.NodeAt f₁ m} {m' : } {q : Tseitin.NodeAt (f₁.imp f₂) m'} {b : Bool} (h : kidOf (f₁.imp f₂) (Sum.inr (Sum.inl p₁)) q = some b) :
    ∃ (q₁ : Tseitin.NodeAt f₁ m'), q = Sum.inr (Sum.inl q₁)
    Dependency graph
    theorem DescriptiveComplexity.FinSat.kidOf_imp_right_range {L' : FirstOrder.Language} {n : } {f₁ f₂ : L'.BoundedFormula Empty n} {m : } {p₂ : Tseitin.NodeAt f₂ m} {m' : } {q : Tseitin.NodeAt (f₁.imp f₂) m'} {b : Bool} (h : kidOf (f₁.imp f₂) (Sum.inr (Sum.inr p₂)) q = some b) :
    ∃ (q₂ : Tseitin.NodeAt f₂ m'), q = Sum.inr (Sum.inr q₂)
    Dependency graph
    theorem DescriptiveComplexity.FinSat.kidOf_all_range {L' : FirstOrder.Language} {n : } {f : L'.BoundedFormula Empty (n + 1)} {m : } {p : Tseitin.NodeAt f m} {m' : } {q : Tseitin.NodeAt f.all m'} {b : Bool} (h : kidOf f.all (Sum.inr p) q = some b) :
    ∃ (q' : Tseitin.NodeAt f m'), q = Sum.inr q'
    Dependency graph
    theorem DescriptiveComplexity.FinSat.kidOf_imp_root_range {L' : FirstOrder.Language} {n : } {f₁ f₂ : L'.BoundedFormula Empty n} {m' : } {q : Tseitin.NodeAt (f₁.imp f₂) m'} {b : Bool} (h : kidOf (f₁.imp f₂) (Sum.inl { down := }) q = some b) :
    (∃ (q₁ : Tseitin.NodeAt f₁ m'), q = Sum.inr (Sum.inl q₁)) ∃ (q₂ : Tseitin.NodeAt f₂ m'), q = Sum.inr (Sum.inr q₂)

    The children of the root of an implication are the roots of its two sides, and the children of the root of a quantifier the root of its body: what an induction over subformulas descends along.

    Dependency graph
    theorem DescriptiveComplexity.FinSat.kidOf_all_root_range {L' : FirstOrder.Language} {n : } {f : L'.BoundedFormula Empty (n + 1)} {m' : } {q : Tseitin.NodeAt f.all m'} {b : Bool} (h : kidOf f.all (Sum.inl { down := }) q = some b) :
    ∃ (q' : Tseitin.NodeAt f m'), q = Sum.inr q'
    Dependency graph
    theorem DescriptiveComplexity.FinSat.nodeSize_lt_of_kidOf {L' : FirstOrder.Language} {n : } (f : L'.BoundedFormula Empty n) {m : } (p : Tseitin.NodeAt f m) {m' : } (q : Tseitin.NodeAt f m') {b : Bool} :
    kidOf f p q = some bnodeSize f q < nodeSize f p

    A child carries a strictly smaller subformula. This is what makes the parse DAG of the image acyclic, and it is all the order of the syntax is asked to witness (DescriptiveComplexity.FinSat.IsWF.child_lt).

    Dependency graph

    What the kernel says at a position #

    The de Bruijn level a term denotes, when it is a variable at all: none for a function application, which the relational milestone of the reduction excludes and the term layer translates by its graph (the junk-value hazard).

    Equations
    Instances For
      Dependency graph

      What the kernel says at a position: the constructor there, with the data the corresponding node of the encoded sentence needs. The three kinds of atom are separated, because the encoded sentence may name only the relation variables – an atom of the instance's vocabulary, and the marker old, are translated away into a disjunction over the tuples where they hold.

      Instances For
        Dependency graph
        Dependency graph
        Dependency graph
        Dependency graph

        The atoms of the relation variables #

        The three accessors an atom of the encoded sentence is read through – its relation symbol, its arity, and the de Bruijn level of each of its arguments – together with what the shape conditions of well-formedness ask of them: an argument sits below the arity, the arity is the one the block declares, and (in a relational vocabulary) every position below the arity does carry a level.

        The relation variable of the block a position carries, if it carries one.

        Equations
        Instances For
          Dependency graph

          The arity of the atom a position carries, 0 when it carries none.

          Equations
          Instances For
            Dependency graph

            The de Bruijn level of the j-th argument of that atom.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Dependency graph
              theorem DescriptiveComplexity.FinSat.arityOf_eq {L : FirstOrder.Language} {B : SOBlock} {n : } {f : ((newLang L).sum B.lang).BoundedFormula Empty n} {m : } {q : Tseitin.NodeAt f m} {i : B.ι} (h : symOf f q = some i) :
              arityOf f q = B.arity i

              The arity is the one the block declares: the relation symbols of the block are its indices, tagged by their arity.

              Dependency graph

              The dimension is wide enough for an atom of a relation variable too: its arity is one of the arities occurring in the kernel.

              Dependency graph
              theorem DescriptiveComplexity.FinSat.lt_arityOf_of_argOf {L : FirstOrder.Language} {B : SOBlock} {n : } {f : ((newLang L).sum B.lang).BoundedFormula Empty n} {m : } {q : Tseitin.NodeAt f m} {j l : } (h : argOf f q j = some l) :
              j < arityOf f q

              An argument sits below the arity.

              Dependency graph

              The de Bruijn level a term denotes is one of the context: in a relational vocabulary every term is a variable.

              Dependency graph

              The arity of an atom the encoded sentence must not mention: one of the input vocabulary, or the marker old, both of which the translation replaces by a disjunction over the tuples where they hold.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph

                The dimension of the reduction is wide enough for such an atom: its arity is one of the arities occurring in the kernel.

                Dependency graph
                theorem DescriptiveComplexity.FinSat.argOf_some {L : FirstOrder.Language} {B : SOBlock} [L.IsRelational] {n : } (f : ((newLang L).sum B.lang).BoundedFormula Empty n) {m : } (q : Tseitin.NodeAt f m) (j : ) :
                j < arityOf f q∃ (l : ), argOf f q j = some l l < Tseitin.maxCtx f

                Every position below the arity carries a level, in a relational vocabulary – and the level is one of the de Bruijn levels of the kernel. This is what lets the image of the reduction give an atom an argument at each position of its signature (DescriptiveComplexity.FinSat.IsWF.arg_tot).

                Dependency graph
                theorem DescriptiveComplexity.FinSat.realize_of_termLevel {L : FirstOrder.Language} {B : SOBlock} [L.IsRelational] {M : Type} [(newLang L).Structure M] {m : } {t : ((newLang L).sum B.lang).Term (Empty Fin m)} {l : } (h : termLevel t = some l) (hl : l < m) (w : Fin mM) :

                The value of a term of the kernel, when it is a variable: the context tuple at its de Bruijn level.

                Dependency graph

                Subformulas, and their positions inside the kernel #

                Tseitin.Gates – the recursion the encoded sentence has to compute – is defined by recursion on the formula with the node valuation restricted along each descent. The induction that proves the image satisfies it must therefore be generalized over an embedding of a subformula's positions into the kernel's, carrying the three facts that make the kernel's reading of an embedded position the same as the subformula's: what the kernel says there, which positions are its children, and – the one with content – that those children are themselves embedded, so that a clause quantifying over all the children a node has in the kernel collapses to the subformula.

                All three are definitional at each of the three descents, because that is exactly how DescriptiveComplexity.FinSat.kernelNode and DescriptiveComplexity.FinSat.kidOf are defined; the third rests on the range lemmas above.

                A subformula of the kernel, with its positions embedded in the kernel's.

                Instances For
                  Dependency graph

                  The kernel is a subformula of itself.

                  Equations
                  Instances For
                    Dependency graph
                    def DescriptiveComplexity.FinSat.SubEmb.impL {L : FirstOrder.Language} {B : SOBlock} {n₀ : } {φ : ((newLang L).sum B.lang).BoundedFormula Empty n₀} {n : } {f₁ f₂ : ((newLang L).sum B.lang).BoundedFormula Empty n} (E : SubEmb φ (f₁.imp f₂)) :
                    SubEmb φ f₁

                    The premise of an implication.

                    Equations
                    Instances For
                      Dependency graph
                      def DescriptiveComplexity.FinSat.SubEmb.impR {L : FirstOrder.Language} {B : SOBlock} {n₀ : } {φ : ((newLang L).sum B.lang).BoundedFormula Empty n₀} {n : } {f₁ f₂ : ((newLang L).sum B.lang).BoundedFormula Empty n} (E : SubEmb φ (f₁.imp f₂)) :
                      SubEmb φ f₂

                      The conclusion of an implication.

                      Equations
                      Instances For
                        Dependency graph
                        def DescriptiveComplexity.FinSat.SubEmb.allB {L : FirstOrder.Language} {B : SOBlock} {n₀ : } {φ : ((newLang L).sum B.lang).BoundedFormula Empty n₀} {n : } {f : ((newLang L).sum B.lang).BoundedFormula Empty (n + 1)} (E : SubEmb φ f.all) :
                        SubEmb φ f

                        The body of a quantifier.

                        Equations
                        Instances For
                          Dependency graph

                          What the children of the root of an embedded subformula are, in the kernel: the three facts the induction over subformulas needs, one per shape.

                          theorem DescriptiveComplexity.FinSat.SubEmb.no_children {L : FirstOrder.Language} {B : SOBlock} {n₀ : } {φ : ((newLang L).sum B.lang).BoundedFormula Empty n₀} {n : } {f : ((newLang L).sum B.lang).BoundedFormula Empty n} (E : SubEmb φ f) (hnk : ∀ {m' : } (q' : Tseitin.NodeAt f m') {b : Bool}, kidOf f (Tseitin.rootAt f) q' some b) {m' : } {q : Tseitin.NodeAt φ m'} {b : Bool} (h : kidOf φ (E.emb (Tseitin.rootAt f)) q = some b) :

                          The root of an embedded leaf – falsity, an equality or an atom – has no children in the kernel.

                          Dependency graph
                          theorem DescriptiveComplexity.FinSat.SubEmb.imp_children {L : FirstOrder.Language} {B : SOBlock} {n₀ : } {φ : ((newLang L).sum B.lang).BoundedFormula Empty n₀} {n : } {f₁ f₂ : ((newLang L).sum B.lang).BoundedFormula Empty n} (E : SubEmb φ (f₁.imp f₂)) {m' : } {q : Tseitin.NodeAt φ m'} {b : Bool} (h : kidOf φ (E.emb (Tseitin.rootAt (f₁.imp f₂))) q = some b) :

                          The children of the root of an embedded implication are the roots of its two sides, the premise at some true – where negation normal form flips the polarity – and the conclusion at some false.

                          Dependency graph
                          theorem DescriptiveComplexity.FinSat.SubEmb.all_children {L : FirstOrder.Language} {B : SOBlock} {n₀ : } {φ : ((newLang L).sum B.lang).BoundedFormula Empty n₀} {n : } {f : ((newLang L).sum B.lang).BoundedFormula Empty (n + 1)} (E : SubEmb φ f.all) {m' : } {q : Tseitin.NodeAt φ m'} {b : Bool} (h : kidOf φ (E.emb (Tseitin.rootAt f.all)) q = some b) :

                          The only child of the root of an embedded quantifier is the root of its body.

                          Dependency graph