I see in a book on Type Theory the following definition of a subterm of a $λ$-term:
We call $L$ a subterm of $M$ if $L ∈ \mathrm{Sub}(M)$.
$\mathrm{Sub}(x) = \{x\}$, for each $x ∈ V. (V$ is the set of variables.)
$\mathrm{Sub}(MN) = \mathrm{Sub}(M) ∪ \mathrm{Sub}(N) ∪ {MN}$.
$\mathrm{Sub}(λx.M) = \mathrm{Sub}(M) ∪ {λx.M}$.
Well... it is as follows:
From the above definition, the properties below follow.
(Reflexivity) For all $λ$-terms $M$, we have $M ∈ \mathrm{Sub}(M)$.
(Transitivity) If $L ∈ \mathrm{Sub}(M)$ and $M ∈ \mathrm{Sub}(N)$, then $L ∈ \mathrm{Sub}(N)$.
Reflexivity is clear by definition, I think.
My question is how to prove transitivity.
I ask for help.
By induction on $N$, let us show that $\forall M\in\mathrm{Sub}(N)$, $\forall L\in\mathrm{Sub}(M)$, $L \in\mathrm{Sub}(N)$:
In the first case the result is immediate again: $L \in \mathrm{Sub}(M) = \mathrm{Sub}(N)$.
In the second case, by induction you have $L \in \mathrm{Sub}(N') \subset \mathrm{Sub}(N)$.
If it is not clear, please ask for details in the comments! :-)