Union of Initial Segments is Initial Segment or All of Woset/Proof 2

Proof
Suppose the hypotheses of the theorem hold.

For every $x \in A$, we have $S_x \subseteq X$ by the definition of initial segment.

By Union of Subsets is Subset: Family of Sets, we have $J \subseteq X$.

Consider $X \setminus J$.

If $X \setminus J$ is empty, then $X \subseteq J$ by Set Difference with Superset is Empty Set, and hence $J = X$ by Subset Relation is Antisymmetric, so the theorem is satisfied.

So assume $X \setminus J$ is non-empty.

By Subset of Well-Ordered Set is Well-Ordered, $X \setminus J$ is itself well-ordered.

Thus $X \setminus J$ has a smallest element; call it $a$.

We will show that $J = S_a$, thus showing the veracity of the theorem.

We need to show that $J = \left\{{b \in S: b \prec a}\right\}$, which by Axiom of Extension is equivalent to the claim that $z \in J \iff z \prec a$ for every $z \in X$.

For the forward direction, suppose $z \in J$. We need to show that $z \prec a$.

By definition of union, there is $x \in A$ such that $z \in S_x$, that is $z \prec x$.

$a \preceq z$.

Then $a \prec x$, so $a \in S_x$ by the definition of initial segment

Hence $a \in J$ by definition of union.

This contradicts the fact that $a \in X \setminus J$.

Thus $z \prec a$.

For the backward direction, suppose $z \prec a$ where $z \in X$. We need to show that $z \in J$

$z \notin J$.

Then $z \in X \setminus J$.

Hence $a \preceq z$ by definition of smallest element.

This contradicts the fact that $z \prec a$.

Thus $z \in J$.

Since $z$ was arbitrary, we conclude that $J = S_a$ as required.