# If there is a need to distinguish between 'image' and 'codomain', why not do this on the input side of a fucntion?

I see lots of reasons provided for distinguishing between codomain and image. But it seems to me I can take all those reasons and make them into reasons for making a similar distinction on the input side (e.g. to discriminate between a 'domain of discourse' and 'domain of definition'). For example, here are some quotes from a discussion on the need to distinguish between 'image' and 'codomain' Why is it important to have a discrepancy between image and codomain? :

for many functions it's not particularly important what its image is, while at the same time it would be tricky to figure this out. The codomain however is easy, it describes the type of value one can get. Is it a real number, a complex number, a fraction?

For some functions, the same is true for the input side. That is, when dealing with a function I want to describe the type of input values (real numbers, or complex numbers, or?) that I would like that function to deal with, but the function may be a really hairy function for which its actual domain is tricky (if not impossible, if I define some function over Turing-machines and have their halting behavior be an essential aspect as to whether the output value is defined) to figure out.

Codomain and Image of a function are two completely different concepts. The codomain of a function often has a structure, like being a topological space or something like this. It will be very inconvenient to put all that structure in the image, which is only a set, and often not such a nice one.

Again, I think the same could be said on the input side ... for some functions it will be very inconvenient to describe its domain, as it's not a nice one, and as it's just a set, rather than a structure. I would like two similar concepts on the input side as well.

You cannot speak about surjectivity (that is, whether it is onto) otherwise. If we would define the codomain of every function to be its image, then every function would be surjective.

I can likewise say: "You cannot speak of totality if you don't distinguish between 'domain of discourse' and 'domain of definition'. If we would define the 'domain of discourse' to be its 'domain of definition', then every function would be total."

What is a function? Informally, it is a process, or an assignment, from an input set to an output set. It is not just the process or assignment that forms a function, but specifying the input and output is part of what it is.

Right ... so that would suggest we define a 'domain of discourse' before we figure out for which values the function is actually defined.

I need to define a co-domain before the image makes sense.

Same for the input: if you give me something like $f(x) = 1/x$, I would first need to know the domain of discourse (real numbers? Complex numbers?) before I can figure out its actual domain of definition.

Finally, if it is so important for functions to have a codomain in addition to an image, why is it that when I take the inverse of a function (assuming it has one), its codomain will always be the same as its image, namely the domain of the original function? It seems to me that if you do make a distinction between 'domain of discourse' and 'domain of definition', then right there you have your 'codomain' and 'image' of the inverse that actually can be different and serve their respective purposes for the inverse.

So, my question is this: why then don't we typically make a similar discrepancy on the input as we do on the output? (and yes, I believe some mathematical texts do make this distinction, but my question is why don't we typically make this distinction?) Why don't we have two terms on the input side that are the conceptual counterparts of 'co-domain' vs 'image' on the output side? Is this mere historical 'accident' and mostly a matter of 'well, we've always done things this way', or are there actual good practical reasons for this?

• We consider functions restricted to subsets all the time. In topology we are often concerned with extending maps from subsets to the whole set. Is that the kind of thing you are asking? – Joe Johnson 126 Oct 17 '16 at 13:21
• "Partial function" is a term sometimes used to capture exactly what you are talking about. And there are terms for the domain versus domain of definition for a given partial function. – Hugh Denoncourt Oct 17 '16 at 13:37
• @JoeJohnson126 I realize that we sometimes do make the distinction. But my question iss why we don't typically make this distinction. For example, any high school discussion of functions mentions domain, image, and codomain ... and that's it. But it would make sense to distinguish between the two different conceptual notions of domain analogous to how we separate between image and codomain. For example, when asked to graph a function, the 'domain of discourse' or 'maximal domain' would tell students what the axes should be like, after which they can worry about actual input and output. – Bram28 Oct 17 '16 at 13:54
• @HughDenoncourt Correct ... but why is the idea that functions can be total or partial just as common as the idea that functions can be surjective or non-surjective? Why are functions typically assumed to be total? – Bram28 Oct 17 '16 at 13:57
• What are you asking is "standard" in e.g. Computability theory : "a partial function from X to Y is a function $f : X' \to Y$, for some subset $X'$ of $X$. It generalizes the concept of a function $f : X \to Y$ by not forcing $f$ to map every element of $X$ to an element of $Y$. If $X' = X$, then $f$ is called a total function and is equivalent to a function." – Mauro ALLEGRANZA Oct 17 '16 at 14:01

## 3 Answers

I have a couple of answers.

$1.$ This is the same as my comment. Whenever you introduce sets, you introduce the notion of a subset. If you are writing out the definition for what a function is, the only data that are required are domain and codomain. You usually then talk about what the image is. In my experience, any class that bothers to define a function will also have defined subset at one point. I would say it is standard practice to both talk about image and restriction to subset after you've defined a function.

$2.$ Whenever we are using a function, we usually have a domain in mind. As in vadim123's answer, there is usually an obvious codomain to ensure we have a well-defined function. Sometimes it's interesting to see what the image is. This sometimes takes work. So, you end up saying "This function is from said domain to said codomain. We will now prove that the image is blank." We care less about the occurring in the domain, because, we would've just restricted the domain to the subset we cared about in the first place. You usually don't say "I have a function $f:X \to Y$, but I'll restrict it to $f:A \to Y$. You would just start with a function $f:A \to Y$ in the first place, if that's all you cared about. I do admit there are exceptions to this rule. But, I would say they are less common.

• On 1. If you talk about what is 'required', then I could question why we have a notion of a 'codomain' in addition to the 'image'. It seems to me that we add the notion of the codomain because it provides an important conceptual role: it tells us what kinds of objects we are talking about. I would like something that serves that same purpose on the input side: indicate the set of kinds of objects that the function is supposed to work with, and then we can restrict using subset if needed. – Bram28 Oct 17 '16 at 17:08
• On 2. Yes, we have a domain in mind ... But in my eyes that domain we have in mind (e.g natural numbers or real numbers, or some other 'nice' set of objects) is different from what we find out the function will actually work on (e.g we may need to throw out some objects from this inital domain). But I wouldn't change the notation ... I would say use $f(x): A \rightarrow B$ to indicate the domain and codomain of discourse and keep it that way; this notation would be a great way to indicate the initial 'here is what we have in mind'. – Bram28 Oct 17 '16 at 17:14

Why do not do this at the input side of a function?

We do it!

Two examples come to mind:

1. Convex analysis. Here you consider convex real valued functions $f$ defined on normed real vector spaces $X$. You define these functions (for example) by the inequality $$f(\lambda x + (1-\lambda) y)\leq \lambda f(x) + (1-\lambda)f(y)$$ which should hold for all $x,y\in X$ and $\lambda\in [0,1]$. However, many interesting functions are not defined on the whole space (e.g. the entropy on euclidean space) so it is very convenient to let the functions take on the value $+\infty$ (and note that this keeps the definition intact since we can compare $\infty$ to every other real number - no other operations with $\infty$ are needed here). So you deal with functions $$f:X\to\mathbb{R}\cup\{+\infty\}.$$ But then you often want to talk about the set on which $f$ takes finite values and this has an extra name and notion. You set $\operatorname{dom}(f) = \{x\mid f(x)<+\infty\}$ and call the the domain or effective domain of $f$. Moreover, one says that a convex function is proper if its domain is not empty.
2. Unbounded operators. When we want to describe differential operators like the Laplace operator $\Delta$ on function spaces like $L^2(\Omega)$ for some subset $\Omega\subset\mathbb{R}^d$ we note that we do not get well defined mappings. One could try to figure out subsets of $L^2$ where the domain could be (which leads to things like Sobolev spaces), but this is often cumbersome and prevents one from getting started in the first place. An idea, due to von Neumann, I guess, is to define unbounded operators $T:X\to Y$ between two Banach spaces to be defined as linear mapping defined on a subspace $D(T)\subset X$. We still write $T:X\to Y$ but usually use the domain $D(T)$ to write $T:D(T)\subset X\to Y$…

Probably there are more examples I don't know, but what is true, that the distinction between "possible arguments" and "actual arguments" is not that present in undergraduate courses than the distiction between "possible outcomes" and "actual outcomes".

• Yes, what you say at the end there is what bothers me: why is this distinction not made as a matter of standard practice? I would think it would be a very useful distinction, and as I indicated in my original post, all the conceptual and practical reasons for separating between image and codomain, I think can be applied to the input side as well. – Bram28 Oct 17 '16 at 14:08

Well, how to answer that...

First of all: are you familiar with the term "maximal domain"? Given a rule like your $f(x) = 1/x$ and a "nice" set (e.g. $\mathbb{R}$), the maximal domain is the largest subset of this set on which the given rule gives a function.

So why don't we just write $f : \mathbb{R} \to \mathbb{R}, x \mapsto 1/x$ and let everyone figure out the maximal domain?

That has multiple reasons:

• A function should always be well defined, i.e. for every x in the domain we want to know that $f(x)$ exists; even if we don't know how to compute it.

• Important properties of the function (injective, surjective,...) may change depending on the domain.

• For numerical purposes (e.g. approximate a function at a certain point) the domain is very important. For example given the rule $f(x) = 1/x$ it makes quite a difference if we say $x \in \mathbb{R} \backslash \{0\}$ or if we say $x \in \mathbb{R}$ and $|x| > 1$.

There are many more reasons depending on what you want to do with the function, but the base line is that the same rule can behave totally different depending on the domain it is defined on.

edit: Look here for a great example on why not giving a domain can cause problems: Differentiability of $x/x$

• OK, but why not have those two different concepts of 'domain' then? You list several important things we want to be true for the domain ... I say: yes, for its 'domain of definition'. But in addition to that I think it is quite natural to have a 'maximal domain' or 'domain of discourse' to specify what kinds of things I am talking about: something that would serve the same purpose as what the codomain does on the output. I am still not clear why we don't typically make this conceptual distinction. – Bram28 Oct 17 '16 at 14:04
• It is done, but only if needed. The basics we need to consider the function as a black box is "what goes in and what comes out?" So we need a domain and we need a codomain. Everything else are just extras that we add in case that we need them. E.g. the maximal domain is important in the question if a function has a continuous extension at some point. The question for the image is important if we are interested in computing preimages or inverses. I suppose the image is used more often because it is often easier to understand and compute. – Dirk Oct 18 '16 at 14:18
• But if you take this approach, why even bring up the codomain? Why not say that the input is the domain and the output is the image and leave it at that? To get the inverse all we need is the image. – Bram28 Oct 18 '16 at 21:18
• OK, so here is my issue: I can understand it if people take the more 'practical' route like you say, and just consider inputs and outputs, i.e. 'domain' and 'image' (or 'range') and leave it at that. And I also understand that there are good reasons to consider objects beyond this ... but why do we typically only do that on the output side? It just strikes me as a major source of conceptual confusion, especially as we now have a notion of a 'codomain' that is not at all what you would expect the 'co-' of the 'domain' to be (if anything is the 'co-' of the domain, it would be the 'range'). – Bram28 Oct 18 '16 at 21:23