Documentation

DescriptiveComplexity.ArithmeticFixedPoint

AC⁰ ⊆ PTIME: the numeric predicates are an induction #

AC⁰ ⊆ PTIME (DescriptiveComplexity.ac0Definable_mem_PTIME): first-order logic with + and × on the ranks is inside polynomial time, because the two numeric predicates are themselves defined by one simultaneous induction over the order, and DescriptiveComplexity.StepDef puts an unrestricted first-order sentence on top of the relations it computes.

Why the fixed-point layer, and not the machine #

The tempting route is FO(DTC): x + y = z is a walk (step two heads in lockstep), which is deterministic, so addition is one operator. But DescriptiveComplexity.TCSpec is a single operator over first-order kernels, with no relation variables; multiplication is a walk whose step needs addition, and the sentence on top needs both, so the route requires nesting that the specification-as-data logic does not have. DescriptiveComplexity.StepDef has exactly the two features that are wanted instead:

Since the numeric predicates are symbols, no formula recursion is involved either: the translation of an AC⁰ sentence is a language map (DescriptiveComplexity.arithToBlock) sending plus and times to the two relation variables, and FirstOrder.Language.LHom.realize_onSentence does the rest, once the limit of the induction is proved to be the arithmetic.

The induction #

Two variables of arity 3, plus and times, with the clauses

read inflationarily. Soundness is an induction on the stages (DescriptiveComplexity.inflStage_arith_sound); completeness needs no stage count at all, only that the limit is closed under the step (DescriptiveComplexity.StepDef.isFixedPt_inflStep_inflLimit), and then an induction along the order (DescriptiveComplexity.inflLimit_plus_of_eq, DescriptiveComplexity.inflLimit_times_of_eq).

What this does and does not give #

It gives the inclusion in PTIME, hence in NP and everything above, and it gives every consumer that a closure of AC⁰ under first-order reductions would (a problem reducing to an AC⁰ problem is in PTIME, PTIME being closed under reductions). It does not give the sharper AC⁰ ⊆ LOGSPACE, which needs the arithmetic computed by a deterministic multi-head automaton (DescriptiveComplexity.HeadProgram) rather than by an induction.

The block of the two numeric predicates #

@[reducible, inline]

The relation variables computing the numeric predicates: two of arity 3, false for addition and true for multiplication. The index type is Bool rather than Fin 2 because numerals do not elaborate at a block's ι.

Equations
Instances For
    Dependency graph
    @[reducible, inline]

    The addition variable, as a symbol of the expanded vocabulary.

    Equations
    Instances For
      Dependency graph
      @[reducible, inline]

      The multiplication variable, as a symbol of the expanded vocabulary.

      Equations
      Instances For
        Dependency graph

        An order formula, transported to the vocabulary expanded by the block.

        Equations
        Instances For
          Dependency graph

          An atom of one of the two numeric relation variables.

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

            The clause of addition: either y is least and z is x, or y and z both step down and the smaller triple is already there.

            Stated at Fin 3 and only then read at Fin (arithBlock.arity i): numerals do not elaborate through the arity projection of a block.

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

              The clause of multiplication: either y and z are least, or y steps down, x * y' is already there, and one more x is added to it – the addition variable of the same simultaneous induction.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph
                Dependency graph
                Dependency graph
                @[simp]
                theorem DescriptiveComplexity.realize_arithVarF {L : FirstOrder.Language} {α A : Type} [L.Structure A] [LinearOrder A] (ρ : arithBlock.Assignment A) (i : Bool) (a b c : α) (v : αA) :
                (arithVarF i a b c).Realize v ρ i ![v a, v b, v c]
                Dependency graph

                The definition, and what it is meant to compute #

                @[reducible]

                The numeric induction, with an arbitrary first-order output: the two variables of DescriptiveComplexity.arithBlock, the clauses of DescriptiveComplexity.arithStep, and a sentence over the expanded vocabulary.

                Reducible, so that the arity of a variable of its block still reduces to 3 where rw works at implicit transparency.

                Equations
                Instances For
                  Dependency graph

                  One application of the numeric clauses, unfolded: the step formula realized at the current assignment. Stated because DescriptiveComplexity.StepDef.next is a def whose equation theorems do not rewrite.

                  Dependency graph
                  theorem DescriptiveComplexity.next_plus_iff {L : FirstOrder.Language} {A : Type} [L.Structure A] [LinearOrder A] (out : ((L.sum FirstOrder.Language.order).sum arithBlock.lang).Sentence) (ρ : arithBlock.Assignment A) (v : Fin 3A) :
                  (arithStepDef out).next ρ false v (∀ (a : A), v 1 a) v 0 = v 2 ∃ (y' : A) (z' : A), (y' < v 1 ∀ (a : A), ¬(y' < a a < v 1)) (z' < v 2 ∀ (a : A), ¬(z' < a a < v 2)) ρ false ![v 0, y', z']

                  What the addition clause derives: either the base case, or a step down on both y and z from a triple already there.

                  Dependency graph
                  theorem DescriptiveComplexity.next_times_iff {L : FirstOrder.Language} {A : Type} [L.Structure A] [LinearOrder A] (out : ((L.sum FirstOrder.Language.order).sum arithBlock.lang).Sentence) (ρ : arithBlock.Assignment A) (v : Fin 3A) :
                  (arithStepDef out).next ρ true v ((∀ (a : A), v 1 a) ∀ (a : A), v 2 a) ∃ (y' : A) (w : A), (y' < v 1 ∀ (a : A), ¬(y' < a a < v 1)) ρ true ![v 0, y', w] ρ false ![w, v 0, v 2]

                  What the multiplication clause derives: either the base case, or one copy of x peeled off y and added back with the addition variable.

                  Dependency graph

                  Soundness: every stage holds only true facts #

                  theorem DescriptiveComplexity.inflStage_arith_sound {L : FirstOrder.Language} {A : Type} [L.Structure A] [LinearOrder A] (out : ((L.sum FirstOrder.Language.order).sum arithBlock.lang).Sentence) [Finite A] (n : ) :
                  (∀ (v : Fin 3A), (arithStepDef out).inflStage A n false vorank (v 0) + orank (v 1) = orank (v 2)) ∀ (v : Fin 3A), (arithStepDef out).inflStage A n true vorank (v 0) * orank (v 1) = orank (v 2)

                  Every stage of the numeric induction is sound: the addition variable holds only triples whose ranks add up, and the multiplication variable only triples whose ranks multiply.

                  Dependency graph

                  Completeness: the limit is closed under the clauses #

                  The limit of the numeric induction is closed under the step formulas: what one clause derives from it is already in it.

                  Dependency graph

                  The addition variable holds every true triple, by induction along the order: the clause is applied to the limit, which is closed under it.

                  Dependency graph

                  The multiplication variable holds every true triple: the same argument, one copy of x at a time, using the addition variable for the accumulation.

                  Dependency graph

                  The limit of the numeric induction is the arithmetic of the order: the two variables hold exactly the true triples.

                  Dependency graph

                  Reading an AC⁰ sentence at the limit #

                  The translation of an AC⁰ sentence: the numeric symbols go to the two relation variables of the induction, the order symbol and the input symbols to themselves. Being a language map, it needs no recursion over formulas.

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

                    The inclusion #

                    AC⁰ ⊆ FO(IFP): the numeric predicates are the limit of the simultaneous induction of DescriptiveComplexity.arithStep, and an AC⁰ sentence is its output, translated by DescriptiveComplexity.arithToBlock.

                    Dependency graph

                    AC⁰ ⊆ FO(LFP), through the equivalence of the inflationary and the least fixed point.

                    Dependency graph

                    AC⁰ ⊆ PTIME. With DescriptiveComplexity.FODefinable.ac0Definable and DescriptiveComplexity.exists_ac0Definable_not_foDefinable this places the arithmetic logic strictly above FO(≤) and inside polynomial time; the sharper AC⁰ ⊆ LOGSPACE needs the multi-head automaton instead.

                    Dependency graph