Constant function
Function  

x ↦ f (x)  
Examples by domain and codomain  


Classes/properties  
Constant · Identity · Linear · Polynomial · Rational · Algebraic · Analytic · Smooth · Continuous · Measurable · Injective · Surjective · Bijective  
Constructions  
Restriction · Composition · λ · Inverse  
Generalizations  
Partial · Multivalued · Implicit  
In mathematics, a constant function is a function whose (output) value is the same for every input value.^{[1]}^{[2]}^{[3]} For example, the function y(x) = 4 is a constant function because the value of y(x) is 4 regardless of the input value x (see image).
Basic properties
As a realvalued function of a realvalued argument, a constant function has the general form y(x) = c or just y = c.^{[4]}
 Example: The function y(x) = 2 or just y = 2 is the specific constant function where the output value is c = 2. 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 y(0) = 2, y(−2.7) = 2, y(π) = 2, and so on. No matter what value of x is input, the output is "2".
 Realworld example: A store where every item is sold for the price of 1 dollar.
The graph of the constant function y = c is a horizontal line in the plane that passes through the point (0, c).^{[5]}
In the context of a polynomial in one variable x, the nonzero constant function is a polynomial of degree 0 and its general form is f(x) = c where c is nonzero. This function has no intersection point with the xaxis, that is, it has no root (zero). On the other hand, the polynomial f(x) = 0 is the identically zero function. It is the (trivial) constant function and every x is a root. Its graph is the xaxis in the plane.^{[6]}
A constant function is an even function, i.e. the graph of a constant function is symmetric with respect to the yaxis.
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.^{[7]} This is often written: [math]\displaystyle{ (x \mapsto c)' = 0 }[/math]. The converse is also true. Namely, if y′(x) = 0 for all real numbers x, then y is a constant function.^{[8]}
 Example: Given the constant function [math]\displaystyle{ y(x) = \sqrt{2} }[/math]. The derivative of y is the identically zero function [math]\displaystyle{ y'(x) = \left(x \mapsto \sqrt{2}\right)' = 0 }[/math].
Other properties
For functions between preordered sets, constant functions are both orderpreserving and orderreversing; conversely, if f is both orderpreserving and orderreversing, 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 onepoint 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).^{[9]}
 For any nonempty Y, every set X is isomorphic to the set of constant functions in [math]\displaystyle{ Y \to X }[/math]. For any Y and each element x in X, there is a unique function [math]\displaystyle{ \tilde{x}: Y \to X }[/math] such that [math]\displaystyle{ \tilde{x}(y) = x }[/math] for all [math]\displaystyle{ y \in Y }[/math]. Conversely, if a function [math]\displaystyle{ f: Y \to X }[/math] satisfies [math]\displaystyle{ f(y) = f\left(y'\right) }[/math] for all [math]\displaystyle{ y, y' \in Y }[/math], [math]\displaystyle{ f }[/math] is by definition a constant function.
 As a corollary, the onepoint set is a generator in the category of sets.
 Every set [math]\displaystyle{ X }[/math] is canonically isomorphic to the function set [math]\displaystyle{ X^1 }[/math], or hom set [math]\displaystyle{ \operatorname{hom}(1,X) }[/math] in the category of sets, where 1 is the onepoint 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, [math]\displaystyle{ \operatorname{hom}(X \times Y, Z) \cong \operatorname{hom}(X(\operatorname{hom}(Y, Z)) }[/math]) the category of sets is a closed monoidal category with the Cartesian product of sets as tensor product and the onepoint set as tensor unit. In the isomorphisms [math]\displaystyle{ \lambda: 1 \times X \cong X \cong X \times 1: \rho }[/math] natural in X, the left and right unitors are the projections [math]\displaystyle{ p_1 }[/math] and [math]\displaystyle{ p_2 }[/math] the ordered pairs [math]\displaystyle{ (*, x) }[/math] and [math]\displaystyle{ (x, *) }[/math] respectively to the element [math]\displaystyle{ x }[/math], where [math]\displaystyle{ * }[/math] is the unique point in the onepoint set.
A function on a connected set is locally constant if and only if it is constant.
References
 ↑ Tanton, James (2005). Encyclopedia of Mathematics. Facts on File, New York. p. 94. ISBN 0816051240.
 ↑ C.Clapham, J.Nicholson (2009). "Oxford Concise Dictionary of Mathematics, Constant Function". AddisonWesley. p. 175. http://web.cortland.edu/matresearch/OxfordDictionaryMathematics.pdf.
 ↑ Weisstein, Eric (1999). CRC Concise Encyclopedia of Mathematics. CRC Press, London. p. 313. ISBN 0849396409.
 ↑ Weisstein, Eric W.. "Constant Function" (in en). https://mathworld.wolfram.com/ConstantFunction.html.
 ↑ Dawkins, Paul (2007). "College Algebra". Lamar University. p. 224. http://tutorial.math.lamar.edu/Classes/Alg/Alg.aspx.
 ↑ Carter, John A.; Cuevas, Gilbert J.; Holliday, Berchie; Marks, Daniel; McClure, Melissa S. (2005). "1". Advanced Mathematical Concepts  Precalculus with Applications, Student Edition (1 ed.). Glencoe/McGrawHill School Pub Co. p. 22. ISBN 9780078682278.
 ↑ Dawkins, Paul (2007). "Derivative Proofs". Lamar University. http://tutorial.math.lamar.edu/Classes/CalcI/DerivativeProofs.aspx.
 ↑ "Zero Derivative implies Constant Function". http://www.proofwiki.org/wiki/Zero_Derivative_implies_Constant_Function.
 ↑ Leinster, Tom (27 Jun 2011). "An informal introduction to topos theory". arXiv:1012.5647 [math.CT].
 Herrlich, Horst and Strecker, George E., Category Theory, Heldermann Verlag (2007).
External links
 Weisstein, Eric W.. "Constant Function". http://mathworld.wolfram.com/ConstantFunction.html.
 "Constant function". http://planetmath.org/?op=getobj&from=objects&id={{{id}}}.
Original source: https://en.wikipedia.org/wiki/Constant function.
Read more 