From "A course in Universal Algebra" of Burris and Sankappanavar.
Given an algebra $A$ define, for every $X \subseteq A$:
$Sg(X) = \bigcap\{B : X \subseteq B \ and \ B \ is \ a \ subuniverse \ of \ A\}$
$E(X) = X \cup \{f(a_1,...,a_n) : f \ is\ a \ fundamental \ nary \ operation \ on \ A \ and \ a_1,...,a_n \in X\}$.
Then define $E^n(X)$ for $n \ge 0$ by:
$E^0(X) = X $
$E^{n+1}(X) = E(E^n(X))$.
It is possible to prove that:
$Sg(X) = X \cup E(X) \cup E^2(X) \cup ··· $
Question
I would like to know how the last sentence is shown.
To prove that $Sg(X)$ is a subset of $X\cup E(X)\cup\dots$, it suffices to prove that $B:=X\cup E(X)\cup\dots$ is a subuniverse of $A$ containing $X$ (because then this particular $B$ appears in the big intersection defining $Sg(X)$, so that $Sg(X)\subseteq B$).
So let us take an $n$-ary fundamental operation $f$ and $a_1,\dots,a_n\in B$. Since $E^k(X)\subseteq E^{k+1}(X)$ for all $k$, we have that $a_1,\dots,a_n$ all belong to the same $E^k(X)$ for some large enough $k$. Now we get by definition of $E$ that $f(a_1,\dots,a_n)\in E(E^k(X))= E^{k+1}(X)\subseteq B$. Therefore, $B$ is a subuniverse.