Logic Decoration algorithm Decorating proofs Helmut Schwichtenberg joint work with Luca Chiarabini and Diana Ratiu Mathematisches Institut, LMU, M¨ unchen Leeds Symposium on Proof Theory and Constructivism, 3 - 16 July 2009 Helmut Schwichtenberg Decorating proofs
Natural deduction with non-computational connectives Logic Computational content of proofs Decoration algorithm Realizability Logic ◮ Typed language, with free algebras as base types. ◮ Intended domains: partial continuous functionals. ◮ Terms are those of T + , a common extension of G¨ odel’s T and Plotkin’s PCF . ◮ Natural deduction rules for → and ∀ (“minimal logic”). ◮ All predicates are defined inductively. Examples: (Leibniz) equality Eq , totality, ∃ , ∧ , ∨ . Helmut Schwichtenberg Decorating proofs
Natural deduction with non-computational connectives Logic Computational content of proofs Decoration algorithm Realizability Computational content ◮ Proofs have two aspects: (i) They guarantee correctness. (ii) They may have computational content. ◮ Computational content only enters a proof via inductively (or coinductively) defined predicates. ◮ To fine tune the computational content of a proof, distinguish → c , ∀ c (computational) and → , ∀ (non-computational). Helmut Schwichtenberg Decorating proofs
Natural deduction with non-computational connectives Logic Computational content of proofs Decoration algorithm Realizability Natural deduction : assumption variables u A . Rules for → c : derivation proof term [ u : A ] | M ( λ u A M B ) A → c B B ( → c ) + u A → c B | M | N A → c B ( M A → c B N A ) B A ( → c ) − B Helmut Schwichtenberg Decorating proofs
Natural deduction with non-computational connectives Logic Computational content of proofs Decoration algorithm Realizability Natural deduction: rules for ∀ c derivation proof term | M x A (var. cond.) ( λ x M A ) ∀ c A ( ∀ c ) + x (var. cond.) ∀ c x A | M ∀ c ( M ∀ c x A ( x ) r ) A ( r ) x A ( x ) r ( ∀ c ) − A ( r ) Helmut Schwichtenberg Decorating proofs
Natural deduction with non-computational connectives Logic Computational content of proofs Decoration algorithm Realizability Restrictions to → + and ∀ + (non-computational) CV ( M ) := the set of “computational variables” of a derivation M , relative to a fixed assigment u A �→ x τ ( A ) . Consider u [ u : A ] | M ( λ u A M B ) A → B . or as proof term B → + u A → B ( λ u A M B ) A → B is correct if M B is and x u / ∈ CV ( M B ). Consider | M ( λ x M A ) ∀ x A or as proof term (with var. condition) . A ∀ + x ∀ x A ( λ x M A ) ∀ x A is correct if M A is and x / ∈ CV ( M A ). Helmut Schwichtenberg Decorating proofs
Natural deduction with non-computational connectives Logic Computational content of proofs Decoration algorithm Realizability Formulas as computational problems ◮ Kolmogorov (1925) proposed to view a formula A as a computational problem, of type τ ( A ), the type of a potential solution or “realizer” of A . ◮ Example: ∀ c n ∃ m > n Prime ( m ) has type N → N . ◮ A �→ τ ( A ), a type or the “nulltype” symbol o . ◮ In case τ ( A ) = o proofs of A have no computational content; such formulas A are called computationally irrelevant (c.i.) or Harrop formulas; the others computationally relevant (c.r.). Helmut Schwichtenberg Decorating proofs
Natural deduction with non-computational connectives Logic Computational content of proofs Decoration algorithm Realizability Realizability Let t be either a term of type τ ( A ) if this is a type, or the “nullterm” symbol ε if τ ( A ) = o . Extend term application to ε : ε t := ε, t ε := t , εε := ε. We define the formula t r A , read t realizes A . ε r I � r := I � r for I not requiring witnesses (e.g., Eq ) , t r ( A → c B ) := ∀ x ( x r A → tx r B ) , t r ( A → B ) := ∀ x ( x r A → t r B ) , t r ∀ c x A := ∀ x ( tx r A ) , t r ∀ x A := ∀ x ( t r A ) and similarly for ∃ , ∧ , ∨ and other inductively defined I ’s. Helmut Schwichtenberg Decorating proofs
Natural deduction with non-computational connectives Logic Computational content of proofs Decoration algorithm Realizability Derivations and extracted terms For M A with A c.i. let [ [ M ] ] := ε . Assume A is c.r. Then := x τ ( A ) ( x τ ( A ) [ u A ] uniquely associated with u A ) , [ ] u u [( λ u A M B ) A → c B ] [ ] := λ x τ ( A ) [ [ M ] ] , u [( M A → c B N A ) B ] [ ] := [ [ M ] ][ [ N ] ] , [( λ x ρ M A ) ∀ c x A ] [ ] := λ x ρ [ [ M ] ] , [( M ∀ c x A ( x ) r ) A ( r ) ] [ ] := [ [ M ] ] r , [( λ u A M B ) A → B ] [( M A → B N A ) B ] [( λ x ρ M A ) ∀ x A ] [ ] := [ ] := [ ] [( M ∀ x A ( x ) r ) A ( r ) ] := [ ] := [ [ M ] ] . Define CV ( M ) := FV ([ [ M ] ]). Helmut Schwichtenberg Decorating proofs
Natural deduction with non-computational connectives Logic Computational content of proofs Decoration algorithm Realizability Soundness Let x u A denote the nullterm symbol ε in case A is c.i. Theorem (Soundness) Let M be a derivation of A from assumptions u i : C i (i < n). Then we can derive [ [ M ] ] r A from assumptions x u i r C i . Proof. Case u : A . Then [ [ u ] ] = x u . Case ( λ u A M B ) A → B . We must find a derivation of [ [ M ] ] r ( A → B ) , which is ∀ x ( x r A → [ [ M ] ] r B ) , Use the IH. Case M A → B N A . We must find a derivation [ [ M ] ] r B . By IH we have ∀ x ( x r A → [ [ M ] ] r B ) and [ [ N ] ] r A . Hence the claim. Helmut Schwichtenberg Decorating proofs
Example: Maximal Scoring Segment (MSS) Logic Example: induction vs. cases Decoration algorithm Example: passing continuations Decoration can simplify extracts ◮ Suppose that a proof M uses a lemma L d : A ∨ d B . ◮ Then the extract [ [ L d ] [ M ] ] will contain the extract [ ]. ◮ Suppose that the only computationally relevant use of L d in M was which one of the two alternatives holds true, A or B . ◮ Express this by using a weakened lemma L : A ∨ B . ◮ Since [ [ L ] ] is a boolean, the extract of the modified proof is [ L d ] “purified”: the (possibly large) extract [ ] has disappeared. Helmut Schwichtenberg Decorating proofs
Example: Maximal Scoring Segment (MSS) Logic Example: induction vs. cases Decoration algorithm Example: passing continuations Decoration algorithm Goal: Insert as few as possible decorations into a proof. ◮ Seq ( M ) of a proof M consists of its context and end formula. ◮ The uniform proof pattern U ( M ) of a proof M is the result of changing in c.r. formulas of M (i.e., not above a c.i. formula) all → c , ∀ c into → , ∀ (some restrictions on axioms, theorems). ◮ A formula D extends C if D is obtained from C by changing some → , ∀ into → c , ∀ c . ◮ A proof N extends M if (i) N and M are the same up to variants of → , ∀ in their formulas, and (ii) every c.r. formula of M is extended by the corresponding one in N . Helmut Schwichtenberg Decorating proofs
Example: Maximal Scoring Segment (MSS) Logic Example: induction vs. cases Decoration algorithm Example: passing continuations Decoration algorithm Assumption: For every axiom or theorem A and every decoration variant C of A we have another axiom or theorem whose formula D extends C , and D is the least among those extensions. Theorem (Ratiu, S.) Under the assumption above, for every uniform proof pattern U and every extension of its sequent Seq ( U ) we can find a decoration M ∞ of U such that (a) Seq ( M ∞ ) extends the given extension of Seq ( U ) , and (b) M ∞ is optimal in the sense that any other decoration M of U whose sequent Seq ( M ) extends the given extension of Seq ( U ) has the property that M also extends M ∞ . Helmut Schwichtenberg Decorating proofs
Example: Maximal Scoring Segment (MSS) Logic Example: induction vs. cases Decoration algorithm Example: passing continuations Case → − . Consider a uniform proof pattern Φ , Γ Γ , Ψ | U | V A → B A → − B Given: extension Π , ∆ , Σ ⇒ D of Φ , Γ , Ψ ⇒ B . Alternating steps: ◮ IH a ( U ) for extension Π , ∆ ⇒ A → D �→ decoration M 1 of U whose sequent Π 1 , ∆ 1 ⇒ C 1 ˘ → D 1 extends Π , ∆ ⇒ A → D . Suffices if A is c.i.: extension ∆ 1 , Σ ⇒ C 1 of V is a proof (in c.i. parts of a proof → , ∀ and → c , ∀ c are identified). For A c.r: ◮ IH a ( V ) for the extension ∆ 1 , Σ ⇒ C 1 �→ decoration N 2 of V whose sequent ∆ 2 , Σ 2 ⇒ C 2 extends ∆ 1 , Σ ⇒ C 1 . ◮ IH a ( U ) for Π 1 , ∆ 2 ⇒ C 2 ˘ → D 1 �→ decoration M 3 of U whose sequent Π 3 , ∆ 3 ⇒ C 3 ˘ → D 3 extends Π 1 , ∆ 2 ⇒ C 2 ˘ → D 1 . ◮ IH a ( V ) for the extension ∆ 3 , Σ 2 ⇒ C 3 �→ decoration N 4 of V whose sequent ∆ 4 , Σ 4 ⇒ C 4 extends ∆ 3 , Σ 2 ⇒ C 3 . . . . Helmut Schwichtenberg Decorating proofs
Example: Maximal Scoring Segment (MSS) Logic Example: induction vs. cases Decoration algorithm Example: passing continuations Decorating axioms and theorems ◮ The “uninstantiated” formula of the axiom or theorem may contain the same predicate variable Q many times. The decoration algorithm needs to pick the “least upper bound” (w.r.t. extension) of the formula substituted for Q . ◮ The data base of theorems is checked whether there is one that fits as well, has its assumptions in the present context, and is minimal (w.r.t. extension) among all those. This alternative then is preferred. Helmut Schwichtenberg Decorating proofs
Recommend
More recommend