1

I want to prove by induction that if $A$ is finite, then $f:A \to A$ is injective $ \iff f $ is surjective. Can you please verify my proof?

Pf:

For $ n = 0 $, $ A = \emptyset $, and there is only one function from $ A $ to $ A $, which is both surjective and injective.

Assume (by way of induction on $n$) that for all $ A $ such that $ \left|A\right| = n $, a function $ f : A \to A $ is injective $ \iff $ $ f $ is surjective. Therefore, there are exactly $ n $ elements in $ A, \, a_1 \ldots a_n $ . Add one more element to $ A, a_{n+1} $ such that $ f $ is still injective. Therefore, $ f(a_{n+1}) = a_{n+1} $, and therefore $ f $ is surjective. Add an element to $ A \setminus \{a_{n+1\}} $, call it $ a_i $, such that $ f $ is still surjective. For every $ a_m \in \{a_1 \ldots a_n\}, \, a_m $ has only one $ x \in \{a_1 \ldots a_n\} $ such that $ f(x) = a_m $. Therefore, $ f(a_i) = a_i $ and therefore, $ f $ is injective.

Asaf Karagila
  • 393,674
talopl
  • 999
  • It's not really correct. Instead of adding elements to smaller sets we should remove elements from the given bigger sets. Assume the proposition holds for sets with $n$ elements, and let $A$ be a given set of $n+1$ elements together with a map $f:A\to A$. – Berci Jul 28 '22 at 10:54
  • 4
    If you insist on an induction argument, it is easier to generalize a little bit. Prove that: for every $n$, for all sets $A$ and $B$ with $|A| = |B| = n$, for every function $f \colon A \to B$: $f$ is injective if and only if $f$ is surjective. This enables you to look at two sets $A$ and $B$ of size $n + 1$, pick an element $a$ of $A$ and then look at the sets $A \setminus {a}$ and $B \setminus {f(a)}$. – Magdiragdag Jul 28 '22 at 11:09
  • 1
    "I want to prove by induction that if $ A $ is finite, then $ f : A \to B $ is injective $ \iff f $ is surjective." But then in your answer you talk about a function $ f : A \to A $. Shouldn't you be talking about a function a $ f : A \to B $ in your answer? – Adam Rubinson Jul 28 '22 at 11:25
  • @talopl Can you please clarify if you mean $f : A \to A$ as stated in the title or $f : A \to B$ as stated in the first line? – Jamie Jul 28 '22 at 11:50
  • See also https://math.stackexchange.com/a/989059/589 – lhf Sep 13 '22 at 09:50

2 Answers2

1

An induction argument doesn't really help you here, it's probably simpler to just use a counting argument.

Firstly, to show $f : A \to A$ injective $\implies$ surjective, assume you have an injective function $f : A \to A$, and assume $A$ has $n$ elements. Since $f$ injective, it's image $f(A)$ will have $n$ elements, but as $f(A) \subseteq A$, and $A$ has $n$ elements, we must have that $f(A) = A$ and so $f$ is surjective.

Now to show $f : A \to A$ surjective $\implies$ injective, assume you have a surjective function $f : A \to A$, and again assume $A$ has $n$ elements. This means that $f(A) = A$ and so $f(A)$ has $n$ different elements. But now each element in $f(A)$ must be mapped to from an element in $A$ but as they both have $n$ elements, each element in $A$ must be mapped somewhere different and so $f$ is injective.

Jamie
  • 117
  • 1
    Wait, how do you prove that $f(A)$ has $n$ elements? And how do you prove that the only subset of $A$ with $n$ elements is $A$ itself? – Asaf Karagila Jul 28 '22 at 11:26
  • @AsafKaragila If $f$ injective then for $a_1 \neq a_2$, $f(a_1) \neq f(a_2)$ and so $f(A)$ contains the $n$ distinct elements $f(a_1), f(a_2), \ldots f(a_n)$. – Jamie Jul 28 '22 at 11:45
  • And if $A$ has $n$ elements and you want a subset of $A$ with $n$ elements then your only choice is to choose the whole of $A$. If you didn't include all the elements you wouldn't have $n$ elements in your subset – Jamie Jul 28 '22 at 11:46
  • Your replies are circular. You're saying that it works because it does, and there's no way it wouldn't. And it's the hard part of disputing a proof of something that is provable, since I cannot give you a counterexample, obviously, but at the same time, you argument is still circular. – Asaf Karagila Jul 28 '22 at 12:27
  • Perhaps there is some confusion as I am showing $f : A \to A$ is surjective $\iff$ injective and am considering the two cases $\impliedby$ and then $\implies$. If this does not clear it up I do not understand what you mean – Jamie Jul 28 '22 at 14:28
  • Made an edit to make it clearer. Please let me know if you think there is still an error in reasoning because I am struggling to see it myself – Jamie Jul 28 '22 at 14:40
  • How do you know there is no subset of $A$ with $n+1$ elements? – Asaf Karagila Jul 28 '22 at 19:10
  • Because A has $n$ elements and if $B \subseteq A$ then $|B| \leq |A| = n$ – Jamie Jul 28 '22 at 23:04
  • But how do you know that? – Asaf Karagila Jul 29 '22 at 04:02
  • I think using a result like this in this type of question is entirely reasonable. I'd argue it holds since for $B \subseteq A$, $b \in B \implies b \in A$, but i can't say I know an entirely rigorous proof off the top of my head – Jamie Jul 29 '22 at 08:53
  • Let me solve that mystery. Induction. – Asaf Karagila Jul 29 '22 at 09:02
0

Let $n$ be the number of elements in $A$. We can then enumerate the elements of $A$ by $a_1, a_2,...,a_n$. Since $f$ is injective, we know that $f(a_i)\ne f(a_j)$ for $a_i\ne a_j$. If $f$ is not surjective then there exists $b\in A$ such that $f(a_i)\ne b$ for any of the $a_i$. Therefore, $f(a_i),...,f(a_n), b$ form a set of $n+1$ values. But this is impossible because $A$ only contains $n$ values. Therefore, $f$ is surjective.

John Douma
  • 11,426
  • 2
  • 23
  • 24