Correct.

]]>In your formula defining local constancy, if you replace the parameter $k$ by $f(x)$, then you do not need the parameter $k$.

In your definition of $X_\gt$, you mean $f(u) \lt f(v)$?

To show closedness in $I$, you also assume that the limit point $x$ belongs to $I$ (which you seem to without saying it).

Otherwise, your argument for the first exercise is correct.

For the next exercise, wouldn’t the left endpoint of this first interval have $a_0 = a$ as left endpoint? Here is how I would say this: by the Monotonicity Theorem, there exists $a_1 > a$ such that the restriction of $f$ to the interval $(a,a_1)$ is strictly monotone. Now describe $\lim_{t \to a^+} f(t)$ depending on the three possible cases of monotonicity of this restriction of $f$.

]]>Since $f$ is definable there exists a formula $\phi$ defining the graph of $f$. We note that the set of $x\in I$ for which there is a neighborhood about $x$ where $f$ is constant is definable (with parameters) via the formula $$\exists y\phi(x,y)\wedge\exists s\exists t(s<x<t\wedge\forall z(s<z<t\to f(z)=k)),$$ where $k$ is some constant in $M$. The set of $x$ for which there is a neighborhood about $x$ where $f$ is strictly increasing is also definable is also definable via the formula $$\exists y\phi(x,y)\wedge\exists s\exists t(s<x<t\wedge\forall u\forall v(s<u<v<t\to f(u)$, and $X_<$. We will show that each is open and closed. To show openness, take $x\in X_=$. Then there is a neighborhood $U$ about $x$ on which $f$ is constant. But then for any $y\in U$ there is a neighborhood around $y$ for which $f$ is constant, namely $U$ itself, and so $X_=$ is open. To show closedness let $x$ be a limit point of $X_=$. By the fact that $f$ is strictly monotone at every $y\in I$, we have that there exists an interval $I$ about $x$ on which $f$ is strictly monotone. Since $x$ is a limit point of $X_=$, this interval $I$ contains a point $y\in X_=$. But then, it must be that $f$ is constant on $I$, since $I$ has constant monotonicity and contains at least part of a region, where $f$ is constant. Showing openness and closedness for $X_$ is identical to the above. Since every interval is definably connected, it follows that each of $X_=$, $X_$ must be empty or all of $I$. The result follows.

For the exercises at the end, I think you can claim that $\lim\limits_{x\to a^+}$ is $\text{inf}(f((a_0,a_1)))$, where $(a_0,a_1) $ is the first interval on which $f$ is strictly monotone and continuous (obtained via monotonicity theorem), assuming $f$ is increasing on that interval. Taking an arbitrary neighborhood around $\text{inf}(f((a_0,a_1)))$ we get that the intersection is some sub-interval of $f((a_0,a_1))$. Since $f$ is continuous the pre-image is open and contains a neighborhood which has $a$ as a limit point… I’m not too sure how to formalize this, but it seems to work.

]]>Should say $X_(f)$ in the second paragraph with $*\in\{,=\}$

]]>Suppose $f$ is strictly increasing, and let $(x,y)\in\Delta(I)$. Then $x<y$, such that since $f$ is strictly increasing, $f(x)<f(y)$, and we have $(x,y)\in X_<(f)$ as desired. To show the converse, suppose $\Delta(I)\subseteq X_<(f)$, and let $x<y$. Then $(x,y)\in\Delta(I)\subseteq X_<(f)$, such that $(x,y)\in X_<(f)$, and so $f(x)<f(y)$ whenever $x<y$ as desired.

This was fairly straightforward. From the next post we can easily see the claim at the end is proven via the ordered Ramsey theorem. I think the point is to let the $S_1,S_2,…,S_k\subseteq M^2$ be the sets $X_(f)$ and $X_=(f)$, since at least one of these is true in a dense linear order. These sets are also clearly definable. It follows by the ordered Ramsey theorem that there exists $J\subseteq I$ with $\bigvee\limits_{*\in\{,=\}}J\subseteq X_*(f)$, as desired thereby proving the monotonicity lemma.

]]>