Closure of a function "Let $f: A \rightarrow A$ and let $X \subseteq A$. Then, in a ‘top down’ version, the closure f[X] of X under f is the least subset of A that includes X and also includes f(Y) whenever it includes Y. Be careful: the word ‘includes’ here means ‘is a superset of’ and not ‘contains as an element’. Equivalently, in a ‘bottom up’ or recursive form, we may deﬁne $A_0$ = X and $A_{n+1}$ = $A_n$$\cup$$f$($A_n$) for each natural number n, and put $f[X] = \cup \{A_n: n \in N\}$."
What does it mean by the "least" subset of A and where did f(Y) come from. Why is the function of set Y mentioned? Also I don't understand the recursive form notation. Can someone please explain it to me in a very simple way. Thank you for your time.     
 A: As an example, suppose $A=\{1,2,3,4,5,6,7\}$ and $f$ is defined by
$$
  f(1)=2,\,f(2)=3,\,f(3)=4,\,f(4)=5,\,f(5)=6,\,f(6)=4,\,f(7)=2.
$$
Suppose $X=\{3\}$. To compute $f[X]$, we start with $X$ and keep adding elements obtained by applying $f$ to the ones we have:
$$\begin{eqnarray*}
  A_0&=&\{3\},\\
  A_1&=&\{3,4\}\text{ since }f(3)=4,\\
  A_2&=&\{3,4,5\}\text{ since }f(4)=5,\\
  A_3&=&\{3,4,5,6\}\text{ since }f(5)=6,\\
  A_4&=&\{3,4,5,6\}\text{ since }f(6)=4\\
  &\vdots&
\end{eqnarray*}$$
From this point we won't get any additional elements, so $f[X]=\{3,4,5,6\}$. This is the recursive form.
The 'top down' version says that $f[X]$ has these three properties:


*

*$f[X]$ contains $X$

*If $f[X]$ contains $Y$ then $f[X]$ contains $f(Y)$

*$f[X]$ is the smallest set satisfying 1 and 2.


Note that property 2 asserts something for every subset $Y$ of $f[X]$. We can look at the properties for the example. For property 1,
$$
  f[X]=\{3,4,5,6\}\supseteq\{3\}=X.
$$
To verify property 2 we should check for every subset $Y$ of $f[X]$, but I'll just do a couple. If $Y=\{4,5\}$ then $f(Y)=\{5,6\}\subseteq f[X]$. If $Y=\{3,6\}$ then $f(Y)=\{4\}\subseteq f[X]$. Note that property 2 doesn't apply to $Y=\{1\}$, for example, because this isn't a subset of $f[X]$.
The set $\{2,3,4,5,6\}$ also satisfies properties 1 and 2, but $\{3,4,5,6\}$ is smaller. In fact $\{3,4,5,6\}$ is the smallest set satisfying properties 1 and 2, and this is property 3.

There are a couple of caveats when $A$ is infinite.
Firstly in the recursive form, we may keep getting new elements indefinitely, and $f[X]$ contains all of them.
Secondly it's not enough to look at the number of elements in the set to determine "smaller" or "least" in property 3 for infinite sets. Instead these words should be interpreted in terms of strict subsets.

One more note, actually property 2 could be replaced by a simpler condition


*$f[X]$ contains $f(f[X])$

