program extraction in constructive analysis helmut
play

Program Extraction in Constructive Analysis Helmut Schwichtenberg - PowerPoint PPT Presentation

Program Extraction in Constructive Analysis Helmut Schwichtenberg Mathematisches Institut, Universit at M unchen 1 Program extraction from proofs Every constructive existence proof contains an algorithm. Bishop 1970 Mathematics as a


  1. Program Extraction in Constructive Analysis Helmut Schwichtenberg Mathematisches Institut, Universit¨ at M¨ unchen 1

  2. Program extraction from proofs Every constructive existence proof contains an algorithm. Bishop 1970 “Mathematics as a numerical language”. − : +: +: +: +: 2

  3. Program extraction from proofs Every constructive existence proof contains an algorithm. Bishop 1970 “Mathematics as a numerical language”. − : Less direct, needs formalization. +: +: +: +: 2-a

  4. Program extraction from proofs Every constructive existence proof contains an algorithm. Bishop 1970 “Mathematics as a numerical language”. − : Less direct, needs formalization. +: Extracted programs are correct by construction. +: +: +: 2-b

  5. Program extraction from proofs Every constructive existence proof contains an algorithm. Bishop 1970 “Mathematics as a numerical language”. − : Less direct, needs formalization. +: Extracted programs are correct by construction. +: Proofs machine checkable, programs not (in principle). +: +: 2-c

  6. Program extraction from proofs Every constructive existence proof contains an algorithm. Bishop 1970 “Mathematics as a numerical language”. − : Less direct, needs formalization. +: Extracted programs are correct by construction. +: Proofs machine checkable, programs not (in principle). +: Proof of r realizes ∀ x ∃ yA ( x, y ) machine checkable. +: 2-d

  7. Program extraction from proofs Every constructive existence proof contains an algorithm. Bishop 1970 “Mathematics as a numerical language”. − : Less direct, needs formalization. +: Extracted programs are correct by construction. +: Proofs machine checkable, programs not (in principle). +: Proof of r realizes ∀ x ∃ yA ( x, y ) machine checkable. +: Program development by proof transformation. 2-e

  8. Program extraction from proofs (ctd.) Related work: “proof carrying code” (Lee, Necula). Here: “code carrying proofs”. Efficiency is an issue. Careful selection necessary, of: • definitions ( ∼ data structures), and • proofs. Moreover: unexpected algorithms in classical proofs. 3

  9. Minlog . . . deals with computable functionals, using minimal logic. 4

  10. Minlog . . . deals with computable functionals, using minimal logic. • Constants denote computable functionals. Quantifiers range over Scott-Ershov partial continuous functionals. 4-a

  11. Minlog . . . deals with computable functionals, using minimal logic. • Constants denote computable functionals. Quantifiers range over Scott-Ershov partial continuous functionals. • Conservative over HA . Kreisel: strong language, weak existence axioms. 4-b

  12. Minlog . . . deals with computable functionals, using minimal logic. • Constants denote computable functionals. Quantifiers range over Scott-Ershov partial continuous functionals. • Conservative over HA . Kreisel: strong language, weak existence axioms. • Based on minimal (not classical or intuitionistic) logic. More general; allows to implement program extraction from classical proofs, via refined A -translation [BBS02]. 4-c

  13. Minlog . . . deals with computable functionals, using minimal logic. • Constants denote computable functionals. Quantifiers range over Scott-Ershov partial continuous functionals. • Conservative over HA . Kreisel: strong language, weak existence axioms. • Based on minimal (not classical or intuitionistic) logic. More general; allows to implement program extraction from classical proofs, via refined A -translation [BBS02]. • Proofs treated as first class objects. 4-d

  14. Minlog (ctd.) • (Simply) typed variables; free algebras as base types. 5

  15. Minlog (ctd.) • (Simply) typed variables; free algebras as base types. • Type and predicate parameters allowed, as placeholders for types and formulas. No quantification over these. 5-a

  16. Minlog (ctd.) • (Simply) typed variables; free algebras as base types. • Type and predicate parameters allowed, as placeholders for types and formulas. No quantification over these. • Deduction modulo: terms with the same normal form are identified, w.r.t. user defined rewrite rules. 5-b

  17. Minlog (ctd.) • (Simply) typed variables; free algebras as base types. • Type and predicate parameters allowed, as placeholders for types and formulas. No quantification over these. • Deduction modulo: terms with the same normal form are identified, w.r.t. user defined rewrite rules. • Decidable predicates implemented via boolean valued functions, hence the rewrite mechanism applies to them. 5-c

  18. Minlog (ctd.) • (Simply) typed variables; free algebras as base types. • Type and predicate parameters allowed, as placeholders for types and formulas. No quantification over these. • Deduction modulo: terms with the same normal form are identified, w.r.t. user defined rewrite rules. • Decidable predicates implemented via boolean valued functions, hence the rewrite mechanism applies to them. • www.minlog-system.de 5-d

  19. Program extraction in constructive analysis 6

  20. Program extraction in constructive analysis • Use exact real numbers (not floating point numbers). 6-a

  21. Program extraction in constructive analysis • Use exact real numbers (not floating point numbers). • Emphasis on low type level witnesses (use separability). 6-b

  22. Program extraction in constructive analysis • Use exact real numbers (not floating point numbers). • Emphasis on low type level witnesses (use separability). • Example: Intermediate value theorem. 6-c

  23. Program extraction in constructive analysis • Use exact real numbers (not floating point numbers). • Emphasis on low type level witnesses (use separability). • Example: Intermediate value theorem. • Prospect: approximate solutions of ODEs. 6-d

  24. Reals A real number x is a pair (( a n ) n ∈ N , α ) with a n ∈ Q and α : N → N such that ( a n ) n is a Cauchy sequence with modulus α , that is ∀ k, n, m. α ( k ) ≤ n, m → | a n − a m | ≤ 2 − k , and α is weakly increasing. Two reals x := (( a n ) n , α ), y := (( b n ) n , β ) are equivalent (written x = y ), if ∀ k ( | a α ( k +1) − b β ( k +1) | ≤ 2 − k ) . 7

  25. Nonnegative and positive reals A real x := (( a n ) n , α ) is nonnegative (written x ∈ R 0+ ) if ∀ k ( − 2 − k ≤ a α ( k ) ) . It is k -positive (written x ∈ k R + ) if 2 − k ≤ a α ( k +1) . x ∈ R 0+ and x ∈ k R + are compatible with equivalence. Can define x �→ k x such that a n ≤ 2 k x for all n . However, x �→ k x is not compatible with equivalence. 8

  26. Given x := (( a n ) n , α ) and y := (( b n ) n , β ), define z c n γ ( k ) x + y a n + b n max( α ( k + 1) , β ( k + 1)) − x − a n α ( k ) | x | | a n | α ( k ) x · y a n · b n max( α ( k + 1 + k | y | ) , β ( k + 1 + k | x | ))  1 if a n � = 0  1 a n x for | x | ∈ l R + α (2( l + 1) + k ) 0 if a n = 0  9

  27. Cleaning up a real After some computations involving reals, rationals in the Cauchy sequences may become complex. Hence: clean up a real, as follows. Lemma. For every real x = (( a n ) n , α ) we can construct an equivalent real y = (( b n ) n , β ) where the rationals b n are of the form c n / 2 n with integers c n , and with modulus β ( k ) = k + 2. Proof. c n := ⌊ a α ( n ) · 2 n ⌋ . 10

  28. Redundant dyadic representation of reals The existence of the usual b -adic representation of reals cannot be proved constructively (1 . 000 . . . vs . 999 . . . ). Cure: in addition to 0 , . . . , b − 1 also admit − 1 as a numeral. For b = 2: Lemma. Every real x can be represented in the form ∞ � a n 2 − n with a n ∈ {− 1 , 0 , 1 } . n = − k Notice: uniqueness is lost (this is not a problem). 11

  29. Comparison of reals Write x ≤ y for y − x ∈ R 0+ and x < y for y − x ∈ R + . x ≤ y ↔ ∀ k ∃ p ∀ n.p ≤ n → a n ≤ b n + 2 − k x < y ↔ ∃ k, q ∀ n. q ≤ n → a n + 2 − k ≤ b n Write x < k,q y (or simply x < k y if q is not needed) when we want to call these witnesses. Notice: x ≤ y ↔ y � < x . 12

  30. A continuous function f : I → R on a compact interval I with rational end points is given by • an approximating map h f : ( I ∩ Q ) × N → Q and a (uniform) modulus map α f : N → N such that ( h f ( c, n )) n is a real with modulus α f ; • ω f : N → N (uniform) modulus of continuity: | a − b | ≤ 2 − ω f ( k )+1 → | h f ( a, n ) − h f ( b, n ) | ≤ 2 − k for n ≥ α f ( k ). α f , ω f required to be weakly increasing. Notice: h f , α f , ω f are of type level 1 only . 13

  31. Application of a continuous function to a real Given a continuous function f (by h f , α f , ω f ) and a real x := (( a n ) n , α ), application f ( x ) is defined to be ( h f ( a n , n )) n with modulus k �→ max( α f ( k + 2) , α ( ω f ( k + 1) − 1)). Can show: x = y → f ( x ) = f ( y ) , | x − y | ≤ 2 − ω f ( k ) → | f ( x ) − f ( y ) | ≤ 2 − k . 14

Recommend


More recommend