Bijection $f: N_n\to N_m$

Let $N_n=\{ 1,2,...,n\}$ and $N_m=\{1,2,...,m\}$, if $n\neq m$, then it doesn't exist $f:N_n \to N_m$ such that $f$ is a bijection.

According to my teacher this proof is complicated, but I would like to know how to do it, does anyone know in which text I can find it?

Edit:

In this proof

Let $A$ be a finite and nonempty set. Let $m, n$ be positive integers and suppose that $f: N_n \to A$ and $g: N_m \to A$ are bijections. So $m = n$.

Proof:

The inverse of the function $g^{-1}: A\to N_m$ is bijective. we can affirm that the composition $g^{-1}\circ f : N_n \to N_m$ is a bijection. This contradicts the above statement, then $m=n$.


We start by proving the following.

Lemma: If $f:N_n\to S$ for some $S\subsetneq N_n$, then $f$ is not injective.

Proof. We proceed by induction on $n\geq 0$. If $n=0$, then $N_n=\varnothing$, and the Lemma is vacuously true. Next, assume that the assertion holds for some $n$; we prove it for $n+1$. So let $f:N_{n+1}\to S$ be a map and $S\subsetneq N_{n+1}.$ First, assume $n+1\not\in S$. Then $S\subsetneq N_n$ and $f|_{N_n}:N_n\to S$ isn't injective by induction hypothesis, so $f$ is neither. Next, assume $n+1\in S$. Then $n+1=f(m)$ for some $m\in N_{n+1}$. Seeking for a contradiction, assume that $f$ is injective. Define a function $g:N_n\to S-\{n+1\}$ by $g(m)=f(n+1)$ (in case $m\neq n+1$) and $g(k)=f(k)$ for $k\neq m$. Clearly, $g$ is injective, contradicting the induction hypothesis. This completes the proof.$\quad\tiny\blacksquare$

Now, let's see why this implies your result. Assume for a moment that there was a bijection $f:N_n\to N_m$ for some $n\neq m$. Then we may assume $n>m$ (else, consider $f^{-1}$). The Lemma now states that $f$ cannot be injective, a contradiction.