TITLE: Seemingly invalid step in the proof of $\frac{a^2+b^2}{ab+1}$ is a perfect square?
QUESTION [9 upvotes]: Recall the famous IMO 1988 question 6:

Suppose that $\displaystyle\frac{a^2+b^2}{ab+1}=k\in\mathbb{N}$ for some $a,b\in\mathbb{N}$. Show that $k$ is a perfect square.

Solutions can be found: 
$1)$ http://projectpen.files.wordpress.com/2008/10/pen-vol-i-no-1.pdf (Section 2.6)
$2)$ http://www.georgmohr.dk/tr/tr09taltvieta.pdf
When I first saw solutions to this problem I had no reluctance in accepting the validity of solutions, but just recently I read over them again and there seems to be several things bugging me and it all relates to a particular step in all solutions above.
Solutions $1)$ and $2)$ are essentially the same argument in the sense that they both assume firstly that $k$ is not a perfect square and then deduce a contradiction.
Now let us get to the issue at hand. It follows from Vieta's formulas that the other root $c$ (the other root is called $a_1$, $x_2$ in $1)$, $2)$ respectively - I'm just going to call it $c$ for simplicity as a general reference to the other root of $x^2-kbx+b^2-k$ where $a$ is the first root) must be an integer. Now note that in proving that $c\ge 0$ for $1)$ and $2)$ we didn't need to use the assumption that $k$ is not a perfect square. But to show that $c\neq 0$ then we must finally use the assumption that $k$ is not a perfect square. Here is where there seems (at least to me at the time being) to an issue. Recall that in the problem we want $a,b\in\mathbb{N}$, so this is equivalent to defining a set where we fix $k$.
$$S(k):= \left\{(a,b)\in\mathbb{N}\times\mathbb{N} : \frac{a^2+b^2}{ab+1}=k\in\mathbb{N}\right\}$$
Now in $1)$ and $2)$ they assume that $k$ is not a perfect square and hence deduce that $c\neq 0$ because if $c=0$ then as a result from $x^2-kbx+b^2-k=0$ then $k=b^2$. Here is where there seems to be an invalid contradiction. If $c=0$ then it doesn't contradict that $k=b^2$ because $c=0\not\in\mathbb{N}$ and hence $(c,b)\not\in S(k)$ so as a result $c^2-kbc+b^2-k=0$ no longer satisfies the condition of the question and hence doesn't contradict anything even though $k=b^2$. This is where there may be something I misunderstood and it would be great if someone can justify with clarity as to why my reasoning is flawed?
A little note: We see that it was deduced in $1)$ and $2)$ that $c<a$ just by using the assumption that WLOG $a\ge b$ along with Vieta's formulas ($c<b$ can also be proven just by these assumptions alone). So proving $c<a$ and $c<b$ was independent of $(c,b)\in S(k)$ and is also independent of assuming some minimality property on $b$. Hence we can say that $c<a$ and $c\ge 0$ are all deduced without assuming $k$ not being a perfect square nor $b$ being minimal for fixed $k$.

REPLY [3 votes]: The proof does not require contradiction or any working hypothesis about $k$ being a square or not.  
It can be presented as an algorithm for taking an integer solution $(a_1,b_1)$ with $a_1b_1 \neq 0$ and producing an integer solution $(a_2,b_2)$ that is smaller.  Repeating this reduction process, eventually there will appear a solution $(a_n,b_n)$ with $a_nb_n=0$.  The proof that the algorithm is correct requires $k$ to be an integer, but no other arithmetic condition such as being a square. When the smallest solution is reached, with one of the variables equal to $0$, this demonstrates that $k$ (which is constant during the execution of the algorithm) was a square, but the algorithm and the correctness proof were blind to that. 
To illustrate, imagine observing the reduction procedure starting from a pair of giant numbers $(A,B)$.  Before running the reduction process one might want to calculate $\frac{A^2 + B^2}{AB+1}$ to see that it is really an integer.  This calculation will output an integer so large that it is not immediately recognizable as a perfect square.  The reduction process will then produce a sequence of smaller pairs $(A_i, B_i)$ eventually reaching $(n,0)$ for some $n$ and then the square nature of $k$ will be apparent.
As this outline may suggest, there is something suspicious when...

to show that c≠0 then we must finally use the assumption that k is not a perfect square.

There is no reason to show that $c \neq 0$ at any stage of the proof.  The quotation is describing the situation after reduction from $(a,b)$ to a smaller solution $(b,c)$.  Having $c=0$ is the goal of the argument.  The only thing that needs to be proved is $c \geq 0$ (so the process can continue) and that $(b,c)$ is smaller than $(a,b)$ (so that the algorithm has made progress). Once the new pair $(b,c)$ has been constructed, if $c=0$ the algorithm stops successfully, and if $c > 0$ it continues the reduction process.