Fraïsse Theorem in Bruno Poizat's "A course in model theory" In Bruno Poizat's "A course in model theory" book, I didn't understand the lemma used to prove the second part of the theorem stating that "$p$-equivalence classes are finite for $n$-tuples where $n$ is fixed". The part that I didn't understand was how the given formula $$C(n,p+1)\leq 2^{C(n+1,p)}$$ was deduced from the fact:

In other words, the $(p+1)$-equivalence class of an $n$-tuple is determined by the set of all $p$-equivalence classes of $(n+1)$-tuples obtained by adding one element to it.

 A: Poizat says:

Two $n$-tuples are $(p+1)$-equivalent if whenever I add an element on one side, I can respond with an element on the other side of such a type as to have $p$-equivalence.

So the situation boils down to this:
Suppose we have a set $X$ and, for any integers $p\geq 0$ and $n\geq 1$, we have an equivalence relation $\sim_{p,n}$ on $X^n$ such that the following conditions are satisfied:

*

*For all $n\geq 1$, $\sim_{0,n}$ has finitely many classes.


*For all $n\geq 1$, if $\bar{a},\bar{b}\in X^n$ then $\bar{a}\sim_{p+1,n}\bar{b}$ if and only if

*

*for any $a'\in X$ there is a $b'\in X$ such that $\bar{a}a'\sim_{p,n+1}\bar{b}b'$, and

*for any $b'\in X$ there is $a'\in X$ such that $\bar{a}a'\sim_{p,n+1}\bar{b}b'$.



Here $\bar{a}a'$ denotes the $(n+1)$-tuple in $X^{n+1}$ obtained by concatenating $a'$ on the end of $\bar{a}$ (and similarly for $\bar{b}b'$). Note that condition (2) is precisely transcribing Poizat's quote above.
Now, given $p\geq 0$ and $n\geq 1$, define $C(p,n)$ to be the cardinality of the set of $\sim_{p,n}$-classes on $X^n$. The goal is to show that $C(p,n)$ is finite for all $n$ and the proof proceeds by induction on $p$. The base case $p=0$ is precisely condition (1) above. So fix $p$ and assume $C(p,n)$ is finite for all $n$. The main claim is:
Claim. For all $n\geq 1$, $C(p+1,n)\leq 2^{C(p,n+1)}$.
Proof. Fix $n\geq 1$, and let $k=C(p,n+1)$.  We are going to show that the number of $\sim_{p+1,n}$-classes is at most $2^k$ by using condition (2) to exhibit an injective function from the set of all $\sim_{p+1,n}$-classes to the set of all subsets of $\{1,\ldots,k\}$.
Let $\bar{a}_1,\ldots,\bar{a}_k\in X^{n+1}$ be a full set of representatives for the equivalence relation $\sim_{p,n+1}$ (so any $(n+1)$-tuple in $X^{n+1}$ is equivalent to $\bar{a}_i$ for some $1\leq i\leq k$). Given an $n$-tuple $\bar{a}\in X^n$, define the set
$$
I_{\bar{a}}=\{1\leq i\leq n:\bar{a}_i\sim_{p,n+1}\bar{a}a'\text{ for some }a'\in X\}.
$$
(In other words, $I_{\bar{a}}$ is the set of indices $i$ such that $\bar{a}_i$ is $\sim_{p,n+1}$-equivalent to an $(n+1)$-tuple obtained by adding an element of $X$ to the end of $\bar{a}$.)
Now suppose we have two $n$-tuples $\bar{a},\bar{b}\in X^n$. Then condition (2) above exactly says:
$$
\bar{a}\sim_{p+1,n}\bar{b}\text{ if and only if }I_{\bar{a}}=I_{\bar{b}}.~(\ast)
$$
(If you're unsure of this then I encourage writing out the details.)
So let $S$ be the set of all $\sim_{p+1,n}$-classes, and let $P$ be the set of all subsets of $\{1,2,\ldots,k\}$. Then, by $(\ast)$, we have a well-defined injective function $f\colon S\to P$ such that, given a $\sim_{p+1,n}$-class $c\in P$, $f(c)$ is defined to be $I_{\bar{a}}$, where $\bar{a}$ is an arbitrary element of the class $c$. Since $P$ has cardinality $2^k$, we have $|S|\leq 2^k$, which is what we wanted to prove.
