Let {X_n} be a sequence of real numbers that is bounded above by M and such that X_n-->x Prove that x<=M.

This is what I have, but I believe it is wrong:
Let M>0 then there exist N>=1 s.t. n>=N. then |x_n - x|<M. Since {x_n} is bounded above by the given {x_n} has a least upper bound(sup). Let x=Lub{x}. Then x-M<x. then for n>=N x-m<x_n<x. then -M<X+X_n then x_n+x<M

To prove that x ≤ M, we can start by assuming the contrary, i.e., assuming that x > M.

Since {X_n} is a sequence of real numbers bounded above by M, this means that for every n, we have X_n ≤ M.

Now, we are given that X_n → x, which means that for any ε > 0, there exists N ≥ 1 such that for all n ≥ N, we have |X_n - x| < ε.

Let's choose ε = x - M. Since x > M, ε is positive (ε > 0). Therefore, we can find an N such that for all n ≥ N, |X_n - x| < ε.

Now, let's consider the inequality |X_n - x| < ε:
-ε < X_n - x < ε

Since ε = x - M, we can substitute it into the inequality:
-(x - M) < X_n - x < x - M
-M < X_n - x < 0

Adding x to all sides of the inequality, we get:
x - M < X_n < x

We know that X_n ≤ M for every n, so X_n < x ≤ M. However, this contradicts our assumption that x > M.

Therefore, our assumption that x > M must be false. Therefore, x ≤ M.

Hence, we have proven that if {X_n} is a sequence of real numbers bounded above by M and X_n → x, then x ≤ M.