Documentation

DescriptiveComplexity.Counting.Post

Post-processing terms #

The arithmetic a counting reduction may apply to the answer of its one oracle call (DescriptiveComplexity.Counting.Reduction). Two layers, kept apart so that every number written stays of polynomially many bits:

So a post-processing term is a fixed arithmetic expression over the oracle's answer and first-order definable counts: it can be evaluated in polynomial time, and it does no counting of its own beyond tuples of the instance.

Both layers are pulled back along a relativized interpretation (DescriptiveComplexity.PolyTerm.pull, DescriptiveComplexity.PostTerm.pull): a definable cardinality of the interpreted structure is a definable cardinality of the instance. A cardinality is stored as the universe of a relativized interpretation into the empty vocabulary, so the pullback is the composition of relativized interpretations and needs nothing new. With substitution for the oracle's answer (DescriptiveComplexity.PostTerm.subst), this is what makes one-call reductions compose.

Polynomial terms #

Terms denoting numbers polynomial in the size of the instance: numerals, definable cardinalities, sums and products.

Instances For
    Dependency graph
    Dependency graph

    The relativized interpretation into the empty vocabulary whose universe is the set of tuples satisfying a formula.

    Equations
    Instances For
      Dependency graph

      The number of k-tuples satisfying a first-order formula over the ordered expansion.

      Equations
      Instances For
        Dependency graph

        The number of elements satisfying a first-order formula over the ordered expansion, as a cardinality of a set of elements.

        Dependency graph
        Dependency graph
        Dependency graph
        noncomputable def DescriptiveComplexity.PolyTerm.pull {L₁ L₂ : FirstOrder.Language} [L₂.IsRelational] {T : Type} [LinearOrder T] [Finite T] {d : ℕ} (I : RelFOInterpretation (L₁.sum FirstOrder.Language.order) L₂ T d) :
        PolyTerm L₂ → PolyTerm L₁

        The pullback of a polynomial term along a relativized interpretation: a definable cardinality of the interpreted structure, ordered lexicographically, is the size of the universe of a composite interpretation.

        Equations
        Instances For
          Dependency graph
          theorem DescriptiveComplexity.PolyTerm.eval_pull {L₁ L₂ : FirstOrder.Language} [L₂.IsRelational] {T : Type} [LinearOrder T] [Finite T] {d : ℕ} (I : RelFOInterpretation (L₁.sum FirstOrder.Language.order) L₂ T d) (A : Type) [L₁.Structure A] [LinearOrder A] (p : PolyTerm L₂) :
          eval A (pull I p) = eval (I.MapRel A) p

          A pulled-back polynomial term has, at the instance, the value of the original term at the interpreted structure.

          Dependency graph

          Post-processing terms #

          The arithmetic applied to the answer of an oracle call: polynomial terms, powers of two with a polynomial exponent, and the operations +, *, truncated -, / and % of the natural numbers.

          Instances For
            Dependency graph
            Dependency graph

            Substitution of a term for the answer of the oracle.

            Equations
            Instances For
              Dependency graph
              theorem DescriptiveComplexity.PostTerm.eval_subst {L : FirstOrder.Language} (A : Type) [L.Structure A] [LinearOrder A] (c : ℕ) (s u : PostTerm L) :
              eval A c (s.subst u) = eval A (eval A c u) s
              Dependency graph
              noncomputable def DescriptiveComplexity.PostTerm.pull {L₁ L₂ : FirstOrder.Language} [L₂.IsRelational] {T : Type} [LinearOrder T] [Finite T] {d : ℕ} (I : RelFOInterpretation (L₁.sum FirstOrder.Language.order) L₂ T d) :
              PostTerm L₂ → PostTerm L₁

              The pullback of a post-processing term along a relativized interpretation, its polynomial terms being pulled back.

              Equations
              Instances For
                Dependency graph