Let $E/F$ be an extension, $S=\{a_1,\ldots,a_n\}\subseteq E$ algebraically independent over $F$ and $S\subseteq T$, $T$ a subset of $E$, that spans $E$ algebraically over $F$.

I want to show that there exists a set $B$ between $S$ and $T$, that is a trancendental basis of $E/F$, as follows:

Let $T\setminus S=\{\beta_1,\ldots ,\beta_m\}$.

If $T=\varnothing$, then $B=S$ is the trancendental basis.

Otherwise, we define $S_0=S$ and for $i=1,\ldots ,m$

$S_i=\left\{\begin{matrix} S_{i-1} & \text{ if } \beta_i \text{ is algebraic } /F(S_{i-1})\\ S_{i-1}\cup \{\beta_i\} & \text{ if } \beta_i \text{ is not algebraic } /F(S_{i-1}) \end{matrix}\right.$

I want to show that that $B=S_m$ is the trancendental basis of $E/F$.

$$$$

I have shown that $S_m$ is $F$-algebraically independent.

So, it is left to show that $S_m$ spans algebraically $E$ over $F$. Could you give me some hints how we could show that?

$$$$

**EDIT**:

To show that $S_m$ spans algebraically $E$ over $F$, we have to show that $E/F(S_m)$ is algebraic, right?

We have that the extension $E/F(T)$ is algebraic.

It holds that $S_m\subseteq T$, or not?

Do we know if $F(S_m)\leq F(T)$ or $F(T)\leq F(S_m)$ ?