title: Ehrenfeucht–Fraïssé game
text: # Ehrenfeucht–Fraïssé game
  
  In the mathematical discipline of model theory, the Ehrenfeucht–Fraïssé game (also called back-and-forth games) is a technique based on game semantics for determining whether two structures are elementarily equivalent. The main application of Ehrenfeucht–Fraïssé games is in proving the inexpressibility of certain properties in first-order logic. Indeed, Ehrenfeucht–Fraïssé games provide a complete methodology for proving inexpressibility results for first-order logic. In this role, these games are of particular importance in finite model theory and its applications in computer science (specifically computer aided verification and database theory), since Ehrenfeucht–Fraïssé games are one of the few techniques from model theory that remain valid in the context of finite models. Other widely used techniques for proving inexpressibility results, such as the compactness theorem, do not work in finite models.
  
  Ehrenfeucht–Fraïssé-like games can also be defined for other logics, such as fixpoint logics and pebble games for finite variable logics; extensions are powerful enough to characterise definability in existential second-order logic.
  
  ## Main idea
  
  The main idea behind the game is that we have two structures, and two players – Spoiler and Duplicator. Duplicator wants to show that the two structures are elementarily equivalent (satisfy the same first-order sentences), whereas Spoiler wants to show that they are different. The game is played in rounds. A round proceeds as follows: Spoiler chooses any element from one of the structures, and Duplicator chooses an element from the other structure. In simplified terms, the Duplicator's task is to always pick an element "similar" to the one that the Spoiler has chosen, whereas the Spoiler's task is to choose an element for which no "similar" element exists in the other structure. Duplicator wins if there exists an isomorphism between the eventual substructures chosen from the two different structures; otherwise, Spoiler wins.
  
  The game lasts for a fixed number of steps $\gamma$ (which is an ordinal – usually a finite number or $\omega$).
  
  ## Definition
  
  Suppose that we are given two structures ${\mathfrak {A}}$ and ${\mathfrak {B}}$, each with no function symbols and the same set of relation symbols, and a fixed natural number n. We can then define the Ehrenfeucht–Fraïssé game $G_{n}({\mathfrak {A}},{\mathfrak {B}})$ to be a game between two players, Spoiler and Duplicator, played as follows:
  
  * The first player, Spoiler, picks either a member $a_{1}$ of ${\mathfrak {A}}$ or a member $b_{1}$ of ${\mathfrak {B}}$.
  * If Spoiler picked a member of ${\mathfrak {A}}$, Duplicator picks a member $b_{1}$ of ${\mathfrak {B}}$; otherwise, Duplicator picks a member $a_{1}$ of ${\mathfrak {A}}$.
  * Spoiler picks either a member $a_{2}$ of ${\mathfrak {A}}$ or a member $b_{2}$ of ${\mathfrak {B}}$.
  * Duplicator picks an element $a_{2}$ or $b_{2}$ in the model from which Spoiler did not pick.
  * Spoiler and Duplicator continue to pick members of ${\mathfrak {A}}$ and ${\mathfrak {B}}$ for $n-2$ more steps.
  * At the conclusion of the game, we have chosen distinct elements $a_{1},\dots ,a_{n}$ of ${\mathfrak {A}}$ and $b_{1},\dots ,b_{n}$ of ${\mathfrak {B}}$. We therefore have two structures on the set $\{1,\dots ,n\}$, one induced from ${\mathfrak {A}}$ via the map sending $i$ to $a_{i}$, and the other induced from ${\mathfrak {B}}$ via the map sending $i$ to $b_{i}$. Duplicator wins if these structures are the same; Spoiler wins if they are not.
  
  For each n we define a relation ${\mathfrak {A}}\ {\overset {n}{\sim }}\ {\mathfrak {B}}$ if Duplicator wins the n-move game $G_{n}({\mathfrak {A}},{\mathfrak {B}})$. These are all equivalence relations on the class of structures with the given relation symbols. The intersection of all these relations is again an equivalence relation ${\mathfrak {A}}\sim {\mathfrak {B}}$.
  
  ## Equivalence and inexpressibility
  
  It is easy to prove that if Duplicator wins this game for all finite n, that is, ${\mathfrak {A}}\sim {\mathfrak {B}}$, then ${\mathfrak {A}}$ and ${\mathfrak {B}}$ are elementarily equivalent. If the set of relation symbols being considered is finite, the converse is also true.
  
  If a property $Q$ is true of ${\mathfrak {A}}$ but not true of ${\mathfrak {B}}$, but ${\mathfrak {A}}$ and ${\mathfrak {B}}$ can be shown equivalent by providing a winning strategy for Duplicator, then this shows that $Q$ is inexpressible in the logic captured by this game.
  
  ## History
  
  The back-and-forth method used in the Ehrenfeucht–Fraïssé game to verify elementary equivalence was given by Roland Fraïssé in his thesis; it was formulated as a game by Andrzej Ehrenfeucht. The names Spoiler and Duplicator are due to Joel Spencer. Other usual names are Eloise [sic] and Abelard (and often denoted by $\exists$ and $\forall$) after Heloise and Abelard, a naming scheme introduced by Wilfrid Hodges in his book Model Theory, or alternatively Eve and Adam.
  
  