{{Short description|Subset of a function's codomain}} {{For|the statistical concept|Range (statistics)}}[[File:Codomain2.SVG|thumb|<math>f</math> is a function from domain '''''X''''' to codomain '''''Y'''''. The yellow oval inside '''''Y''''' is the image of <math>f</math>. Sometimes "range" refers to the image and sometimes to the codomain.]]
In mathematics, the '''range of a function''' may refer either to the codomain of the function, or the image of the function. In some cases the codomain and the image of a function are the same set; such a function is called ''surjective'' or ''onto''. For any non-surjective function <math>f: X \to Y,</math> the codomain <math>Y</math> and the image <math>\tilde Y</math> are different; however, a new function can be defined with the original function's image as its codomain, <math>\tilde{f}: X \to \tilde{Y}</math> where <math>\tilde{f}(x) = f(x).</math> This new function is surjective.
==Definitions== Given two sets {{mvar|X}} and {{mvar|Y}}, a binary relation {{mvar|f}} between {{mvar|X}} and {{mvar|Y}} is a function (from {{mvar|X}} to {{mvar|Y}}) if for every element {{mvar|x}} in {{mvar|X}} there is exactly one {{mvar|y}} in {{mvar|Y}} such that {{mvar|f}} relates {{mvar|x}} to {{mvar|y}}. The sets {{mvar|X}} and {{mvar|Y}} are called the ''domain'' and ''codomain'' of {{mvar|f}}, respectively. The ''image'' of the function {{mvar|f}} is the subset of {{mvar|Y}} consisting of only those elements {{mvar|y}} of {{mvar|Y}} such that there is at least one {{mvar|x}} in {{mvar|X}} with {{math|1=''f''(''x'') = ''y''}}.
==Usage== As the term "range" can have different meanings, it is considered a good practice to define it the first time it is used in a textbook or article. Older{{Until when|date=May 2026}} books, when they use the word "range", tend to use it to mean what is now called the codomain.{{sfnm|1a1=Hungerford|1y=1974|1p=3|2a1=Childs|2y=2009|2p=140}}{{Synthesis inline|date=May 2026|sure=yes|reason=Of the two sources mentioned, Hungerford does indeed treat range and codomain as synonyms, but Childs doesn't address the term "codomain" or comment on this at all. Neither explicitly mention that "older textbooks use a different definition," so it's textbook WP:SYNTH (no pun intended)}} More modern books, if they use the word "range" at all, generally use it to mean what is now called the image.{{sfn|Dummit|Foote|2004|p=2}} To avoid any confusion, a number of modern books don't use the word "range" at all.{{sfn|Rudin|1991|p=99}}
==Elaboration and example== Given a function
<math display="block">f \colon X \to Y</math>
with domain <math>X</math>, the range of <math>f</math>, sometimes denoted <math>\operatorname{ran}(f)</math> or <math>\operatorname{Range}(f)</math>,<ref>{{Cite web|last=Weisstein|first=Eric W.|title=Range|url=https://mathworld.wolfram.com/Range.html|access-date=2020-08-28|website=mathworld.wolfram.com|language=en}}</ref> may refer to the codomain or target set <math>Y</math> (i.e., the set into which all of the output of <math>f</math> is constrained to fall), or to <math>f(X)</math>, the image of the domain of <math>f</math> under <math>f</math> (i.e., the subset of <math>Y</math> consisting of all actual outputs of <math>f</math>). The image of a function is always a subset of the codomain of the function.<ref>{{Cite web|last=Nykamp|first=Duane|date=|title=Range definition|url=https://mathinsight.org/definition/range|archive-url=|archive-date=|access-date=August 28, 2020|website=Math Insight}}</ref>
As an example of the two different usages, consider the function <math>f(x) = x^2</math> as it is used in real analysis (that is, as a function that inputs a real number and outputs its square). In this case, its codomain is the set of real numbers <math>\mathbb{R}</math>, but its image is the set of non-negative real numbers <math>\mathbb{R}^+</math>, since <math>x^2</math> is never negative if <math>x</math> is real. For this function, if we use "range" to mean ''codomain'', it refers to <math>\mathbb{{\displaystyle \mathbb {R} ^{}}}</math>; if we use "range" to mean ''image'', it refers to <math>\mathbb{R}^+</math>.
For some functions, the image and the codomain coincide; these functions are called ''surjective'' or ''onto''. For example, consider the function <math>f(x) = 2x,</math> which inputs a real number and outputs its double. For this function, both the codomain and the image are the set of all real numbers, so the word ''range'' is unambiguous.
Even in cases where the image and codomain of a function are different, a new function can be uniquely defined with its codomain as the image of the original function. For example, as a function from the integers to the integers, the doubling function <math>f(n) = 2n</math> is not surjective because only the even integers are part of the image. However, a new function <math>\tilde{f}(n) = 2n</math> whose domain is the integers and whose codomain is the even integers ''is'' surjective. For <math>\tilde{f},</math> the word ''range'' is unambiguous.
==See also== * Bijection, injection and surjection * Essential range
==Notes and references==
{{Reflist}}
==Bibliography==
*{{Cite book | first = Lindsay N. | last = Childs | editor-first1 = Lindsay N. | editor-last1 = Childs | title = A Concrete Introduction to Higher Algebra | series = Undergraduate Texts in Mathematics | edition = 3rd | publisher = Springer | year = 2009 | isbn = 978-0-387-74527-5 | oclc = 173498962 | doi = 10.1007/978-0-387-74725-5 }} *{{Cite book | first1 = David S. | last1 = Dummit | first2 = Richard M. | last2 = Foote | title = Abstract Algebra | edition = 3rd | publisher = Wiley | year = 2004 | isbn = 978-0-471-43334-7 | oclc = 52559229 }} *{{Cite book | first = Thomas W. | last = Hungerford | author-link = Thomas W. Hungerford | title = Algebra | publisher = Springer | series = Graduate Texts in Mathematics | volume = 73 | year = 1974 | isbn = 0-387-90518-9 | oclc = 703268 | doi = 10.1007/978-1-4612-6101-8 }} *{{Cite book | first = Walter | last = Rudin | title = Functional Analysis | edition = 2nd | publisher = McGraw Hill | year = 1991 | isbn = 0-07-054236-8 | url-access = registration | url = https://archive.org/details/functionalanalys00rudi }}
{{Mathematical logic}}
{{DEFAULTSORT:Range (Mathematics)}} Category:Functions and mappings Category:Basic concepts in set theory