Euclidean Algorithm/Formal Implementation

Implementation
The Euclidean algorithm can be implemented as a computational method $\struct {Q, I, \Omega, f}$ as follows:

Let $Q$ be the set of:
 * all singletons $\tuple n$
 * all ordered pairs $\tuple {m, n}$
 * all ordered quadruples:
 * $\tuple {m, n, r, 1}$
 * $\tuple {m, n, r, 2}$
 * $\tuple {m, n, p, 3}$

where $m, n, p \in \Z_{> 0}$ and $r \in \Z_{\ge 0}$.

Let $I \subseteq Q$ be the set of all ordered pairs $\tuple {m, n}$.

Let $\Omega$ be the set of all singletons $\tuple n$.

Let $f: Q \to Q$ be defined as follows:

where $\map \rem {m, n}$ denotes the remainder of $m$ on division by $n$.