Type Structures and Normalization by Evaluation for System F ω

Size: px
Start display at page:

Download "Type Structures and Normalization by Evaluation for System F ω"

Transcription

1 Type Structures and Normalization by Evaluation for System F ω Andreas Abel Department of Computer Science Ludwig-Maximilians-University Munich Abstract We present the first verified normalization-by-evaluation algorithm for System F ω, the simplest impredicative type theory with computation on the type level Types appear in three shapes: As syntactical types, as type values which direct the reification process, and as semantical types, ie, sets of total values The three shapes are captured by the new concept of a type structure, and the fundamental theorem now states that an induced structure is a type substructure This work is an attempt at an algebraic treatment of type theory based on typed applicative structures rather than categories 1 Introduction The Curry-Howard isomorphism, which identifies proofs with programs and propositions with types, is the basis of several type-theoretic theorem provers, such as Coq [19], Agda [20], Epigram [15] and LEGO [21] In these systems, checking the validity of proofs or typings relies on deciding equality of types Types are recognized as equal if they have the same normal form, this is why normalization plays a key role in the study of the theories underlying these theorem provers, such as the Calculus of Constructions (CC) which underlies Coq and LEGO, and Martin-Löf Type Theory which is the basis of Agda and Epigram The hardwired type equality of these systems, often referred to as definitional equality, is necessarily intensional, since fully extensional equality is undecidable The minimal equality is induced by just the computational laws (β-laws), yet, the stronger the hardwired equality, the less manual equality proofs, and the succincter proofs can get Thus, it is desirable to add bits of extensionality as long as decidability is preserved For the CC, different directions have been explored, such as rewriting [13, 16] and decision procedures [14] Our goal is to integrate η-laws which provide some extensionality for functions, into definitional equality of CC Normalization by evaluation (NbE) [12, 17] is a systematic method to perform βη-normalization In a first step, the object t of type T is evaluated The resulting value d is then reified to an η-long β-normal form v The reification process is directed by the shape of type T NbE has proven a valid tool to structure extensional normalization, especially in the case of sum types [7, 9, 11] We are convinced it is the perfect tool to account for the meta-theory of η, thus, we are researching the type systems of the lambda cube with βη-equality given by judgements The lambda cube organizes type systems in three dimensions: dependency, impredicativity, and higher-order In previous work [3], we have adapted NbE to a dependent type theory with one predicative universe and judgmental βη-equality, yielding injectivity of the function space constructor in the presence of universes What is the challenge when stepping up to impredicativity? Predicative type theories allow to define the semantics of types from below via induction-recursion, and the reification function can be defined by induction on types This fails in the presence of impredicativity, where one first has to lay out a lattice of semantic type candidates and then define impredicative quantification as the intersection over all candidates [18] Hence, the semantic type structure is not inductive, and reification cannot be defined by induction on types 1 There are at least two ways out of this dilemma: Altenkirch, Hofmann, and Streicher [8] incorporated the definition of the normalization function into their model construction for System F In previous work, I have conceived reification as a deterministic relation between value d and normal form v and their type T, and showed through a model construction that it corresponds to a total function In this work, we are moving one step closer to NbE for the CC: we are considering the simplest type system which features impredicativity and computation on the type level: the higher-order polymorphic lambda-calculus F ω It adds to the problem of impredicativity the difficulty that types are no longer fixed syntactic expressions as in System F, but 1 The reflection function, which is defined mutually inductive with reification, yields at universal quantification ( XA t)(b) = A[B/X] (t B) Clearly A[B/X] can be bigger as XA For similar reasons, the set of η-long normal forms cannot be defined by induction on the type in System F; it lacks the subformula property for normal forms 1

2 they need to be normalized as well One solution would be to keep types always in long normal form, e g, by the use of hereditary substitutions [23, 6] This is possible since the types are simply-kinded, so normalization can be defined by induction on kinds However, this approach would not scale, eg, to CC, where serious computation is happening on the type level Furthermore, we would like to use the same normalization procedure both on object and type level In the solution we have chosen here, reification of objects is directed by type values A Syntactic types T are interpreted by a pair (A, A) of a type value A and a semantic type A which is a set of objects that are reifiable at type A Furthermore, type value A reifies to a normal form V which is βη-equal to T These considerations lead us to the concept of a type structure which captures the similarities between syntactic types, type values, and semantic types Consequently, syntactic objects and their values both form an object structure over a type structure, the syntactical type structure in case of syntactic objects and the structure of type values in case of (object) values We reorganize a typical normalization proof for System F ω by model construction [5] into our framework of type and object structures Central to such a normalization proof is the fundamental theorem of typing which states that t [[T ]] for any object t of type T Herein, t interprets object t in some applicative structure, for instance in the structure of syntactical objects The semantic type [[T ]] is a collection of values, typically a set of normalizing objects, where the function type [[T 1 T 2 ]] is defined à la Tait [22], i e, as all values f such that f applied to d inhabits [[T 2 ]] for all d in [[T 1 ]] The essence of the fundamental theorem is that the (hereditarily) normalizing terms model the typing rules where these terms are a (non-proper) subset of the typable terms In our abstract setting, the fundamental theorem proves that a part of an object structure with the above function type definition is an object substructure, casting the fundamental theorem into an algebraic setting Or notions of type and object structures are very general, in essence typed versions of Barendregt s syntactical applicative structures [10, Def 531] The fundamental theorems we prove are also very general since we do not fix an interpretation of types; we only require that semantical types inhabit a candidate space By choosing different candidate spaces we can harvest different results from the same fundamental theorem, e g, soundness of NbE, completeness of NbE, or weak normalization of β- or βη-reduction [2] 11 Overview Table 1 systematizes the main structures introduced in this article Kind structures are inhabited by kinds, the types of types of System F ω The free kind structure Ki is inhabited by the syntactic kinds κ which coincide with their values, since no computation takes place on the kind level A kind κ can be interpreted as a family K of types which are drawn from a type structure T ; with Tait s interpretation of the function arrow between kinds, the collection T of subsets of T forms another kind structure Instances of type structures are Ty, which contains the syntactical types T, or T, which contains type values A of some sort, or D which contains semantical types A, sets of objects, hence, subsets of an object structure D At higher kinds κ κ, Ty is inhabited by proper type constructors, T by their values F, and D by operators F on sets of objects On the level of objects, we have syntactical objects t in structure Obj and values d in structure D All structures are sorted, so types always have a kind, and objects always have a type, syntactical objects a syntactical type, and values a type value In the following developments we omit most proofs due to lack of space They can be found in the full version of this article on the author s homepage [1] 12 Preliminaries Contexts,, Γ,, Φ, Ψ are functions from variables to some codomain We write for the totally undefined function and Φ, x : a for the function Φ with domain dom(φ) {x} such that Φ (x) = a and Φ (y) = Φ(y) for y x We say Ψ extends Ψ, written Ψ Ψ, if Ψ (x) = Ψ(x) for all x dom(ψ) Families T indexed by a context are always understood to be Kripke, i e, implies T T We use also for pointwise inclusion of families, e g, S T means S κ T κ if S, T are families indexed by a kind κ and a context The notion Kripke family is also used for maps M There it implies that M does not depend on the context parameter, i e, M (a) = M (a) for a dom(m ) and (Note that dom(m ) dom(m ) since M is Kripke) We identify a pair of functions (f, g) with the function h(x) = (f(x), g(x)), especially in the case of contexts (, Γ) or environments (σ, ρ) We will sometimes drop the parentheses and write just the comma We write (a A) B(a) for the dependent function space {f A a A B(a) f(a) B(a) for all a A} 2 Syntax In this section, we present the syntax and inference rules for System F ω The system consists of three levels: On the lowest level there live the objects, meaning polymorphic, purely functional programs On the middle level live the 2

3 syntax value semantics structures kind κ Ki family of types K T κ Ki, T type T Ty A T family of objects A D A Ty, T, D object T Ty κ κ t Obj Γ T D F :κ κ F T κ κ operator F d D A Obj, D Table 1 Systematics of kind, type, and object structures types of objects, and the type constructors, which are classified by kinds which inhabit the highest level Kinds κ Ki are given by the grammar κ ::= κ κ Kind classifies type constructors which are actually types, and kind κ κ classifies the type constructors which map type constructors of kind κ to type constructors of kind κ In the following, we will refer to all type constructors as types Assume a countably infinite set of type variables TyVar whose members are denoted by X, Y, Z, Kinding contexts, KiCxt are partial maps from the type variables into Ki The set TyCst = {, κ κ Ki} contains the type constants C Their kinds are given by the signature Σ TyCst Ki defined by Σ( ) = Σ( κ ) = (κ ) for all κ Ki Types are given by the grammar T, U, V ::= C X λx : κ T T U where X TyVar and form a simplykinded lambda calculus Objects are given by the grammar t, u, v ::= x λx : T t t u ΛX : κ t t U and form a polymorphic lambda-calculus with type abstraction and type application Herein, object variables x are drawn from a countably infinite set ObjVar which is disjoint to TyVar We write b[a/x] for caption-avoiding substitution of a for variable x in syntactic expression b, and FV for the function returning the set of all free type and object variables of a syntactic expression Kinding, typing, and equality for System F ω is given by five judgements whose inference rules are displayed in Figure 1 T : κ T = T : κ ; Γ t : T ; Γ t = t : T Herein, the auxiliary judgement Γ, read Γ is a wellformed typing context in, is defined as Γ(x) : for all x dom(γ) We set Ty κ := {T T : κ} Obj Γ T := {t ; Γ t : T } 3 Kind Structures Definition 1 (Kind structure) A kind structure is a set K with a distinguished element K and a binary operation K K K The free kind structure is Ki A kind structure can also consist of semantical kinds which are sets of types drawn from a type structure T In the following, we present this abstractly Definition 2 (Kind candidate space) Let (K κ, κ ) be a Ki-indexed family of posets with a (polymorphic) binary operation K κ K κ K κ κ A kind candidate space C consists of two families C κ, C κ K κ, written κ, κ if no ambiguity arises, such that K-BASE, K-FUN-I κ κ κ κ, K-FUN-E κ κ κ κ For K K κ we write κ C K and say κ realizes K w r t C iff κ K κ For a family K κ K κ we write C K if κ C K for all κ Lemma 3 (Realizability kind structure) In the context of the above definition: If is antitone in its first argument and monotone in its second argument, then C := {(κ, K) κ C K} constitutes a kind structure with distinguished element Proof We have, and κ K and κ K imply κ κ K K 4 Type Structures In this section, we define type structures as an abstraction over syntactic types, type values, and semantic types Type structures form a category with products Definition 4 (Type structure) An (F ω ) type structure is a Kripke family T κ of sets with the following Kripke families of maps: Cst (C dom(σ)) T Σ(C) App κ κ T κ κ T κ T κ 3

4 Kinding T : κ In context, type T has kind κ C : Σ(C) X : (X), X :κ T : κ T : κ κ U : κ λx :κ T : κ κ T U : κ Type equality T = T : κ In context, types T and T are βη-equal of kind κ, X :κ T : κ U : κ T : κ κ (λx :κ T ) U = T [U/X] : κ λx :κ T X = T : κ κ X FV(T ) C = C : Σ(C) X = X : (X), X :κ T = T : κ T : κ κ U : κ λx :κ T = λx :κ T : κ κ T U : κ Typing ; Γ t : T In contexts, Γ, object t has type T Γ ; Γ x : Γ(x) ; Γ, x:u t : T ; Γ λx:u t : U T ; Γ t : U T ; Γ u : U ; Γ t u : T, X :κ; Γ t : T X ; Γ ΛX :κ t : κ T X FV(T ) ; Γ t : κ T U : κ ; Γ t U : T U ; Γ t : T T = T : ; Γ t : T Object equality ; Γ t = t : T In contexts, Γ, objects t and t are βη-equal of type T ; Γ, x:u t : T ; Γ u : U ; Γ (λx:u t) u = t[u/x] : T, X :κ; Γ t : T U : κ ; Γ (ΛX :κ t) U = t[u/x] : T [U/X] ; Γ t : U T ; Γ λx:u t x = t : U T x FV(t) ; Γ t : κ T ; Γ ΛX :κ t X = t : κ T X FV(t) Γ ; Γ x = x : Γ(x) ; Γ, x:u t = t : T ; Γ λx:u t = λx:u T : U T ; Γ t = t : U T ; Γ u = u : U ; Γ t u = t u : T, X :κ; Γ t = t : T X ; Γ ΛX :κ t = ΛX :κ t : κ T X FV(T ) ; Γ t = t : κ T U = U : κ ; Γ t U = t U : T U ; Γ t = t : T T = T : ; Γ t = t : T Figure 1 F ω : kinding, type equality, typing, object equality 4

5 Usually, we will just write F G for App κ κ (F, G) Furthermore, we stipulate an interpretation function [[ ]] : Ty κ T T κ where ρ T (X) iff ρ(x) T for all X dom() The interpretation function must satisfy the following equations [[C]] ρ = Cst (C) [[X]] ρ = ρ(x) [[λx :κ T ]] ρ G = [[T ]] ρ[x G] [[T U]] ρ = [[T ]] ρ [[U]] ρ We use interpretation synonymous to evaluation We may suppress the index in Cst or even drop Cst altogether, i e, we just write T instead of Cst( ) T To avoid ambiguities when different type structures are in scope, we may write T, κ T, T and T [[ ]] to emphasize that we mean the type structure operations of T Simple examples of type structures are Ty and Ty modulo β, βη, or judgmental equality In these instances, the interpretation function is parallel substitution Our notion of type structure essentially coincides with Barendregt s syntactical applicative structure [10, 531], except that we are working in a kinded setting and Barendregt in untyped lambda-calculus Definition 5 (Type structure morphism) Given two type structures S and T, a type structure morphism M : S T is a Kripke family of maps M κ Sκ T κ that commute with the operations of S, i e, M κ(c S) = C T (C :κ) Σ M κ (F S G) = M κ κ (F ) T M κ (G) F Sκ κ, G S κ M κ(s[[t ]] ρ ) = T [[T ]] M ρ T Ty κ, ρ S forms a new type structure with C S T := (C S, C T ) for all C TyCst (F, F ) (G, G ) := (F G, F G ) [[F ]] ρ,ρ := ([[F ]] ρ, [[F ]] ρ ) Proof One easily validates the laws [[X]] ρ,ρ = (ρ, ρ )(X) [[λx :κ T ]] ρ,ρ (G, G ) = [[T ]] (ρ,ρ )[X (G,G )] [[T U]] ρ,ρ = [[T ]] ρ,ρ [[U]] ρ,ρ using the definition of application and evaluation The two projections π 1 : S T S and π 2 : S T T are trivially type structure morphisms, and is a product in the category of type structures and their morphisms 41 Type Substructures and the Fundamental Theorem for Kinding Definition 8 (Type substructure) Given a type structure T, the Kripke family S κ T κ is a type substructure of T if C T S κ for all (C :κ) Σ T S κ κ S κ Sκ T [[ ]] Ty κ S Sκ Basically, a type substructure is a subfamily which is still a type structure with the original operations One could also say that S is a type substructure of T iff the identity on S is a type structure morphism from S to T However, then the notion of type structure morphism must be set up more liberally, not requiring S to be a type structure a priori Lemma 9 (Projection type substructure) If S T 1 T 2 is a type substructure, so are π 1 (S) T 1 and π 2 (S) T 2 where (M (X) ρ)(x) := M (ρ(x)) Definition 6 (Environment pairing) Given two type structures S, T and environments ρ S and ρ T, we define (ρ, ρ ) (X dom()) S (X) pointwise by (ρ, ρ )(X) = (ρ(x), ρ (X)) T (X) For the environment update operation then holds (ρ, ρ )[X (G, G )] = (ρ[x G], ρ [X G ]) Def and Lem 7 (Product type structure) Given type structures S, T, the pointwise product (S T ) κ = Sκ T κ two Definition 10 (Function space) We write K T κ if K is a Kripke family of subsets K T κ Given K T κ and K T κ we define the Kripke function space (K bt K ) = {F T κ κ F G K for all and G K } If no ambiguities arise, we write for bt Definition 11 (Induced type structure) Let T be a type structure and S T be Kripke If C T S κ for all (C :κ) Σ S κ κ = (S κ bt S κ ) then S is called induced or an induced type substructure of T (see Thm 12) 5

6 Such an S is called induced since it is already determined by the choice of S Theorem 12 (Fundamental theorem of kinding) Let T be a type structure If S T is induced, then S is a type substructure of T Proof We mainly need to show that evaluation is welldefined This is shown by induction on the kinding derivation, as usual Let ρ S We show T ρ S κ by induction on T : κ The cases for variables and constants are trivial, X :κ T : κ λx :κ T : κ κ Since S is induced, it is sufficient to show λx : κ T ρ G S κ for arbitrary and G S κ This follows from the induction hypothesis T ρ S κ with ρ = ρ[x G] S,X:κ T : κ κ U : κ T U : κ Since S κ κ S κ bt S κ, the goal follows by the induction hypotheses and T U ρ = T ρ U ρ 42 NbE for Types and Its Soundness We are ready to define the reification relation for type values and show that NbE, i e, the composition of evaluation of a syntactic type T and reification to a normal form V, is sound, i e, T and V are judgmentally equal As a byproduct, we show totality of NbE on well-kinded types The structure T of type values is left abstract, a concrete definition will be given in Sect 8 However, not every T permits reification of its inhabitants It needs to include the variables which need to be distinguishable from each other and other type values Neutral types, i e, of the shape X G, need to be analyzable into head X and spine G We call a suitable T term-like; on such a T we can define contextual reification [4, 2] Definition 13 (Type structure with variables) A type structure T has variables if there exists a Kripke family of maps Var (X dom()) T (X) such that Var (X) T κ iff (X) = κ Usually, we simply write X for Var (X) 1 Types X G are called neutral 2 Types C G are called constructed If clear from the context of discourse, we drop the index to Var To disambiguate, we sometimes write Var T to refer to the variable embedding of type structure T Usually, we write T [[T ]] instead of T [[T ]] VarT for the interpretation in the identity environment Definition 14 (Term-like type structure) A type structure T is term-like if it has variables and there exists a Kripke family of partial maps View κ T κ {(C, G) TyCst T κ Σ(C) = κ κ} + {(X, G) TyVar T κ (X) = κ κ} such that: View(F ) = (C, G) iff F = Cst(C) G View(F ) = (X, G) iff F = Var(X) G Lemma 15 (Injectivity in term-like type structures) In a term-like type structure T, Cst and Var are families of injective maps and neutral and constructed application is injective, i e, H G = H G implies H = H and G = G for neutral or constructed H, H Proof Assume, for instance H = X G, H = X G neutral We have (X; G, G) = View(H G) = View(H G ) = (X ; G, G ), thus X = X, G = G, and G = G Immediately, H = H follows Trivially, Ty is a term-like type structure with Var Ty (X) = X The product of term-like type structures S and T is again term-like with Var S T = (Var S, Var T ) Ty/= β is term-like due to confluence of β-reduction Ty modulo judgmental equality is not trivially term-like, since first injectivity of the type constructors needs to be proven Definition 16 (Reifiable type structure) A type structure T with variables is reifiable, if there are relations F V κ in, F reifies to V at kind κ, H U κ in, H reifies to U, inferring kind κ, (where F, H T κ with H neutral or constructed, and V, U Ty κ ) which obey the following rules: C C Σ(C) X X (X) H U κ κ G V κ ================================= H G U V κ H U ============ H U, X :κ F X V κ ====================== F λx :κ V κ κ 6

7 Further, these reification relations must be deterministic in the following sense: For all, κ, F (inputs) and neutral or constructed H (input) there is at most one V (output) such that F V κ and at most one U and κ (outputs) such that H U κ Seen as logic programs with inputs and outputs as indicated above, these relations denote partial functions, where is defined by cases on the kind κ and and by cases on the neutral value H Lemma 17 (Reification returns long normal form) If F V κ, then V is η-long β-normal Lemma 18 (Term-like type structure is reifiable) Any term-like type structure T is reifiable Proof In the presence of View, the two relations can simply defined inductively by the above rules We continue by constructing a model of the kinding rules which proves soundness of NbE for types Kinds κ are interpreted as sets G κ of pairs (F, T ) glued together by reification, i e, the type value F reifies to syntactic type T up to βη-equality Function kinds are interpreted via Tait s function space, thus, the fundamental theorem of kinding yields that G is indeed a type structure Definition 19 (Glueing candidate) Fix a reifiable type structure T We define the families Gl, Gl T Ty by Gl κ = {(F, T ) T κ Tyκ F V κ and T = V : κ}, Gl κ = {(H, T ) T κ Tyκ H U κ and T = U : κ} A family S with Gl κ S κ Gl κ is called a glueing candidate Lemma 20 Any glueing candidate S contains the constants Proof Since C C Σ(C) we have Cst S (C) = (C, C) Gl Σ(C) S Σ(C) Lemma 21 (Glueing candidate space) Gl κ, Gl κ form a kind candidate space according to Def 2 Proof Let us write κ, κ for Gl κ, Gl κ We show K-FUN-I Assume (F, T ) (κ κ ) and show (F, T ) κ κ We have (X, X) κ,x:κ, hence, (F X, T X) κ,x:κ That is,, X :κ F X V κ and, X :κ T X = V : κ It follows F λx : κ V κ κ and λx : κ T X = λx : κ V : κ Since T Ty κ κ by assumption, we have X FV(T ), hence, T = λx : κ V : κ Thus, (F, T ) κ κ Definition 22 (Glueing type structure) Given a type structure T, we define G T Ty by G :=, G κ κ := (G κ T Ty Gκ ) Lemma 23 (G κ is a glueing candidate) Gl κ G κ Gl κ Proof By induction on κ By definition, Gl G, and κ Gl G κ and κ Gl G κ imply κ κ κ κ G κ G κ κ κ κ κ Corollary 24 G is induced Proof C G G Σ(C) since any glueing candidate contains the constants, and G κ κ = G κ G κ by definition Since G is induced, by the fundamental theorem of kinding it is a type substructure of T Ty Theorem 25 (Soundness of NbE for types) Let T be an reifiable type structure If T : κ then there is a V Ty κ such that T [[T ]] VarT V κ and T = V : κ Proof Since (X, X) (X) G (X) for all X dom(), for the identity valuation Var T Ty (X) = (X, X) we have Var G = Var T Ty G By the fundamental theorem, G[[T ]] VarG = (T [[T ]] VarT, T ) G κ Since Gκ Gl κ, we have that T [[T ]] VarT V κ with T = V : κ The V returned by reification is the long normal form of T 5 Type Groupoids Completeness of NbE means that it models judgmental type equality, i e, if T = T : κ then [[T ]] V κ and [[T ]] V κ Completeness will be shown by a fundamental theorem of type equality Judgmental equality is usually modelled by partial equivalence relations, which can be seen as groupoids Hence, we introduce the notion of a groupoidal type structure, or type groupoid Definition 26 (From Wikipedia, :) A groupoid is a set G with a function 1 : G G and a partial function : G G G that have the following properties: 1 Associativity: For all a, b, c G, if a b and b c are defined, then (a b) c and a (b c) are defined and equal Conversely, if either of these last two expressions is defined, then so is the other (and again they are equal) 7

8 2 Inverse: For all a G, a 1 a and a a 1 are defined 3 Identity: For all a, b G, if a b is defined, then a b b 1 = a, and a 1 a b = b (The previous axioms already show that these expressions are defined and unambiguous) Example 27 (PER as groupoid) A partial equivalence relation R over set S is a groupoid with (s, t) 1 = (t, s) and (r, s) (s, t) = (r, t) Example 28 (Discrete groupoid) Any set S gives rise to a trivial groupoid with s 1 = s and is defined exactly on the diagonal of S S, and there s s = s Lemma 29 (b 1 ) 1 = b Proof (Uli Schoepp) First, note that b 1 = b 1 b b 1 Hence (b 1 ) 1 = (b 1 ) 1 b 1 (b 1 ) 1 = (b 1 ) 1 b 1 b b 1 (b 1 ) 1 = b b 1 (b 1 ) 1 = b Lemma 30 If a b is defined then (a b) 1 = b 1 a 1 Proof First a = a b b 1 Since (a b) 1 (a b) is defined, (a b) 1 = (a b) 1 a a 1 = (a b) 1 a b b 1 a 1 = b 1 a 1 Definition 31 (Subgroupoid) Given a groupoid G, a set H G is a subgroupoid if it is closed under inversion and composition, ie, if 1 a H implies a 1 H, and 2 a, b H implies a b H if a b is defined 51 Type Groupoids and the Fundamental Theorem of Type Equality Definition 32 (Type groupoid) A type structure is groupoidal if each T κ is a groupoid, and the following laws are fulfilled: C 1 = C for all C TyCst, (F G) 1 = F 1 G 1, (F F ) (G G ) = (F G) (F G ) Example 33 Each type structure is groupoidal for the trivial choice of inversion (identity) and composition (idempotent, defined on the diagonal) Def and Lem 34 (Square type groupoid) Given a type structure T we define the square type groupoid 2 T as the product type structure T T equipped with (F, G) 1 = (G, F ), (F, G) (G, H) = (F, H) Proof The laws of a type groupoid are satisfied, eg, for the last law we have ((F 1, F 2 ) (F 2, F 3 )) ((G 1, G 2 ) (G 2, G 3 )) = (F 1, F 3 ) (G 1, G 3 ) = (F 1 G 1, F 3 G 3 ) = (F 1 G 1, F 2 G 2 ) (F 2 G 2, F 3 G 3 ) = ((F 1, F 2 ) (G 1, G 2 )) ((F 2, F 3 ) (G 2, G 3 )) Lemma 35 (Function space is groupoid) If K T κ and K T κ are groupoids, so is K K T κ κ Proof Analogous to the proof of Lemma 81 Definition 36 (Induced type groupoid) Let T be a type structure and E 2 T We say E is induced if E is an induced type structure and E is a family of groupoids Since type equality refers to kinding, we will have to refer to the fundamental theorem of kinding in the proof of the fundamental theorem of type equality Lemma 37 (Fund thm of kinding for type groupoids) Let T be a type structure and E 2 T be induced Then, 1 E is a type subgroupoid of 2 T, and 2 if T : κ and (ρ, ρ ) E then (T [[T ]] ρ, T [[T ]] ρ ) E κ Proof 1 By induction on κ and Lemma 35 we show that E κ is groupoidal 2 This is just an instance of Theorem 12, since E[[T ]] (ρ,ρ ) = (T [[T ]] ρ, T [[T ]] ρ ) We are now ready to show the fundamental theorem of type equality Since the β-law is formulated in terms of ordinary substitution and not explicit substitution, we need to ask from interpreting type structures that substitution commutes with evaluation Since this is a characterizing property of combinatory algebras (separating them from mere applicative structures), we use the term combinatory type structure Definition 38 (Combinatory type structure) A structure T is combinatory if [[U]] ρ = [[U]] ρ if (ρ = ρ ) FV(U) [[T [U/X]]] ρ = [[T ]] ρ[x [U ]ρ ] for all U Ty κ, T Ty κ,x:κ and ρ, ρ T type 8

9 The first condition, namely that evaluation of an expression depends only on the values of its free variables, is needed for the η-law Definition 39 (Modelling type equality) Let T a type structure We say that E 2 T models type equality if T = T : κ and (ρ, ρ ) E imply (T [[T ]] ρ, T [[T ]] ρ ) E κ Theorem 40 (Fundamental theorem of type equality) Let T be an combinatory type structure and E 2 T an induced type structure Then E models type equality Proof By induction on T = T : κ We give a few representative cases T : κ κ λx :κ T X = T : κ κ X FV(T ) Since E is induced, it is sufficient to assume arbitrary and (G, G ) E κ and show ([[λx : κ T X]] ρ, [[T ]] ρ ) (G, G ) E κ By Lemma 37, ([[T ]] ρ, [[T ]] ρ ) E κ κ, hence, ([[T ]] ρ G, [[T ]] ρ G ) E κ We are done, since [[λx : κ T X]] ρ G = [[T X]] ρ[x G] = [[T ]] ρ G, for X FV(T ) and T is combinatory, X :κ T : κ U : κ (λx :κ T ) U = T [U/X] : κ Here we use the law [[T [U/X]]] ρ = [[T ]] ρ[x [U ]ρ ] of combinatory type structures T 1 = T 2 : κ T 2 = T 3 : κ T 1 = T 3 : κ Let F i = [[T i ]] ρ for i = 1, 2, 3 By induction hypothesis, (F 1, F 2 ), (F 2, F 3 ) E κ Since E κ is a subgroupoid of 2 T κ and (F 1, F 2 ) (F 2, F 3 ) is defined, we have (F 1, F 3 ) E κ Definition 41 (Respect type equality) A type structure T respects type equality if T = T : κ implies [[T ]] ρ = [[T ]] ρ for all ρ T Lemma 42 (Type structure modulo) Let T and E 2 T be type structures such that E models type equality Then T /E is a type structure respecting type equality Proof Application and evaluation are well-defined in T /E since E is a type structure T /E respects type equality since E models type equality 52 Completeness of NbE for Types Def and Lem 43 (Kind candidate space for completeness) Let T be an reifiable type structure Per κ = {(F, F ) 2 T κ F V κ and F V κ for some V Ty κ } Per κ = {(F, F ) 2 T κ F V κ and F V κ for some V Ty κ } Per κ and Per κ are Kripke families of subgroupoids, and form a kind candidate space Proof Composition (F 1, F 2 ) (F 2, F 3 ) is well-defined since reification is deterministic Def and Lem 44 (Type groupoid for completeness) Let T be a type structure We define P κ 2 T κ by recursion on κ: P := Per, P κ κ := P κ c2 T Pκ P is an induced type groupoid Theorem 45 (Completeness of NbE for Types) Let T be an reifiable type structure If T = T : κ then [[T ]] Var V κ and [[T ]] Var V κ for some V Proof Since (Var, Var) P, by the fundamental theorem of type equality we have ([[T ]] Var, [[T ]] Var ) P κ Per κ which entails the goal 53 Type structure modulo reification Lemma 46 (Strengthening of reification) Let T be a term-like type structure, F T κ, and {, } If F T κ for some, then F T κ Proof By induction on F T κ In the case of a variable X T κ, we know (X) = κ, hence, X X κ Lemma 47 (Reification of neutral and constructed types) Let T be a reifiable type structure Let H T κ be neutral or constructed If H V κ then H U κ and U = V : κ Proof By induction on κ Trivial for κ = In case κ = κ 1 κ 2, we have Xi, X :κ 1 H X V κ 2 ======================== H λx :κ 1 V κ 1 κ 2 Analyzing the induction hypothesis, we get, X : κ 1 H U κ 1 κ 2 and, X :κ 1 U X = V : κ 2 Since H T κ, we get by Lemma 46, H U κ 2, hence, X FV(U) This entails U = λx : κ 1 V : κ 1 κ 2 9

10 Corollary 48 If (H, T ) Per κ and H is neutral or constructed, then (H, T ) Per κ Theorem 49 (Type structure modulo reification) Let T be a reifiable type structure and P defined as above Then T /P is reifiable and respects type equality Proof Since P models type equality, we only need to show that reification is well-defined on T /P First, if F V κ and F V κ and (F, F ) P κ Perκ then V = V since reification is deterministic Secondly, if H U κ and H U κ for neutral or constructed (H, H ) P κ, then by Cor 48 (H, H ) Per κ, hence, U = U 6 Object Structures In this section, we introduce object structures which model both the syntactic object structure Obj indexed by syntactic types in Ty as structures of values D indexed by type values from a structure T The following development, leading up the fundamental theorem of typing and the soundness of NbE for objects, parallels the preceding one on the type level However, while we could define the glueing type structure G κ by induction on kind κ, we cannot define a similar glueing objects structure gl by induction on types, due to impredicativity Hence, we will define gl as a structure of candidates for semantical types Definition 50 (Typing context) Given a type structure T, a T -context T is a partial map from the term variables into T If Γ Ty and ρ T then [[Γ]] ρ T is defined by [[Γ]] ρ (x) = [[Γ(x)]] ρ Definition 51 (Object structure) Let T be a type structure An object structure over T is a family D A (A T ) of Kripke sets indexed by T -contexts such that implies D A = D A It respects type equality, i e, T = T : implies D [T ] ρ = D [T ] ρ for any ρ T, and there are operations: app A B D A B D A TyApp κ F D κ F (G T κ D B, F G ) D We write for both of these operations For, Ψ T, let η D Ψ iff η(x) D Ψ(x) for all x dom(ψ) We stipulate a family of evaluation functions ρ Obj T Γ indexed by ρ T D [Γ] ρ D [T ] ρ which satisfy the following equations: x ρ η = η(x) r s ρ η = r ρ η s ρ η t U ρ η = t ρ η [[U]] ρ λx:u t ρ η d = t ρ η[x d] if d D [U ] ρ ΛX :κ t ρ η G = t η ρ[x G] if G T κ With parallel substitution, Obj (modulo β, βη, or judgmental equality) forms an object structure over Ty (modulo the same equality) Definition 52 (Object substructure) Let S, T be type structures with S T and let D be an object structure over T Let E A D A be a Kripke family of subsets indexed by S for all A S Then E is an object substructure of D over S if application and evaluation are well defined on E app A B E A B E A TyApp κ F E κ F (G S κ ρ Obj Γ T E S [Γ] ρ E B ) E F G E S [T ] ρ for all S and ρ S Definition 53 (Reindexed object structure) Let M : S T a type structure morphism and D an object structure over T The type structure E A := D M(A) over S with is called D reindexed by M f E d := f D d d E G := d D (M(G)) E ρ := D M ρ Definition 54 (Object structure morphism) Let M : S T a type structure morphism and D an object structure over S and E one over T An object structure morphism m : D E is a Kripke family of maps m A D A E M (A) M which commute with application and evaluation, i e, m(f D d) = m(f) E m(d) for all f D A B, d D A m(d D G) = m(d) E M(G) for all d D κ F, G T κ m(d t ρ η) = E t M ρ m η for all T Ty, t ObjΓ T, ρ S S [Γ], η D Definition 55 (Product object structure) Given object structures D 1 over T 1 and D 2 over T 1 we define the product object structure D 1 D 2 over T 1 T 2 by (D 1 D 2 ) (A1,A2) A ( 1, 2) := D 1 A 1 1 D with (f 1, f 2 ) D1 D 2 (d 1, d 2 ) := (f 1 D1 d 1, f 2 D2 d 2 ) (d 1, d 2 ) D1 D 2 (G 1, G 2 ) := (d 1 D1 G 1, d 2 D2 G 2 ) (D 1 D 2 ) t (ρ1,ρ2) η 1,η 2 := (D 1 t ρ1 η 1, D 2 t ρ2 η 2 ) 10

11 61 Realizability Type Structure and the Fundamental Theorem of Typing Fix some term-like type structure T and an object structure D over T Let A D A if A D A and A is Kripke DA forms a complete lattice for all, A Lemma 56 If then D A = D A Proof D A = D A Definition 57 (Function space and type abstraction on D) bd DA D B A B D (A B) := {f D A B for all d,, d A implies f d B } ( ) κ F (G T κ F G ) D D κ F (GA) κ F := {d D κ F d G A } Constructors of higher kind are interpreted as operators on Kripke sets Definition 58 (Kripke operators of higher kind) D A: := D A D F :κ κ := (G Tκ ) D G:κ D F G:κ Definition 59 (Type candidate space) A type candidate space C for D over T consists of two Kripke sets C A, C A D A, (written A, A if no ambiguities arise) for each type A T such that the following conditions hold K-NE H H D H if H neutral K-FUN-E A B A bd B K-FUN-I A bd B A B A B D A B D K-ALL-E κ F GF G D κ F K-ALL-I XF X κ F D κ F if G T κ if X dom() Definition 60 (Realizable semantic types) If F T κ and F :κ F D then F κ C F (pronounced F realizes F) is defined by induction on κ as follows: Definition 61 (Neutral realizable semantic types) Given a type candidate space, for a neutral H T κ we define H:κ H, H D by induction on κ For base kind, it is already defined, for higher kinds we set H(G, G) := H G, H(G, G) := H G Lemma 62 For neutral H T κ, H κ H and H κ H Definition 63 (Type constants in D) D : (A, A)(B, B) := A B κ D κ :(κ ) κ (F, F) := G κ G GF(G, G) Definition 64 (Interpretation into D) For T Ty κ and (σ, ρ) T D we define D[[T ]] σ,ρ D T [T ] σ :κ as follows: D[[C]] σ,ρ = C bd D[[X]] σ,ρ = ρ(x) D[[λX :κ T ]] σ,ρ = ((G, G) T D κ ) D[[T ]] (σ,ρ)[x (G,G)] D[[T U]] σ,ρ = D[[T ]] σ,ρ (T [[U]] σ, D[[U]] σ,ρ ) Lemma 65 (Well-definedness of interpretation into D) If T Ty κ and (σ, ρ) T D then D[[T ]] σ,ρ D T [T ] σ :κ Proof D[[C]] σ,ρ D[[C]] σ,ρ D T [C ] σ :Σ(C) = D C T :Σ(C) = C bd D[[X]] σ,ρ D T [X ] σ :κ = D[[X]] σ,ρ D σ(x):κ = ρ(x) D[[λX :κ T ]] σ,ρ D T [λx:κ T ] σ = ((G, G) T D κ ) D T [λx:κ T ] σ G = ((G, G) T D κ ) D T [T ] σ[x G] D[[λX :κ T ]] σ,ρ = ((G, G) T D κ ) D[[T ]] (σ,ρ)[x (G,G)] A C A : A A A F κ κ C F : F G κ C F(G, G) for all G κ C G We define the Kripke families T D and C T D by T D κ = {(F, F) T κ F :κ D } C κ = {(F, F) T κ F :κ D F κ C F} For the remainder of this section, we fix a type candidate space C D[[T U]] σ,ρ D T [T U ] σ = D T [T ] σ T [U ] σ D[[T U]] σ,ρ = D[[T ]] σ,ρ (T [[U]] σ, D[[U]] σ,ρ ) where, in the last line, D[[T ]] σ,ρ D T [T ] σ :κ κ = ((G, G) T D κ ) D T [T ] σ G:κ 11

12 Lemma 66 (Pre-realizability type structure) T D is a type structure with application (F, F) (G, G) = (F G, F(G, G)) and evaluation T D[[T ]] σ,ρ = (T [[T ]] σ, D[[T ]] σ,ρ ) Since the kind function space is the full set-theoretic one, D is combinatory and respects type equality Lemma 67 ( D is combinatory) Let U Ty κ, T Ty κ,x:κ and (σ, ρ), (σ, ρ ) T D 1 D[[U]]σ,ρ = D[[U]] σ,ρ if ρ(x) = ρ (X) for all X FV(U) 2 D[[T [U/X]]]σ,ρ = D[[T ]] (σ,ρ)[x T b D [U ]σ,ρ ] Proof 1 By induction on U 2 By induction on T, using 1 κ = κ 1 κ 2 and T = λy : κ 1 T Using the induction hypothesis and 1, we have for all κ1 (G, G) T D, since Y FV(U), D[[T [U/X]]] (σ,ρ)[y (G,G)] = D[[T ]] (σ,ρ)[y (G,G)][X T b D [U ](σ,ρ)[y (G,G)] ] = D[[T ]] (σ,ρ)[y (G,G)][X T b D [U ]σ,ρ ] = D[[T ]] (σ,ρ)[x T b D [U ]σ,ρ ][Y (G,G)] hence, D[[λY : κ1 T [U/X]]] σ,ρ = D[[λY : κ 1 T ]] (σ,ρ)[x T b D [U ]σ,ρ ] Lemma 68 ( D respects type equality) If T = T : κ and (σ, ρ) T D then D[[T ]] σ,ρ = D[[T ]] σ,ρ Proof By induction on T = T : κ, using Lemma 67 Lemma 69 (Realizability of type constructors) and κ (κ ) κ Proof Assume A D A and B D B with A A and B B We show A B A B A B A B A B A B A B D F :κ Assume F with F κ F We show κ F κ X:κ (F, F) Let X dom() Then X D,X:κ and X κ X κ F G T GF G κ G κ G GF G G κ G GF(G, G) = κ (F, F) XF(X, X) XF X κ F Theorem 70 (Realizability) C is a type substructure of T D Proof By Def 60 and Lemma 69, C is induced, hence, by Theorem 12, it is a type structure Corollary 71 If T Ty and σ ρ then T [[T ]] σ T [[T ]] σ Proof By the theorem, T [[T ]] σ D[[T ]]σ,ρ Theorem 72 (Fundamental theorem of typing) Let D be an object structure over T and C, C D a type candidate space Let S C a type substructure of the associated realizability type structure C Then the family E (A,A) (,Φ) := A is an object substructure of D reindexed by π 1 : S T Proof Note that E (A,A) (,Φ) D A 1 E respects type equality For T = T : and (σ, ρ) S we have E S [T ] σ,ρ,φ = ( D[[T ]] σ,ρ ) = ( D[[T ]] σ,ρ ) = E S [T ] σ,ρ,φ since D respects type equality 2 Object application is well-defined Let (A, A), (B, B) S (A,A) (B,B) and f E,Φ = (A bd B) and d E (A,A),Φ = A By definition of bd, f d B = E (B,B),Φ 3 Type application is well-defined Let (F, F) S κ, (G, G) S κ, and d E κ (F,F),Φ = ( κ F) = ( G κ G GF(G, G)) = G κ G (GF(G, G)) Since G G, d (GF(G, G)), hence, d E (G, G) = d D G F(G, G) = E (F,F) (G,G),Φ 4 Evaluation is well-defined We show E t σ,ρ η E S [T ] σ,ρ,φ E S [Γ] σ,ρ,φ for (, Φ) S, (σ, ρ) S, and η by induction on ; Γ t : T By definition of E, it is sufficient to show D t σ η ( D[[T ]] σ,ρ ) for η ( D[[Γ]] σ,ρ ) Γ ; Γ x : Γ(x) We have D x σ η = η(x) ( D[[Γ(x)]] σ,ρ ), X :κ; Γ t : T X ; Γ ΛX :κ t : κ T X FV(T ) To show D ΛX : κ t σ η ( D[[ κ T ]] σ,ρ ), assume arbitrary (G, G) S κ, let σ := σ[x 12

13 G] and ρ := ρ[x G], and show D ΛX : κ t σ η E (G, G) ( D[[T ]] σ,ρ (G, G)) Let d := D ΛX : κ t σ η E (G, G) = D t σ η and note that S[[X]] σ,ρ = (G, G) Since (σ, ρ ) S,X:κ, by induction hypothesis d ( D[[T X]] σ,ρ ) = ( D[[T ]] σ,ρ (G, G)), because X F V (T ) and D is combinatory ; Γ t : κ T U : κ ; Γ t U : T U Let (F, F) := S[[T ]] σ,ρ and (G, G) := S[[U]] σ,ρ By induction hypothesis d := D t σ η ( D[[ κ T ]] σ,ρ ) = ( κ b D (F, F)) Since G G, d E (G, G) = d D G F(G, G) = ( D[[T U]] σ,ρ ) ; Γ t : T T = T : ; Γ t : T If view(f) = (e, G) then f = e G and e is neutral If view(f) = then f is not neutral If D is a term-like structure over T, we may write D t ρ for D t ρ var D If T is also term-like we may further abbreviate D t Var T to D t Lemma 74 (Injectivity in a term-like object structure) In a term-like object structure, var and neutral application are injective Definition 75 (Object reification) Given a term-like type structure T and a term-like object structure D over T, we define the relations ; d v A d reifies to v at type A, ; e u A e reifies to u, inferring type A, (where d, e D A and v, u are syntactical objects) inductively by the following rules: ; x x (x) Clear, since D respects type equality ; e u A B ; d v A ; e d u v B 62 Soundness of Nbe for Objects Definition 73 (Term-like object structure) An structure D over T is term-like if: object 1 There exists a Kripke family of maps var (x dom()) D (x) indexed by T In the presence of var, we can define the neutral objects inductively as follows: var (x) D (x) If e D A B f d D B If e D κ F F G e G D is neutral is neutral and d D A is neutral then is neutral and G T κ, then is neutral 2 There exists a Kripke family of computable maps view B such that: D B ObjVar + A T D A B D A + F T κ + { } Definition 76 (Glueing type candidate space) Let S T Ty a glueing candidate, Gl S For (A, T ) {G T κ F G = B} S we define the Kripke families gl (A,T ), gl (A,T ) D Obj (A,T ) by D κ F If view(f) = x then f = var(x) If view(f) = (e, d) then f = e d and e is neutral ; e u κ F G V κ ; e G u V F G ; e u H ; e u H H neutral ;, x:a f x v B A U ; f λx:u v A B, X :κ; f X v F X ; f ΛX :κ v κ F As for types, object reification is deterministic Note that we cannot say now in which Obj Γ T the objects u and v live The conjecture is those Γ, T with Γ and A T However, this does not follow directly from the definition (Not even if we suppose (, Γ) S and (A, T ) S, because of the -elimination rule) The typings of u and v will be a byproduct of Thm 78 gl (A,T ) (,Γ) := {(d, t) ; d v A and ; Γ t = v : T for some v}, gl (A,T ) (,Γ) := {(e, t) ; e u A and ; Γ t = u : T for some u} 13

14 Lemma 77 gl is a type candidate space Proof We show gl A,T gl B,U gl A B,T U (f, v) (gl A,T gl B,U ),Γ =, x:a and Γ = Γ, x:t x x A and Γ x = x : T (x, x) gl A,T,Γ (f x, v x) gl B,U,Γ f x w B Γ v x = w : U A T Γ T = T : f λx:t w A B Γ v = λx:t w : T U (A,T ) (B,U) (f, v) gl,γ assumption by def by def from assumption and for some w and since (A, T ) S and since x FV(w) by def Theorem 78 (Soundness of NbE for objects) Let D be a term-like object structure over a term-like type structure T If ; Γ t : T then there is a long normal form v such that ; T [[Γ]] D t v T [[T ]] and ; Γ t = v : T Proof Consider the type candidate space gl, gl D Obj for the glueing type structure G Recall that gl κ = {((F, T ), F) G κ D Obj (F,T ):κ (F, T ) κ gl F} ((A,T ),A) By the fundamental theorem of typing, E((,Γ),Φ) := A (,Γ) is an object substructure of D Obj reindexed by π 1 : gl G Since (X, X) G (X) and (X, X) (X) gl gl (X,X) we have a variable embedding Var gl (X) = ((X, X), gl (X,X) ) gl (X) into type structure gl Also, since ; x x (x) and ; Γ x = x : Γ(x) we have (x, x) gl ((x),γ(x)) The setting of such (,Γ) that G[[Γ]] = (, Γ) implies (x, x) gl G[Γ(x)] G[Γ] ( D Obj[[Γ(x)]]) G[Γ] = E gl[γ(x)] gl[γ] Hence, setting var gl[γ] Vargl E (x) = (x, x) we have var [Γ] E E gl[γ] gl[γ] It follows that E t = E t Var gl var E E gl[t ] gl[γ] = ( D Obj[[T ]]) G[Γ] gl G[T ] With d := D t we have (d, t) = (D Obj) t = E t, thus, ; d v T [[T ]] and ; Γ t = v : T for some v 7 Object Groupoids Definition 79 (Object groupoid) An object structure D over a type structure T is an object groupoid if each D A is a groupoid and 1 app(f, d) 1 = app(f 1, d 1 ), 2 TyApp(f, G) 1 = TyApp(f 1, G), and 3 if f f and d d are defined, then app(f, d) app(f, d ) = app(f f, d d ) and TyApp(f, G) TyApp(f, G) = TyApp(f f, G) Definition 80 (Groupoidal at higher kinds) Let D be a object groupoid over T Then A D A: is ( -)groupoidal if A is a subgroupoid for each F D F :κ κ is (κ κ -)groupoidal if F(G, G) is (κ -)groupoidal for all G T κ G:κ and (κ-)groupoidal G D Let D F :κ D F :κ := {F F is κ-groupoidal }, T D κ := {(F, F) T κ F :κ T D } D A Lemma 81 (Function space is groupoidal) If A and B D B are groupoidal, so is A bd B D A B Proof First, we show that (A B) is closed under inversion Assume f (A B) To show f 1 (A B), assume arbitrary and d A and show f 1 d B Since d 1 A we have f d 1 B, hence, B (f d 1 ) 1 = f 1 d Then, we show that (A B) is closed under composition Assume f, f (A B) and f f defined Further, assume and d A arbitrary and show (f f ) d B Note that d = d d 1 d, hence, it suffices to show (f d) (f (d 1 d)) B Yet this holds, since f d B and f (d 1 d) B (because d 1 d A ) Lemma 82 (Type abstraction is groupoidal) If A D F G is groupoidal, so is GA D κf Proof Assume f, f (GA) and f f defined Since f G A, also (f G) 1 = f 1 G A Further, (f G) (f G) = (f f ) G A, hence f f (GA) Corollary 83 (Impredicative quantification is groupoidal) κ D κ :(κ ) is (κ ) -groupoidal Theorem 84 (Fund thm of kinding for type groupoids) Let D be an object groupoid over T Then T D is a type substructure of T D 14

15 D Proof By Lemma 81 and Cor 83, T D b T and κ T D b (κ ) ) T D By definition of groupoidal, κ (F, F) T D b (G, G) = (F G, F(G, G)) T D for all D κ κ (F, F) T and (G, G) T D κ, thus, application is well-defined It remains to show that interpretation is well-defined Let T : κ and (σ, ρ) T D One easily shows T D[[T ]] ρ T D κ by induction on T : κ Definition 85 (Square object groupoid) Let D be an object structure over T Then 2 D A = D A D A with (d, d ) 1 = (d, d) (d 1, d 2 ) (d 2, d 3 ) = (d 1, d 3 ) is a type groupoid over T 71 Fundamental theorem of object equality Definition 86 (Combinatory object structure) Let D be an object structure over some type structure T We say D is combinatory if u σ η = u σ η t[u/x] σ η = t σ[x [U ] σ ] η t[u/x] σ η = t σ η[x u σ η ] if σ = σ FV(u) and η = η FV(u) Theorem 87 (Fundamental theorem of object equality) Assume a type structure T that respects type equality and a combinatory object structure D over T Let C, C 2 D be a type candidate space and C its associated realizability type structure If ; Γ t = t : T and (σ, ρ) C and (η, η ) 2 D[[Γ]] σ,ρ then (D t σ η, D t σ η ) 2 D[[T ]] σ,ρ Proof By induction on ; Γ t = t : T We show a few representative cases, X :κ; Γ t : T U : κ ; Γ (ΛX :κ t) U = t[u/x] : T Let (G, G) := T 2 D[[U]] σ,ρ C κ and (σ, ρ ) := (σ, ρ)[x (G, G)] C,X:κ By induction hypothesis, (d, d ) := ( t σ η, t σ η ) 2 D[[T ]] σ,ρ This entails the goal, since 2 D[[T [U/X]]] σ,ρ = 2 D[[T ]] σ,ρ and ( (ΛX : κ t) U σ η, t[u/x] σ η ) = (d, d ) by the combinatory laws ; Γ t : κ T ; Γ ΛX :κ t X = t : κ T X FV(t) Let F := 2 D[[T ]] σ,ρ, d := t σ η and d := t σ η Let further ˆd := ΛX : κ t X σ η We have to show ( ˆd, d ) κ F Assume arbitrary (G, G) C κ It is sufficient to show ( ˆd, d ) G F(G, G) Note that ˆd G = t X η σ[x G] = t σ[x G] η G = d G, since X FV(t) and D is combinatory The desired (d G, d G) F(G, G) now follows from the induction hypothesis (d, d ) κ F ; Γ t = t : κ T U = U : κ ; Γ t U = t U : T U Let d := t σ η and d := t σ η Let further (G, G) := (T 2 D[[U]] σ,ρ ) = (T 2 D[[U ]] σ,ρ ), since T (hence also T 2 D) respects type equality First, observe that t U σ η = d G t U σ η = d G 2 D[[T U]] σ,ρ = 2 D[[T ]] σ,ρ (G, G) By induction hypothesis, (d, d ) 2 D[[ κ T ]] σ,ρ = (G,G) C κ G( 2 D[[T ]] σ,ρ (G, G)) By the fundamental theorem of kinding, (G, G) C κ, hence (d, d ) G = (d G, d G) 2 D[[T ]] σ,ρ (G, G), as expected ; Γ t = t : T T = T : ; Γ t = t : T Trivial, since 2 D respects type equality 72 Completeness of Nbe for objects Definition 88 (Type candidate space for completeness) Let D be a term-like object structure over term-like T We define the Kripke families per A, per A 2 D A: by per A per A := {(d, d ) 2 D A ; d v A and ; d v A for some v} := {(e, e ) 2 D A ; e u A and ; e u A for some u} Note that composition (d 1, d 2 ) (d 2, d 3 ) = (d 1, d 3 ) is welldefined in per A and per A since reification is deterministic Lemma 89 per, per form a type candidate space for 2 D 15

16 Theorem 90 (Completeness of NbE for objects) Let D 0 be a term-like object structure over reifyable T 0 If ; Γ t = t : T then there is a long normal form v such that ; t v A and ; t v A where := T [[Γ]] and A := T [[A]] Proof The term structure T := T 0 /P is reifyable and respects type equality Let D be defined as D 0 reindexed by the representation function T T 0 Consider the type structure per κ = {(F, F) T κ 2 D F :κ F κ per F} The variable embedding for per is given by Var = (X (X, per X )) per E (A,A) (,Φ) := A is an object subgroupoid of 2 D reindexed by π 1 : per T Its variable embedding is given by var E = (var π1 D, var π1 D ) = (x (x, x)) E (,Φ) (,Φ) per By the fundamental theorem of object equality we obtain (D t, D t ) 2 D[[T ]] per A, thus, t v A and t v A for some v 8 An Nbe Algorithm Definition 91 (Value domain) Define D X O as the family of recursive datatypes indexed by X TyVar and O ObjVar with the strict constructors: vard O D X O tyvard X D X O absd [D X O DX O ] DX O appd D X O DX O DX O arrowd D X O foralld Ki D X O Application D [D X O [DX O DX O ]] is defined by (absd f) d = f(d) e d = appd e d if e not an absd Lemma 92 (Monotonicity) D X O is monotone in X and O can be constructed by solving the domain equa- Proof tion D X O D X O = O X [D X O D X O] D X O D X O 1 Ki Since the continuous function space is covariant, O and X appear only positively in this equation Definition 93 (Value type structure) We define Val κ := with D dom() Val Val Val := arrowd κ Val Val (κ ) κ Val := foralld κ Val Val κ κ [Val κ Val κ ] F Val G := F D G Val[[ ]] Ty κ [Val Val κ ] Val[[C]] ρ := C Val Val[[X]] ρ := ρ(x) Val[[T U]] ρ := Val[[T ]] ρ Val Val[[U]] ρ Val[[λX :κ T ]] ρ := (G Val κ ) Val[[T ]] ρ[x G] Lemma 94 Val a term-like and combinatory type structure with computable application and evaluation Hence, it is reifyable Definition 95 (NbE for types) By Thm 25, the following is a well-defined total and computable function: Nbe ( (KiCxt)) (κ Ki) Ty κ Ty κ Nbe κ (F ) := the V with Val[[F ]] V κ Theorem 96 (Nbe decides type equality) Let T, T : κ Then T = T : κ iff Nbe κ (T ) = Nbe κ (T ) Proof Nbe is computable, total, sound, and complete by theorems 25 and 45 Definition 97 (Value object structure) We define val A := D dom dom indexed by A Val and Val with val f val d val f val G val val x ρ η val r s ρ η val t U ρ η val A B := f D d [val A val B ] val κ F (G Val κ ) val := f D G Obj Γ T [val [Γ] ρ = η(x) [(ρ Val ) = val r ρ η val val s ρ η = val t ρ η val [[U]] ρ val [T ] ρ ]] val λx:u t ρ η = (d val [U ] ρ ) val t ρ η[x d] val ΛX :κ t ρ η = (G Val κ ) val t ρ[x G] η F G Lemma 98 val is a term-like and combinatory object structure over Val with computable application and evaluation 16

Brief Notes on the Category Theoretic Semantics of Simply Typed Lambda Calculus

Brief Notes on the Category Theoretic Semantics of Simply Typed Lambda Calculus University of Cambridge 2017 MPhil ACS / CST Part III Category Theory and Logic (L108) Brief Notes on the Category Theoretic Semantics of Simply Typed Lambda Calculus Andrew Pitts Notation: comma-separated

More information

A Translation of Intersection and Union Types

A Translation of Intersection and Union Types A Translation of Intersection and Union Types for the λ µ-calculus Kentaro Kikuchi RIEC, Tohoku University kentaro@nue.riec.tohoku.ac.jp Takafumi Sakurai Department of Mathematics and Informatics, Chiba

More information

Unary PCF is Decidable

Unary PCF is Decidable Unary PCF is Decidable Ralph Loader Merton College, Oxford November 1995, revised October 1996 and September 1997. Abstract We show that unary PCF, a very small fragment of Plotkin s PCF [?], has a decidable

More information

CS792 Notes Henkin Models, Soundness and Completeness

CS792 Notes Henkin Models, Soundness and Completeness CS792 Notes Henkin Models, Soundness and Completeness Arranged by Alexandra Stefan March 24, 2005 These notes are a summary of chapters 4.5.1-4.5.5 from [1]. 1 Review indexed family of sets: A s, where

More information

Strong normalisation and the typed lambda calculus

Strong normalisation and the typed lambda calculus CHAPTER 9 Strong normalisation and the typed lambda calculus In the previous chapter we looked at some reduction rules for intuitionistic natural deduction proofs and we have seen that by applying these

More information

CIS 500 Software Foundations Fall October. CIS 500, 6 October 1

CIS 500 Software Foundations Fall October. CIS 500, 6 October 1 CIS 500 Software Foundations Fall 2004 6 October CIS 500, 6 October 1 Midterm 1 is next Wednesday Today s lecture will not be covered by the midterm. Next Monday, review class. Old exams and review questions

More information

In this lecture, we will use the semantics of our simple language of arithmetic expressions,

In this lecture, we will use the semantics of our simple language of arithmetic expressions, CS 4110 Programming Languages and Logics Lecture #3: Inductive definitions and proofs In this lecture, we will use the semantics of our simple language of arithmetic expressions, e ::= x n e 1 + e 2 e

More information

TABLEAU-BASED DECISION PROCEDURES FOR HYBRID LOGIC

TABLEAU-BASED DECISION PROCEDURES FOR HYBRID LOGIC TABLEAU-BASED DECISION PROCEDURES FOR HYBRID LOGIC THOMAS BOLANDER AND TORBEN BRAÜNER Abstract. Hybrid logics are a principled generalization of both modal logics and description logics. It is well-known

More information

Introduction to Type Theory August 2007 Types Summer School Bertinoro, It. Herman Geuvers Nijmegen NL. Lecture 3: Polymorphic λ-calculus

Introduction to Type Theory August 2007 Types Summer School Bertinoro, It. Herman Geuvers Nijmegen NL. Lecture 3: Polymorphic λ-calculus Introduction to Type Theory August 2007 Types Summer School Bertinoro, It Herman Geuvers Nijmegen NL Lecture 3: Polymorphic λ-calculus 1 Why Polymorphic λ-calculus? Simple type theory λ is not very expressive

More information

Typed Lambda Calculi Lecture Notes

Typed Lambda Calculi Lecture Notes Typed Lambda Calculi Lecture Notes Gert Smolka Saarland University December 4, 2015 1 Simply Typed Lambda Calculus (STLC) STLC is a simply typed version of λβ. The ability to express data types and recursion

More information

École normale supérieure, MPRI, M2 Year 2007/2008. Course 2-6 Abstract interpretation: application to verification and static analysis P.

École normale supérieure, MPRI, M2 Year 2007/2008. Course 2-6 Abstract interpretation: application to verification and static analysis P. École normale supérieure, MPRI, M2 Year 2007/2008 Course 2-6 Abstract interpretation: application to verification and static analysis P. Cousot Questions and answers of the partial exam of Friday November

More information

GUESSING MODELS IMPLY THE SINGULAR CARDINAL HYPOTHESIS arxiv: v1 [math.lo] 25 Mar 2019

GUESSING MODELS IMPLY THE SINGULAR CARDINAL HYPOTHESIS arxiv: v1 [math.lo] 25 Mar 2019 GUESSING MODELS IMPLY THE SINGULAR CARDINAL HYPOTHESIS arxiv:1903.10476v1 [math.lo] 25 Mar 2019 Abstract. In this article we prove three main theorems: (1) guessing models are internally unbounded, (2)

More information

arxiv: v1 [math.lo] 24 Feb 2014

arxiv: v1 [math.lo] 24 Feb 2014 Residuated Basic Logic II. Interpolation, Decidability and Embedding Minghui Ma 1 and Zhe Lin 2 arxiv:1404.7401v1 [math.lo] 24 Feb 2014 1 Institute for Logic and Intelligence, Southwest University, Beibei

More information

CATEGORICAL SKEW LATTICES

CATEGORICAL SKEW LATTICES CATEGORICAL SKEW LATTICES MICHAEL KINYON AND JONATHAN LEECH Abstract. Categorical skew lattices are a variety of skew lattices on which the natural partial order is especially well behaved. While most

More information

How not to prove Strong Normalisation

How not to prove Strong Normalisation How not to prove Strong Normalisation based on joint work with James Chapman School of Computer Science and IT University of Nottingham April 11, 2007 Long time ago... 1993 A formalization of the strong

More information

THE NUMBER OF UNARY CLONES CONTAINING THE PERMUTATIONS ON AN INFINITE SET

THE NUMBER OF UNARY CLONES CONTAINING THE PERMUTATIONS ON AN INFINITE SET THE NUMBER OF UNARY CLONES CONTAINING THE PERMUTATIONS ON AN INFINITE SET MICHAEL PINSKER Abstract. We calculate the number of unary clones (submonoids of the full transformation monoid) containing the

More information

Untyped Lambda Calculus

Untyped Lambda Calculus Chapter 2 Untyped Lambda Calculus We assume the existence of a denumerable set VAR of (object) variables x 0,x 1,x 2,..., and use x,y,z to range over these variables. Given two variables x 1 and x 2, we

More information

CS 4110 Programming Languages & Logics. Lecture 2 Introduction to Semantics

CS 4110 Programming Languages & Logics. Lecture 2 Introduction to Semantics CS 4110 Programming Languages & Logics Lecture 2 Introduction to Semantics 29 August 2012 Announcements 2 Wednesday Lecture Moved to Thurston 203 Foster Office Hours Today 11a-12pm in Gates 432 Mota Office

More information

Characterisation of Strongly Normalising λµ-terms

Characterisation of Strongly Normalising λµ-terms Characterisation of Strongly Normalising λµ-terms Ugo de Liguoro joint work with Steffen van Bakel and Franco Barbanera ITRS - June 2012, Dubrovnik Introduction Parigot s λµ-calculus is an extension of

More information

COMBINATORICS OF REDUCTIONS BETWEEN EQUIVALENCE RELATIONS

COMBINATORICS OF REDUCTIONS BETWEEN EQUIVALENCE RELATIONS COMBINATORICS OF REDUCTIONS BETWEEN EQUIVALENCE RELATIONS DAN HATHAWAY AND SCOTT SCHNEIDER Abstract. We discuss combinatorial conditions for the existence of various types of reductions between equivalence

More information

Introduction to Probability Theory and Stochastic Processes for Finance Lecture Notes

Introduction to Probability Theory and Stochastic Processes for Finance Lecture Notes Introduction to Probability Theory and Stochastic Processes for Finance Lecture Notes Fabio Trojani Department of Economics, University of St. Gallen, Switzerland Correspondence address: Fabio Trojani,

More information

Laurence Boxer and Ismet KARACA

Laurence Boxer and Ismet KARACA SOME PROPERTIES OF DIGITAL COVERING SPACES Laurence Boxer and Ismet KARACA Abstract. In this paper we study digital versions of some properties of covering spaces from algebraic topology. We correct and

More information

Yao s Minimax Principle

Yao s Minimax Principle Complexity of algorithms The complexity of an algorithm is usually measured with respect to the size of the input, where size may for example refer to the length of a binary word describing the input,

More information

UPWARD STABILITY TRANSFER FOR TAME ABSTRACT ELEMENTARY CLASSES

UPWARD STABILITY TRANSFER FOR TAME ABSTRACT ELEMENTARY CLASSES UPWARD STABILITY TRANSFER FOR TAME ABSTRACT ELEMENTARY CLASSES JOHN BALDWIN, DAVID KUEKER, AND MONICA VANDIEREN Abstract. Grossberg and VanDieren have started a program to develop a stability theory for

More information

4: SINGLE-PERIOD MARKET MODELS

4: SINGLE-PERIOD MARKET MODELS 4: SINGLE-PERIOD MARKET MODELS Marek Rutkowski School of Mathematics and Statistics University of Sydney Semester 2, 2016 M. Rutkowski (USydney) Slides 4: Single-Period Market Models 1 / 87 General Single-Period

More information

Conditional Rewriting

Conditional Rewriting Conditional Rewriting Bernhard Gramlich ISR 2009, Brasilia, Brazil, June 22-26, 2009 Bernhard Gramlich Conditional Rewriting ISR 2009, July 22-26, 2009 1 Outline Introduction Basics in Conditional Rewriting

More information

A CATEGORICAL FOUNDATION FOR STRUCTURED REVERSIBLE FLOWCHART LANGUAGES: SOUNDNESS AND ADEQUACY

A CATEGORICAL FOUNDATION FOR STRUCTURED REVERSIBLE FLOWCHART LANGUAGES: SOUNDNESS AND ADEQUACY Logical Methods in Computer Science Vol. 14(3:16)2018, pp. 1 38 https://lmcs.episciences.org/ Submitted Oct. 12, 2017 Published Sep. 05, 2018 A CATEGORICAL FOUNDATION FOR STRUCTURED REVERSIBLE FLOWCHART

More information

Notes to The Resurrection Axioms

Notes to The Resurrection Axioms Notes to The Resurrection Axioms Thomas Johnstone Talk in the Logic Workshop CUNY Graduate Center September 11, 009 Abstract I will discuss a new class of forcing axioms, the Resurrection Axioms (RA),

More information

Type-safe cast does no harm: Syntactic parametricity for F ω and beyond

Type-safe cast does no harm: Syntactic parametricity for F ω and beyond Under consideration for publication in J. Functional Programming 1 T H E O R E T I C A L P E A R L Type-safe cast does no harm: Syntactic parametricity for F ω and beyond DIMITRIOS VYTINIOTIS Microsoft

More information

Parametricity, Type Equality and Higher-order Polymorphism

Parametricity, Type Equality and Higher-order Polymorphism Under consideration for publication in J. Functional Programming 1 Parametricity, Type Equality and Higher-order Polymorphism DIMITRIOS VYTINIOTIS Microsoft Research STEPHANIE WEIRICH University of Pennsylvania

More information

CS 4110 Programming Languages and Logics Lecture #2: Introduction to Semantics. 1 Arithmetic Expressions

CS 4110 Programming Languages and Logics Lecture #2: Introduction to Semantics. 1 Arithmetic Expressions CS 4110 Programming Languages and Logics Lecture #2: Introduction to Semantics What is the meaning of a program? When we write a program, we represent it using sequences of characters. But these strings

More information

arxiv: v2 [math.lo] 13 Feb 2014

arxiv: v2 [math.lo] 13 Feb 2014 A LOWER BOUND FOR GENERALIZED DOMINATING NUMBERS arxiv:1401.7948v2 [math.lo] 13 Feb 2014 DAN HATHAWAY Abstract. We show that when κ and λ are infinite cardinals satisfying λ κ = λ, the cofinality of the

More information

MITCHELL S THEOREM REVISITED. Contents

MITCHELL S THEOREM REVISITED. Contents MITCHELL S THEOREM REVISITED THOMAS GILTON AND JOHN KRUEGER Abstract. Mitchell s theorem on the approachability ideal states that it is consistent relative to a greatly Mahlo cardinal that there is no

More information

Lecture Notes on Type Checking

Lecture Notes on Type Checking Lecture Notes on Type Checking 15-312: Foundations of Programming Languages Frank Pfenning Lecture 17 October 23, 2003 At the beginning of this class we were quite careful to guarantee that every well-typed

More information

The illustrated zoo of order-preserving functions

The illustrated zoo of order-preserving functions The illustrated zoo of order-preserving functions David Wilding, February 2013 http://dpw.me/mathematics/ Posets (partially ordered sets) underlie much of mathematics, but we often don t give them a second

More information

AMH4 - ADVANCED OPTION PRICING. Contents

AMH4 - ADVANCED OPTION PRICING. Contents AMH4 - ADVANCED OPTION PRICING ANDREW TULLOCH Contents 1. Theory of Option Pricing 2 2. Black-Scholes PDE Method 4 3. Martingale method 4 4. Monte Carlo methods 5 4.1. Method of antithetic variances 5

More information

Laurence Boxer and Ismet KARACA

Laurence Boxer and Ismet KARACA THE CLASSIFICATION OF DIGITAL COVERING SPACES Laurence Boxer and Ismet KARACA Abstract. In this paper we classify digital covering spaces using the conjugacy class corresponding to a digital covering space.

More information

2 Deduction in Sentential Logic

2 Deduction in Sentential Logic 2 Deduction in Sentential Logic Though we have not yet introduced any formal notion of deductions (i.e., of derivations or proofs), we can easily give a formal method for showing that formulas are tautologies:

More information

Non replication of options

Non replication of options Non replication of options Christos Kountzakis, Ioannis A Polyrakis and Foivos Xanthos June 30, 2008 Abstract In this paper we study the scarcity of replication of options in the two period model of financial

More information

Generalising the weak compactness of ω

Generalising the weak compactness of ω Generalising the weak compactness of ω Andrew Brooke-Taylor Generalised Baire Spaces Masterclass Royal Netherlands Academy of Arts and Sciences 22 August 2018 Andrew Brooke-Taylor Generalising the weak

More information

Game Theory: Normal Form Games

Game Theory: Normal Form Games Game Theory: Normal Form Games Michael Levet June 23, 2016 1 Introduction Game Theory is a mathematical field that studies how rational agents make decisions in both competitive and cooperative situations.

More information

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Lecture 2 Thursday, January 30, 2014 1 Expressing Program Properties Now that we have defined our small-step operational

More information

Type-safe cast does no harm

Type-safe cast does no harm Type-safe cast does no harm Theoretical Pearl Dimitrios Vytiniotis Stephanie Weirich University of Pennsylvania {dimitriv,sweirich}@cis.upenn.edu Abstract Generic functions can specialize their behaviour

More information

AUTOSUBST: Automation for de Bruijn Substitutions

AUTOSUBST: Automation for de Bruijn Substitutions AUTOSUBST: Automation for de Bruijn Substitutions https://www.ps.uni-saarland.de/autosubst Steven Schäfer Tobias Tebbi Gert Smolka Department of Computer Science Saarland University, Germany August 13,

More information

Notes on the symmetric group

Notes on the symmetric group Notes on the symmetric group 1 Computations in the symmetric group Recall that, given a set X, the set S X of all bijections from X to itself (or, more briefly, permutations of X) is group under function

More information

Gödel algebras free over finite distributive lattices

Gödel algebras free over finite distributive lattices TANCL, Oxford, August 4-9, 2007 1 Gödel algebras free over finite distributive lattices Stefano Aguzzoli Brunella Gerla Vincenzo Marra D.S.I. D.I.COM. D.I.C.O. University of Milano University of Insubria

More information

Semantics and Verification of Software

Semantics and Verification of Software Semantics and Verification of Software Thomas Noll Software Modeling and Verification Group RWTH Aachen University http://moves.rwth-aachen.de/teaching/ws-1718/sv-sw/ Recap: CCPOs and Continuous Functions

More information

Development Separation in Lambda-Calculus

Development Separation in Lambda-Calculus WoLLIC 2005 Preliminary Version Development Separation in Lambda-Calculus Hongwei Xi 1,2 Computer Science Department Boston University Boston, Massachusetts, USA Abstract We present a proof technique in

More information

Semantics with Applications 2b. Structural Operational Semantics

Semantics with Applications 2b. Structural Operational Semantics Semantics with Applications 2b. Structural Operational Semantics Hanne Riis Nielson, Flemming Nielson (thanks to Henrik Pilegaard) [SwA] Hanne Riis Nielson, Flemming Nielson Semantics with Applications:

More information

Martingales. by D. Cox December 2, 2009

Martingales. by D. Cox December 2, 2009 Martingales by D. Cox December 2, 2009 1 Stochastic Processes. Definition 1.1 Let T be an arbitrary index set. A stochastic process indexed by T is a family of random variables (X t : t T) defined on a

More information

Syllogistic Logics with Verbs

Syllogistic Logics with Verbs Syllogistic Logics with Verbs Lawrence S Moss Department of Mathematics Indiana University Bloomington, IN 47405 USA lsm@csindianaedu Abstract This paper provides sound and complete logical systems for

More information

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Lecture 3 Tuesday, January 30, 2018 1 Inductive sets Induction is an important concept in the theory of programming language.

More information

2. The ultrapower construction

2. The ultrapower construction 2. The ultrapower construction The study of ultrapowers originates in model theory, although it has found applications both in algebra and in analysis. However, it is accurate to say that it is mainly

More information

STRONGLY UNFOLDABLE CARDINALS MADE INDESTRUCTIBLE

STRONGLY UNFOLDABLE CARDINALS MADE INDESTRUCTIBLE The Journal of Symbolic Logic Volume 73, Number 4, Dec. 2008 STRONGLY UNFOLDABLE CARDINALS MADE INDESTRUCTIBLE THOMAS A. JOHNSTONE Abstract. I provide indestructibility results for large cardinals consistent

More information

Lecture Notes on Bidirectional Type Checking

Lecture Notes on Bidirectional Type Checking Lecture Notes on Bidirectional Type Checking 15-312: Foundations of Programming Languages Frank Pfenning Lecture 17 October 21, 2004 At the beginning of this class we were quite careful to guarantee that

More information

Sy D. Friedman. August 28, 2001

Sy D. Friedman. August 28, 2001 0 # and Inner Models Sy D. Friedman August 28, 2001 In this paper we examine the cardinal structure of inner models that satisfy GCH but do not contain 0 #. We show, assuming that 0 # exists, that such

More information

10.1 Elimination of strictly dominated strategies

10.1 Elimination of strictly dominated strategies Chapter 10 Elimination by Mixed Strategies The notions of dominance apply in particular to mixed extensions of finite strategic games. But we can also consider dominance of a pure strategy by a mixed strategy.

More information

Two Notions of Sub-behaviour for Session-based Client/Server Systems

Two Notions of Sub-behaviour for Session-based Client/Server Systems Two Notions of Sub-behaviour for Session-based Client/Server Systems Franco Barbanera 1 and Ugo de Liguoro 2 1 Dipartimento di Matematica e Informatica, Università di Catania 2 Dipartimento di Informatica,

More information

α-structural Recursion and Induction

α-structural Recursion and Induction α-structural Recursion and Induction AndrewPitts UniversityofCambridge ComputerLaboratory TPHOLs 2005, - p. 1 Overview TPHOLs 2005, - p. 2 N.B. binding and non-binding constructs are treated just the same

More information

LARGE CARDINALS AND L-LIKE UNIVERSES

LARGE CARDINALS AND L-LIKE UNIVERSES LARGE CARDINALS AND L-LIKE UNIVERSES SY D. FRIEDMAN There are many different ways to extend the axioms of ZFC. One way is to adjoin the axiom V = L, asserting that every set is constructible. This axiom

More information

ON THE QUOTIENT SHAPES OF VECTORIAL SPACES. Nikica Uglešić

ON THE QUOTIENT SHAPES OF VECTORIAL SPACES. Nikica Uglešić RAD HAZU. MATEMATIČKE ZNANOSTI Vol. 21 = 532 (2017): 179-203 DOI: http://doi.org/10.21857/mzvkptxze9 ON THE QUOTIENT SHAPES OF VECTORIAL SPACES Nikica Uglešić To my Master teacher Sibe Mardešić - with

More information

Big-Step Normalisation

Big-Step Normalisation Under consideration for publication in J. Functional Programming 1 Big-Step Normalisation THORSTEN ALTENKIRCH and JAMES CHAPMAN School of Computer Science, University of Nottingham, UK Abstract Traditionally,

More information

Cut-free sequent calculi for algebras with adjoint modalities

Cut-free sequent calculi for algebras with adjoint modalities Cut-free sequent calculi for algebras with adjoint modalities Roy Dyckhoff (University of St Andrews) and Mehrnoosh Sadrzadeh (Universities of Oxford & Southampton) TANCL Conference, Oxford, 8 August 2007

More information

3 The Model Existence Theorem

3 The Model Existence Theorem 3 The Model Existence Theorem Although we don t have compactness or a useful Completeness Theorem, Henkinstyle arguments can still be used in some contexts to build models. In this section we describe

More information

Martingale Pricing Theory in Discrete-Time and Discrete-Space Models

Martingale Pricing Theory in Discrete-Time and Discrete-Space Models IEOR E4707: Foundations of Financial Engineering c 206 by Martin Haugh Martingale Pricing Theory in Discrete-Time and Discrete-Space Models These notes develop the theory of martingale pricing in a discrete-time,

More information

SAT and DPLL. Introduction. Preliminaries. Normal forms DPLL. Complexity. Espen H. Lian. DPLL Implementation. Bibliography.

SAT and DPLL. Introduction. Preliminaries. Normal forms DPLL. Complexity. Espen H. Lian. DPLL Implementation. Bibliography. SAT and Espen H. Lian Ifi, UiO Implementation May 4, 2010 Espen H. Lian (Ifi, UiO) SAT and May 4, 2010 1 / 59 Espen H. Lian (Ifi, UiO) SAT and May 4, 2010 2 / 59 Introduction Introduction SAT is the problem

More information

Matching [for] the Lambda Calculus of Objects

Matching [for] the Lambda Calculus of Objects Matching [for] the Lambda Calculus of Objects Viviana Bono 1 Dipartimento di Informatica, Università di Torino C.so Svizzera 185, I-10149 Torino, Italy e-mail: bono@di.unito.it Michele Bugliesi Dipartimento

More information

3.2 No-arbitrage theory and risk neutral probability measure

3.2 No-arbitrage theory and risk neutral probability measure Mathematical Models in Economics and Finance Topic 3 Fundamental theorem of asset pricing 3.1 Law of one price and Arrow securities 3.2 No-arbitrage theory and risk neutral probability measure 3.3 Valuation

More information

Value of Flexibility in Managing R&D Projects Revisited

Value of Flexibility in Managing R&D Projects Revisited Value of Flexibility in Managing R&D Projects Revisited Leonardo P. Santiago & Pirooz Vakili November 2004 Abstract In this paper we consider the question of whether an increase in uncertainty increases

More information

Concurrency Semantics in Continuation-Passing Style The Companion Technical Report

Concurrency Semantics in Continuation-Passing Style The Companion Technical Report Concurrency Semantics in Continuation-Passing Style The Companion Technical Report Eneia Nicolae Todoran Technical University of Cluj-Napoca Department of Computer Science Baritiu Str. 28, 400027, Cluj-Napoca,

More information

PAULI MURTO, ANDREY ZHUKOV

PAULI MURTO, ANDREY ZHUKOV GAME THEORY SOLUTION SET 1 WINTER 018 PAULI MURTO, ANDREY ZHUKOV Introduction For suggested solution to problem 4, last year s suggested solutions by Tsz-Ning Wong were used who I think used suggested

More information

INTRODUCTION TO ARBITRAGE PRICING OF FINANCIAL DERIVATIVES

INTRODUCTION TO ARBITRAGE PRICING OF FINANCIAL DERIVATIVES INTRODUCTION TO ARBITRAGE PRICING OF FINANCIAL DERIVATIVES Marek Rutkowski Faculty of Mathematics and Information Science Warsaw University of Technology 00-661 Warszawa, Poland 1 Call and Put Spot Options

More information

Generalized Finite Developments

Generalized Finite Developments Generalized Finite Developments Jean-Jacques Lévy INRIA, Microsoft Research-INRIA Joint Centre Abstract. The Finite Development theorem (FD) is a fundamental theorem in the theory of the syntax of the

More information

Quadrant marked mesh patterns in 123-avoiding permutations

Quadrant marked mesh patterns in 123-avoiding permutations Quadrant marked mesh patterns in 23-avoiding permutations Dun Qiu Department of Mathematics University of California, San Diego La Jolla, CA 92093-02. USA duqiu@math.ucsd.edu Jeffrey Remmel Department

More information

Semantic Types for Classes and Mixins

Semantic Types for Classes and Mixins University of Turin ITRS 14, Vienna, July 18, 2014 Motivations Motivations Issues: Mixins have been proposed in the late 80 s to enhance modularity and reusability of code for class based OO programming

More information

CTL Model Checking. Goal Method for proving M sat σ, where M is a Kripke structure and σ is a CTL formula. Approach Model checking!

CTL Model Checking. Goal Method for proving M sat σ, where M is a Kripke structure and σ is a CTL formula. Approach Model checking! CMSC 630 March 13, 2007 1 CTL Model Checking Goal Method for proving M sat σ, where M is a Kripke structure and σ is a CTL formula. Approach Model checking! Mathematically, M is a model of σ if s I = M

More information

Arbitrage of the first kind and filtration enlargements in semimartingale financial models. Beatrice Acciaio

Arbitrage of the first kind and filtration enlargements in semimartingale financial models. Beatrice Acciaio Arbitrage of the first kind and filtration enlargements in semimartingale financial models Beatrice Acciaio the London School of Economics and Political Science (based on a joint work with C. Fontana and

More information

Outline of Lecture 1. Martin-Löf tests and martingales

Outline of Lecture 1. Martin-Löf tests and martingales Outline of Lecture 1 Martin-Löf tests and martingales The Cantor space. Lebesgue measure on Cantor space. Martin-Löf tests. Basic properties of random sequences. Betting games and martingales. Equivalence

More information

SAT and DPLL. Espen H. Lian. May 4, Ifi, UiO. Espen H. Lian (Ifi, UiO) SAT and DPLL May 4, / 59

SAT and DPLL. Espen H. Lian. May 4, Ifi, UiO. Espen H. Lian (Ifi, UiO) SAT and DPLL May 4, / 59 SAT and DPLL Espen H. Lian Ifi, UiO May 4, 2010 Espen H. Lian (Ifi, UiO) SAT and DPLL May 4, 2010 1 / 59 Normal forms Normal forms DPLL Complexity DPLL Implementation Bibliography Espen H. Lian (Ifi, UiO)

More information

MATH 5510 Mathematical Models of Financial Derivatives. Topic 1 Risk neutral pricing principles under single-period securities models

MATH 5510 Mathematical Models of Financial Derivatives. Topic 1 Risk neutral pricing principles under single-period securities models MATH 5510 Mathematical Models of Financial Derivatives Topic 1 Risk neutral pricing principles under single-period securities models 1.1 Law of one price and Arrow securities 1.2 No-arbitrage theory and

More information

Stochastic Calculus, Application of Real Analysis in Finance

Stochastic Calculus, Application of Real Analysis in Finance , Application of Real Analysis in Finance Workshop for Young Mathematicians in Korea Seungkyu Lee Pohang University of Science and Technology August 4th, 2010 Contents 1 BINOMIAL ASSET PRICING MODEL Contents

More information

RUDIN-KEISLER POSETS OF COMPLETE BOOLEAN ALGEBRAS

RUDIN-KEISLER POSETS OF COMPLETE BOOLEAN ALGEBRAS RUDIN-KEISLER POSETS OF COMPLETE BOOLEAN ALGEBRAS PETER JIPSEN, ALEXANDER PINUS, HENRY ROSE Abstract. The Rudin-Keisler ordering of ultrafilters is extended to complete Boolean algebras and characterised

More information

CARDINALITIES OF RESIDUE FIELDS OF NOETHERIAN INTEGRAL DOMAINS

CARDINALITIES OF RESIDUE FIELDS OF NOETHERIAN INTEGRAL DOMAINS CARDINALITIES OF RESIDUE FIELDS OF NOETHERIAN INTEGRAL DOMAINS KEITH A. KEARNES AND GREG OMAN Abstract. We determine the relationship between the cardinality of a Noetherian integral domain and the cardinality

More information

Game Theory. Lecture Notes By Y. Narahari. Department of Computer Science and Automation Indian Institute of Science Bangalore, India August 2012

Game Theory. Lecture Notes By Y. Narahari. Department of Computer Science and Automation Indian Institute of Science Bangalore, India August 2012 Game Theory Lecture Notes By Y. Narahari Department of Computer Science and Automation Indian Institute of Science Bangalore, India August 2012 Chapter 6: Mixed Strategies and Mixed Strategy Nash Equilibrium

More information

Maximum Contiguous Subsequences

Maximum Contiguous Subsequences Chapter 8 Maximum Contiguous Subsequences In this chapter, we consider a well-know problem and apply the algorithm-design techniques that we have learned thus far to this problem. While applying these

More information

5 Deduction in First-Order Logic

5 Deduction in First-Order Logic 5 Deduction in First-Order Logic The system FOL C. Let C be a set of constant symbols. FOL C is a system of deduction for the language L # C. Axioms: The following are axioms of FOL C. (1) All tautologies.

More information

Persuasion in Global Games with Application to Stress Testing. Supplement

Persuasion in Global Games with Application to Stress Testing. Supplement Persuasion in Global Games with Application to Stress Testing Supplement Nicolas Inostroza Northwestern University Alessandro Pavan Northwestern University and CEPR January 24, 208 Abstract This document

More information

Arbitrage Conditions for Electricity Markets with Production and Storage

Arbitrage Conditions for Electricity Markets with Production and Storage SWM ORCOS Arbitrage Conditions for Electricity Markets with Production and Storage Raimund Kovacevic Research Report 2018-03 March 2018 ISSN 2521-313X Operations Research and Control Systems Institute

More information

A class of coherent risk measures based on one-sided moments

A class of coherent risk measures based on one-sided moments A class of coherent risk measures based on one-sided moments T. Fischer Darmstadt University of Technology November 11, 2003 Abstract This brief paper explains how to obtain upper boundaries of shortfall

More information

Introduction to Stochastic Calculus and Financial Derivatives. Simone Calogero

Introduction to Stochastic Calculus and Financial Derivatives. Simone Calogero Introduction to Stochastic Calculus and Financial Derivatives Simone Calogero December 7, 215 Preface Financial derivatives, such as stock options for instance, are indispensable instruments in modern

More information

Notes on Natural Logic

Notes on Natural Logic Notes on Natural Logic Notes for PHIL370 Eric Pacuit November 16, 2012 1 Preliminaries: Trees A tree is a structure T = (T, E), where T is a nonempty set whose elements are called nodes and E is a relation

More information

METRIC POSTULATES FOR MODULAR, DISTRIBUTIVE, AND BOOLEAN LATTICES

METRIC POSTULATES FOR MODULAR, DISTRIBUTIVE, AND BOOLEAN LATTICES Bulletin of the Section of Logic Volume 8/4 (1979), pp. 191 195 reedition 2010 [original edition, pp. 191 196] David Miller METRIC POSTULATES FOR MODULAR, DISTRIBUTIVE, AND BOOLEAN LATTICES This is an

More information

LECTURE 2: MULTIPERIOD MODELS AND TREES

LECTURE 2: MULTIPERIOD MODELS AND TREES LECTURE 2: MULTIPERIOD MODELS AND TREES 1. Introduction One-period models, which were the subject of Lecture 1, are of limited usefulness in the pricing and hedging of derivative securities. In real-world

More information

Information Acquisition under Persuasive Precedent versus Binding Precedent (Preliminary and Incomplete)

Information Acquisition under Persuasive Precedent versus Binding Precedent (Preliminary and Incomplete) Information Acquisition under Persuasive Precedent versus Binding Precedent (Preliminary and Incomplete) Ying Chen Hülya Eraslan March 25, 2016 Abstract We analyze a dynamic model of judicial decision

More information

Best-Reply Sets. Jonathan Weinstein Washington University in St. Louis. This version: May 2015

Best-Reply Sets. Jonathan Weinstein Washington University in St. Louis. This version: May 2015 Best-Reply Sets Jonathan Weinstein Washington University in St. Louis This version: May 2015 Introduction The best-reply correspondence of a game the mapping from beliefs over one s opponents actions to

More information

Syllogistic Logics with Verbs

Syllogistic Logics with Verbs Syllogistic Logics with Verbs Lawrence S Moss Department of Mathematics Indiana University Bloomington, IN 47405 USA lsm@csindianaedu Abstract This paper provides sound and complete logical systems for

More information

American Option Pricing Formula for Uncertain Financial Market

American Option Pricing Formula for Uncertain Financial Market American Option Pricing Formula for Uncertain Financial Market Xiaowei Chen Uncertainty Theory Laboratory, Department of Mathematical Sciences Tsinghua University, Beijing 184, China chenxw7@mailstsinghuaeducn

More information

0.1 Equivalence between Natural Deduction and Axiomatic Systems

0.1 Equivalence between Natural Deduction and Axiomatic Systems 0.1 Equivalence between Natural Deduction and Axiomatic Systems Theorem 0.1.1. Γ ND P iff Γ AS P ( ) it is enough to prove that all axioms are theorems in ND, as MP corresponds to ( e). ( ) by induction

More information

INVARIANT VALUATION AND ECONOMIC DEPRECIATION: A CONSTRUCTIVE PROOF OF THE SAMUELSON THEOREM

INVARIANT VALUATION AND ECONOMIC DEPRECIATION: A CONSTRUCTIVE PROOF OF THE SAMUELSON THEOREM INVARIANT VALUATION AND ECONOMIC DEPRECIATION: A CONSTRUCTIVE PROOF OF THE SAMUELSON THEOREM Boston University School of Law Working Paper No. 11-06 (February 14, 2011) Theodore S. Sims This paper can

More information

SHORT-TERM RELATIVE ARBITRAGE IN VOLATILITY-STABILIZED MARKETS

SHORT-TERM RELATIVE ARBITRAGE IN VOLATILITY-STABILIZED MARKETS SHORT-TERM RELATIVE ARBITRAGE IN VOLATILITY-STABILIZED MARKETS ADRIAN D. BANNER INTECH One Palmer Square Princeton, NJ 8542, USA adrian@enhanced.com DANIEL FERNHOLZ Department of Computer Sciences University

More information