You are here:

Advanced Math/Equality of Functions


QUESTION: Correct me if I'm wrong, but I believe the following is the typical definition of a function: Let A and B be sets. We call a relation f of A and B (a subset f of A x B) a function iff, for all x in A, there exists a unique y in B such that (x,y) is in f.

Does this imply that equality of two functions is implied by equality of their elements? Consequently, are two functions considered equal even if they have different codomains? This, to me, seems a little unintuitive. How can a surjective function be equal to a non-surjective one?

ANSWER: Hi Tony,

Your definition of a function is correct. I'm not quite sure what you mean by "equality of their elements" but perhaps it helps to say that 2 functions are equal if they produce the same image elements given the same domain elements.

I'm also not sure why the equality of elements implies different codomains. I would say that if 2 functions are equal they have the same codomains. Anyway, I also believe that a function is by definition surjective so that, given any supposition about their elements, you wouldn't be trying to equate a surjective relation (function) to a non-surjective one if the 2nd is in fact a function.

Hope this helps.


---------- FOLLOW-UP ----------

QUESTION: Consider f:{1,2,3} -> {1,2,3} defined by f(x) = x and g:{1,2,3} -> {1,2,3,4} defined by g(x) = x. Clearly, f = {(1,1),(2,2),(3,3)} = g per our set-theoretic definition of functions. But f is urjectve while g is not. Yet by extensionality or transitivity of equality, it follows that f = g.

Thus, it would seem to imply that two functions f and g being equal with one being surjectivity does not imply the surjectivity of the other.

I think this can be resolved by using the definiton* of a 'relation'** between a set X and a set Y as a subset of the 'Cartesian product' X x Y. Since a 'function' is a type of 'relation', this introduces the concept of a function representing not only a mapping but also a specific subset, or 'ordered pair', of X x Y. Thus, if the subsets associated with different functions are not equal then the functions are not equal.

In your example, the Cartesian product represented by the function f(x) = y is

(xf, yf) ∈ f where xf ∈ {1,2,3} and yf ∈ {1,2,3} such that, ' if (xf, yf1) ∈ f and (xf, yf2) ∈ f, then yf1 = yf2 '  <- definition of function*.

However, we have for the function g that (xg,yg) ∈ g where xg ∈ {1,2,3} and yg ∈ {1,2,3,4}.

Since (xf, yf) ≠ (xg, yg), f ≠ g.

Part of the confusion may be that

'functional value' = 'image' ≠ 'codomain',

where 'image' has a specific definition associated with functions. In my understanding, image ∈ codomain, which, in looser notation might be written image ≤ codomain.

* "Abstract and Linear Algebra", David Burton

** I'm using the single quotes, '  ', to denote a formal mathematical term.  

Advanced Math

All Answers

Answers by Expert:

Ask Experts


randy patton


college mathematics, applied math, advanced calculus, complex analysis, linear and abstract algebra, probability theory, signal processing, undergraduate physics, physical oceanography


26 years as a professional scientist conducting academic quality research on mostly classified projects involving math/physics modeling and simulation, data analysis and signal processing, instrument development; often ocean related

J. Physical Oceanography, 1984 "A Numerical Model for Low-Frequency Equatorial Dynamics", with M. Cane

M.S. MIT Physical Oceanography, B.S. UC Berkeley Applied Math

Past/Present Clients
Also an Expert in Oceanography

©2016 All rights reserved.