Documentation

DescriptiveComplexity.Invariant.TwoPebble

The k-pebble game between two structures #

DescriptiveComplexity.Invariant.Pebble refines a relation between k-tuples of one structure, which is all the Abiteboul–Vianu development needs: it asks which tuples a definition can tell apart. Separating a Boolean query needs the same game played across two structures, and that is what this file builds – the same chain, the same coinduction, the same stabilization, with the two sides now living in different types.

The pieces mirror their one-structure originals one for one: DescriptiveComplexity.EquivK₂ is the limit of DescriptiveComplexity.pebbleStage₂, greatest by DescriptiveComplexity.le_equivK₂, a fixed point on finite types (DescriptiveComplexity.equivK₂_iff, whence the game moves DescriptiveComplexity.EquivK₂.update), and unchanged by expanding both sides with relations it already refines (DescriptiveComplexity.equivK₂_inf_eq) – the lemma that carries invariance through the stages of an induction.

Instantiated at agreement on the atomic type (DescriptiveComplexity.atomicAgreeOn₂) and at bare sets, it collapses: DescriptiveComplexity.equivK₂_bare – over the empty vocabulary, k-tuples of two sets with k elements each are equivalent as soon as they have the same equality pattern, whatever the two sizes. That is the sentence-level counterpart of DescriptiveComplexity.equivK_bare, and the reason a k-variable induction cannot count.

The chain #

@[reducible, inline]

A relation between k-tuples of two types: the positions of the two-structure k-pebble game.

Equations
Instances For
    Dependency graph

    Pointwise implication of two-structure relations.

    Equations
    • E.Le E' = ∀ (a : Fin k → M) (b : Fin k → N), E a b → E' a b
    Instances For
      Dependency graph

      The back-and-forth condition of the two-structure k-pebble game: the pebble the spoiler moves, on either structure, can be answered on the other.

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

        One round of refinement.

        Equations
        Instances For
          Dependency graph
          def DescriptiveComplexity.pebbleStage₂ {M N : Type} {k : ℕ} (E₀ : PebbleRel₂ M N k) :
          ℕ → PebbleRel₂ M N k

          The descending refinement chain.

          Equations
          Instances For
            Dependency graph
            def DescriptiveComplexity.EquivK₂ {M N : Type} {k : ℕ} (E₀ : PebbleRel₂ M N k) :

            k-pebble equivalence between two structures: the limit of the refinement chain.

            Equations
            Instances For
              Dependency graph
              theorem DescriptiveComplexity.EquivK₂.initial {M N : Type} {k : ℕ} {E₀ : PebbleRel₂ M N k} {a : Fin k → M} {b : Fin k → N} (h : EquivK₂ E₀ a b) :
              E₀ a b

              The limit is below the initial relation.

              Dependency graph
              theorem DescriptiveComplexity.le_equivK₂ {M N : Type} {k : ℕ} {E₀ E : PebbleRel₂ M N k} (h : E.Le (pebbleRefine₂ E₀ E)) :
              E.Le (EquivK₂ E₀)

              Coinduction: a relation below its own refinement is below the limit – how a pair is ever proved equivalent.

              Dependency graph

              Stabilization #

              theorem DescriptiveComplexity.pebbleStage₂_eq_of_succ_eq {M N : Type} {k : ℕ} {E₀ : PebbleRel₂ M N k} {n : ℕ} (hn : pebbleStage₂ E₀ (n + 1) = pebbleStage₂ E₀ n) {m : ℕ} (hm : n ≤ m) :
              Dependency graph
              theorem DescriptiveComplexity.equivK₂_iff {M N : Type} {k : ℕ} [Finite M] [Finite N] (E₀ : PebbleRel₂ M N k) (a : Fin k → M) (b : Fin k → N) :
              EquivK₂ E₀ a b ↔ E₀ a b ∧ PebbleBackForth₂ (EquivK₂ E₀) a b

              The interface characterization: consumers use this, never the stages.

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

              The game move, from the left.

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

              The game move, from the right.

              Dependency graph

              Monotonicity and expansion #

              theorem DescriptiveComplexity.equivK₂_inf_eq {M N : Type} {k : ℕ} [Finite M] [Finite N] {E₀ E₀' : PebbleRel₂ M N k} (hle : E₀'.Le E₀) (hinv : (EquivK₂ E₀).Le E₀') :
              EquivK₂ E₀' = EquivK₂ E₀

              The expansion lemma: refining the initial relation by anything the limit already refines does not change the limit – so expanding both structures by relations the equivalence cannot see leaves it alone.

              Dependency graph

              Agreement on the atomic type, across two structures #

              def DescriptiveComplexity.atomicAgreeOn₂ {L : FirstOrder.Language} (S : Set ((n : ℕ) × L.Relations n)) (M N : Type) [L.Structure M] [L.Structure N] (k : ℕ) :

              Agreement on the atomic type between tuples of two structures: the same equalities between coordinates, and the same base relations of the family S at every selection of coordinates.

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

                The bare case #

                theorem DescriptiveComplexity.equivK₂_bare {M N : Type} {k : ℕ} [FirstOrder.Language.empty.Structure M] [FirstOrder.Language.empty.Structure N] [Finite M] [Finite N] {S : Set ((n : ℕ) × FirstOrder.Language.empty.Relations n)} (hM : k ≤ Nat.card M) (hN : k ≤ Nat.card N) {v : Fin k → M} {w : Fin k → N} (hpat : ∀ (p q : Fin k), v p = v q ↔ w p = w q) :

                Two bare sets with k elements each are indistinguishable by k pebbles: over the empty vocabulary, tuples with the same equality pattern are ≡ᵏ-equivalent across the two sets, however far apart their sizes. The strategy is the one of DescriptiveComplexity.exists_update_pattern, played on both sides at once. Registered in the Lax archive as Lax945089.PebbleInvariance.equivK₂_bare.

                Dependency graph