Example function which is partial, injective, and surjective

1k Views Asked by At

Can somebody give an example of a function $f : \mathbb{N} → \mathbb{N}$ which is partial, injective, and surjective. I was thinking about $f(x)=x-1$, but I am not sure if it is surjective.

1

There are 1 best solutions below

1
On BEST ANSWER

Your suggestion $f(x)=x-1$ is a valid example for a suitable choice of $S\subset \mathbb N$ on which $f$ is to be defined.

More generally, if $S_n=\{n,n+1,n+2,\dots\}$ and $\mathbb N = S_0$, then $f:\mathbb S_n\longrightarrow \mathbb N$ defined by $f(x)=x-n$ is a partial function $f:\mathbb N \longrightarrow\hspace{-12pt}{\small|}\hspace{11pt} \mathbb N$ that is both injective and surjectice.