The Euclidean algorithm strikes again
American Mathematical Monthly
A one-sentence proof that every prime pΞ1(mod 4) is a sum of two squares
American Mathematical Monthly
A formal approach to program inversion
CSC '90 Proceedings of the 1990 ACM annual conference on Cooperation
Program inversion in the refinement calculus
Information Processing Letters
Inversion of a recursive tree traversal
Information Processing Letters
What computing is all about
The Science of Programming
Concrete Mathematics: A Foundation for Computer Science
Concrete Mathematics: A Foundation for Computer Science
Recounting the Rationals: Twice!
MPC '08 Proceedings of the 9th international conference on Mathematics of Program Construction
Which Mathematics for the Information Society?
TFM '09 Proceedings of the 2nd International Conference on Teaching Formal Methods
On Euclid's algorithm and elementary number theory
Science of Computer Programming
Hi-index | 0.00 |
We show a new and constructive proof of the two-squares theorem, based on a somewhat unusual, but very effective, way of rewriting the so-called extended Euclid's algorithm. Rather than simply verifying the result -- as it is usually done in the mathematical community -- we use Euclid's algorithm as an interface to investigate which numbers can be written as sums of two positive squares. The precise formulation of the problem as an algorithmic problem is the key, since it allows us to use algorithmic techniques and to avoid guessing. The notion of invariance, in particular, plays a central role in our development: it is used initially to observe that Euclid's algorithm can actually be used to represent a given number as a sum of two positive squares, and then it is used throughout the argument to prove other relevant properties. We also show how the use of program inversion techniques can make mathematical arguments more precise.