Documentation

DescriptiveComplexity.Invariant.OrderDef

The canonical order is inflationary-definable #

That one fixed-point formula orders the ≡ᵏ-classes uniformly over all finite structures is the central lemma of Dawar–Lindell–Weinstein 1995; here it is stated as the first-order definition of the ordered pebble refinement (DescriptiveComplexity.Invariant.OrderedPebble): a simultaneous induction DescriptiveComplexity.ordStepDef over the base vocabulary, with one relation variable of arity k + k holding the current strict order on k-tuples, whose inflationary stages are exactly the stages of the ordered refinement (DescriptiveComplexity.inflStage_ordStepDef), so whose limit is the canonical order DescriptiveComplexity.OrdK on the ≡ᵏ-classes.

The initial coloring is the atomic bit vector relative to a finite agreement family S (DescriptiveComplexity.atomColor): one bit per coordinate equality and one per relation of S at each selection of coordinates, ordered lexicographically along an arbitrary enumeration of the bits. Its agreement is atomic agreement (DescriptiveComplexity.colorAgree_atomColor), which plugs the definable order into the invariant structure's linear order (DescriptiveComplexity.invLinearOrder).

Every piece of one refinement round is written as a first-order formula over the expanded vocabulary – the bit comparisons as finite lexicographic disjunctions, membership in a move set with one quantifier, move-set comparison with a quantified separating tuple and a quantified minimality check – and each formula builder comes with its realization lemma, so the step formula realizes one round of DescriptiveComplexity.ordRefine (DescriptiveComplexity.realize_ordStepF).

The order block and its symbol #

@[reducible]

The block of the definable refinement: one relation variable of arity k + k, the current strict order on k-tuples.

Equations
Instances For
    Dependency graph
    @[reducible, inline]

    The order variable's relation symbol.

    Equations
    Instances For
      Dependency graph
      @[reducible, inline]

      A base relation symbol, in the vocabulary expanded by the order block.

      Equations
      Instances For
        Dependency graph

        The strict order on k-tuples held by an assignment of the order block.

        Equations
        Instances For
          Dependency graph
          theorem DescriptiveComplexity.addCases_comp {k : } {A γ : Type} (w : γA) (f g : Fin kγ) :
          (fun (i : Fin (k + k)) => Fin.addCases (fun (i : Fin k) => w (f i)) (fun (i : Fin k) => w (g i)) i) = fun (p : Fin (k + k)) => w (Fin.addCases f g p)

          Reading a k + k-tuple as two k-tuples.

          Dependency graph

          Formula builders #

          Each builder takes the tuples it speaks about as selections of variables Fin k → γ in an arbitrary context γ, so that the builders compose under the quantifiers Formula.iExs/Formula.iAlls.

          noncomputable def DescriptiveComplexity.ordPrecF (L : FirstOrder.Language) (k : ) {γ : Type} (f g : Fin kγ) :

          The -atom between two k-tuples of variables.

          Equations
          Instances For
            Dependency graph
            noncomputable def DescriptiveComplexity.incompF (L : FirstOrder.Language) (k : ) {γ : Type} (f g : Fin kγ) :

            Incomparability of two k-tuples of variables.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Dependency graph
              noncomputable def DescriptiveComplexity.inMovesF (L : FirstOrder.Language) (k : ) {γ : Type} [DecidableEq γ] (j : Fin k) (f x : Fin kγ) :

              Membership of the class of x in the move set of f at pebble j: some value of pebble j moves f into the class of x.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph
                noncomputable def DescriptiveComplexity.movesDiffF (L : FirstOrder.Language) (k : ) {γ : Type} [DecidableEq γ] (j : Fin k) (f g x : Fin kγ) :

                The class of x separates the move sets of f and g at pebble j.

                Equations
                Instances For
                  Dependency graph
                  noncomputable def DescriptiveComplexity.setLessF (L : FirstOrder.Language) (k : ) {γ : Type} [DecidableEq γ] (j : Fin k) (f g : Fin kγ) :

                  Move-set comparison at pebble j: some separating class in the move set of f and not of g is minimal among the separating classes.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Dependency graph
                    noncomputable def DescriptiveComplexity.movesEqF (L : FirstOrder.Language) (k : ) {γ : Type} [DecidableEq γ] (j : Fin k) (f g : Fin kγ) :

                    Move-set equality at pebble j.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Dependency graph
                      noncomputable def DescriptiveComplexity.movesLessF (L : FirstOrder.Language) (k : ) {γ : Type} [DecidableEq γ] (f g : Fin kγ) :

                      Lexicographic move-set comparison over the pebbles.

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

                        Realization of the builders #

                        theorem DescriptiveComplexity.realize_ordPrecF {L : FirstOrder.Language} {k : } {A : Type} [L.Structure A] {σ : (ordBlock k).Assignment A} {γ : Type} (f g : Fin kγ) (w : γA) :
                        (ordPrecF L k f g).Realize w toPebble σ (fun (i : Fin k) => w (f i)) fun (i : Fin k) => w (g i)
                        Dependency graph
                        theorem DescriptiveComplexity.realize_incompF {L : FirstOrder.Language} {k : } {A : Type} [L.Structure A] {σ : (ordBlock k).Assignment A} {γ : Type} (f g : Fin kγ) (w : γA) :
                        (incompF L k f g).Realize w IncompRel (toPebble σ) (fun (i : Fin k) => w (f i)) fun (i : Fin k) => w (g i)
                        Dependency graph
                        theorem DescriptiveComplexity.realize_inMovesF {L : FirstOrder.Language} {k : } {A : Type} [L.Structure A] {σ : (ordBlock k).Assignment A} {γ : Type} [DecidableEq γ] (j : Fin k) (f x : Fin kγ) (w : γA) :
                        (inMovesF L k j f x).Realize w InMoves (toPebble σ) j (fun (i : Fin k) => w (f i)) fun (i : Fin k) => w (x i)
                        Dependency graph
                        theorem DescriptiveComplexity.realize_movesDiffF {L : FirstOrder.Language} {k : } {A : Type} [L.Structure A] {σ : (ordBlock k).Assignment A} {γ : Type} [DecidableEq γ] (j : Fin k) (f g x : Fin kγ) (w : γA) :
                        (movesDiffF L k j f g x).Realize w MovesDiff (toPebble σ) j (fun (i : Fin k) => w (f i)) (fun (i : Fin k) => w (g i)) fun (i : Fin k) => w (x i)
                        Dependency graph
                        theorem DescriptiveComplexity.realize_setLessF {L : FirstOrder.Language} {k : } {A : Type} [L.Structure A] {σ : (ordBlock k).Assignment A} {γ : Type} [DecidableEq γ] (j : Fin k) (f g : Fin kγ) (w : γA) :
                        (setLessF L k j f g).Realize w SetLess (toPebble σ) j (fun (i : Fin k) => w (f i)) fun (i : Fin k) => w (g i)
                        Dependency graph
                        theorem DescriptiveComplexity.realize_movesEqF {L : FirstOrder.Language} {k : } {A : Type} [L.Structure A] {σ : (ordBlock k).Assignment A} {γ : Type} [DecidableEq γ] (j : Fin k) (f g : Fin kγ) (w : γA) :
                        (movesEqF L k j f g).Realize w MovesEq (toPebble σ) j (fun (i : Fin k) => w (f i)) fun (i : Fin k) => w (g i)
                        Dependency graph
                        theorem DescriptiveComplexity.realize_movesLessF {L : FirstOrder.Language} {k : } {A : Type} [L.Structure A] {σ : (ordBlock k).Assignment A} {γ : Type} [DecidableEq γ] (f g : Fin kγ) (w : γA) :
                        (movesLessF L k f g).Realize w MovesLess (toPebble σ) (fun (i : Fin k) => w (f i)) fun (i : Fin k) => w (g i)
                        Dependency graph

                        The atomic bit coloring #

                        @[reducible]

                        The bit positions of the atomic coloring: one per coordinate equality, one per relation of the family at each selection of coordinates.

                        Equations
                        Instances For
                          Dependency graph
                          noncomputable def DescriptiveComplexity.atomBits (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) {A : Type} [L.Structure A] (w : Fin kA) :
                          BitIdx L k SBool

                          The atomic bit vector of a k-tuple.

                          Equations
                          Instances For
                            Dependency graph
                            noncomputable def DescriptiveComplexity.atomColor (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) {A : Type} [L.Structure A] (w : Fin kA) :
                            Lex (BitIdx L k SBool)

                            The atomic coloring: the bit vector, compared lexicographically.

                            Equations
                            Instances For
                              Dependency graph
                              @[instance_reducible]
                              noncomputable def DescriptiveComplexity.bitIdxLinearOrder (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) (hS : S.Finite) :

                              An arbitrary enumeration order on the bit positions (finitely many, for a finite family).

                              Equations
                              Instances For
                                Dependency graph
                                @[instance_reducible]
                                noncomputable def DescriptiveComplexity.bitVecLinearOrder (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) (hS : S.Finite) :
                                LinearOrder (Lex (BitIdx L k SBool))

                                The lexicographic order on bit vectors.

                                Equations
                                Instances For
                                  Dependency graph

                                  The agreement of the atomic coloring is atomic agreement.

                                  Dependency graph

                                  The bit comparison formulas #

                                  noncomputable def DescriptiveComplexity.atomBitF (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) {γ : Type} (b : BitIdx L k S) (f : Fin kγ) :

                                  The formula of one atomic bit at a selection of variables.

                                  Equations
                                  Instances For
                                    Dependency graph
                                    noncomputable def DescriptiveComplexity.atomBitEqF (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) {γ : Type} (b : BitIdx L k S) (f g : Fin kγ) :

                                    Bit agreement at two selections of variables.

                                    Equations
                                    Instances For
                                      Dependency graph
                                      noncomputable def DescriptiveComplexity.atomLessF (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) (hS : S.Finite) {γ : Type} (f g : Fin kγ) :

                                      Lexicographic bit-vector comparison: agree before some bit, 0 < 1 at it.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        Dependency graph
                                        noncomputable def DescriptiveComplexity.atomEqF (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) (hS : S.Finite) {γ : Type} (f g : Fin kγ) :

                                        Bit-vector equality.

                                        Equations
                                        Instances For
                                          Dependency graph
                                          theorem DescriptiveComplexity.realize_atomBitF (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) {A : Type} [L.Structure A] {σ : (ordBlock k).Assignment A} {γ : Type} (b : BitIdx L k S) (f : Fin kγ) (w : γA) :
                                          (atomBitF L k S b f).Realize w atomBits L k S (fun (i : Fin k) => w (f i)) b = true
                                          Dependency graph
                                          theorem DescriptiveComplexity.realize_atomBitEqF (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) {A : Type} [L.Structure A] {σ : (ordBlock k).Assignment A} {γ : Type} (b : BitIdx L k S) (f g : Fin kγ) (w : γA) :
                                          (atomBitEqF L k S b f g).Realize w atomBits L k S (fun (i : Fin k) => w (f i)) b = atomBits L k S (fun (i : Fin k) => w (g i)) b
                                          Dependency graph
                                          theorem DescriptiveComplexity.realize_atomLessF (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) {A : Type} [L.Structure A] {σ : (ordBlock k).Assignment A} (hS : S.Finite) {γ : Type} (f g : Fin kγ) (w : γA) :
                                          (atomLessF L k S hS f g).Realize w (atomColor L k S fun (i : Fin k) => w (f i)) < atomColor L k S fun (i : Fin k) => w (g i)
                                          Dependency graph
                                          theorem DescriptiveComplexity.realize_atomEqF (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) {A : Type} [L.Structure A] {σ : (ordBlock k).Assignment A} (hS : S.Finite) {γ : Type} (f g : Fin kγ) (w : γA) :
                                          (atomEqF L k S hS f g).Realize w (atomColor L k S fun (i : Fin k) => w (f i)) = atomColor L k S fun (i : Fin k) => w (g i)
                                          Dependency graph

                                          The step formula and the induction #

                                          noncomputable def DescriptiveComplexity.ordStepF (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) (hS : S.Finite) :
                                          (L.sum (ordBlock k).lang).Formula (Fin (k + k))

                                          The step formula of the definable refinement: one round of DescriptiveComplexity.ordRefine, over the current order variable.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            Dependency graph
                                            noncomputable def DescriptiveComplexity.ordStepDef (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) (hS : S.Finite) :

                                            The definable refinement: the simultaneous induction computing the canonical order on k-tuples, inflationarily. (The output sentence is irrelevant: the induction is consumed as the first stratum of a stratification.)

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              Dependency graph
                                              theorem DescriptiveComplexity.realize_ordStepF (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) {A : Type} [L.Structure A] (hS : S.Finite) {σ : (ordBlock k).Assignment A} (w : Fin (k + k)A) :
                                              (ordStepF L k S hS).Realize w (IncompRel (toPebble σ) (fun (i : Fin k) => w (Fin.castAdd k i)) fun (i : Fin k) => w (Fin.natAdd k i)) (((atomColor L k S fun (i : Fin k) => w (Fin.castAdd k i)) < atomColor L k S fun (i : Fin k) => w (Fin.natAdd k i)) ((atomColor L k S fun (i : Fin k) => w (Fin.castAdd k i)) = atomColor L k S fun (i : Fin k) => w (Fin.natAdd k i)) MovesLess (toPebble σ) (fun (i : Fin k) => w (Fin.castAdd k i)) fun (i : Fin k) => w (Fin.natAdd k i))
                                              Dependency graph
                                              theorem DescriptiveComplexity.inflStage_ordStepDef (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) {A : Type} [L.Structure A] (hS : S.Finite) (n : ) :
                                              (ordStepDef L k S hS).inflStage A n = fun (x : (ordStepDef L k S hS).B.ι) (w : Fin ((ordStepDef L k S hS).B.arity x)A) => ordStage (atomColor L k S) n (fun (i : Fin k) => w (Fin.castAdd k i)) fun (i : Fin k) => w (Fin.natAdd k i)

                                              The stages of the definable refinement are the stages of the ordered pebble refinement.

                                              Dependency graph
                                              theorem DescriptiveComplexity.toPebble_inflLimit_ordStepDef (L : FirstOrder.Language) (k : ) (S : Set ((n : ) × L.Relations n)) {A : Type} [L.Structure A] (hS : S.Finite) :
                                              toPebble ((ordStepDef L k S hS).inflLimit A) = OrdK (atomColor L k S)

                                              The value of the definable refinement is the canonical order.

                                              Dependency graph