Proper Fraction can be Expressed as Finite Sum of Unit Fractions/Fibonacci's Greedy Algorithm

Proof: Fibonacci's Greedy Algorithm
We use Fibonacci's Greedy Algorithm:

The above constitutes an algorithm, for the following reasons:

Inputs
The input to this algorithm is the proper fraction $\dfrac p q$.

Definiteness
Steps $(1)$, $(2)$ and $(5)$ are trivially definite.

Step $(3)$:

We have:

while:

Hence $\dfrac 1 {\ceiling {y_k / x_k} }$ is the largest unit fraction less than $\dfrac {x_k} {y_k}$.

Finiteness
In order for the algorithm to terminate after a finite number of steps, at some stage step $(2)$ is to be executed where $x_m = 1$.

Hence it is to be shown that at the end of step $(4)$ $x_k = 1$ for some $k$.

We have:

We know that $x_k$ is not a divisor of $y_k$ as $\dfrac {x_k} {y_k}$ is expressed in canonical form.

Hence:
 * $0 < \paren {-y_k} \bmod {x_k} < x_k$

Hence the numerator of $\dfrac {\paren {-y_k} \bmod {x_k} } {y_k \ceiling {y_k / x_k} }$ is strictly less than $x_k$.

Expressing $\dfrac {\paren {-y_k} \bmod {x_k} } {y_k \ceiling {y_k / x_k} }$ in the canonical form $\dfrac {x_{k + 1} } {y_{k + 1} }$ may reduce the numerator further, but will not increase it.

Hence:
 * $x_{k + 1} < x_k$

and so by the Method of Infinite Descent it must eventually be the case that:
 * $x_m = 1$

for some $m \in \N$.

Outputs
The output to this algorithm is the summation $\displaystyle \sum_{\substack {1 \mathop \le k \mathop \le m \\ n_j \mathop \le n_{j + 1} } } \dfrac 1 {n_k}$.

Effective
Each step of the algorithm is basic enough to be done exactly and in a finite length of time.

It is seen that every time step $(3)$ is executed, another unit fraction is generated.

When, at some stage after step $(4)$, $x_k = 1$, again a unit fraction has been generated.

But now it is not necessary to go through the algorithm again, and so at step $(2)$ the algorithm terminates.

It has output a sequence of unit fractions all of which have different denominators, which together add up to $\dfrac p q$.

All criteria are seen to hold.

The result follows.