Documentation

DescriptiveComplexity.Invariant.Pebble

The k-pebble refinement, over an abstract initial relation #

The combinatorial core of k-variable equivalence ≡ᵏ (Abiteboul–Vianu 1991; Ebbinghaus–Flum 1995, ch. 3), with no logic in sight: positions are k-tuples over a bare type A, an initial relation E₀ stands in for «same atomic type», and one round of the k-pebble game refines a relation E to DescriptiveComplexity.pebbleRefine E₀ E – the pairs that are in E₀ and survive one exchange of a pebble (DescriptiveComplexity.PebbleBackForth).

DescriptiveComplexity.EquivK E₀ is the limit of the descending refinement chain DescriptiveComplexity.pebbleStage, that is, the greatest fixed point of the refinement:

Keeping E₀ abstract keeps the vocabulary out: the instantiation at «same atomic type over a structure» – necessarily over the finitely many symbols a definition actually mentions – is where the logic enters, and lives with the invariance results for the fixed-point logics, not here. The same skeleton with rounds in place of pebbles is the Ehrenfeucht–Fraïssé refinement, a second consumer this file is stated to serve.

Relations on k-tuples #

@[reducible, inline]

A relation between k-tuples over A: the positions of the k-pebble game.

Equations
Instances For
    Dependency graph

    Pointwise implication of relations on k-tuples, spelled out (the lattice order, kept explicit per the conventions of this library).

    Equations
    • E.Le E' = ∀ (a b : Fin kA), E a bE' a b
    Instances For
      Dependency graph

      One round of the game #

      The back-and-forth condition of the k-pebble game relative to a relation E: whichever pebble the spoiler moves, on whichever side, the duplicator can move the same pebble on the other side and stay in E.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Dependency graph
        def DescriptiveComplexity.pebbleRefine {A : Type} {k : } (E₀ E : PebbleRel A k) :

        One round of refinement: agree initially, and survive one exchange of a pebble relative to E.

        Equations
        Instances For
          Dependency graph

          The back-and-forth condition is monotone in the relation it is relative to.

          Dependency graph
          theorem DescriptiveComplexity.pebbleRefine_mono {A : Type} {k : } (E₀ : PebbleRel A k) {E E' : PebbleRel A k} (h : E.Le E') :
          (pebbleRefine E₀ E).Le (pebbleRefine E₀ E')

          One round of refinement is monotone in the refined relation.

          Dependency graph

          The refinement chain and its limit #

          def DescriptiveComplexity.pebbleStage {A : Type} {k : } (E₀ : PebbleRel A k) :
          PebbleRel A k

          The descending refinement chain, from the all-relation: what one round cannot yet tell apart, twice refined, thrice refined …

          Equations
          Instances For
            Dependency graph
            def DescriptiveComplexity.EquivK {A : Type} {k : } (E₀ : PebbleRel A k) :

            k-equivalence relative to an initial relation: the limit of the refinement chain – equivalently (DescriptiveComplexity.equivK_iff, DescriptiveComplexity.le_equivK) the greatest fixed point of one round of refinement.

            Equations
            Instances For
              Dependency graph
              theorem DescriptiveComplexity.pebbleStage_succ_le {A : Type} {k : } (E₀ : PebbleRel A k) (n : ) :
              (pebbleStage E₀ (n + 1)).Le (pebbleStage E₀ n)

              The refinement chain descends.

              Dependency graph
              theorem DescriptiveComplexity.pebbleStage_le_of_le {A : Type} {k : } (E₀ : PebbleRel A k) {m n : } (hmn : m n) :
              (pebbleStage E₀ n).Le (pebbleStage E₀ m)

              The refinement chain descends, monotonically.

              Dependency graph
              theorem DescriptiveComplexity.EquivK.stage {A : Type} {k : } {E₀ : PebbleRel A k} {a b : Fin kA} (h : EquivK E₀ a b) (n : ) :
              pebbleStage E₀ n a b

              The limit is below every stage.

              Dependency graph
              theorem DescriptiveComplexity.EquivK.initial {A : Type} {k : } {E₀ : PebbleRel A k} {a b : Fin kA} (h : EquivK E₀ a b) :
              E₀ a b

              The limit is below the initial relation.

              Dependency graph

              Coinduction: the limit is the greatest post-fixed point #

              theorem DescriptiveComplexity.le_equivK {A : Type} {k : } {E₀ E : PebbleRel A k} (h : E.Le (pebbleRefine E₀ E)) :
              E.Le (EquivK E₀)

              The coinduction principle: a relation below its own refinement is below the limit. This is how tuples are ever proved ≡ᵏ-equivalent – exhibit a back-and-forth system containing the pair.

              Dependency graph

              Stabilization on a finite type #

              theorem DescriptiveComplexity.exists_pebbleStage_succ_eq {A : Type} {k : } [Finite A] (E₀ : PebbleRel A k) :
              NNat.card ((Fin kA) × (Fin kA)), pebbleStage E₀ (N + 1) = pebbleStage E₀ N

              The refinement chain plateaus within the number of pairs of k-tuples: consecutive stages agree from there on.

              Dependency graph
              theorem DescriptiveComplexity.pebbleRefine_equivK {A : Type} {k : } [Finite A] (E₀ : PebbleRel A k) :
              pebbleRefine E₀ (EquivK E₀) = EquivK E₀

              On a finite type the limit is a fixed point of the refinement – the greatest one, by DescriptiveComplexity.le_equivK.

              Dependency graph
              theorem DescriptiveComplexity.equivK_iff {A : Type} {k : } [Finite A] (E₀ : PebbleRel A k) (a b : Fin kA) :
              EquivK E₀ a b E₀ a b PebbleBackForth (EquivK E₀) a b

              The interface characterization of ≡ᵏ on a finite type: initial agreement together with the back-and-forth condition relative to ≡ᵏ itself. Consumers should use this, never the stages.

              Dependency graph
              theorem DescriptiveComplexity.EquivK.update {A : Type} {k : } {E₀ : PebbleRel A k} [Finite A] {a b : Fin kA} (h : EquivK E₀ a b) (i : Fin k) (c : A) :
              ∃ (d : A), EquivK E₀ (Function.update a i c) (Function.update b i d)

              The game move: from an equivalent pair, moving a pebble on the left can be answered on the right.

              Dependency graph
              theorem DescriptiveComplexity.EquivK.update_right {A : Type} {k : } {E₀ : PebbleRel A k} [Finite A] {a b : Fin kA} (h : EquivK E₀ a b) (i : Fin k) (d : A) :
              ∃ (c : A), EquivK E₀ (Function.update a i c) (Function.update b i d)

              The game move, from the right.

              Dependency graph

              Pair substructures #

              A tuple pair obtained by selecting, permuting and repeating coordinate pairs of an equivalent pair is equivalent: duplicated pebbles only make the duplicator's task easier. This is the well-definedness lemma behind every operation on ≡ᵏ-classes that rearranges coordinates – the substitution and rearrangement relations of the invariant structure.

              theorem DescriptiveComplexity.equivK_of_pairSub {A : Type} {k : } {E₀ : PebbleRel A k} [Finite A] (hE₀ : ∀ {x y u v : Fin kA}, (∀ (j : Fin k), ∃ (i : Fin k), x j = u i y j = v i)E₀ u vE₀ x y) {x y u v : Fin kA} (hsub : ∀ (j : Fin k), ∃ (i : Fin k), x j = u i y j = v i) (huv : EquivK E₀ u v) :
              EquivK E₀ x y

              Equivalence is inherited by pair substructures: if every coordinate pair of (x, y) is a coordinate pair of (u, v), and the initial relation is closed under this passage, then u ≡ᵏ v forces x ≡ᵏ y. Coinduction: the spoiler's move on (x, y) frees a pebble of (u, v) (at most k - 1 pairs are still needed), where the duplicator answers via the game move.

              Dependency graph

              Equivalence #

              theorem DescriptiveComplexity.pebbleBackForth_refl {A : Type} {k : } {E : PebbleRel A k} (h : ∀ (a : Fin kA), E a a) (a : Fin kA) :

              The back-and-forth condition preserves reflexivity.

              Dependency graph
              theorem DescriptiveComplexity.pebbleBackForth_symm {A : Type} {k : } {E : PebbleRel A k} (h : ∀ (a b : Fin kA), E a bE b a) {a b : Fin kA} (hab : PebbleBackForth E a b) :

              The back-and-forth condition preserves symmetry.

              Dependency graph
              theorem DescriptiveComplexity.pebbleBackForth_trans {A : Type} {k : } {E : PebbleRel A k} (h : ∀ (a b c : Fin kA), E a bE b cE a c) {a b c : Fin kA} (hab : PebbleBackForth E a b) (hbc : PebbleBackForth E b c) :

              The back-and-forth condition preserves transitivity.

              Dependency graph
              theorem DescriptiveComplexity.pebbleStage_equivalence {A : Type} {k : } {E₀ : PebbleRel A k} (hE₀ : Equivalence E₀) (n : ) :

              Every stage of the refinement chain of an equivalence is an equivalence.

              Dependency graph
              theorem DescriptiveComplexity.equivK_equivalence {A : Type} {k : } {E₀ : PebbleRel A k} (hE₀ : Equivalence E₀) :

              ≡ᵏ is an equivalence whenever the initial relation is one.

              Dependency graph

              Monotonicity and the expansion lemma #

              theorem DescriptiveComplexity.pebbleStage_mono {A : Type} {k : } {E₀ E₀' : PebbleRel A k} (h : E₀'.Le E₀) (n : ) :
              (pebbleStage E₀' n).Le (pebbleStage E₀ n)

              The stages are monotone in the initial relation.

              Dependency graph
              theorem DescriptiveComplexity.equivK_mono {A : Type} {k : } {E₀ E₀' : PebbleRel A k} (h : E₀'.Le E₀) :
              (EquivK E₀').Le (EquivK E₀)

              ≡ᵏ is monotone in the initial relation.

              Dependency graph
              theorem DescriptiveComplexity.equivK_inf_eq {A : Type} {k : } [Finite A] {E₀ E₀' : PebbleRel A k} (hle : E₀'.Le E₀) (hinv : (EquivK E₀).Le E₀') :
              EquivK E₀' = EquivK E₀

              The expansion lemma: refining the initial relation by anything ≡ᵏ already refines does not change ≡ᵏ. Read with E₀' the conjunction of E₀ and agreement on an ≡ᵏ-invariant relation, this says ≡ᵏ is unchanged when the structure is expanded by an ≡ᵏ-invariant relation – the lemma that carries the ≡ᵏ-invariance of the fixed-point logics, stage by stage.

              Dependency graph