Locally constant implies constant
ProvedMonotonicity_Theorem.locally_constant_implies_constantLet be an o-minimal structure over a dense linear order without endpoints, let be a definable function of one variable, and let be such that the open interval is contained in the domain .
Claim. If every point of has an open neighbourhood on which is constant, then is constant on :
This is the passage from local to global constancy. Over a general dense linear order it is not a consequence of the local hypothesis alone, since there is no completeness available; it holds because the level set is definable, and a nonempty definable subset of an interval which is open and relatively closed is the whole interval. The hypothesis cannot be dropped: for a domain consisting of isolated points, can be locally constant at every point and still take different values.
import Definitions.Def_Monotonicity_Theorem_Window_Loci
theorem Monotonicity_Theorem.locally_constant_implies_constant {R : Type} (D : DenseLinearOrderNoEndpoints R)
(M : OMinimalStructure D) {I B : Set (Power R 1)} (f : DefinableFunction M I B)
(u v : R) (huv : D.lt u v)
(hsub : (openInterval D (Endpoint.finite u) (Endpoint.finite v)).Subset I)
(hloc : (openInterval D (Endpoint.finite u) (Endpoint.finite v)).Subset (ConstWindowLocus f)) :
ConstOnInterval f u v := by sorry