From a classical proof that the gcd of natural numbers a1 and a2 is a linear combination of the two, we extract by Gödel's Dialectica interpretation an algorithm computing the coefficients. The proof uses the minimum principle. We show generally how well-founded recursion can be used to Dialectica interpret well-founded induction, which is needed in the proof of the minimum principle. In the special case of the example above it turns out that we obtain a reasonable extracted term, representing an algorithm close to Euclid's.Copyright line will be provided by the publisher Finding and extracting computational content in existence proofs is a challenging subject, particularly so when the proofs do not seem to have such content. This is regularly the case when what is proved is only a "weak" existential formula, that is, a formula ∀ x∃y A 0 (x, y) with∃ the weak existential quantifier defined bỹ ∃ y A 0 (x, y) := ¬∀ y ¬A 0 (x, y), and A 0 quantifier-free.Yiannis Moschovakis suggested the following example: the gcd of natural numbers a 1 and a 2 is a linear combination of the two. This proof uses the minimum principle. Here we treat that example as a case study for program extraction from classical proofs by Gödel's Dialectica interpretation. We show generally how wellfounded recursion can be used to Dialectica interpret well-founded induction, which is needed in the proof of the minimum principle. In the special case of the example above it turns out that we obtain a reasonable extracted term, representing an algorithm close to Euclid's.In [3] the same example has already been treated, but with a different method: a refined [1] form of the "Atranslation" [5,4]. The extracted algorithm was again close to Euclid's. The work in [3] would probably benefit as well from the use of well-founded induction. This and also a detailed comparison of the two methods is left for future work.
Arithmetic in finite typesWe use a standard formalization HA ω of arithmetic in finite types, based on natural deduction; cf.[10]. In fact, its "negative" fragment suffices, because we will only need implication and universal quantification to build formulas. For simplicity we take as the only base types the type N of natural numbers (generated by the constructors zero 0 and successor S), and B of booleans (with constructors tt and ff).
LanguageTypes are built from base types N and B by arrows ρ → σ and products ρ × σ. (Typed) terms are formed from typed variables and constants by (type correct) lambda abstraction, application, pairing and projections; for the latter we use the notation r0, r1 (for the left/right component of r). Constants (including the structural and wellfounded recursion operators; see below) are defined by computation rules. We assume that the constants denote total functions only. It is well known that under the standard conversion rules plus the computation rules every term posesses a unique normal form, which in fact can be computed via normalization by evaluation; see [2]. To avoid equality reasoning in formal derivat...