# Surjective Function **A [[function]] for which every possible output has at least one corresponding input.** >[!Example] Surjective Function > A *surjective* or *onto function*, or a *surjection*, is a function $f: X\to Y$ such that for every $y\in Y$, there is *at least one* $x\in X$ such that $f(x)=y$. > > This means the [[image]] and [[codomain]] of $f$ are equal. > >[!Visual definitions]+ > > In an arrow diagram, a function $f:X\to Y$ is surjective if and only if each element of the codomain $Y$ has *at least one incoming* arrow. > > > > ![[SurjectiveOrNotArrows.svg]] > > *** > > On a Cartesian plane, a function $f:\mathbb{R}\to\mathbb{R}$ is surjective if and only if *every possible horizontal line* intersects the graph at *at least one* point. > > > > ![[SurjectiveOrNotGraph.svg]] If $F:X\to Y$ is a surjective function for some finite sets $X$ and $Y$, then $Y$ has *at most* the same [[cardinality]] as $X$. $|X|\ge|Y|$