on the constructive content of proofs in abstract analysis
play

On the constructive content of proofs in abstract analysis Ulrich - PowerPoint PPT Presentation

On the constructive content of proofs in abstract analysis Ulrich Berger Swansea University Helsinki Logic Seminar December 19, 2018 Supported by a Royal Society grant on Team Semantics, and the EU project Computation with Infinite Data


  1. Overview of existing case studies in program extraction ◮ Discrete structures ◮ Quotient and remainder on natural numbers. ◮ Dijkstra’s algorithm (1997, Benl, Schwichtenberg): Reachable nodes in a weighted graph ◮ Warshall Algorithm (2001, Schwichtenberg, Seisenberger, B): Transitive closure of a relation ◮ Programs from classical proofs ◮ GCD (1995, B, Schwichtenberg): Uses the Friedman/Dragalin A-translation ◮ Dickson’s Lemma (2001, Schwichtenberg, Seisenberger, B): F/D A-translation in infinite combinatorics ◮ Higman’s Lemma (2008, Seisenberger): Uses F/D A-translation and classical countable choice ◮ Fibonacci numbers from a classical proofs (2002, Buchholz, Schwichtenberg, B): Uses F/D A-translation to obtain fast program 10 / 50

  2. Overview ctd. ◮ Lambda calculus: ◮ Extraction of normalization-by-evaluation (NbE) (2006, Berghofer, Letouzey, Schwichtenberg, B): Extraction of NbE from Tait’s proof of strong normalization for the typed lambda calculus (in Isabelle, Coq, Minlog) 11 / 50

  3. Overview ctd. ◮ Lambda calculus: ◮ Extraction of normalization-by-evaluation (NbE) (2006, Berghofer, Letouzey, Schwichtenberg, B): Extraction of NbE from Tait’s proof of strong normalization for the typed lambda calculus (in Isabelle, Coq, Minlog) ◮ Real numbers ◮ Cauchy sequences vs signed digit representation (SD): Cauchy sequences are functions. SD representations are streams defined by coinduction. ◮ Arithmetic operations on reals w.r.t. SD ◮ Integration w.r.t. SD (2011, B): Real functions are given by trees realizing a nested coinductive/inductive definition 11 / 50

  4. Overview ctd. ◮ Lists ◮ List reversal Uses F/D A-translation to extract linear program from naive proof ◮ In-place Quicksort (2014, Seisenberger, Woods, B): Extracts an ’imperative’ program 12 / 50

  5. Overview ctd. ◮ Lists ◮ List reversal Uses F/D A-translation to extract linear program from naive proof ◮ In-place Quicksort (2014, Seisenberger, Woods, B): Extracts an ’imperative’ program ◮ Satisfiabilty testing ◮ Extraction of a SAT-solver from completeness proof for DPLL (2015, B, Forsberg, Lawrence, Seisenberger) 12 / 50

  6. Overview ctd. ◮ Lists ◮ List reversal Uses F/D A-translation to extract linear program from naive proof ◮ In-place Quicksort (2014, Seisenberger, Woods, B): Extracts an ’imperative’ program ◮ Satisfiabilty testing ◮ Extraction of a SAT-solver from completeness proof for DPLL (2015, B, Forsberg, Lawrence, Seisenberger) ◮ Ongoing: Extraction of ◮ monadic parsers (Jones, Seisenberger, B) ◮ concurrent programs (Miyamoto, Petrovska, Schwichtenberg, Spreen, Takayama, Tsuiki, B) ◮ truly imperative programs (Reus, B) ◮ modulus of uniform continuity from Fan Theorem (B) 12 / 50

  7. The Archimedean property The natural numbers are unbounded: ∀ x ∃ n ∈ N x < n 13 / 50

  8. The Archimedean property The natural numbers are unbounded: ∀ x ∃ n ∈ N x < n not realizable 13 / 50

  9. The Archimedean property The natural numbers are unbounded: ∀ x ∃ n ∈ N x < n not realizable The rational numbers are dense: ∀ x ∀ ǫ > 0 ∃ q ∈ Q | x − q | < ǫ 13 / 50

  10. The Archimedean property The natural numbers are unbounded: ∀ x ∃ n ∈ N x < n not realizable The rational numbers are dense: ∀ x ∀ ǫ > 0 ∃ q ∈ Q | x − q | < ǫ not realizable 13 / 50

  11. The Archimedean property The natural numbers are unbounded: ∀ x ∃ n ∈ N x < n not realizable The rational numbers are dense: ∀ x ∀ ǫ > 0 ∃ q ∈ Q | x − q | < ǫ not realizable There are no infinitesimals: ∀ x ( ∀ k ∈ N | x | < 2 − k → x = 0) AP 13 / 50

  12. The Archimedean property The natural numbers are unbounded: ∀ x ∃ n ∈ N x < n not realizable The rational numbers are dense: ∀ x ∀ ǫ > 0 ∃ q ∈ Q | x − q | < ǫ not realizable There are no infinitesimals: ∀ x ( ∀ k ∈ N | x | < 2 − k → x = 0) AP a true Harrop formula 13 / 50

  13. Apartness x � � = y Def = ∃ k ∈ N | x − y | ≥ 2 − k 14 / 50

  14. Apartness x � � = y Def = ∃ k ∈ N | x − y | ≥ 2 − k Proposition 1. ∀ x ∈ C ( x � = 0 → x � � = 0). 14 / 50

  15. Apartness x � � = y Def = ∃ k ∈ N | x − y | ≥ 2 − k Proposition 1. ∀ x ∈ C ( x � = 0 → x � � = 0). Proof. Uses AP , as well as countable choice : ∀ n ∈ N ∃ x A ( n , x ) → ∃ f ∀ n ∈ N A ( m , f ( n )), and Markov’s principle for decidable A ( n ): ¬¬∃ n ∈ N A ( n ) → ∃ n ∈ N A ( n ). Assume C ( x ) and x � = 0. By countable choice there exists an infinite sequence of rational numbers q k ( k ∈ N ) such that | x − q k | ≤ 2 − k for all k ∈ N . It is impossible that | q k +1 | ≤ 2 − k for all k ∈ N since this would imply that | x | ≤ 2 − k for all k ∈ N and therefore x = 0, by AP . Since | q k +1 | ≤ 2 − k is a decidable property of k , by Markov’s principle, we can find some k ∈ N with | q k +1 | > 2 − k . It follows that | x | ≥ 2 − ( k +1) . 14 / 50

  16. Apartness x � � = y Def = ∃ k ∈ N | x − y | ≥ 2 − k Proposition 1. ∀ x ∈ C ( x � = 0 → x � � = 0). Proof. Uses AP , as well as countable choice : ∀ n ∈ N ∃ x A ( n , x ) → ∃ f ∀ n ∈ N A ( m , f ( n )), and Markov’s principle for decidable A ( n ): ¬¬∃ n ∈ N A ( n ) → ∃ n ∈ N A ( n ). Assume C ( x ) and x � = 0. By countable choice there exists an infinite sequence of rational numbers q k ( k ∈ N ) such that | x − q k | ≤ 2 − k for all k ∈ N . It is impossible that | q k +1 | ≤ 2 − k for all k ∈ N since this would imply that | x | ≤ 2 − k for all k ∈ N and therefore x = 0, by AP . Since | q k +1 | ≤ 2 − k is a decidable property of k , by Markov’s principle, we can find some k ∈ N with | q k +1 | > 2 − k . It follows that | x | ≥ 2 − ( k +1) . Can countable choice be avoided? 14 / 50

  17. Brouwer’s thesis Brouwer’s thesis ( BT ) Every bar is inductive. 15 / 50

  18. Brouwer’s thesis Brouwer’s thesis ( BT ) Every bar is inductive. A predicate P on natural numbers is a bar if ∀ α ∃ n P (¯ α n ) 15 / 50

  19. Brouwer’s thesis Brouwer’s thesis ( BT ) Every bar is inductive. A predicate P on natural numbers is a bar if ∀ α ∃ n P (¯ α n ) P is an inductive bar if IB P ( �� ) holds where, inductively, (i) If P ( s ), then IB P ( s ). (ii) If IB P ( s ∗ n ) for all n ∈ N , then IB P ( s ). More compactly, µ IB P ( s ) = P ( s ) ∨ ∀ n IB P ( s ∗ n ) ( µ means ’least’) 15 / 50

  20. Brouwer’s thesis Brouwer’s thesis ( BT ) Every bar is inductive. A predicate P on natural numbers is a bar if ∀ α ∃ n P (¯ α n ) P is an inductive bar if IB P ( �� ) holds where, inductively, (i) If P ( s ), then IB P ( s ). (ii) If IB P ( s ∗ n ) for all n ∈ N , then IB P ( s ). More compactly, µ IB P ( s ) = P ( s ) ∨ ∀ n IB P ( s ∗ n ) ( µ means ’least’) Hence BT can be written as the schema ∀ α ∃ n P (¯ α n ) → IB P ( �� ) Recommended reading on BT : Wim Veldman: Brouwers Real Thesis on Bars, Philosophia Scientiae, CS 6, 2006. 15 / 50

  21. Issues with BT (regarding applicability) BT ∀ α ∃ n P (¯ α n ) → IB P ( �� ) 16 / 50

  22. Issues with BT (regarding applicability) BT ∀ α ∃ n P (¯ α n ) → IB P ( �� ) ◮ restricted to natural numbers 16 / 50

  23. Issues with BT (regarding applicability) BT ∀ α ∃ n P (¯ α n ) → IB P ( �� ) ◮ restricted to natural numbers ◮ talks about infinite sequences 16 / 50

  24. Issues with BT (regarding applicability) BT ∀ α ∃ n P (¯ α n ) → IB P ( �� ) ◮ restricted to natural numbers ◮ talks about infinite sequences ◮ the premise has computational content which is often not available 16 / 50

  25. Issues with BT (regarding applicability) BT ∀ α ∃ n P (¯ α n ) → IB P ( �� ) ◮ restricted to natural numbers ◮ talks about infinite sequences ◮ the premise has computational content which is often not available ◮ the conclusion has unwanted computational content 16 / 50

  26. Issues with BT (regarding applicability) BT ∀ α ∃ n P (¯ α n ) → IB P ( �� ) ◮ restricted to natural numbers ◮ talks about infinite sequences ◮ the premise has computational content which is often not available ◮ the conclusion has unwanted computational content ◮ to be realizable, the bar P must be decidable, that is, ∀ n ( P ( n ) ∨ ¬ P ( n )) must be provable. 16 / 50

  27. Issues with BT (regarding applicability) BT ∀ α ∃ n P (¯ α n ) → IB P ( �� ) ◮ restricted to natural numbers ◮ talks about infinite sequences ◮ the premise has computational content which is often not available ◮ the conclusion has unwanted computational content ◮ to be realizable, the bar P must be decidable, that is, ∀ n ( P ( n ) ∨ ¬ P ( n )) must be provable. Therefore, we weaken and generalize premise and conclusion. 16 / 50

  28. Paths and accessibility Let ≺ be an arbitrary binary relation. ν Path ≺ ( x ) = ∃ y ≺ x Path ≺ ( y ) ( ν means ’greatest’) µ Acc ≺ ( x ) = ∀ y ≺ x Acc ≺ ( y ) 17 / 50

  29. Paths and accessibility Let ≺ be an arbitrary binary relation. ν Path ≺ ( x ) = ∃ y ≺ x Path ≺ ( y ) ( ν means ’greatest’) µ Acc ≺ ( x ) = ∀ y ≺ x Acc ≺ ( y ) Classically, Path ≺ and Acc ≺ are complements of each other. 17 / 50

  30. Paths and accessibility Let ≺ be an arbitrary binary relation. ν Path ≺ ( x ) = ∃ y ≺ x Path ≺ ( y ) ( ν means ’greatest’) µ Acc ≺ ( x ) = ∀ y ≺ x Acc ≺ ( y ) Classically, Path ≺ and Acc ≺ are complements of each other. Path ≺ ( x ) means (with dependent choice) that there is an infinite ≺ -descending sequence starting with x . 17 / 50

  31. Paths and accessibility Let ≺ be an arbitrary binary relation. ν Path ≺ ( x ) = ∃ y ≺ x Path ≺ ( y ) ( ν means ’greatest’) µ Acc ≺ ( x ) = ∀ y ≺ x Acc ≺ ( y ) Classically, Path ≺ and Acc ≺ are complements of each other. Path ≺ ( x ) means (with dependent choice) that there is an infinite ≺ -descending sequence starting with x . Acc ≺ ( x ) means that ≺ -induction is valid at x . 17 / 50

  32. Paths and accessibility Let ≺ be an arbitrary binary relation. ν Path ≺ ( x ) = ∃ y ≺ x Path ≺ ( y ) ( ν means ’greatest’) µ Acc ≺ ( x ) = ∀ y ≺ x Acc ≺ ( y ) Classically, Path ≺ and Acc ≺ are complements of each other. Path ≺ ( x ) means (with dependent choice) that there is an infinite ≺ -descending sequence starting with x . Acc ≺ ( x ) means that ≺ -induction is valid at x . Setting s ≺ P t Def = ∃ n s = t ∗ n ∧ ¬ P ( t ): ¬ Path ≺ P ( �� ) means that P is a bar, Acc ≺ P ( �� ) means that P is an inductive bar. 17 / 50

  33. Brouwer’s thesis without computational content The implication Acc ≺ ( x ) → ¬ Path ≺ ( x ) is intuitionistically valid (easy ≺ -induction). The converse is can be viewed as a version of Brouwer’s thesis: BT 0 ∀ x ( ¬ Path ≺ ( x ) → Acc ≺ ( x )) 18 / 50

  34. Brouwer’s thesis without computational content The implication Acc ≺ ( x ) → ¬ Path ≺ ( x ) is intuitionistically valid (easy ≺ -induction). The converse is can be viewed as a version of Brouwer’s thesis: BT 0 ∀ x ( ¬ Path ≺ ( x ) → Acc ≺ ( x )) Both, the premise and conclusion of BT 0 , are Harrop formulas (do not contain ∨ at a strictly positive position). 18 / 50

  35. Brouwer’s thesis without computational content The implication Acc ≺ ( x ) → ¬ Path ≺ ( x ) is intuitionistically valid (easy ≺ -induction). The converse is can be viewed as a version of Brouwer’s thesis: BT 0 ∀ x ( ¬ Path ≺ ( x ) → Acc ≺ ( x )) Both, the premise and conclusion of BT 0 , are Harrop formulas (do not contain ∨ at a strictly positive position). Therefore, BT 0 has no computational content and hence does not spoil program extraction. 18 / 50

  36. Wellfounded induction Combining BT 0 and induction for Acc ≺ one obtains wellfounded induction ∀ x ( ∀ y ≺ x P ( y ) → P ( x )) ∀ x ( ¬ Path ≺ ( x ) → P ( x )) wfind (progressive predicates hold at all wellfounded points). 19 / 50

  37. Wellfounded induction Combining BT 0 and induction for Acc ≺ one obtains wellfounded induction ∀ x ( ∀ y ≺ x P ( y ) → P ( x )) ∀ x ( ¬ Path ≺ ( x ) → P ( x )) wfind (progressive predicates hold at all wellfounded points). The extracted program is wellfounded recursion . 19 / 50

  38. Archimedean induction ∀ x � = 0 (( | x | ≤ 3 → P (2 x )) → P ( x )) AI ∀ x � = 0 P ( x ) AI follows classically from AP and wellfounded induction and is realized by general recursion (least fixed point operator). 20 / 50

  39. Archimedean induction ∀ x � = 0 (( | x | ≤ 3 → P (2 x )) → P ( x )) AI ∀ x � = 0 P ( x ) AI follows classically from AP and wellfounded induction and is realized by general recursion (least fixed point operator). A useful variant of Archimedean induction is its relativization to C : ∀ x ∈ C \ { 0 } (( | x | ≤ 3 → P (2 x )) → P ( x )) AIC ∀ x ∈ C \ { 0 } P ( x ) AIC follows from AI and is realized as follows: Assume s realizes the premise of AIC . Then a realizer of the conclusion of AIC is extracted as the recursively defined function χ g = s g ( χ ( d g )) where d = λ g λ n 2 ∗ ( g ( S ( n ))) is the realizer extracted from the easy proof of C ( x ) → C (2 x ) and 2 ∗ implements doubling of (unary representations of) natural numbers. 20 / 50

  40. Avoiding countable choice Proposition 1. ∀ x ∈ C ( x � = 0 → x � � = 0). 21 / 50

  41. Avoiding countable choice Proposition 1. ∀ x ∈ C ( x � = 0 → x � � = 0). Alternative proof. We show ∀ x ∈ C \ { 0 } x � � = 0 using AIC . Let x ∈ C \ { 0 } and assume, as induction hypothesis, | x | ≤ 3 → 2 x � � = 0. Since x ∈ C there is q ∈ Q such that | x − q | ≤ 1. If | q | > 2, then | x | ≥ 1 and we are done. If | q | ≤ 2, then | x | ≤ 3 so we can apply the induction hypothesis to obtain 2 x � � = 0, which implies x � � = 0. 21 / 50

  42. Concurrency (j.w.w. Hideki Tsuiki) Given: Processes p 1 , . . . , p n such that ◮ at least one p i is guaranteed to terminate, ◮ each terminating p i will produce a correct result Task: Combine the p i to obtain a correct result. Solution: Run p 1 , . . . , p n concurrently. As soon as one p i terminates, deliver the result and kill all the other p j . 22 / 50

  43. Concurrency (j.w.w. Hideki Tsuiki) Given: Processes p 1 , . . . , p n such that ◮ at least one p i is guaranteed to terminate, ◮ each terminating p i will produce a correct result Task: Combine the p i to obtain a correct result. Solution: Run p 1 , . . . , p n concurrently. As soon as one p i terminates, deliver the result and kill all the other p j . /papers/tsuiki/ccc tsuiki.pdf 22 / 50

  44. Concurrency (j.w.w. Hideki Tsuiki) Given: Processes p 1 , . . . , p n such that ◮ at least one p i is guaranteed to terminate, ◮ each terminating p i will produce a correct result Task: Combine the p i to obtain a correct result. Solution: Run p 1 , . . . , p n concurrently. As soon as one p i terminates, deliver the result and kill all the other p j . /papers/tsuiki/ccc tsuiki.pdf We introduce an extension of intuitionistic logic enabling the extraction of such kind of programs (together with correctness proofs). 22 / 50

  45. Concurrent disjunction p A 2 which admits two ◮ We add a new form of disjunction A 1 ∨ concurrent processes as realizers. 23 / 50

  46. Concurrent disjunction p A 2 which admits two ◮ We add a new form of disjunction A 1 ∨ concurrent processes as realizers. ◮ . . . and add a new program constructor Amb ( a 1 , a 2 ) for the concurrent execution of the processes a 1 , a 2 (motivated by McCarthy’s Amb). 23 / 50

  47. Concurrent disjunction p A 2 which admits two ◮ We add a new form of disjunction A 1 ∨ concurrent processes as realizers. ◮ . . . and add a new program constructor Amb ( a 1 , a 2 ) for the concurrent execution of the processes a 1 , a 2 (motivated by McCarthy’s Amb). p A 2 iff at least one a i is defined, and ◮ Amb ( a 1 , a 2 ) realizes A 1 ∨ each defined a j realizes A j . 23 / 50

  48. Concurrent law of excluded middle (failed attempt) The following form of the law of excluded middle seems to be realizable provided B is nc: B → A 1 ¬ B → A 2 p A 2 A 1 ∨ If a 1 r ( B → A 1 ) and a 2 r ( ¬ B → A 2 ), which means B → a 1 r A 2 and ¬ B → a 2 r A 2 , one might believe (classically) that p A 2 . Amb ( a 1 , a 2 ) realizes A 1 ∨ However, if, for example, B is false, then the formula B → a 1 r A 1 says nothing about a 1 , but a 1 might still be defined and be delivered as a result of Amb ( a 1 , a 2 ) and consequently, there is no p A 2 . guarantee that Amb ( a 1 , a 2 ) realizes A 1 ∨ 24 / 50

  49. Concurrent law of excluded middle (failed attempt) The following form of the law of excluded middle seems to be realizable provided B is nc: B → A 1 ¬ B → A 2 p A 2 A 1 ∨ If a 1 r ( B → A 1 ) and a 2 r ( ¬ B → A 2 ), which means B → a 1 r A 2 and ¬ B → a 2 r A 2 , one might believe (classically) that p A 2 . Amb ( a 1 , a 2 ) realizes A 1 ∨ However, if, for example, B is false, then the formula B → a 1 r A 1 says nothing about a 1 , but a 1 might still be defined and be delivered as a result of Amb ( a 1 , a 2 ) and consequently, there is no p A 2 . guarantee that Amb ( a 1 , a 2 ) realizes A 1 ∨ We need a variant of implication that avoids this. 24 / 50

  50. Restriction A | | B (a variant of B → A ) Def a r ( A | | B ) = ( B → def ( a )) ∧ ( def ( a ) → a r A ) where B is nc and def ( a ) means that a is defined (i.e. terminates). 25 / 50

  51. Restriction A | | B (a variant of B → A ) Def a r ( A | | B ) = ( B → def ( a )) ∧ ( def ( a ) → a r A ) where B is nc and def ( a ) means that a is defined (i.e. terminates). Proof rules: B → A 0 ∨ A 1 ¬ B → A 0 ∧ A 1 | | I A 0 ∨ A 1 | | B where A 0 , A 1 must be nc . . . 25 / 50

  52. Concurrent law of excluded middle (correct) A 1 | | B A 2 | | ¬ B Conc-lem p A 2 A 1 ∨ If a 1 realizes A 1 | | B and a 2 realizes A 2 | | ¬ B , p A 2 . then Amb ( a 1 , a 2 ) realizes A 1 ∨ 26 / 50

  53. Concurrent law of excluded middle (correct) A 1 | | B A 2 | | ¬ B Conc-lem p A 2 A 1 ∨ If a 1 realizes A 1 | | B and a 2 realizes A 2 | | ¬ B , p A 2 . then Amb ( a 1 , a 2 ) realizes A 1 ∨ Monotonicity (replacing disjunction elimination): A 1 → B 1 A 2 → B 2 p B 2 ) Conc-mon p A 2 ) → ( B 1 ∨ ( A 1 ∨ 26 / 50

  54. Infinite Gray code Using the concurrent extension of IFP it is possible to extract programs operating on Tsuiki’s infinite Gray code for real numbers . Infinite Gray code admits representations of real numbers with possibly one undefined digit, which forces computation to be concurrent and nondeterministic. In return, infinite Gray code has the remarkable property that is computable and unique , that is, every real number has exactly one code . Hideki Tsuiki. Real number computation through Gray code embedding. Theoretical Computer Science, 284:467–485, 2002. 27 / 50

  55. Bar induction for decidable bars ( BI ) If (1) P is a bar, (2) P decidable and P ⊆ Q , (3) ∀ s ( ∀ n Q ( s ∗ n ) → Q ( s )), then Q ( �� ). It is easy to see that BT implies BI . 28 / 50

  56. Abstract bar induction ( ABI ) y ≺ ∗ x y = x ∨ ∃ z ( y ≺ ∗ z ∧ z ≺ x ) µ = (refl. trans. closure) Def y ≺ P x = y ≺ x ∧ ¬ P ( x ) 29 / 50

  57. Abstract bar induction ( ABI ) y ≺ ∗ x y = x ∨ ∃ z ( y ≺ ∗ z ∧ z ≺ x ) µ = (refl. trans. closure) Def y ≺ P x = y ≺ x ∧ ¬ P ( x ) Let x 0 be arbitrary (playing the role of the empty sequence). ABI If (1) ¬ Path ≺ P ( x 0 ) (2) ∀ x ≺ ∗ x 0 ( ¬ P ( x ) ∨ Q ( x )), (3) ∀ x ≺ ∗ x 0 ( ∀ y ≺ x Q ( y ) → Q ( x )), then Q ( x 0 ). 29 / 50

  58. Abstract bar induction ( ABI ) y ≺ ∗ x y = x ∨ ∃ z ( y ≺ ∗ z ∧ z ≺ x ) µ = (refl. trans. closure) Def y ≺ P x = y ≺ x ∧ ¬ P ( x ) Let x 0 be arbitrary (playing the role of the empty sequence). ABI If (1) ¬ Path ≺ P ( x 0 ) (2) ∀ x ≺ ∗ x 0 ( ¬ P ( x ) ∨ Q ( x )), (3) ∀ x ≺ ∗ x 0 ( ∀ y ≺ x Q ( y ) → Q ( x )), then Q ( x 0 ). Lemma. BT 0 implies ABI . Assume (1), (2), (3). By BT 0 , Acc ≺ P ( x 0 ). We prove Proof. Acc ≺ P ⊆ Q by wellfounded induction. By i.h., ∀ y ≺ ∗ P x Q ( y ). We have to show Q ( x ). We do a case analysis according to (2). If Q ( x ), we are done. If ¬ P ( x ) then the i.h. is equivalent to the premise of (3), hence, again Q ( x ). 29 / 50

  59. Bang! If A is a formula, then ! A is a Harrop formula with a r ! A Def = a = Nil ∧ ∀ a ( a r A ). 30 / 50

  60. Bang! If A is a formula, then ! A is a Harrop formula with a r ! A Def = a = Nil ∧ ∀ a ( a r A ). For example, Nil r !( ⊥ → A ) since, a r ( ⊥ → A ) ≡ ⊥ → a r A . 30 / 50

  61. Bang! If A is a formula, then ! A is a Harrop formula with a r ! A Def = a = Nil ∧ ∀ a ( a r A ). For example, Nil r !( ⊥ → A ) since, a r ( ⊥ → A ) ≡ ⊥ → a r A . Intuitively, ! A expresses that A is true (realizable) for trivial reasons. 30 / 50

  62. Bang! If A is a formula, then ! A is a Harrop formula with a r ! A Def = a = Nil ∧ ∀ a ( a r A ). For example, Nil r !( ⊥ → A ) since, a r ( ⊥ → A ) ≡ ⊥ → a r A . Intuitively, ! A expresses that A is true (realizable) for trivial reasons. Valid (realizable) rules we will use in the following: A ! H ( A Harrop) ! A A → ! B ! A ∧ ! B ! → ! ∧ !( A → B ) !( B ∧ A ) ∀ x ! A ( x ) ! ∀ ∃ x ! A ( x ) ! ∃ ! ∀ x A ( x ) ! ∃ x A ( x ) 30 / 50

  63. ! LEM ¬ A → B A → ! B ! LEM B 31 / 50

  64. ! LEM ¬ A → B A → ! B ! LEM B Lemma The rules for bang are realizable. 31 / 50

  65. ! LEM ¬ A → B A → ! B ! LEM B Lemma The rules for bang are realizable. Proof. We only look at ! LEM . Assume a r ( ¬ A → B ) and Nil r ( A → ! B ), that is, ¬∃ c c r A → a r B and ∃ c c r A → ∀ b b r B . Using the law of excluded middle, we conclude a r B . 31 / 50

  66. Banged bar induction ! BI If (1) ¬ Path ≺ P ( x 0 ), (2) ∀ x ≺ ∗ x 0 ( P ( x ) → ! Q ( x )), (3) ∀ x ≺ ∗ x 0 ( ∀ y ≺ x Q ( y ) → Q ( x )), then Q ( x 0 ). 32 / 50

  67. Banged bar induction ! BI If (1) ¬ Path ≺ P ( x 0 ), (2) ∀ x ≺ ∗ x 0 ( P ( x ) → ! Q ( x )), (3) ∀ x ≺ ∗ x 0 ( ∀ y ≺ x Q ( y ) → Q ( x )), then Q ( x 0 ). Lemma BT 0 implies ! BI . 32 / 50

  68. Banged bar induction ! BI If (1) ¬ Path ≺ P ( x 0 ), (2) ∀ x ≺ ∗ x 0 ( P ( x ) → ! Q ( x )), (3) ∀ x ≺ ∗ x 0 ( ∀ y ≺ x Q ( y ) → Q ( x )), then Q ( x 0 ). Lemma BT 0 implies ! BI . Proof. The proof is almost identical to the proof for ABI . The only difference is that we use ! LEM to do a case analysis, on whether P ( x ) holds, using (2). 32 / 50

  69. Banged bar induction ! BI If (1) ¬ Path ≺ P ( x 0 ), (2) ∀ x ≺ ∗ x 0 ( P ( x ) → ! Q ( x )), (3) ∀ x ≺ ∗ x 0 ( ∀ y ≺ x Q ( y ) → Q ( x )), then Q ( x 0 ). Lemma BT 0 implies ! BI . Proof. The proof is almost identical to the proof for ABI . The only difference is that we use ! LEM to do a case analysis, on whether P ( x ) holds, using (2). The extracted program takes as input a realizer g of (3) (note that (2) is Harrop) and returns h �� where h s = g s ( λ a ( h ( s ∗ a ))) . 32 / 50

  70. Proving uniform continuity We aim to prove that every total continuous functional F on Cantor space is uniformly continuous and extract from the proof the fan functional that computes the minimal modulus of uniform continuity of F . 33 / 50

  71. Proving uniform continuity We aim to prove that every total continuous functional F on Cantor space is uniformly continuous and extract from the proof the fan functional that computes the minimal modulus of uniform continuity of F . Language: Constants: 0 , 1 , ⊥ , where 0 , 1 represent at the same time the first two natural numbers and the Booleans, and ⊥ represents ’undefined’ (not to be confused with the formula ⊥ ). Function symbols: + , − , application operation (written by juxtaposition), common (primitive recursive) operations to define finite and infinite sequences. Relation symbol: < (ordinary ordering of numbers). 33 / 50

  72. Proving uniform continuity We aim to prove that every total continuous functional F on Cantor space is uniformly continuous and extract from the proof the fan functional that computes the minimal modulus of uniform continuity of F . Language: Constants: 0 , 1 , ⊥ , where 0 , 1 represent at the same time the first two natural numbers and the Booleans, and ⊥ represents ’undefined’ (not to be confused with the formula ⊥ ). Function symbols: + , − , application operation (written by juxtaposition), common (primitive recursive) operations to define finite and infinite sequences. Relation symbol: < (ordinary ordering of numbers). µ Natural numbers: N ( x ) = x = 0 ∨ N ( x − 1). 33 / 50

  73. Partial functionals We define the partial Booleans and partial Boolean-valued functionals of type 1 and 2: Def B ( x ) = x = 0 ∨ x = 1 Def B ⊥ ( x ) = x � = ⊥ → B ( x ) Def B 1 ⊥ ( α ) = ∀ n ( N ( n ) → B ⊥ ( α n )) Def B 2 ∀ α ( B 1 ⊥ ( F ) = ⊥ ( α ) → B ⊥ ( F α )) 34 / 50

  74. Partial functionals We define the partial Booleans and partial Boolean-valued functionals of type 1 and 2: Def B ( x ) = x = 0 ∨ x = 1 Def B ⊥ ( x ) = x � = ⊥ → B ( x ) Def B 1 ⊥ ( α ) = ∀ n ( N ( n ) → B ⊥ ( α n )) Def B 2 ∀ α ( B 1 ⊥ ( F ) = ⊥ ( α ) → B ⊥ ( F α )) For the following it wouldn’t make much difference if the result predicate of F were N ⊥ (instead of B ⊥ ). 34 / 50

  75. Continuity Specialization order : Def x ⊑ y = x � = ⊥ → x = y Def α ⊑ β = ∀ n ∈ N ( α n ⊑ β n ) 35 / 50

  76. Continuity Specialization order : Def x ⊑ y = x � = ⊥ → x = y Def α ⊑ β = ∀ n ∈ N ( α n ⊑ β n ) Monotonicity , finitarity , continuity : Def ∀ α, β ∈ B 1 Mon ( F ) = ⊥ ( α ⊑ β → F α ⊑ F β ) Def ∀ α ∈ B 1 Fin ( F ) = ⊥ ( ∀ n ∈ N F ( α ↑ n ) = ⊥ → F α = ⊥ ) Def Cont ( F ) = Mon ( F ) ∧ Fin ( F ) where ( α ↑ n ) k = if k < n then α k else ⊥ . 35 / 50

  77. Totality Def Total 1 ( α ) = ∀ n ( N ( n ) → α n � = ⊥ ) Def Total 2 ( F ) ∀ α ( Total 1 ( α ) → F α � = ⊥ )) = 36 / 50

  78. Totality Def Total 1 ( α ) = ∀ n ( N ( n ) → α n � = ⊥ ) Def Total 2 ( F ) ∀ α ( Total 1 ( α ) → F α � = ⊥ )) = Def B 1 ( α ) B 1 ⊥ ( α ) ∧ Total 1 ( α ) = Def B 2 ( F ) B 2 ⊥ ( F ) ∧ Total 1 ( F ) = 36 / 50

  79. Uniform continuity A type 2 functional F is uniformly continuous if there is (a least) n ∈ N such that F α = F β for all total α, β agreeing below n . Def ∀ α, β ∈ B 1 ( α = n β → F α = F β ) UCont ( F , n ) = Def UCont ( F ) = ∃ n ∈ N UCont ( F , n ) where α = n β Def = ∀ k ∈ N ( k < n → α k = β k ). 37 / 50

  80. Uniform continuity A type 2 functional F is uniformly continuous if there is (a least) n ∈ N such that F α = F β for all total α, β agreeing below n . Def ∀ α, β ∈ B 1 ( α = n β → F α = F β ) UCont ( F , n ) = Def UCont ( F ) = ∃ n ∈ N UCont ( F , n ) where α = n β Def = ∀ k ∈ N ( k < n → α k = β k ). We aim to prove that every F ∈ B 2 ⊥ which is total and continuous is uniformly continuous. 37 / 50

Recommend


More recommend