1

Are 2 functions equal when they have same domain, same codomain and same law ?

EXAMPLE 1

$f: \mathbb{R} \to \mathbb{R}$

$x \to x^2$

and

$g: \mathbb{R} \to \mathbb{R^+_0}$ (set of positive reals with zero)

$x \to x^2$

are equal ?

EXAMPLE 2

$f: \mathbb{R} \to \mathbb{R}$

$x \to x^2$

and

$g: \mathbb{R^+_0} \to \mathbb{R}$

$x \to x^2$

are equal ?

halfpog
  • 1,083
  • I personally think that a good definition in the equality of function is that these share the same domain, and that $g-f\equiv 0$ there. The restriction on the codomain is (to me) irrelevant, as long as the functions are well defined. But of course, this would be my definition; I've never been taught a widely accepted one. – b00n heT Jul 10 '16 at 07:25
  • You need to be clearer with what you mean. Are you saying $f$ and $g$ are defined by $f(x)=x^2$ and $g(x)=x^2$? – galois Jul 10 '16 at 07:27
  • @jaska Yes $f(x)=x^2$ and $g(x)=x^2$ – halfpog Jul 10 '16 at 07:30
  • Two functions $f$ and $g$ are equal if they share a common domain of definition and $f(x)=g(x) \quad \forall x$. – StubbornAtom Jul 10 '16 at 07:36
  • I'd make one caveat. Take f:R->[0,4];f (x)= x^2. Now some may argue this is not a function as its stated domain is impossible. They may be right. I'd say that it is a function but it's domain is [-2,2] and is different than the others. I may not be following convention. – fleablood Jul 10 '16 at 08:42
  • Example one are equal because... the two are defined in the same domain and in that domain they are equal at every point. Example 2 is not because they are defined on different domains. [Btw, as per my last comment-- I suppose the "domain of definition" is [-2,2] and that is what matters rather than the "stated domain"] – fleablood Jul 10 '16 at 08:46
  • @Valerio: Both, the domain as well as the codomain are essential for a function. You might find this answer helpful. – Markus Scheuer Jul 27 '16 at 10:35
  • @boonhet: The domain as well as the codomain of a function need to be precisely specified. Otherwise the function is not defined. – Markus Scheuer Jul 27 '16 at 10:38

2 Answers2

4

Functions are sets of cartesian products that fulfill certain conditions, so for example a function $\;f:A\to B\;$ is a subset $\;f\subset A\times B\;$ which must fulfill the condition that $\;(a,b),\,(a,b')\in f\implies b=b'\;$.

Thus, two function are equal if, when thinking of them as sets, they are equal as such, and this means they both are subsets of the same cartesian product $\;A\times B\;$ , which thus means they have exactly the same domain, and also

$$(a,b)\in f\iff (a,b)\in g$$

which means that pointwise they're identical, and in usual functionwise notation::

$$\;\forall\,a\in A\;,\;\;f(a)=g(a)\;$$

DonAntonio
  • 214,715
  • According to your definition, they should have the same codomain as well? – velut luna Jul 10 '16 at 07:38
  • @AlphaGo Absolutely not as you can see in my answer. 2 functions can have different codomains and yet have the same ranges as subsets of the codomain and will be equal in this case. – Mathemagician1234 Jul 10 '16 at 07:49
  • @AlphaGo This may be a matter of definitions, but in general I think mathemagician's right: what is important is that both their images are contained in one common codomain, and then that pointwise the images of eacn point in the domain are equal. – DonAntonio Jul 10 '16 at 07:51
  • @AlphaGo Taking out trivial examples I'd say yes: it must be that both functions' codomains can at least be embedded in one single set, but we can avoid this headache by requiring that both codomains are equal as necessary condition. – DonAntonio Jul 10 '16 at 07:53
  • @DonAntonio Isn't everything in mathematics a matter of definitions,really? – Mathemagician1234 Jul 10 '16 at 07:53
  • @Mathemagician1234 I wouldn't say "everything" but undoubtedly a big and very important part. – DonAntonio Jul 10 '16 at 07:54
1

Ok, this is when a careful definition becomes so critical in answering a question. We need a careful set theoretic definition of a function and we need some prerequisite definitions.

Def: An ordered pair is the following set: (a,b)= { {a},{a,b}} where a,b are elements. 2 ordered pairs are said to be equal iff they are subsets of each other.

Def: Let A and B be sets. Then the Cartesian product of 2 sets is the following set:

$A\times B$ = { (a,b)| $a\in A$ and $b\in B$} Now the definition of a function:

Def:Let A and B be sets. Then we define a function from A into B, denoted $f:A \rightarrow B$ as $f\subseteq A\times B$ such that (a,b),(a,d)$\in f$ iff b = d. (In other words,no 2 different ordered pairs in a function have the same first member.) A is called the domain the function and it consists of all the first members of all the ordered pairs of f. B is called the codomain of the function. The range of the function is the set of all second members of the ordered pairs of the function and it is a subset of B.

Notice our definition of function is completely independent of whether or not it's defined by a formula or not.

Now let's look at the examples. Consider example 1. Given the definition of f and g,despite having different codomains,the ranges of both functions is the set of positive reals because $x^2\geq 0$ for all $x\in \mathbb R$. Since the domains are $\mathbb R$ for both f and g ,clearly every ordered pair in f is in g and vice versa. Therefore f= g.

Now consider example 2. The domain of f is $\mathbb R$ while the domain of g is $\mathbb R \geq 0$. Therefore, {(x,$x^2$)| $x\leq 0$ } $\subset f$ but {(x,$x^2$)| $x\leq 0$ } is not a subset of g. Therefore f is not equal to g.