Intereting Posts

$\frac{\partial T}{\partial t} = \alpha \nabla ^2r$ for spherically symmetric problems
What is the limit of $n \sin (2 \pi \cdot e \cdot n!)$ as $n$ goes to infinity?
An example about finitely cogenerated modules
Is there a name for function with the exponential property $f(x+y)=f(x) \cdot f(y)$?
block matrix multiplication
Why do you add +1 in counting test questions?
Longest sequence of minimally finer topologies
For $W \leqslant V$, prove $\dim W + \dim W^\perp = \dim V$
Euclidean Geometry Intersection of Circles
A closed subspace of a locally compact Hausdorff space is also a locally compact Hausdorff space.
Every closed convex cone in $ \mathbb{R}^2 $ is polyhedral
The product of n consecutive integers is divisible by n factorial
metric property in a group
Proving the convergence of $a_n = \frac{n}{n+\sqrt n}$
For an integrable function $f$, do continuity conditions on its integral affect continuity of $f$?

Formally, I learned that a function $f: X \to Y$ is a subset $f \subset X \times Y$ subject to the condition that for every $x \in X$, there is exactly one $y \in Y$ such that $(x, y) \in f$. We write $y = f(x)$.

The graph of a function $f: X \to Y$ is the set $\{(x, f(x)) : x \in X\}$.

Based on these two definitions, the graph of a function is, well, just the function (i.e $\operatorname{graph} f = f$), which makes me wonder why would you consider the “graph” of a function if it doesn’t tell you anything new?

- An Intuition to An Inclusion: “Union of Intersections” vs “Intersection of Unions”
- Difference Between Product and Function Spaces
- Prove that $A \times (B -C) = (A \times B) - (A \times C)$
- The union of a sequence of countable sets is countable.
- Intuitive explanation for how could there be “more” irrational numbers than rational?
- Number of different partitions of N

- Does $f(X \setminus A)\subseteq Y\setminus f(A), \forall A\subseteq X$ imply $f$ is injective ?
- Natural Numbers and Well ordering
- What is the difference between a function and a distribution?
- Is the set of all strings with countably infinite length bijective to $$?
- Is the set of all pairs of real numbers uncountable?
- Why is this change of variables true?
- Does $A=\{a|\forall x\in \emptyset\ H(x,a) \}$ make sense?
- Comparing the growth rates
- For any sets $A$ and $B$, show that $(B\smallsetminus A)\cup A=B \iff A\subseteq B$.
- Different of mapsto and right arrow

Consider the following two functions: $f:\mathbb R \to \mathbb R$, $f(x)=\sin(x)$, and $g:\mathbb R \to [-1,1]$, $g(x)=\sin (x)$. As functions, these two things are different simply because the codomain of one is different than the codomain of the other. However, since for all $x\in \mathbb R$ it holds that $f(x)=g(x)$, the graphs of both functions are identical.

Some aspects of a function are completely determined just by the graph, but some are not. For instance, injectivity of a function is completely determined by its graph, while surjectivity does not. I.e., $f$ above is not surjective, while $g$ is surjective.

When thinking of a function as a process it is natural to specify its domain (thought of as possible inputs) and its codomain (possible outputs) without committing oneself that every output really is attained. Here is an extreme example. Let $f:\mathbb R \to \mathbb R$ be given by $f(x)=e^{\sin(x)}\cdot\cos(x)$. I just defined the function without worrying about its precise image, which could be a pain to figure out if all I want to do is define the function.

Some people use the definition of function along these lines:

A function from $X$ to $Y$ is an

ordered triple$(X,f,Y)$, where $f\subseteq X\times Y$ and for each $x\in X$ there is unique $y\in Y$ fulfilling $(x,y)\in f$.

(Some examples of texts using this definition can be found if you try to search for function ordered triple or something similar in Google Books.)

This is basically the same thing as saying:

We consider two functions $f\colon X\to Y$, $g\colon Z\to W$ to be equal if (and only if) $X=Z$, $Y=W$ and $f(x)=g(x)$ for each $x\in X$.

So for two functions to be equal, they need to have the same codomain.

(A reasonable search query to find some text including this might be “two functions” equal.)

There are many situations where this distinction is unimportant, so the functions $\sin \colon \mathbb R \to \mathbb R$ and $\sin \colon \mathbb R \to [-1,1]$ are often consider the same. (And the *are* the same according the definition in the OP. If we use the definition as “function is a subset of $X\times Y$ such that…”, then a function is indeed equal to its graph.)

But there are also situations where the distinctions is important, for example speaking about surjective functions only makes sense if you specify the codomain. (So if you use the definition from the OP, you would have to consider surjectivity as property of the pair $(f,Y)$, i.e. a function and a set containing the range of this function, rather then a property of the function $f$.)

Wikipedia article also has a section on alternative definitions of a function. Just in the case the article will be reorganized in the future, I am also adding a link to the current revision.

Well, of course, even those most hung up on set-theoretic regimentations, don’t really, *really*, believe that functions are identical to their graphs, i.e. identical to sets of tuples (or are identical to set-theoretic triples of domains, codomains and sets of tuples, or whatever). For a start, some functions are “too big” to have graphs according to standard set theories, e.g. the function that maps sets to their singletons. And in any case, functions belong to a different logical type to objects such as sets (including sets of tuples). A one-place function $f$ takes single arguments and outputs values; a set [so to speak] just sits there. Of course, we can feed $x$ plus $f$’s graph $G$ as two arguments to a new dyadic evaluation function which returns the value $y$ just in case $(x, y) \in G$: but — on pain of regress — we can’t keep trading in functions for their graphs.

So, the set-theoretic modelling (representation, implementation) of functions by their graphs is just that: modelling or representation or implementation, however you like to put it. And like any modelling, there are different ways to go depending on what features of what you are modelling you really care about representing. What the graph modelling (for workaday functions, if not nasties like $x \mapsto \{x\}$) nicely highlights is *extensionality* and *plenitude* (the idea that there is a function for every arbitrary pairing of arguments and values). Whether you also want to build in codomains to your definition of a function when modelling in set terms will depend on whether that is going to matter, as I think @BrianM.Scott is saying in his comment on @IttayWeiss’s answer. There is surely no question of right or wrong here, just assessments of overall neatness and convenience.

What’s going on here is that “everybody knows” what a function ought to be, and the definition of a function as being *equal* to its graph is just a tool for codifying that. I assure you that there’s hardly a working mathematician in the world who thinks of a function as equaling its graph. A perfectly analogous situation is the standard definition of what an ordered pair $(a,b)$ “is”. (Something like $(a,b)=\{\{a\},\{a,b\}\}$, or another equally unintuitive construct.) Giving the “definition” is just giving a set-theoretic construction that is logically sound and delivers the properties that everybody was expecting the concept to satisfy.

- How prove this inequality $|x\sin{\frac{1}{x}}-y\sin{\frac{1}{y}}|<2\sqrt{|x-y|}$
- Checking whether a map satisfies being homomorphism
- Every Cauchy sequence in $\mathbb{C}$ is bounded
- Find the sum for $\sum_{n=1}^{\infty}(-1)^{(n+1)}\frac{2n+1}{3^n} $
- Using the Fitch system, how do I prove $((p \implies q) \implies p)\implies p$?
- Subrings of fraction fields
- subset of a topological space is closed if and only if it contains all of its limit points.
- Proof that sum of complex unit roots is zero
- Transformation rule for a wedge product
- Differentiable $f$ such that the set of translates of multiples of $f$ is a vector space of dimension two
- Riemann Intergral proof question
- Does a bounded holomorphic function on the unit disc have summable Taylor coefficients?
- The preorder of countable order types
- How to find the minimum value of this function?
- Dilogarithm integral $\int^x_0 \frac{\operatorname{Li}_2(1-t)\log(1-t)}{t}\, dt$