Suppose $A$ and $B$ are two sets with $B\subset A.$ Let $f:A\to B$ be injective. Then show that $\exists$ a bijection $h:A\to B.$
The proof given was :
Let $$X=(A-B)\cup f(A-B)\cup f^2(A-B)\cup \cdots=\bigcup_{n=0}^{\infty}f^n(A- B);f^0(A-B)=A-B.$$
Then clearly if $x\in X,x\in f^n(A-B)$ for some $n.$ Then $f(x)\in f^{n+1}(A-B)\implies f(x)\in X.$
Thus, $f(X)\subset X.$ We define, $$h:A\to B$$ by
$$h(x)=f(x)\text{, if }x\in X,$$ $$x\text{ otherwise. }$$
To show that $h$ is one-one, let $x,y\in A$ and $h(x)=h(y).$
If $x,y\in X$ then $f(x)=f(y)\implies x=y$
If $x,y\in A-X$ then, $x=y,$ by definition of $h.$
If $x\in X$ and $y\in A-X$ then $$h(x)=h(y)\implies f(x)=y\implies y\in f(X)\subset X,$$ a contradiction.
So, the last case can't occur. Thus, $h$ is one-one.
To show that $h$ is onto, let $y\in B.$
If $y\in X$ then $y\in f^n(A-B)$ for some $n\geq 1\implies y=f^n(x),$ for some $x\in A-B$ $$\implies y=f(x')$$ where $x'=f^{n-1}(x)\in f(A-B)\subset X.$ $$\implies y=h(x').$$
If $y\notin X$ thhen, $h(y)=y.$ Thus, $h$ is onto. This completes the proof.
However, I find this proof much convoluted, which was not at all necessary. I tried devising an alternative proff, which is quite straight-foerward in it's working and might even be considered simpler.
Here it is :
Notation: If S is a set, then by $|S|$ I mean, Cardinality of the set $S$
Given,
$B$ is a subset of $A$ and $f:A\to B$ is an injective mapping.
Since, $B$ is a subset of $A,$ we have, $|B|\leq |A|.$
Also, $f$ is an injective mapping from $A$ to $B$ implies, $|A|\leq |B|.$
Hence, $|A|=|B|$ is the only possible conclusion. Again, as $f$ is an injection from $A$ to $B$ (and with the (now) established fact that, $|A|=|B|,$ ) $f$ is a bijection. Thus, $f=h$ and $h:A\to B$ is a bijection.
I hope that my alternative approach is a correct one. Is there any way, I can improve the proof? I am looking, for some specific suggestions that might make my proof look more readable and understandable. Any suggestions/remarks against ways of improving it, will be highly appreciated. Also, please do point out if any requisite changes should be made or not. Lastly, if there are any errors in my proof, please correct me.
The above alternative proof is justified/valid only under the assumption, that we are working with finite sets.
To elaborate, the proof might be true in general, but it's not a complete one. It is incomplete because, while dealing with cardinalities, of $A$ and $B$, i.e $|A|$ and $|B|$ we have used the following implication :
This is obvious, if $|A|,|B|$ are real numbers. More appropriate to say, the above fact, makes sense only if $A,B$ are finite sets.
The problem comes, when we add infinite sets to the picture. If atleast either of the sets $A$ or $B$ are infinite, we can't treat $|A|$ and $|B|$ as real numbers. They are then, treated as so called "Cardinal Numbers ". In case of Cardinal numbers, the properties applicable for real numbers might not be even valid. One must prove them, in order to establish their validity/correctness.
In short: The proof in OP is correct if all the sets considered in the question, are finite sets. If either of $A$ or $B$ is infinite, then the proof is invalid and erroneous.