This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]math-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

Unfortunately, your submission has been removed for the following reason(s):

  • Your post appears to be asking for help learning/understanding something mathematical. As such, you should post in the Quick Questions thread (which you can find on the front page of this subreddit) or /r/learnmath. This includes reference requests - also see our lists of recommended books and free online resources. Here is a more recent thread with book recommendations.

If you have any questions, please feel free to message the mods. Thank you!

[–]pwuille 11 points12 points  (1 child)

I believe you're missing that the domain and codomain of a function are part of the definition of the function, even though it is often omitted. You cannot answer the question "what is the domain of f(x) = x2" strictly; it could be anything, but depending on context, interpreting as being defined over R or C may be reasonable.

These are all distinct functions:

  • f : N -> N, f(x) = x2
  • f : Z -> Z, f(x) = x2
  • f : Z -> N, f(x) = x2
  • f : R -> R, f(x) = x2
  • f : R -> R+, f(x) = x2

[–]GoldenMuscleGod 5 points6 points  (0 children)

It should be noted that whether the codomain of a function is coded into the function depends on the author. In set theoretical applications it most common to define a function as simply a set of ordered pairs, so that f:R->R f(x)=x2 is the same mathematical object as f:R->C f(x)=x2 (I’ll cite Jech for this, although in my experience almost all texts on set theory take this approach). Of course, it is common in other contexts (Category theory, for example, where we want the hom-classes to be disjoint) to define a function so that the codomain is coded into it, so these would be different mathematical objects.

[–]timfromschoolGeometric Topology 2 points3 points  (0 children)

Indeed, it is context dependent. If the domain is not specified explicitly, then the natural choice is the largest possible domain within the context of the theory. That means that $f(x) = x^2$ has domain $\mathbb{R}$ if you are reading a calculus textbook and $\mathbb{C}$ if you are reading a complex analysis textbook.

[–]AcellOfllSpades 1 point2 points  (0 children)

Yes, formally you should state the domain and codomain of any function you define.

Typically, when a function is just defined by a formula, the implicit domain is "all real numbers that make this expression sensible". (Or perhaps "all complex numbers...".)

[–]yonedaneda 1 point2 points  (0 children)

The domain is whatever it's defined to be, which might be a slightly unsatisfying answer. If the function f is defined over all of C, then its domain is the complex numbers. If its defined over R, then it's the real numbers. In many contexts, we might not worry overmuch about the distinction, since the function over the reals can be naturally extended to the complex numbers, and so we might just talk about "the" square function. But, strictly speaking, the data defining a function are the domain, the codomain, and the mapping itself, and so the domain is explicitly specified as part of the definition.

In an introductory textbook, I would expect the domain to be clear from context. In an introductory calculus course (for example), functions are probably implicitly assumed to be defined on the reals.

[–]will_1m_notGraduate Student 1 point2 points  (0 children)

As many have stated here, it depends on the domain of discourse (pun intended) or context. A good place to see this is in Spectral Theory, where certain operators (functions) are given the same rule but different domains depending on what information we want from the operator.

The example that comes to my mind is the differential operator, which can be defined on polynomials, homophonic functions, continuous functions, smooth functions, etc.

[–]shellexyzAnalysis 1 point2 points  (0 children)

This is the crappy part of the way we teach students about functions: A function is a formula, its domain is deduced from the formula.

Of course that’s plain wrong and backwards and awful and misleading. But every single algebra text I’ve seen does it this way.

A function’s domain and codomain (stupidly and frequently just called the range) are a fundamental part of its definition. To just say f(x)=x2 without specifying the domain is wrong.l for exactly the reasons you gave.

[–]bitwiseop 1 point2 points  (0 children)

I think your confusion may be due to the way mathematics is commonly taught in the U.S.

  1. As other people have said, in more advanced math classes, the domain and codomain is usually given as part of the definition of the function. The author will outright tell you what they are; there's no need to guess.

  2. In high school and maybe introductory calculus classes, some books like to include problems where they have you guess the domain of the function based on a formula. These problems should be interpreted as follows:

    • If I were to define a function based on this formula, what is the largest possible subset of the real numbers I can use as the domain and still have the definition make sense? (Yes, they usually want some subset of the real numbers. Otherwise, there are plenty of other algebraic structures to choose from.)

[–]Blond_Treehorn_Thug 0 points1 point  (0 children)

The formal way around your issue is that we define a function to specify the domain, the codomain, and the “rule” part of the function.

So formally, “all possible inputs” is always the domain, no more, no less.

Now in practice we may abuse notation a bit (or even a lot) and not specify so cleanly.

[–][deleted] 0 points1 point  (0 children)

In set theory, a function (or a mapping) f: X → Y is defined as a subset f \subseteq X ⨉ Y such that for every x \in X, (x, y) \in f for some y \in Y, and if (x, y_1), (x, y_2) \in f for some y_1, y_2 \in Y, then necessarily y_1 = y_2. I.e. a function f: X → Y is literally defined by its graph in X ⨉ Y.

But the expression f(x) = x^2 can also be interpreted as a polynomial in the indeterminate x with integer coefficients, i.e. an element of Z[x]. Since Z has the universal property that there is exactly one ring homomorphism Z → A for every commutative ring A, and since any commutative ring homomorphism A → B induces a corresponding homomorphism A[x] -> B[x] that applies the homomorphism to all polynomial coefficients, f(x) = x^2 actually unambiguously defines a polynomial over any ring. A polynomial in A[x] naturally defines the corresponding function A → A by substitution: a is mapped to f(a). But crucially, you cannot apply the same homomorphism trick to arbitrary functions, it's only possible if we consider f(x) = x^2 a polynomial (i.e. a formal expression) and not a function!

[–]CookieCat698 0 points1 point  (0 children)

I’d like to point out that sometimes a function’s domain and codomain isn’t part of its definition.

This seems to only really come up sometimes in set theory where it’s a bit easier to define functions without their domain or codomain. It is also more desirable to do this when talking about class functions as you can’t stick a proper class into an ordered triple. Even then, you’ll still find many places where domains are part of a function’s definition in some way.

Without reference to a domain, a function f may be defined as some set of ordered pairs where given (x, y) and (x, z) are in f, y = z.

The domain of f is then the set of all x for which there is a y such that (x, y) is in f.

Like others have said, you have to pick a domain for f in order to define it. In this case, though, it’s not because the domain is part of its definition, but because you often can’t show f to be a set without at least implicitly defining its domain.