[step:Verify the closure axioms before exchange]
Let $A \subseteq M$. Here $\operatorname{acl}_M(A)$ denotes the set of elements of $M$ algebraic over $A$, meaning that $c \in \operatorname{acl}_M(A)$ iff there is a formula with finitely many realizations in $M$, using only parameters from $A$, that is satisfied by $c$. Since every element $a \in A$ is defined over $A$ by the formula $x = a$, we have $A \subseteq \operatorname{acl}_M(A)$.
If $A \subseteq B \subseteq M$ and $c \in \operatorname{acl}_M(A)$, then some formula $\varphi(x,\alpha)$ with parameter tuple $\alpha \in A^r$ has finitely many realizations and satisfies $\varphi(c,\alpha)$. Since $\alpha$ is also a tuple from $B$, the same formula witnesses $c \in \operatorname{acl}_M(B)$.
For finite character, suppose $c \in \operatorname{acl}_M(A)$. Then there are a formula $\varphi(x,\alpha)$, a finite parameter tuple $\alpha = (\alpha_1,\dots,\alpha_r) \in A^r$, and an integer $N \in \mathbb{N}$ such that $\varphi(c,\alpha)$ holds and $\varphi(x,\alpha)$ has at most $N$ realizations. Let $A_0 := \{\alpha_1,\dots,\alpha_r\}$. Then $A_0 \subseteq A$ is finite and $c \in \operatorname{acl}_M(A_0)$.
It remains to prove idempotence. The inclusion $\operatorname{acl}_M(A) \subseteq \operatorname{acl}_M(\operatorname{acl}_M(A))$ follows from extensivity and monotonicity. Conversely, let $c \in \operatorname{acl}_M(\operatorname{acl}_M(A))$. Then there are a formula $\varphi(x,d)$, a tuple $d = (d_1,\dots,d_r) \in \operatorname{acl}_M(A)^r$, and an integer $N \in \mathbb{N}$ such that $\varphi(c,d)$ holds and $\varphi(x,d)$ has at most $N$ realizations.
For each index $i \in \{1,\dots,r\}$, choose a formula $\psi_i(z_i,\alpha_i)$ with finite parameter tuple $\alpha_i$ from $A$ and an integer $N_i \in \mathbb{N}$ such that $\psi_i(d_i,\alpha_i)$ holds and $\psi_i(z_i,\alpha_i)$ has at most $N_i$ realizations. Let $\alpha$ be the concatenation of the tuples $\alpha_1,\dots,\alpha_r$. We use $\exists^{\leq N}w\,\varphi(w,z_1,\dots,z_r)$ to denote the first-order assertion that at most $N$ elements $w$ satisfy $\varphi(w,z_1,\dots,z_r)$. Define the formula
\begin{align*}
\theta(x,\alpha) :\Longleftrightarrow \exists z_1 \cdots \exists z_r \left(\bigwedge_{i=1}^{r} \psi_i(z_i,\alpha_i) \wedge \varphi(x,z_1,\dots,z_r) \wedge \exists^{\leq N}w\,\varphi(w,z_1,\dots,z_r)\right).
\end{align*}
The element $c$ satisfies $\theta(c,\alpha)$ by taking $z_i = d_i$ for each $i \in \{1,\dots,r\}$, because $\varphi(x,d)$ has at most $N$ realizations. The tuple $(z_1,\dots,z_r)$ has at most $\prod_{i=1}^{r} N_i$ possible values, since each formula $\psi_i(z_i,\alpha_i)$ has at most $N_i$ realizations. For each such tuple satisfying the final bounded-fibre condition, the set of possible $x$ has at most $N$ elements. Hence $\theta(x,\alpha)$ has at most $N\prod_{i=1}^{r}N_i$ realizations in $M$. Since $\alpha$ is a tuple from $A$ and $M \models \theta(c,\alpha)$, this witnesses $c \in \operatorname{acl}_M(A)$. Thus idempotence holds.
[/step]