# When two functions are equal ?

in some books when we have a function f : A → B , and g : C → D , to prove that they are equal it proves that the domains are equal and the codomans are equal , in other words A=C and B=D , and that f(a) = g(a) , for all a element of A , I see that proving that codomains are equal is not necessarily important that is because f and g are sets of ordered pairs , that are subsets of A x B and C x D respectively , and I proved that they are equal if and only if A = C , and f(A) = f(C) , in other words A = C and f(a) = g(a) for all a element of A , is that right ???

Thanks

## Answers and Replies

Stephen Tashi
The "co-domain" of a function isn't the same as the "image" of the function.
If f(x) is a function with domain A and co-domain B then the image of f is set {y: f(x) = y for some x in A} and it is a subset of B. The co-domain of a function (it seems to me) is a somewhat arbitrary specification given as part of the definition of a function. Someone might say: "Let f(x) be a function from the reals into the reals defined by f(x) = x^2" without being specific that the image of f is the non-negative reals.

So what shall it mean to say that two functions are "equal"? Must they have the same co-domain or must they also have the same image? And do you really find a lot of material that talks about the equality of functions? There's lots of material about how f(x) = g(x) for all x, which stops short of saying that f and g are "equal" functions.

The "co-domain" of a function isn't the same as the "image" of the function.
If f(x) is a function with domain A and co-domain B then the image of f is set {y: f(x) = y for some x in A} and it is a subset of B. The co-domain of a function (it seems to me) is a somewhat arbitrary specification given as part of the definition of a function. Someone might say: "Let f(x) be a function from the reals into the reals defined by f(x) = x^2" without being specific that the image of f is the non-negative reals.

So what shall it mean to say that two functions are "equal"? Must they have the same co-domain or must they also have the same image? And do you really find a lot of material that talks about the equality of functions? There's lots of material about how f(x) = g(x) for all x, which stops short of saying that f and g are "equal" functions.

That is what I know But why Some books write that the equality of co-domains is necessary .

Stephen Tashi
That is what I know But why Some books write that the equality of co-domains is necessary .

As I said, I am not familiar with any material where the equality of functions is an important issue. Can you give specific examples of books that want the co-domains to be equal?

As I said, I am not familiar with any material where the equality of functions is an important issue. Can you give specific examples of books that want the co-domains to be equal?

proofs and Fundamentals : A first course in Abstract Mathematics , Ethan D.Bloch

Stephen Tashi
proofs and Fundamentals : A first course in Abstract Mathematics , Ethan D.Bloch

I don't have that book. Does he do any proofs that involve showing two functions are "equal"? When he does them, how does he handle the part about the co-domains?

he writes when giving a proof that two functions are equal we write the proof in that form

Proof. (Argumentation)
.
.
.

Therefore the domain of f is the same as the domain of g.
.
.
.
(argumentation)
.
.
.
Therefore the codomain of f is the same as the codomain of g.

Let a be in the domain of f and g.
..
.
.
(argumentation)
...
Then f (a) = g(a).
Therefore f = g.

Stephen Tashi
(argumentation)
.
Therefore the codomain of f is the same as the codomain of g

Can he give any sort of argumentation about the codomains being the same except that the codomains were specified to be the same when the functions were defined?

Can he give any sort of argumentation about the codomains being the same except that the codomains were specified to be the same when the functions were defined?

No , but in his analysis book he says that in principle changing co-domains changes the function . and I see that it is not necessarily the case , that is for example if B ≠ f(A) m doesn't mean that these two functions are not equal f : A → B and f : A → f(A) .

Last edited:
Stephen Tashi
doesn't mean that these two functions are not equal f : A → B and f : A → f(A) .

That statement has too many negations for me to understand!

The technicality here is what is meant by "equal" in some mathematical context. (For example, equality of sets A and B has a different definition that equality of real numbers A and B.) This is complicated by the fact that we use "equal", "the same" , "identical" etc. in ordinary speech. If Bloch wished, he could make a distinction between the definition of two functions being "identical" and two functions being "equal". When he talks about the technicality of the co-domains, does he use the word "equal"?

Deveno
if all we were ever concerned about was just single functions, that there would be little harm in declaring:

f:A→B and
f:A→f(A)

to be "the same function".

the problems arise when we consider:

gf:A→C, where f:A→B and g:B→C, we don't want a "type-mismatch" in composing g and f.

this happens in, say computer programming, where you declare the variable type of function arguments.

so if x is of type "integer", and f:x→ x*x, we could declare f(x) to be of type "natural number", but then g might not process x*x properly if its input variable type is "integer".

in other words, if you restrict the co-domain of f to f(A), gf might not be defined without considering the (clearly related) function g|f(A), that is, g restricted to f(A).

in practice, this rarely comes up, but defining compositions can get really complicated if you have to include the various extensions and restrictions of the domain and co-domain.