Canonical: https://knowlpedia.com/shared-foundations/graph-of-function/

# Graph of a function

The set of ordered pairs consisting of each input and its output

A [function](https://knowlpedia.com/shared-foundations/function/) \(f:A\to B\) has **graph**
\[
\Gamma_f=\{(a,f(a)):\ a\in A\}\subseteq A\times B.
\]

## Remarks

The graph is a [subset](https://knowlpedia.com/shared-foundations/subset/) of the [Cartesian product](https://knowlpedia.com/shared-foundations/cartesian-product/) and consists of [ordered pairs](https://knowlpedia.com/shared-foundations/ordered-pair/). Viewing a function as a special kind of [relation](https://knowlpedia.com/shared-foundations/relation/), the graph is exactly the corresponding relation.

## Examples

- If \(f:\mathbb R\to\mathbb R\) is \(f(x)=x^2\), then \(\Gamma_f=\{(x,x^2):x\in\mathbb R\}\).
- If \(A\) is any set, the graph of \(\mathrm{id}_A\) is \(\{(a,a):a\in A\}\).
