# Constant function

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Constant_function
> Markdown URL: https://mediated.wiki/source/Constant_function.md
> Source: https://en.wikipedia.org/wiki/Constant_function
> Source revision: 1350437448
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Type of mathematical function

Not to be confused with [function constant](/source/Function_constant).

Function x ↦ f (x) History of the function concept Types by domain and codomain X → 𝔹 𝔹 → X 𝔹n → X X → ℤ ℤ → X X → ℝ ℝ → X ℝn → X X → ℂ ℂ → X ℂn → X Classes/properties Constant Identity Linear Polynomial Rational Algebraic Analytic Smooth Continuous Measurable Injective Surjective Bijective Constructions Restriction Composition λ Inverse Generalizations Relation (Binary relation) Set-valued Multivalued Partial Implicit Space Higher-order Morphism Functor List of specific functions v t e

In [mathematics](/source/Mathematics), a **constant function** is a [function](/source/Function_(mathematics)) whose (output) value is the same for every input value.

## Basic properties

An example of a constant function is *y*(*x*) = 4, because the value of *y*(*x*) is 4 regardless of the input value x.

As a real-valued function of a real-valued argument, a constant function has the general form *y*(*x*) = *c* or just *y* = *c*. For example, the function *y*(*x*) = 4 is the specific constant function where the output value is *c* = 4. The [domain of this function](/source/Domain_of_a_function) is the set of all [real numbers](/source/Real_number). The [image](/source/Image_(mathematics)) of this function is the [singleton](/source/Singleton_(mathematics)) set {4}. 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) = 4, *y*(−2.7) = 4, *y*(π) = 4, and so on. No matter what value of *x* is input, the output is 4.[1]

The graph of the constant function *y* = *c* is a *horizontal line* in the [plane](/source/Plane_(geometry)) that passes through the point (0, *c*).[2] In the context of a [polynomial](/source/Polynomial) in one variable *x*, the constant function is called *non-zero constant function* because it 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 *x*-axis, meaning it has no [root (zero)](/source/Zero_of_a_function). 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 *x*-axis in the plane.[3] Its graph is symmetric with respect to the *y*-axis, and therefore a constant function is an [even function](/source/Even_and_odd_functions).[4]

In the context where it is defined, the [derivative](/source/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.[5] This is often written: ( x ↦ c ) ′ = 0 {\displaystyle (x\mapsto c)'=0} . The converse is also true. Namely, if *y*′(*x*) = 0 for all real numbers *x*, then *y* is a constant function.[6] For example, given the constant function y ( x ) = − 2 {\displaystyle y(x)=-{\sqrt {2}}} . The derivative of *y* is the identically zero function y ′ ( x ) = ( x ↦ − 2 ) ′ = 0 {\displaystyle y'(x)=\left(x\mapsto -{\sqrt {2}}\right)'=0} .

## Other properties

For functions between [preordered sets](/source/Preorder), constant functions are both [order-preserving](/source/Order-preserving) and [order-reversing](/source/Order-reversing); conversely, if *f* is both order-preserving and order-reversing, and if the [domain](/source/Domain_of_a_function) of *f* is a [lattice](/source/Lattice_(order)), then *f* must be constant.

- Every constant function whose [domain](/source/Domain_of_a_function) and [codomain](/source/Codomain) are the same set *X* is a [left zero](/source/Left_zero) of the [full transformation monoid](/source/Full_transformation_monoid) on *X*, which implies that it is also [idempotent](/source/Idempotent).

- It has zero [slope](/source/Slope) or [gradient](/source/Gradient).

- Every constant function between [topological spaces](/source/Topological_space) is [continuous](/source/Continuous_function_(topology)).

- A constant function factors through the [one-point set](/source/Singleton_(mathematics)), the [terminal object](/source/Terminal_object) in the [category of sets](/source/Category_of_sets). This observation is instrumental for [F. William Lawvere](/source/F._William_Lawvere)'s axiomatization of set theory, the [Elementary Theory of the Category of Sets](/source/Elementary_Theory_of_the_Category_of_Sets) (ETCS).[7]

- For any non-empty *X*, every set *Y* is [isomorphic](/source/Isomorphic) to the set of constant functions in X → Y {\displaystyle X\to Y} . For any *X* and each element *y* in *Y*, there is a unique function y ~ : X → Y {\displaystyle {\tilde {y}}:X\to Y} such that y ~ ( x ) = y {\displaystyle {\tilde {y}}(x)=y} for all x ∈ X {\displaystyle x\in X} . Conversely, if a function f : X → Y {\displaystyle f:X\to Y} satisfies f ( x ) = f ( x ′ ) {\displaystyle f(x)=f(x')} for all x , x ′ ∈ X {\displaystyle x,x'\in X} , f {\displaystyle f} is by definition a constant function. - As a corollary, the one-point set is a [generator](/source/Generator_(category_theory)) in the category of sets. - Every set X {\displaystyle X} is canonically isomorphic to the function set X 1 {\displaystyle X^{1}} , or [hom set](/source/Hom_set) hom ⁡ ( 1 , X ) {\displaystyle \operatorname {hom} (1,X)} 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, hom ⁡ ( X × Y , Z ) ≅ hom ⁡ ( X ( hom ⁡ ( Y , Z ) ) {\displaystyle \operatorname {hom} (X\times Y,Z)\cong \operatorname {hom} (X(\operatorname {hom} (Y,Z))} ) the category of sets is a [closed monoidal category](/source/Closed_monoidal_category) with the [Cartesian product](/source/Cartesian_product) of sets as tensor product and the one-point set as tensor unit. In the isomorphisms λ : 1 × X ≅ X ≅ X × 1 : ρ {\displaystyle \lambda :1\times X\cong X\cong X\times 1:\rho } [natural in *X*](/source/Natural_transformation), the left and right unitors are the projections p 1 {\displaystyle p_{1}} and p 2 {\displaystyle p_{2}} the [ordered pairs](/source/Ordered_pair) ( ∗ , x ) {\displaystyle (*,x)} and ( x , ∗ ) {\displaystyle (x,*)} respectively to the element x {\displaystyle x} , where ∗ {\displaystyle *} is the unique [point](/source/Point_(mathematics)) in the one-point set.

A function on a [connected set](/source/Connected_set) is [locally constant](/source/Locally_constant) if and only if it is constant.

## References

1. **[^](#cite_ref-1)** Tanton, James (2005). [*Encyclopedia of Mathematics*](https://archive.org/details/encyclopedia-of-mathematics_202206/page/94/mode/1up?view=theater). Facts on File, New York. p. 94. [ISBN](/source/ISBN_(identifier)) [0-8160-5124-0](https://en.wikipedia.org/wiki/Special:BookSources/0-8160-5124-0).

1. **[^](#cite_ref-2)** Dawkins, Paul (2007). ["College Algebra"](http://tutorial.math.lamar.edu/Classes/Alg/Alg.aspx). Lamar University. p. 224. Retrieved January 12, 2014.

1. **[^](#cite_ref-3)** Carter, John A.; Cuevas, Gilbert J.; Holliday, Berchie; Marks, Daniel; McClure, Melissa S. (2005). "1". *Advanced Mathematical Concepts - Pre-calculus with Applications, Student Edition* (1 ed.). Glencoe/McGraw-Hill School Pub Co. p. 22. [ISBN](/source/ISBN_(identifier)) [978-0078682278](https://en.wikipedia.org/wiki/Special:BookSources/978-0078682278).

1. **[^](#cite_ref-4)** [Young, Cynthia Y.](/source/Cynthia_Y._Young) (2021). [*Precalculus*](https://books.google.com/books?id=BOBDEAAAQBAJ&pg=PA122) (3rd ed.). John Wiley & Sons. p. 122. [ISBN](/source/ISBN_(identifier)) [978-1-119-58294-6](https://en.wikipedia.org/wiki/Special:BookSources/978-1-119-58294-6).

1. **[^](#cite_ref-5)** Varberg, Dale E.; Purcell, Edwin J.; Rigdon, Steven E. (2007). *Calculus* (9th ed.). [Pearson Prentice Hall](/source/Pearson_Prentice_Hall). p. 107. [ISBN](/source/ISBN_(identifier)) [978-0131469686](https://en.wikipedia.org/wiki/Special:BookSources/978-0131469686).

1. **[^](#cite_ref-6)** ["Zero Derivative implies Constant Function"](https://www.proofwiki.org/wiki/Zero_Derivative_implies_Constant_Function). Retrieved January 12, 2014.

1. **[^](#cite_ref-7)** [Leinster, Tom](/source/Tom_Leinster) (27 Jun 2011). "An informal introduction to topos theory". [arXiv](/source/ArXiv_(identifier)):[1012.5647](https://arxiv.org/abs/1012.5647) [[math.CT](https://arxiv.org/archive/math.CT)].

- Herrlich, Horst and Strecker, George E., *Category Theory*, Heldermann Verlag (2007).

## External links

Wikimedia Commons has media related to [Constant functions](https://commons.wikimedia.org/wiki/Category:Constant_functions).

- [Weisstein, Eric W.](/source/Eric_W._Weisstein) ["Constant Function"](https://mathworld.wolfram.com/ConstantFunction.html). *[MathWorld](/source/MathWorld)*.

- ["Constant function"](https://planetmath.org/ConstantFunction). *[PlanetMath](/source/PlanetMath)*.

v t e Polynomials and polynomial functions and polynomial equations By degree Zero polynomial (degree undefined or −1 or −∞) Constant function (0) Linear function (1) Linear equation Quadratic function (2) Quadratic equation Cubic function (3) Cubic equation Quartic function (4) Quartic equation Quintic function (5) Sextic equation (6) Septic equation (7) By properties Univariate Bivariate Multivariate Monomial Binomial Trinomial Irreducible Square-free Homogeneous Quasi-homogeneous Tools and algorithms Factorization Greatest common divisor Division Horner's method of evaluation Polynomial identity testing Resultant Discriminant Gröbner basis

v t e Function History List of specific functions Types by domain, codomain X → 𝔹 𝔹 → X 𝔹ⁿ → 𝔹 X → ℤ ℤ → X X → ℝ ℝ → X ℝⁿ → X X → ℂ ℂ → X ℂⁿ → X Classes, properties Constant Identity Linear Polynomial Rational Algebraic Analytic Smooth Continuous Measurable Injective Surjective Bijective Constructions Restriction Composition λ Inverse Generalizations Relation (Binary relation) Set-valued Multivalued Partial Implicit Space Higher-order Morphism Functor Category

---
Adapted from the Wikipedia article [Constant function](https://en.wikipedia.org/wiki/Constant_function) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Constant_function?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
