Documentation

DescriptiveComplexity.Counting

Counting problems and parsimonious reductions #

A decision problem is an isomorphism-invariant property of finite structures; a counting problem (DescriptiveComplexity.CountingProblem) is an isomorphism-invariant number attached to them – the number of satisfying assignments of a CNF formula, of proper colorings of a graph, of accepting runs of a machine. Vocabularies, tagged interpretations and the invariance discipline carry over unchanged from DescriptiveComplexity.Interpretation.

The reductions of this file are the parsimonious ones: a first-order interpretation under which the two counts are equal,

They are DescriptiveComplexity.FOReduction and DescriptiveComplexity.OrderedFOReduction with the equivalence of the correct field replaced by an equation, and they compose for the same reason: the composite interpretation is isomorphic to the twice-applied one, and a counting problem does not distinguish isomorphic structures.

Every counting problem has a decision problem underneath, its support (DescriptiveComplexity.CountingProblem.support): “is the count positive?”. A parsimonious reduction between two counting problems is in particular a first-order reduction between their supports (DescriptiveComplexity.ParsimoniousReduction.toFOReduction), which is how hardness results for counting problems yield hardness results for decision problems.

A counting problem in the sense of descriptive complexity: an isomorphism-invariant natural number attached to every L-structure. As for DescriptiveComplexity.DecisionProblem, only the values on finite structures are ever read.

  • Count (A : Type) [L.Structure A] : ℕ

    The count: C A (through the function coercion) is the number attached to the structure A.

  • iso_invariant {A B : Type} [L.Structure A] [L.Structure B] : ∀ (a : L.Equiv A B), self.Count A = self.Count B

    Counting problems do not distinguish isomorphic structures.

Instances For
    Dependency graph
    Dependency graph
    theorem DescriptiveComplexity.CountingProblem.ext {L : FirstOrder.Language} [L.IsRelational] {C D : CountingProblem L} (h : ∀ (A : Type) [inst : L.Structure A], C.Count A = D.Count A) :
    C = D
    Dependency graph
    Dependency graph

    The decision problem underneath a counting problem: is the count positive?

    Equations
    Instances For
      Dependency graph
      Dependency graph

      Reading an interpretation over a larger source vocabulary #

      def DescriptiveComplexity.FOInterpretation.liftSource {L' L₀ L₁ : FirstOrder.Language} {Tag : Type} {dim : ℕ} (Φ : L₀ →ᴸ L₁) (I : FOInterpretation L₀ L' Tag dim) :
      FOInterpretation L₁ L' Tag dim

      An interpretation read over a larger source vocabulary: every defining formula is transported along the vocabulary map.

      Equations
      Instances For
        Dependency graph
        def DescriptiveComplexity.FOInterpretation.liftSourceLEquiv {L' L₀ L₁ : FirstOrder.Language} {Tag : Type} {dim : ℕ} [L'.IsRelational] (Φ : L₀ →ᴸ L₁) (I : FOInterpretation L₀ L' Tag dim) (A : Type) [L₀.Structure A] [L₁.Structure A] [Φ.IsExpansionOn A] :
        L'.Equiv ((liftSource Φ I).Map A) (I.Map A)

        On a structure that is an expansion along the vocabulary map, the lifted interpretation produces the same structure as the original one: the identity on tagged tuples is an isomorphism.

        Equations
        Instances For
          Dependency graph

          Parsimonious reductions #

          A parsimonious first-order reduction from the counting problem C to the counting problem D: a first-order interpretation under which the two counts agree.

          • Tag : Type

            The tags (copies of A^dim) used by the underlying interpretation.

          • tagFinite : Finite self.Tag

            Tags are finite, so that finite structures map to finite structures.

          • tagNonempty : Nonempty self.Tag

            Tags are nonempty, so that nonempty structures map to nonempty structures.

          • dim : ℕ

            The dimension of the underlying interpretation.

          • toInterpretation : FOInterpretation L L' self.Tag self.dim

            The underlying first-order interpretation.

          • correct (A : Type) [L.Structure A] [Finite A] [Nonempty A] : C.Count A = D.Count (self.toInterpretation.Map A)

            The counts agree, on the finite nonempty structures.

          Instances For
            Dependency graph

            A parsimonious first-order reduction from the counting problem C to the counting problem D: a first-order interpretation under which the two counts agree.

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

              An ordered parsimonious reduction: a first-order interpretation over the ordered expansion of the source vocabulary under which the two counts agree, for every linear order of the (finite) input structure.

              Instances For
                Dependency graph

                An ordered parsimonious reduction: a first-order interpretation over the ordered expansion of the source vocabulary under which the two counts agree, for every linear order of the (finite) input structure.

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

                  A parsimonious reduction is a first-order reduction between the supports: equal counts are positive together.

                  Equations
                  Instances For
                    Dependency graph

                    An ordered parsimonious reduction is an ordered first-order reduction between the supports.

                    Equations
                    Instances For
                      Dependency graph

                      Reflexivity and transitivity #

                      Every counting problem parsimoniously reduces to itself, via the identity interpretation.

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

                        Transitivity of parsimonious reductions. The composite interpretation is only isomorphic to the twice-applied one, so the isomorphism-invariance built into DescriptiveComplexity.CountingProblem concludes.

                        Equations
                        Instances For
                          Dependency graph

                          Transitivity of ordered parsimonious reductions. The intermediate structure is ordered by the lexicographic order on tagged tuples, which is first-order definable from the order of the input.

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

                            A parsimonious reduction is in particular an ordered one: lift its defining formulas to the ordered expansion, where they ignore the order.

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

                              Mixed transitivity: an ordered parsimonious reduction followed by a plain one.

                              Equations
                              Instances For
                                Dependency graph

                                Mixed transitivity: a plain parsimonious reduction followed by an ordered one.

                                Equations
                                Instances For
                                  Dependency graph
                                  @[instance_reducible]

                                  Trans instance for parsimonious reductions, enabling calc chains.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Dependency graph
                                  @[instance_reducible]

                                  Trans instance for ordered parsimonious reductions.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Dependency graph
                                  @[instance_reducible]

                                  Mixed transitivity: an ordered parsimonious reduction followed by a plain one.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Dependency graph
                                  @[instance_reducible]

                                  Mixed transitivity: a plain parsimonious reduction followed by an ordered one.

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

                                  Replacing the source of an ordered parsimonious reduction by a counting problem with the same values on finite structures.

                                  Equations
                                  Instances For
                                    Dependency graph