Constant function

Constant function
In mathematics, a constant function is a function whose (output) value is the same for every input value. For example, the function is a constant function because the value of is 4 regardless of the input value (see image).
Basic properties
As a real-valued function of a real-valued argument, a constant function has the general form or just
Example: The function or just is the specific constant function where the output value is The domain of this function is the set of all real numbers R. The codomain of this function is just {2}. The independent variable x does not appear on the right side of the function expression and so its value is "vacuously substituted". Namely and so on. No matter what value of x is input, the output is "2".
Real-world example: A store where every item is sold for the price of 1 dollar.
The graph of the constant function is a horizontal line in the plane that passes through the point
In the context of a polynomial in one variable x, the non-zero constant function is a polynomial of degree 0 and its general form is where is nonzero. This function has no intersection point with the x-axis, that is, it has no root (zero). On the other hand, the polynomial is the identically zero function. It is the (trivial) constant function and every x is a root. Its graph is the x-axis in the plane.
A constant function is an even function, i.e. the graph of a constant function is symmetric with respect to the y-axis.
In the context where it is defined, the derivative of a function is a measure of the rate of change of function values with respect to change in input values. Because a constant function does not change, its derivative is 0. This is often written: . The converse is also true. Namely, if for all real numbers x, then y is a constant function.
Example: Given the constant function The derivative of y is the identically zero function
Other properties
For functions between preordered sets, constant functions are both order-preserving and order-reversing; conversely, if f is both order-preserving and order-reversing, and if the domain of f is a lattice, then f must be constant.
Every constant function whose domain and codomain are the same set X is a left zero of the full transformation monoid on X, which implies that it is also idempotent.
It has zero slope/gradient.
Every constant function between topological spaces is continuous.
A constant function factors through the one-point set, the terminal object in the category of sets. This observation is instrumental for F. William Lawvere's axiomatization of set theory, the Elementary Theory of the Category of Sets (ETCS).
For any non-empty Y, every set X is isomorphic to the set of constant functions in . For any Y and each element x in X, there is a unique function such that for all . Conversely, if a function satisfies for all , is by definition a constant function.
As a corollary, the one-point set is a generator in the category of sets.
Every set is canonically isomorphic to the function set , or hom set in the category of sets, where 1 is the one-point set. Because of this, and the adjunction between Cartesian products and hom in the category of sets (so there is a canonical isomorphism between functions of two variables and functions of one variable valued in functions of another (single) variable) the category of sets is a closed monoidal category with the Cartesian product of sets as tensor product and the one-point set as tensor unit. In the isomorphisms natural in X, the left and right unitors are the projections and the ordered pairs and respectively to the element , where is the unique point in the one-point set.
A function on a connected set is locally constant if and only if it is constant.
References
Herrlich, Horst and Strecker, George E., Category Theory, Heldermann Verlag (2007).
External links
Elementary mathematics
Elementary special functions
Polynomial functions