# Why it is necessary to mention the domain and codomain of function as part of its definition?

Relations are defined, without mentioning its domain and codomain, as,

Relation is a set of ordered pairs.

Intuitively a function is a non one-to-many relation. But additionally the definition of function has the domain and codomain in it. One possible definition is,

A function $f$ from $A$ to $B$ is a non one-to-many relation such that $\mathbf{Dom}(f) = A$ and $\mathbf{Ran}(f) \subseteq B$.

Why can't we just say

function is a non one-to-many relation

and then we may introduce the domain and codomain (as we usually do for relations). Afterwards we shall continue to speak about surjection, bijection, inverse, composition, etc.

• "Relations are defined, without mentioning its domain and codomain" No, they aren't. "Relation is a set of ordered pairs." Ordered pairs of what? If these are so defined it is because the domain and range are implicitly assumed. "But additionally the definition of function has the domain and codomain in it." They are required. They are also required for relations. But I've seen them both where it was implied."Why can't we just say "function is a non one-to-many relation". We can. And it is. But it's very confusing. Especially to novices. – fleablood May 27 '17 at 3:39
• @fleablood At least the condition $\mathbf{Dom}(f) = A$ is needed, because relations have no such restriction, right? – Durgadass S May 27 '17 at 6:59

The domain can be directly extracted from the set of ordered pairs version of the function. It is important enough that we usually prefer to isolate it anyway, but there would be no loss in the domain being a "function" of the function (namely $\operatorname{Dom}(f)=\{ \operatorname{First}(t) : t \in f \}$) rather than a "data field" in the definition of a function (e.g. $\operatorname{First}(f)$).