0

$f(x,y) := \begin{cases} f(x-y,y) \hspace{0.5cm} if \hspace{0.5cm} x > y\\ f(x, y-x) \hspace{0.5cm} if \hspace{0.5cm} y > x\\ x \hspace{2.2cm} if \hspace{0.5cm} x= y \end{cases}$

Define a well founded order on $\mathbb{N} x \mathbb{N}$ and prove by induction that $\forall x, y \in N: f(x,y) = \operatorname{gcd}(x,y)$.

Regarding the well founded order, I once read in a book that $({\mathbb{N}}^{k}, \leq)$ with $(k \geq 1)$ is always a well founded order. Here we have $k=2$. So would this answer suffice or it is intuitively clear but how could I prove it being well-founded?

Regarding the induction the third case is obvious, I think I have to the induction for the first case and the second would be analogous to the first?

Base case: $x=2, y= 1$
$f(2,1) = f(2-1,1) = f(1,1) = 1$

I have seen this question was asked already here. The solution suggestion is with diagonal sets. is there another way to show this?

sai-kartik
  • 2,090
Parinn
  • 537
  • 2
    In this answer I explain a simple intuitive way to view this induction (for the more general extended gcd algorithm that computes the Bezout identity) – Bill Dubuque May 02 '20 at 02:56
  • 2
    Btw, a good place to learn about well-founded orders on $\Bbb N^k$ is in textbooks that discuss the Grobner basis algorithm for ideals (or more general treatments on term-rewriting such as the Knuth-Bendix equational completion algorithm). Search on those keywords to find pertinent literature. – Bill Dubuque May 02 '20 at 03:08
  • Thanks Gone. I will walk through the proof, and if I have any questions I will ask. – Parinn May 02 '20 at 19:51

0 Answers0