Documentation

CslibFrontier.Logics.FirstOrder.FiniteVariable.GenPebbleGame

Generalized-quantifier pebble games #

A single-variable quantifier kind Q (Cslib.Logic.FO.FiniteVariable.Quantifier) induces a k-pebble game between L-structures M and N parameterized by its one-round step condition QuantGameStep.Step (Q := Q) : (M → N → Prop) → Prop ([Hel96], [Lib04], [Imm99]). In each round Spoiler selects a pebble index i : Fin k, and the two players execute one round of the Q-step on the continuation relation fun c d => Win (insert i S) (Function.update a i c) (Function.update b i d).

Instantiating QuantGameStep at:

All structural laws of the game—monotonicity in rounds and placed pebbles, independence of unplaced pebbles, pebble reindexing, reflexivity, symmetry, transitivity, isomorphism invariance, monotonicity in the step condition, back-and-forth invariants, finite-structure saturation of the infinite game (genPebbleWinsForever_iff_forall_genPebbleWins), and soundness for GenFormula—are proved once here for arbitrary Q.

A position is a set S : Set (Fin k) of placed pebble indices together with total assignments a : Fin k → M and b : Fin k → N; only the values on S matter (genPebbleWins_congr). Since positions are total assignments, for k > 0 and empty M or N statements about positions are vacuous.

Main definitions #

Main results #

References #

Partial isomorphisms on placed pebbles #

structure Cslib.Logic.FO.PartialIsoOn (L : FirstOrder.Language) {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} (S : Set (Fin k)) (a : Fin k → M) (b : Fin k → N) :

The pebbles with indices in S define a partial isomorphism a i ↦ b i: the map is well defined and injective, and it preserves and reflects every relation among placed pebbles.

theorem Cslib.Logic.FO.PartialIsoOn.refl {L : FirstOrder.Language} {M : Type w} [L.Structure M] {k : ℕ} (S : Set (Fin k)) (a : Fin k → M) :
PartialIsoOn L S a a
theorem Cslib.Logic.FO.PartialIsoOn.symm {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} (h : PartialIsoOn L S a b) :
PartialIsoOn L S b a
theorem Cslib.Logic.FO.PartialIsoOn.trans {L : FirstOrder.Language} {M : Type w} {N : Type w'} {P : Type w''} [L.Structure M] [L.Structure N] [L.Structure P] {k : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} {c : Fin k → P} (h₁ : PartialIsoOn L S a b) (h₂ : PartialIsoOn L S b c) :
PartialIsoOn L S a c
theorem Cslib.Logic.FO.PartialIsoOn.mono {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {S T : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} (hST : S ⊆ T) (h : PartialIsoOn L T a b) :
PartialIsoOn L S a b
theorem Cslib.Logic.FO.PartialIsoOn.congr {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {S : Set (Fin k)} {a a' : Fin k → M} {b b' : Fin k → N} (ha : Set.EqOn a a' S) (hb : Set.EqOn b b' S) (h : PartialIsoOn L S a b) :
PartialIsoOn L S a' b'

A partial isomorphism on S depends only on the values of the pebbles in S.

theorem Cslib.Logic.FO.partialIsoOn_empty {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} [IsEmpty (L.Relations 0)] (a : Fin k → M) (b : Fin k → N) :

With no pebbles placed, every position is a partial isomorphism, provided L has no nullary relation symbols: these are sentences that the two structures would have to agree on.

theorem Cslib.Logic.FO.partialIsoOn_comp_equiv_iff {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k k' : ℕ} (σ : Fin k' ≃ Fin k) {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} :
PartialIsoOn L (⇑σ ⁻¹' S) (a ∘ ⇑σ) (b ∘ ⇑σ) ↔ PartialIsoOn L S a b

Reindexing pebble names along a bijection preserves partial isomorphisms.

theorem Cslib.Logic.FO.PartialIsoOn.update_of_mem {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} (h : PartialIsoOn L S a b) {i j₀ : Fin k} (hj₀ : j₀ ∈ S) {c : M} (hc : a j₀ = c) :
PartialIsoOn L (insert i S) (Function.update a i c) (Function.update b i (b j₀))

Updating pebble i to an already-placed pebble a j₀ (j₀ ∈ S) preserves PartialIsoOn when paired with b j₀.

theorem Cslib.Logic.FO.PartialIsoOn.update_eq_iff_of_fresh {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} (h : PartialIsoOn L S a b) {i : Fin k} {c : M} {d : N} (hc : ∀ j ∈ S, j ≠ i → a j ≠ c) (hd : ∀ j ∈ S, j ≠ i → d ≠ b j) {r : Fin k} (hr : r ∈ insert i S) {q : Fin k} (hq : q ∈ insert i S) :

Equality preservation on insert i S when updating pebble i to fresh elements c and d outside {a j | j ∈ S ∧ j ≠ i} and {b j | j ∈ S ∧ j ≠ i}.

One-step quantifier game interface #

One-step game condition for a single-variable quantifier kind Q between domains M and N. Given the winning relation R : M → N → Prop for the remaining rounds after moving one pebble, Step R asserts that Duplicator wins the single round. It must be monotone in R, satisfied by any bijection whose graph lies in R, and sound for evaluating every quantifier q : Q.

  • Step : (M → N → Prop) → Prop

    One-round winning condition on the continuation relation R : M → N → Prop.

  • step_mono {R R' : M → N → Prop} : (∀ (c : M) (d : N), R c d → R' c d) → Step Q R → Step Q R'

    Weakening the continuation relation preserves a winning step.

  • step_of_equiv {R : M → N → Prop} (f : M ≃ N) : (∀ (c : M), R c (f c)) → Step Q R

    Any bijection whose graph is contained in R witnesses a winning step.

  • eval_iff_of_step {R : M → N → Prop} {pM : M → Prop} {pN : N → Prop} (q : Q) : Step Q R → (∀ {c : M} {d : N}, R c d → (pM c ↔ pN d)) → (FiniteVariable.Quantifier.eval q pM ↔ FiniteVariable.Quantifier.eval q pN)

    A winning step preserves the truth of every quantifier q : Q.

Instances

    Symmetry of the one-step game condition for Q between M and N.

    Instances

      Transitivity of the one-step game condition for Q across M, N, P.

      Instances

        Compactness (finite-saturation) of the one-step game condition: an antitone countable chain of winning steps has a winning step into its intersection.

        • step_iInf_of_antitone {R : ℕ → M → N → Prop} : (∀ (c : M) (d : N), Antitone fun (n : ℕ) => R n c d) → (∀ (n : ℕ), QuantGameStep.Step Q (R n)) → QuantGameStep.Step Q fun (c : M) (d : N) => ∀ (n : ℕ), R n c d

          If R n is antitone in n and every R n admits a winning step, so does ∀ n, R n.

        Instances

          Generalized k-pebble games #

          def Cslib.Logic.FO.GenPebbleWins (Q : Type) (L : FirstOrder.Language) {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {k : ℕ} :
          ℕ → Set (Fin k) → (Fin k → M) → (Fin k → N) → Prop

          Duplicator wins the n-round generalized Q-pebble game with k pebbles from (S, a, b): the placed pebbles define a partial isomorphism, and if a round remains then for every pebble index i : Fin k Duplicator wins one round of QuantGameStep.Step (Q := Q) into the (n - 1)-round winning relation.

          theorem Cslib.Logic.FO.genPebbleWins_zero {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} :
          GenPebbleWins Q L 0 S a b ↔ PartialIsoOn L S a b
          theorem Cslib.Logic.FO.genPebbleWins_succ {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {n : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} :
          GenPebbleWins Q L (n + 1) S a b ↔ PartialIsoOn L S a b ∧ ∀ (i : Fin k), QuantGameStep.Step Q fun (c : M) (d : N) => GenPebbleWins Q L n (insert i S) (Function.update a i c) (Function.update b i d)
          theorem Cslib.Logic.FO.GenPebbleWins.partialIsoOn {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {n : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} (h : GenPebbleWins Q L n S a b) :
          PartialIsoOn L S a b
          theorem Cslib.Logic.FO.GenPebbleWins.step {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {n : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} (h : GenPebbleWins Q L (n + 1) S a b) (i : Fin k) :
          QuantGameStep.Step Q fun (c : M) (d : N) => GenPebbleWins Q L n (insert i S) (Function.update a i c) (Function.update b i d)

          Duplicator's winning one-step response to Spoiler's choice of pebble i.

          theorem Cslib.Logic.FO.GenPebbleWins.mono {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {m n : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} :
          m ≤ n → GenPebbleWins Q L n S a b → GenPebbleWins Q L m S a b

          Winning a generalized pebble game implies winning every shorter game.

          theorem Cslib.Logic.FO.GenPebbleWins.of_subset {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {n : ℕ} {S T : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} :
          S ⊆ T → GenPebbleWins Q L n T a b → GenPebbleWins Q L n S a b

          Lifting placed pebbles keeps the position winning.

          theorem Cslib.Logic.FO.genPebbleWins_congr {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {n : ℕ} {S : Set (Fin k)} {a a' : Fin k → M} {b b' : Fin k → N} :
          Set.EqOn a a' S → Set.EqOn b b' S → GenPebbleWins Q L n S a b → GenPebbleWins Q L n S a' b'

          Winning depends only on the positions of the placed pebbles.

          theorem Cslib.Logic.FO.genPebbleWins_comp_equiv_iff {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {k' : ℕ} (σ : Fin k' ≃ Fin k) {n : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} :
          GenPebbleWins Q L n (⇑σ ⁻¹' S) (a ∘ ⇑σ) (b ∘ ⇑σ) ↔ GenPebbleWins Q L n S a b

          Reindexing pebble names along a bijection preserves winning positions of any generalized pebble game.

          theorem Cslib.Logic.FO.GenPebbleWins.refl {L : FirstOrder.Language} {M : Type w} [L.Structure M] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [QuantGameStep Q M M] (n : ℕ) (S : Set (Fin k)) (a : Fin k → M) :
          GenPebbleWins Q L n S a a
          theorem Cslib.Logic.FO.GenPebbleWins.symm {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] [QuantGameStep Q N M] [QuantGameSymm Q M N] {n : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} :
          GenPebbleWins Q L n S a b → GenPebbleWins Q L n S b a
          theorem Cslib.Logic.FO.GenPebbleWins.trans {L : FirstOrder.Language} {M : Type w} {N : Type w'} {P : Type w''} [L.Structure M] [L.Structure N] [L.Structure P] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] [FiniteVariable.Quantifier Q P] [QuantGameStep Q N P] [QuantGameStep Q M P] [QuantGameTrans Q M N P] {n : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} {c : Fin k → P} :
          GenPebbleWins Q L n S a b → GenPebbleWins Q L n S b c → GenPebbleWins Q L n S a c
          theorem Cslib.Logic.FO.GenPebbleWins.of_step_imp {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {Q' : Type} [FiniteVariable.Quantifier Q' M] [FiniteVariable.Quantifier Q' N] [QuantGameStep Q' M N] (himp : ∀ {R : M → N → Prop}, QuantGameStep.Step Q R → QuantGameStep.Step Q' R) {n : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} :
          GenPebbleWins Q L n S a b → GenPebbleWins Q' L n S a b

          A stronger one-step game condition implies winning the weaker finite-round pebble game.

          Back-and-forth invariants and the infinite game #

          structure Cslib.Logic.FO.IsGenPebbleBackAndForth (Q : Type) (L : FirstOrder.Language) {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {k : ℕ} (I : Set (Fin k) → (Fin k → M) → (Fin k → N) → Prop) :

          A back-and-forth invariant for the generalized Q-pebble game: a set of positions, each a partial isomorphism on its placed pebbles, such that from every position in the set and for every pebble index i, Duplicator has a winning Q-step staying inside the set.

          theorem Cslib.Logic.FO.IsGenPebbleBackAndForth.genPebbleWins {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {I : Set (Fin k) → (Fin k → M) → (Fin k → N) → Prop} (hI : IsGenPebbleBackAndForth Q L I) {n : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} :
          I S a b → GenPebbleWins Q L n S a b

          Every position of a back-and-forth invariant is won by Duplicator in every finite game.

          theorem Cslib.Logic.FO.IsGenPebbleBackAndForth.of_step_imp {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {Q' : Type} [FiniteVariable.Quantifier Q' M] [FiniteVariable.Quantifier Q' N] [QuantGameStep Q' M N] {I : Set (Fin k) → (Fin k → M) → (Fin k → N) → Prop} (hI : IsGenPebbleBackAndForth Q L I) (himp : ∀ {R : M → N → Prop}, QuantGameStep.Step Q R → QuantGameStep.Step Q' R) :

          A stronger one-step game condition carries back-and-forth invariants to the weaker game.

          def Cslib.Logic.FO.GenPebbleWinsForever (Q : Type) (L : FirstOrder.Language) {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {k : ℕ} (S : Set (Fin k)) (a : Fin k → M) (b : Fin k → N) :

          Duplicator wins the infinite generalized Q-pebble game from (S, a, b): the position belongs to a Q-pebble back-and-forth invariant.

          theorem Cslib.Logic.FO.genPebbleWinsForever_iff_exists_isGenPebbleBackAndForth {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} :
          GenPebbleWinsForever Q L S a b ↔ ∃ (I : Set (Fin k) → (Fin k → M) → (Fin k → N) → Prop), IsGenPebbleBackAndForth Q L I ∧ I S a b

          Unfolds GenPebbleWinsForever into existence of a Q-pebble back-and-forth invariant.

          theorem Cslib.Logic.FO.IsGenPebbleBackAndForth.genPebbleWinsForever {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {I : Set (Fin k) → (Fin k → M) → (Fin k → N) → Prop} (hI : IsGenPebbleBackAndForth Q L I) {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} (h : I S a b) :

          Every position of a back-and-forth invariant is won by Duplicator in the infinite game.

          theorem Cslib.Logic.FO.GenPebbleWinsForever.genPebbleWins {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} (h : GenPebbleWinsForever Q L S a b) (n : ℕ) :
          GenPebbleWins Q L n S a b

          Winning the infinite game implies winning every finite game.

          theorem Cslib.Logic.FO.GenPebbleWinsForever.of_step_imp {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {Q' : Type} [FiniteVariable.Quantifier Q' M] [FiniteVariable.Quantifier Q' N] [QuantGameStep Q' M N] {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} (h : GenPebbleWinsForever Q L S a b) (himp : ∀ {R : M → N → Prop}, QuantGameStep.Step Q R → QuantGameStep.Step Q' R) :

          A stronger one-step game condition implies winning the weaker infinite pebble game.

          theorem Cslib.Logic.FO.genPebbleWinsForever_iff_forall_genPebbleWins {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] [QuantGameCompact Q M N] {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} :
          GenPebbleWinsForever Q L S a b ↔ ∀ (n : ℕ), GenPebbleWins Q L n S a b

          Finite saturation of generalized pebble games. Under QuantGameCompact Q M N, Duplicator wins the infinite Q-pebble game from (S, a, b) if and only if she wins every finite n-round game.

          Duplicator wins the infinite generalized pebble game between a structure and an isomorphic copy, from a position and its image.

          Duplicator wins every finite generalized pebble game between a structure and an isomorphic copy, from a position and its image.

          Soundness for GenFormula #

          theorem Cslib.Logic.FO.GenPebbleWins.realize_iff {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {n : ℕ} {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} (h : GenPebbleWins Q L n S a b) {φ : FiniteVariable.GenFormula Q L k} (hr : φ.quantifierRank ≤ n) (hS : ↑φ.freeVars ⊆ S) :
          φ.Realize a ↔ φ.Realize b

          Generalized pebble games, easy direction. A winning position of the n-round Q-pebble game preserves every GenFormula Q L k of quantifier rank at most n whose free variables are placed pebbles.

          theorem Cslib.Logic.FO.GenPebbleWinsForever.realize_iff {L : FirstOrder.Language} {M : Type w} {N : Type w'} [L.Structure M] [L.Structure N] {k : ℕ} {Q : Type} [FiniteVariable.Quantifier Q M] [FiniteVariable.Quantifier Q N] [QuantGameStep Q M N] {S : Set (Fin k)} {a : Fin k → M} {b : Fin k → N} (h : GenPebbleWinsForever Q L S a b) {φ : FiniteVariable.GenFormula Q L k} (hS : ↑φ.freeVars ⊆ S) :
          φ.Realize a ↔ φ.Realize b

          Infinite generalized pebble games, easy direction. A winning position of the infinite Q-pebble game preserves every GenFormula Q L k whose free variables are placed pebbles.