Questions: Functions and Mappings: Formal Definition
5 questions to test your understanding
Score: 0 / 5
Question 1 Multiple Choice
Let f: ℝ → ℝ be defined by f(x) = x², and let g: ℝ → [0, ∞) be defined by g(x) = x². Are f and g the same function?
AYes — they have the same rule, so they are the same function
BYes — they have the same domain and the same range, so they are the same function
CNo — they have different codomains, and the codomain is part of the function's specification
DIt depends on context; in some frameworks they are equal and in others they are not
The codomain is part of the specification of a function, not an afterthought. f: ℝ → ℝ and g: ℝ → [0, ∞) differ in their codomain even though they have the same rule and the same range. Two functions are equal if and only if they have the same domain, the same codomain, and the same graph (set of ordered pairs). Changing the codomain gives a different function — a fact that matters for properties like surjectivity: g is surjective, but f is not.
Question 2 Multiple Choice
Which condition is required for a relation R ⊆ A × B to qualify as a function from A to B?
AEvery element of B must appear as a second coordinate in R
BEvery element of A must appear as a first coordinate in exactly one ordered pair in R
CNo element of B may appear as a second coordinate more than once
DThe relation must be symmetric: if (a, b) ∈ R then (b, a) ∈ R
A function must be total (every element of A has an output) and single-valued (each element of A has exactly one output). This is precisely 'each element of A appears as a first coordinate in exactly one pair.' Option A would require surjectivity, which is not part of the function definition. Option C would rule out many-to-one functions like f(x) = x², where different inputs can map to the same output. Option D describes symmetry, a property of relations that has nothing to do with functions.
Question 3 True / False
The range of a function f: A → B is always a subset of the codomain B, but it need not equal B.
TTrue
FFalse
Answer: True
The range (image) f(A) = {f(a) : a ∈ A} is the set of actual outputs, and by definition every actual output is an element of the codomain B, so f(A) ⊆ B. But f need not hit every element of B — that stronger condition (f(A) = B) is surjectivity. For example, f: ℝ → ℝ defined by f(x) = x² has range [0, ∞), which is a proper subset of ℝ.
Question 4 True / False
Two functions with the same rule are generally equal, regardless of their specified domains and codomains.
TTrue
FFalse
Answer: False
Domain and codomain are constitutive parts of a function's identity, not mere annotations. The function f: ℝ → ℝ given by f(x) = x² and g: [0, ∞) → ℝ given by g(x) = x² are different functions — they have different domains. Similarly, changing the codomain (as in the ℝ → ℝ vs. ℝ → [0,∞) example) produces different functions even with the same rule. Two functions are equal iff they agree on domain, codomain, and all output values.
Question 5 Short Answer
Why does the formal set-theoretic definition of a function specify both the domain and codomain as part of the function, rather than just the rule that maps inputs to outputs?
Think about your answer, then reveal below.
Model answer: The domain and codomain determine the function's identity and what properties it can have. Without fixing the domain, there is no well-defined set of inputs and 'totality' has no meaning. Without fixing the codomain, surjectivity cannot be defined (surjectivity means every element of the codomain is hit — but which set is the codomain?). Two functions with identical rules but different codomains differ in surjectivity. The set-theoretic definition (a function IS a set of ordered pairs, plus a specified domain and codomain) makes these distinctions precise and enables function equality, composition, and classification into injective/surjective/bijective.
This also explains why the set-of-pairs definition is preferable to a 'rule-based' definition: two different-looking rules (f(x) = x+1−1 and g(x) = x) define the same function from ℤ to ℤ, because their graphs are identical. Extensionality — judging equality by behavior, not description — is fundamental to rigorous mathematics.