22
Light Monotone Dialectica Extraction of moduli of uniform continuity for closed terms from Goedel’s T of type (IN IN) (IN IN) Mircea-Dan Hernest Project LogiCal – Paris, France and GKLI – Munich, Germany LFMTP’06 Talk in Seattle, 16 August 2006 Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 1 / 22

Light Monotone Dialectica - Computer Science AUdanher/Slides/Hernest-LFMTP06sld.pdf · Light Monotone Dialectica Extraction of moduli of uniform continuity for closed terms from Goedel’s

Embed Size (px)

Citation preview

Light Monotone DialecticaExtraction of moduli of uniform continuity for closed terms from

Goedel’s T of type (IN ⇒ IN) ⇒ (IN ⇒ IN)

Mircea-Dan Hernest

Project LogiCal – Paris, France and GKLI – Munich, Germany

LFMTP’06 Talk in Seattle, 16 August 2006

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 1 / 22

Outline of this Talk1 Introduction

A seemingly simple game-problem of discrete mathematicsGeneralization and set-up for the Proof-theoretic machinery

2 Hereditarily Extensional Equality in computer system MinLogTerm system, majorizability and Hereditarily Extensional EqualityWeakly extensional monotonic Arithmetic for Göedel functionals

3 From Gödel’s Dialectica to Light Monotone DialecticaThe pure Göedel’s functional “Dialectica” interpretationThe Contraction Problem –> Achilles’ heel for Dialectica !The Light Monotone Dialectica majorant extraction

4 Conclusions and Future workThe human/computer outcome for our general game-problemComputer really necessary? Implementing Monotone DialecticaWork to be done –> the real “Light” Monotone Dialectica

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 2 / 22

A game-problem of discrete mathematics1 Let f , g, h : IN 7→ IN s.t. h fixed &∀n ∈ IN. f (n) ≤ h(n) ∧g(n) ≤ h(n)

Given k ∈ IN find L ∈ IN s.t. [∀i ≤ L . f (i) = g(i)] ⇒ [∀j ≤ k . f (j) = g(j)]

2 Dummy answer L :≡ k . Hence try to complicate the demand:

∀f , g ≤IN→IN h . [∀i ≤ L . f (i) = g(i) ] ⇒ [∀j ≤ k . f (f (j)) = g(g(j)) ]

3 Simple optimal answer max{k , h(0), . . . , h(k)}. But what about:

∀f , g ≤ h . [∀i ≤ L . f (i) = g(i) ] ⇒ [∀j ≤ k . f (f (f (j))) = g(g(g(j))) ]

4 Temptation max{k , h(0), . . . , h(k), h(h(0)), . . . , h(h(k))}. False,

since f (j) ≤ h(j) 6⇒ f (f (j)) ≤ h(h(j)), hence f (f (0)) > h(h(j)) possible.5 How to solve this? And what about the fully general case?

∀f , g ≤IN→IN h . [∀i ≤ L . f (i) = g(i) ] ⇒ [∀j ≤ k . f (m)(j) = g(m)(j) ]

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 3 / 22

Set-up for the Proof-theoretic machinery (1/2)1 Extract moduli of uniform continuity for closed terms tm of

Goedel’s T of type (IN ⇒ IN) ⇒ (IN ⇒ IN) where

tm :≡ λhIN⇒IN, k IN . RIN⇒IN (0)[λp, q . h(m)(p) + q ](k + 1)

2 Hence tm(h, k) ≡ h(m)(0) + h(m)(1) + . . . + h(m)(k). How???

Let P :≡ ` ∀f , g . [∀i . f (i) =IN g(i) ] ⇒ [∀j . tm(f , j) =IN tm(g, j) ]

3 The above P is a Minimal Logic proof of (almost) tm ≈ tm . Weapply on P a Light Monotone Dialectica extraction in MinLog.

4 Gödel’s Dialectica would give an exact realizer t′[f , g, j ] for i s.t.

∀f , g ∀j . f (t′[f , g, j]) =IN g(t′[f , g, j ]) ⇒ tm(f , j) =IN tm(g, j)

5 If t̃ maj λf , g, j . t′ then for k ≥ j , h? maj h and h ≥ f , g one has(L :≡ t̃(h?, h?, k)) ≥ t′[f , g, j ] and therefore such an L is a solution:

∀h∀f , g ≤IN→IN h∀k . [∀i ≤ L . f (i) = g(i) ] ⇒ [∀j ≤ k . f (m)(j) = g(m)(j) ]

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 4 / 22

Set-up for the Proof-theoretic machinery (2/2)Start from proof of hereditarily extensional equality of t to itself.

Hence a proof of t ≈(IN⇒IN)⇒(IN⇒IN) t in system Z0 of Berger-Buchholz-Schwichtenberg, the base logic of machine system MinLog.

Hence a Minimal Logic proof without use of Extensionality Axiom.

Two extreme approaches:1 First extract t′ by Gödel’s Dialectica and then majorize it via

Howard’s algorithm (Kohlenbach’s PhD thesis, JSL paper ’92).2 Directly extract t̃ by producing a majorant for the closed extracted

term at each of the Dialectica recursion step (Kohlenbach ’93).

None of the two efficient on the computer. Solution: use anintermediate approach –> Extract partial majorants which are notnecessarily closed terms, only simplify treatment of Contraction.Also use a Normalization during Extraction, i.e. NbE-normalizethe extracted term of the conclusion of a Modus Ponens. (NdE)Huge impact of such Partial Evaluation. No solution without it!!

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 5 / 22

The term system – a lambda-variant of Göedel’s T1 All finite types generated from IN and IB by the rule σ, τ 7→ (στ)

2 tt IB , ff IB equality =ININIB and inequality ≥ININIB , maximum Max INININ

3 0IN (zero), SucININ (successor) and Gödel’s recursor Rτ (INτ τ)INττ

And IBIBIB :≡ λp, q . IfIB p q ff ImpIBIBIB :≡ λp, q . IfIB p q tt4 Combinators at all types are defined in terms of λ-abstraction:

Σ :≡ λx , y , z . x z (y z ) Π :≡ λx , y . x5 at IB is the unique predicate symbol of WeZ ∃

m – one IB argument6 Extensionally defined equality and inequality (below σ ∈ {IB, IN})

s =IN t :≡ at(= s t) s =IB t :≡ at(s) ↔ at(t)s ≥IN t :≡ at(≥ s t) s ≥IB t :≡ at(t) → at(s)

s =σ1 ...σn→σ t :≡ ∀xσ11 . . . xσn

n (s x1 . . . xn =σ t x1 . . . xn)

s ≥σ1...σn→σ t :≡ ∀xσ11 . . . xσn

n (s x1 . . . xn ≥σ t x1 . . . xn)

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 6 / 22

Majorizability and Hereditarily Extensional Equality (1)

x maj IN y :≡ x ≥IN y :≡ at(≥ x IN y IN)

x ≥στ y ≡ ∀zσ (x z ≥τ y z )

x maj στ y :≡ ∀zσ1 , zσ

2 (z1 maj σ z2 → x z1 maj τ y z2)

0 maj IN 0, Suc maj ININ Suc , Σ maj Σ , Π maj Π and RM maj R

WeZm ` t ? maj στ t ∧ s? maj σ s =⇒ t ?s? maj τ t s——————————————————————————————

x ≈IN y :≡ x =IN y :≡ at(= x IN y IN)

x =στ y ≡ ∀zσ (x z =τ y z )

x ≈στ y :≡ ∀zσ1 , zσ

2 (z1 ≈σ z2 → x z1 ≈τ y z2)

0 ≈IN 0, Suc ≈ININ Suc , Σ ≈ Σ , Π ≈ Π and R ≈ R

WeZm ` t ? ≈στ t ∧ s? ≈σ s =⇒ t ?s? ≈τ t s

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 7 / 22

System WeZm –> Implic. Introd. with Contraction1 WeZm - Weakly extensional Minimal Arithmetic with ≥ and Max

2 Minimal Arith. ⇔ Heyting Arith. in all finite types HAω \ ⊥ → A

3 WeZm - underlying Logic is Natural Deduction, not Hilbert-style!

4[u : A] . . . /B

A → B→+ , particular set of instances of A in the same

parcel (assumption variable) u get discharged; If at least two Aget discharged then one has logical Contraction; If moreover Acontains at least one positive universal or a negative existentialquantifier then one has a computationally relevant Contraction

5 Comp. Relevance relative to both Gödel and Monotone Dialectica

{AD(z; Ti(z, x , y))}n+1i=1 , {C i

D(xi ; Ti(z, x , y))}mi=n+2 ` BD(T (z, x); y)

Same tuple z produced by 2 ≤ n + 1 ≤ m discharged instances of A

If {Ti}n+1i=1 non-null (A is Dialectica relevant) ⇒ Equalization is a must!

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 8 / 22

Extensionality/Compatibility and Induction rulesEσ,τ : ∀zστ , xσ, yσ. x =σ y → zx =τ zy – must be forbidden

A0 COMPAT σ – with the restriction that... all undischarged assumptions used

s =σ t in the proof of s =σ t (here denoted A0)

B(s) → B(t) are quantifier-free——————————————————————————————∅ ∅ IR0 – equivalent to IA, IR in WeZm...

... A(tt) ∧ A(ff ) → ∀pIBA(p)A(0) ∀z (A(z) → A(Sucz)) (Boolean Induction Axiom)

∀z A(z) Rτ x y 0 =τ xRτ x y (Sucz) =τ y(z, Rτ x y z)

}: AxRτ

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 9 / 22

Göedel’s functional “Dialectica” interpretation1 A translation of proofs which includes a translation of formulas.2 A(a) 7→ AD ≡ ∃x ∀y AD(x ; y ; a) with a all free vars of formula A3 AD is quantifier-free for Göedel’s Dialectica, since decidabilityneeded –> this no longer for Monotone setup ⇒ Bounded Dialectica4 Recursive syntactic translation from proofs in Constructive

Arithmetic (or Classical Arithmetic, modulo the double-negationtranslation) to proofs in Intuitionistic Arithmetic such that positiveoccurrences of ∃ and negative occurrences of ∀ in the proof’sconclusion get actually realized by terms in Gödel’s T.

5 Contraction Problem: –> choose between a number of realizersaccording to a boolean term associated to the contraction formula;Diller-Nahm: –> postpone all choices to the very end by collectingall candidates and making a single final global choice;Monotone Dialectica: –> use a simple common upper bound(maximum majorant) of the candidates =⇒ extract majorants

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 10 / 22

The Light Dialectica interpretation of formulas

AD :≡ (AD :≡ A) for prime formulas A

(A ∧ B)D :≡ ∃x , u ∀y , v [ (A ∧ B)D :≡ AD(x ; y ; a) ∧ BD(u; v ; b) ]

(A → B)D :≡ ∃Y , U ∀x , v [ (A → B)D :≡AD(x ; Y (x , v)) → BD(U(x); v) ]

(∃zA(z, a))D :≡ ∃z†, x ∀y [ (∃zA(z, a))D(z†, x ; y ; a) :≡ AD(x ; y ; z†, a) ]

(∃zA(z, a))D :≡ ∃x ∀y [ (∃zA(z, a))D(x ; y ; a) :≡ ∃z AD(x ; y ; z, a) ]

(∀zA(z, a))D :≡ ∃X ∀z†, y [ (∀zA(z, a))D(X ; z†, y ; a) :≡ AD(X (z†); y ; z†, a) ]

(∀zA(z, a))D :≡ ∃x ∀y [ (∀zA(z, a))D(x ; y ; a) :≡ ∀z AD(x ; y ; z, a) ]

Here · 7→ ·† is a mapping which assigns to every given variable z acompletely new variable z† which has the same type of z.

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 11 / 22

Exact realizer synthesis by Dialectica InterpretationExtraction and Soundness Theorem: There exists an algorithmwhich, given at input a WeZ ∃+ proof P : {C i}n

i=1 ` A [hence of theconclusion formula A, from the undischarged assumption formulas{C i}n

i=1 ] will produce at output 1) the tuples of terms T and {Ti}ni=1

2) the tuples of variables {xi}ni=1 and y 3) the verifying proof

PD : {C iD(xi ; Ti(x , y))}n

i=1 ` AD(T (x); y)

– where x :≡ x1, . . . , xn . Moreover,1 variables x and y are all completely new (not occur in P)2 the free variables of T and {Ti}n

i=1 are among the free variables ofA and {C i}n

i=1 (this one names “the free variable condition (FVC)for programs extracted by the Dialectica Interpretation”)

[ ⇒ x , y not occur free in the extracted terms {Ti}ni=1 and T ]

Notice that: Terms T and {Ti}ni=1 are not necessarily closed !!!

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 12 / 22

Problem –> Implication Introduction with Contraction

[u : A] . . . /B

A → B→+ n ≥ 1, z ≡

n+1︷ ︸︸ ︷z, . . . , z and x ≡ xn+2, . . . , xm :

{AD(z; Ti(z, x , y))}n+1i=1 , {C i

D(xi ; Ti(z, x , y))}mi=n+2 ` BD(T (z, x); y)

1) Same tuple z produced by n + 1 ≤ m discharged instances of A

2) Case: tuples {Ti}n+1i=1 are non-null! Recall that AD is quantifier-free

3) Since {Ti}n+1i=1 non-null =⇒ their equalization is a must :

S :≡ λx , z, y . Ifnτ (tD

A[z; T 1], . . . ,tDA[z; T n], Tn+1(z, x , y), T n, . . . , T 1)

one can now cancell all {AD}n+1i=1 by a single →+ in the verifying proof

{AD(z; S(x , z, y))}n+1i=1 , {C i

D(xi ; Si(x , z, y))}mi=n+2 ` BD(S(x , z); y)

{C iD(xi ; Si(x , z, y))}m

i=n+2 ` AD(z; S(x , z, y)) → BD(S(x , z); y)

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 13 / 22

The Light Monotone Dialectica program extractionMajorant realizer synthesis by Light Monotone DialecticaTheorem: There ex. an algorithm which, given at input a WeZ ∃+

m proofP : {C i(ai)}n

i=1 ` A(a′) [hence of the conclusion formula A, whose freevariables form the tuple a, from the undischarged assumption formulas{C i}n

i=1 ] it will produce at output the following (a :≡ a1, . . . , an, a′):

1 tuples of terms {Ti [a]}ni=1 and T [a], with free variables among a

2 the tuples of variables {xi}ni=1 and y , all together with

3 the following verifying proof in WeZ ∃m (below let x :≡ x1, . . . , xn ):

` ∃Y1, . . . Yn, X [∧n

i=1 (λa . Ti) maj Yi ∧ (λa . T ) maj X ∧∀a, x , y ( {

∧ni=1 C i

D(xi ; Yi(a, x , y); ai)} → AD(X (a, x); y ; a) ) ]

Variables x and y do not occur in P (they are all completely new)

=⇒ x and y do not occur free in the extracted terms {Ti}ni=1 and T .

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 14 / 22

Majorizability and Hereditarily Extensional Equality (2)

x maj IN y :≡ x ≥IN y :≡ at(≥ x IN y IN)

x ≥στ y ≡ ∀zσ (x z ≥τ y z )

x maj στ y :≡ ∀zσ1 , zσ

2 (z1 maj σ z2 → x z1 maj τ y z2)

0 maj IN 0, Suc maj ININ Suc , Σ maj Σ , Π maj Π and RM maj R

WeZm ` t ? maj στ t ∧ s? maj σ s =⇒ t ?s? maj τ t s——————————————————————————————

x ≈IN y :≡ x =IN y :≡ at(= x IN y IN)

x =στ y ≡ ∀zσ (x z =τ y z )

x ≈στ y :≡ ∀zσ1 , zσ

2 (z1 ≈σ z2 → x z1 ≈τ y z2)

0 ≈IN 0, Suc ≈ININ Suc , Σ ≈ Σ , Π ≈ Π and R ≈ R

WeZm ` t ? ≈στ t ∧ s? ≈σ s =⇒ t ?s? ≈τ t s

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 15 / 22

The WeZm proof at input & post-extraction ops.1 Let tρ be a closed term of Gödel’s T. Then WeZm ` t ≈ρ t .

2 Let t (IN→IN)→(IN→IN) be a closed T-term. Since

WeZm ` ∀x IN→IN, y IN→IN [ x =IN→IN y ↔ x ≈IN→IN y ]

(due to weak extensionality + reflexivity) it immediately follows that

WeZm ` ∀x IN→IN, y IN→IN [ x =IN→IN y → t(x) =IN→IN t(y) ]

3 Let t[a] be a T-term with free vars a. There exists a correspondingT-term t?[a] such that WeZm ` λa . t? maj λa . t . Very simple t?

construction: just replace each R in t with the corresponding RM .

4 If the type of a is IN → ρ then aM maj a, hence t?[aM ] maj t[a] .

5 For a of type IN → ρ define aM(k) :≡ Maxρ(a(0), . . . , a(k))

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 16 / 22

MinLog computer output for our game-problem, m = 3

1 For t3 :≡ λhIN⇒IN, k IN . RIN⇒IN (0)[λp, q . h(3)(p) + q ](k + 1) want

∀f , g ≤ h . [∀i ≤ L . f (i) = g(i) ] ⇒ [∀j ≤ k . f (f (f (j))) = g(g(g(j))) ]

2 The MinLog machine outputs in less than one minute:

λh, k . max{k , h(0) . . . , h(k), max{h(0) . . . h(max{h(0) . . . h(k)})}}

which immediately rewrites more humanly readable as

L3 :≡ λh, k . max{k , h(0), h(1), . . . , h(max{k , h(0), h(1), . . . , h(k)})}

3 Recall that for m = 2 and m = 1 the (human) outcomes were

L2 :≡ λh, k . max{k , h(0), h(1), . . . , h(k)}L1 :≡ λh, k . k

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 17 / 22

Final human solution for our general game-problemPattern can be noticed (by the human!) in the solution of our problemfor terms

tm :≡ λh, k . h(m)(0) + . . . + h(m)(k) ,

with h(m)(i) :≡ h(h . . . (h(i))) s.t. h appears m times on the right side.

t̃1(h, k) ≡ k

t̃2(h, k) ≡ max{k , h(0), . . . , h(t̃1(h, k))}

t̃3(h, k) ≡ max{k , h(0), . . . , h(t̃2(h, k))}· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·

Immediate inference of the generic (recursive) solution for m ∈ IN :˜tm+1(h, k) ≡ max{k , h(0), . . . , h(t̃m(h, k))}

Verify that t̃m is the optimal modulus of uniform continuity for tm !Now an easy exercise for the human ! =⇒ See my PhD thesis :)

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 18 / 22

Was the Computer really necessary?1 Maybe not, but what if the problem were more complex/tedious ?2 Certainly helpful for preventing the human error ! Effectively !

Implementing Monotone Dialectica1 The “light” variant of Monotone Dialectica is the result of our

implementation effort ! Many operations which are “easy” for thehuman (mathematician) are not really that easy for the machine !

2 On the computer, the Goal is to produce programs in normal form !3

Hence improve the Nbe-normalization by its own Partial Evaluation=⇒ Normalization during Extraction (NdE) ⇐⇒ NbE-normalizethe term extracted for the conclusion of each Modus Ponens .

4 Only majorize at Contraction =⇒ produce a partial majorant whichis transformed at the end by replacing each R with its corresp. RM .

5 Why? Well, some of the R may be eliminated during the partialNbE-normalization ... Also use the more clever RM , with just 1 R.

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 19 / 22

A lot of Work to be done . . .1 Completely formalize and explore the limits of Normalization

during Extraction (NdE) ⇒ generic optimization for (tn..(t2(t1t0))..)2 Completely formalize these ad-hoc optimizations of the computerimplementation of Monotone Dialectica and combine with the “light”optimization brought by the use of quantifiers without comp. content3 We suspect that the use of these ncm quantifiers may eliminatesome of the comput. contractions in the Hered. Ext. Eq. extraction !This game-problem is already solved for a very particular case only !4 Find other more interesting T-terms tm , for which the modulus of

uniform continuity is far more difficult to find !5 Find other more interesting examples for the Proof Mining by the

Light (monotone) Dialectica on the Computer !6 Improve the human-interaction side of our Dialectica extraction

modules in MinLog, in order to render “MinLog for Dialectica” asan indispensable computer tool even for the more puremathematically oriented Proof Mining !

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 20 / 22

Short List of related Papers IU. Kohlenbach.Proof Interpretations and the Computational Content of Proofs.Lecture Course, latest version in the author’s web page.

U. Kohlenbach and P. Oliva.Proof Mining: a systematic way of analysing proofs inMathematics.Proc. of the Steklov Inst. of Mathem., 242:136–164, 2003.

U. Kohlenbach.Pointwise hereditary majorization and some applications.Arch. Math. Logic, 31:227–241, 1992.

U. Kohlenbach.Analysing proofs in Analysis.In Logic: from Foundations to Applications, Keele, 1993, EuropeanLogic Colloquium, pages 225–260. Oxford University Press, 1996.

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 21 / 22

Short List of related Papers II

M.-D. Hernest.Light Dialectica program extraction from a classical Fibonacciproof Proceedings of DCM@ICALP’06, ENTCS (2007), 10pp.

M.-D. Hernest. Light Functional Interpretation.CSL 2005 - In LNCS 3634 pp. 477 – 492, July 2005.

M.-D. Hernest and U. Kohlenbach.A complexity analysis of functional interpretations.Theoretical Computer Science, 338(1-3):200–246, 2005.

U. Berger.Uniform Heyting Arithmetic.Annals of Pure and Applied Logic, 133(1-3):125–148, 2005.

U. Berger, W. Buchholz, and H. Schwichtenberg.Refined program extraction from classical proofs.Annals of Pure and Applied Logic, 114:3–25, 2002.

Mircea-Dan Hernest (LogiCal) Light Monotone Dialectica FLoC’06, Seattle, 16 Aug 2006 22 / 22