Show that the number of elements of a finite set is well-defined. Given the following definition:
A set $A$ is finite if it is empty or there are $n\in \mathbb{N}$ and a 1-1 onto function $f:\{1,...,n\}\to A$. In the first case we say that $A$ has $0$ elements, while in the second we say $A$ has $n$ elements. We say that $A$ is infinite if it is not finite.
To show that the number of elements of a finite set is well defined, we have to prove the following:
$(1)$ For all $n,k\in \mathbb{N}$ there is a 1-1 onto function $f:\{1,...,n\} \to \{1,...,k\}$ if and only if $n=k$.
I intuitively understand why it is true. But I am having a hard time proving it rigorously. I have also been told that it is best proved by induction. Can you please help provide a proof for that statement?

Sketch:
Hopefully you know that if $n\ne k$, then one of $\{1,2,\ldots,n\}$ and $\{1,2,\ldots, k\}$ is a proper subset of the other.
Now prove by induction on $n$ that a function from $\{1,2,\ldots,n\}$ to a proper subset of itself cannot be injective.
