Ehrenfeucht–Fraïssé games #
The n-round Ehrenfeucht–Fraïssé game on two L-structures M and N starts from a position: a
k-tuple a of pebbled elements of M and a k-tuple b of N. In each round Spoiler picks an
element of one structure and Duplicator answers with an element of the other; the chosen pair
is appended to the position. Duplicator wins a play when every position reached, the initial one
included, is a partial isomorphism: the map a i ↦ b i is well defined, injective, and preserves
and reflects every relation of L.
DuplicatorWins L n a b is the recursive characterization of the positions from which Duplicator
has a winning strategy in the n-round game; duplicatorWins_iff_exists_strategy relates it to
explicit strategies, and IsBackAndForth.duplicatorWins to back-and-forth systems, the usual
way to construct winning strategies. The game is defined for arbitrary languages and structures.
For relational languages, DuplicatorWins.realize_iff is the easy direction of the
Ehrenfeucht–Fraïssé theorem: a winning position satisfies the same formulas of quantifier rank at
most n. The converse needs a finite relational vocabulary and is proved in
CslibFrontier.Logics.FirstOrder.EhrenfeuchtFraisse.Hintikka.
The pebbles are recorded as tuples Fin k → M, which Fin.snoc extends; these are the variable
assignments of Mathlib's BoundedFormula with k bound variables and no free variables, so the
game positions match the semantics of formulas without translation. Constants and function
symbols are not handled by the game: positions do not close under terms, so the easy direction
assumes L.IsRelational.
Main definitions #
Cslib.Logic.FO.PartialIso: the pebbled tuples define a partial isomorphism.Cslib.Logic.FO.DuplicatorWins: Duplicator wins then-round game from a position.Cslib.Logic.FO.Strategy,Cslib.Logic.FO.Strategy.IsWinning: Duplicator strategies and winning strategies. Both bodies are exposed, so clients can build strategies by recursion and check them withStrategy.isWinning_zeroandStrategy.isWinning_succ.Cslib.Logic.FO.IsBackAndForth: back-and-forth systems indexed by the number of rounds left.
Main results #
Cslib.Logic.FO.duplicatorWins_iff_exists_strategy: Duplicator wins exactly when she has a winning strategy.Cslib.Logic.FO.IsBackAndForth.duplicatorWins,Cslib.Logic.FO.isBackAndForth_duplicatorWins: back-and-forth systems consist of winning positions, and the winning positions form the largest one.Cslib.Logic.FO.DuplicatorWins.mono,Cslib.Logic.FO.DuplicatorWins.refl,Cslib.Logic.FO.DuplicatorWins.symm,Cslib.Logic.FO.DuplicatorWins.trans,FirstOrder.Language.Equiv.duplicatorWins: monotonicity in the number of rounds, the equivalence-relation laws and invariance under isomorphism.Cslib.Logic.FO.DuplicatorWins.realize_iff: Ehrenfeucht–Fraïssé, easy direction;Cslib.Logic.FO.DuplicatorWins.formula_realize_iffis the same forL.Formula (Fin k).
References #
Partial isomorphisms #
The pebbled tuples a and b define a partial isomorphism a i ↦ b i: the map is
well defined and injective, and it preserves and reflects every relation.
Two pebbles coincide in
Mexactly when they coincide inN.- relMap_iff {l : ℕ} (R : L.Relations l) (f : Fin l → Fin k) : FirstOrder.Language.Structure.RelMap R (a ∘ f) ↔ FirstOrder.Language.Structure.RelMap R (b ∘ f)
Every relation holds of the pebbles in
Mexactly when it holds of them inN.
Instances For
The game #
Duplicator wins the n-round Ehrenfeucht–Fraïssé game from the position (a, b): the
position is a partial isomorphism and, if a round remains, every move of Spoiler in either
structure has an answer from which Duplicator wins the remaining rounds.
Instances For
Strategies #
A Duplicator strategy for the n-round game from the position (a, b): for every move of
Spoiler, an answer in the other structure together with a strategy for the remaining rounds.
The body is exposed: clients build strategies and read off their answers.
Instances For
A strategy is winning when every position reached in a play following it, including the initial one, is a partial isomorphism. The body is exposed so that clients can check that a concrete strategy wins.
Instances For
Duplicator wins the n-round game exactly when she has a winning strategy.
Back-and-forth systems #
A back-and-forth system: a family I j of sets of positions, j being the number of rounds
still to play, each consisting of partial isomorphisms, such that every position of I (j + 1)
can be extended, for every move of Spoiler, to a position of I j.
Every position of the system is a partial isomorphism.
- forth {j k : ℕ} {a : Fin k → M} {b : Fin k → N} : I (j + 1) a b → ∀ (c : M), ∃ (d : N), I j (Fin.snoc a c) (Fin.snoc b d)
Every move of Spoiler in
Mhas an answer inNstaying in the system. - back {j k : ℕ} {a : Fin k → M} {b : Fin k → N} : I (j + 1) a b → ∀ (d : N), ∃ (c : M), I j (Fin.snoc a c) (Fin.snoc b d)
Every move of Spoiler in
Nhas an answer inMstaying in the system.
Instances For
Every position of a back-and-forth system with n rounds to play is won by Duplicator.
The winning positions of Duplicator form the largest back-and-forth system.
Basic properties of the game #
Duplicator wins every game between a structure and an isomorphic copy, from a position and its image.
The easy direction of the Ehrenfeucht–Fraïssé theorem #
Ehrenfeucht–Fraïssé, easy direction. For a relational language, if Duplicator wins the
n-round game from (a, b), then a and b satisfy the same formulas of quantifier rank at
most n. No finiteness assumption is needed.
A bounded formula φ with k bound variables and no free variables, turned into a formula
with free variables Fin k by BoundedFormula.toFormula and relabeling, holds of a exactly when
φ holds with bound variables a. With quantifierRank_formula_relabel and
quantifierRank_toFormula, it moves rank-bounded statements from L.BoundedFormula Empty k to
L.Formula (Fin k).
Ehrenfeucht–Fraïssé, easy direction, for formulas with free variables. For a relational
language, a winning position (a, b) of the n-round game satisfies the same formulas
φ : L.Formula (Fin k) of quantifier rank at most n, the free variables naming the pebbles.