Proof of Lemma 8.5.14 in Terence Tao Analysis I
Here I provide a solution to Exercise 8.5.13, i.e, prove that at least one of $Y\backslash Y^\prime$ and $Y^\prime \backslash Y$ is empty, which I hope would help you to understand your question.
Proof. Let $P(m)$ is true iff we have
$$
\{y \in Y: y \leq m\}=\{y \in Y^\prime: y \leq m\ \}=\{y \in Y \cap Y^\prime: y \leq m\ \}
$$ Now we prove that $P(m)$ is true for all $m \in Y \cap Y^\prime$ using strong induction. Suppose for induction that, for some $n \in Y \cap Y^\prime$, $P(m)$ is true for all $m \in \{y \in Y \cap Y^\prime: y < n \}$. Now we prove that $P(n)$ is true, which is equivalent to
$$
\{y \in Y: y < n\}=\{y \in Y^\prime: y < n \}
$$
Supoose for contradiction that there exists at least one element in $\{y \in Y: y < n\}$ which is not contained in $\{y \in Y^\prime: y < n \}$. Write $Y_n := \{y \in Y: y<n \}$, and $Y^\prime_n := \{y \in Y^\prime: y<n \}$. Then the set $\{y \in Y_n:y \notin Y^\prime_n \}$ is non-empty and well-ordered, so write $y_0:= \min(\{y \in Y_n:y \notin Y^\prime_n \})$. Then we have
$$
\{y \in Y: y < y_0\}=\{y \in Y \cap Y^\prime: y < y_0 \}
$$which implies that
$$s(\{y \in Y \cap Y^\prime: y < y_0 \}) = s(\{y \in Y: y < y_0\}) = y_0$$
Then we prove that $m < y_0$ for all $m \in \{ y \in Y \cap Y^\prime : y < n\}$, which would imply that $\{y \in Y \cap Y^\prime: y < y_0 \}=\{y \in Y \cap Y^\prime: y < n \}$. For sake of contradiction, supoose that there exists a $m_0 \in \{ y \in Y \cap Y^\prime : y < n\}$ such that $y_0 < m_0$. Since $m_0 < n$, by our inductive hypothesis we have $P(m_0)$ is true, i.e.,
$$\{y \in Y: y < m_0\}=\{y \in Y \cap Y^\prime: y < m_0 \}$$but obviously, $y_0 \in \{y \in Y: y < m_0\}$, $y_0 \notin \{y \in Y \cap Y^\prime: y < m_0 \}$, a contradiction. Hence we have $m < y_0$ for all $m \in \{ y \in Y \cap Y^\prime : y < n\}$. So for every $m \in \{y \in Y \cap Y^\prime: y < n \}$, we have $m \in \{y \in Y \cap Y^\prime: y < y_0 \}$, thus
$$\{y \in Y \cap Y^\prime: y < n \} \subseteq \{y \in Y \cap Y^\prime: y < y_0 \}$$ Since $y_0 < n$, we have
$$\{y \in Y \cap Y^\prime: y < y_0 \} \subseteq \{y \in Y \cap Y^\prime: y < n \} $$Hence,
$$\{y \in Y \cap Y^\prime: y < y_0 \} = \{y \in Y \cap Y^\prime: y < n \} $$Then we have
$$s(\{y \in Y \cap Y^\prime: y < n \}) = s(\{y \in Y \cap Y^\prime: y < y_0 \}) = y_0 $$
Similarly, $y_{0}'=\min\{y\in Y^\prime_n:y\notin Y_n\}$ and
$$s(\{y \in Y \cap Y^\prime: y < n \})=y_0' $$
Hence $y_0=y_0'$, a contradiction. Thus $Y_n \subseteq Y^\prime_n$ and $Y^\prime_n \subseteq Y_n $. Hence, we have $Y^\prime_n = Y_n $. This closes induction.
Finally we prove that at least one of $Y\backslash Y^\prime$ and $Y^\prime \backslash Y$ is empty. Suppose for contradiction that these two sets are both non-empty, write $y_1 = \min(Y\backslash Y^\prime)$ and $y_2 = \min(Y^\prime\backslash Y )$.
we have $\{y \in Y: y < y_1 \} = Y \cap Y^\prime$: If $w\in Y\cap Y' $ and $y_1\le w$, then $P(w)$ is true, which implies that $y_1\in Y\cap Y'$, a contradiction. If $y\in Y$ and $y<y_1$, then $y\in Y\cap Y'$.
Thus $$s(Y \cap Y^\prime)=s(\{y \in Y: y < y_1 \}) = y_1$$ Similarly, we can show that $$s(Y \cap Y^\prime)=s(\{y \in Y^\prime: y < y_2 \}) = y_2$$So we have $y_1 = y_2$. But since $Y\backslash Y^\prime$ and $Y\backslash Y^\prime$ are disjoint, we have $y_1 \neq y_2$, a contradiction. Hence at least one of $Y\backslash Y^\prime$ and $Y^\prime \backslash Y$ is empty.