<<

A Hilbert-style axiomatization of higher-order

Marcelo E. Coniglio1 Cristina Sernadas2 1 GTAL, Departamento de Filosofia, Universidade Estadual de Campinas, Brazil 2 CLC/CMA, Departamento de Matem´atica, IST, Portugal

Abstract Two Hilbert calculi for higher-order intuitionistic logic (or theory of types) are introduced. The first is defined in a language that uses just exponential types of power type, and corresponds to Bell’s local theory. The second one is defined in a language with arbitrary functional types and correspond to Church’s simple . We show that both systems are sound and complete with respect to usual topos .

Introduction

Higher-order logic (or theory of types) is defined in a very rich language which permits to express most of mathematics reasoning. Theory of types was intro- duced by Russell in 1908 as a solution to paradoxes in (see [12]) and was reformulated by Church in [3]. The basic idea of theory of types is to consider objects of different kind, or types. A type can be seen as a given range of values, all of them conforming a certain specie. The universe of things within a structure is then supposed to be classified by species or types. Thus, it is natural (and useful) to think about natural numbers, real numbers, boolean values, and strings, for instance, as been different types of data. The distinction between types is particularly useful in computer science because the different requirements for data storage. Conceptually, it is also very natural to describe mathematical structures using different types of individuals. For instance, the standard definition of vector spaces uses two kind of individuals: Scalars and vectors. If x is an individual of type θ (written x : θ) and x belongs to a collection A (or if x has the property A) then the individual A cannot be of sort θ; instead A is an individual of sort “collections of individuals of sort θ” or, in short, A : P (θ), where P (θ) denotes the “power” type of the type θ. This kind of distinction between “ of a given type” and “collections of objects of a given type” allows Russell to avoid the paradox discovered by himself in 1901, namely, A = {x | x 6∈ x}. In fact, if it would possible to have x ∈ x for some x then A ∈ A A 6∈ A (where A is as above). Therefore, according to Russell’s type theory, the statement “x ∈ x” is senseless (and not contradictory, as appears according to Zermelo-Fraenkel’s set theory), and it is forbidden by allowing types for the individuals. Of course, a type P (θ) is of higher-order than θ, then the resulting logic is called higher-order logic. For instance, in second-order logic we have just two types: Individuals θ and properties P (θ). Then, using lowercase letters for variables of type θ and uppercase letters for variables of type P (θ) (or second- order variables) we can express the second-order Peano’s Induction as follows: ∀Y [Y (0) ∧ ∀x(Y (x) ⇒ Y (S(x))) ⇒ ∀xY (x)]. This axiom, together with first-order Peano’s axiom for arithmetic, character- izes with a single second-order sentence Φ the standard structure hN, +, ·, 0, 1i. We see that theory of types permits, together with the definition of basic types, to construct recursively more complex types from the given ones. For instance, given types θ1 and θ2, it is possible to define the functional type (θ1 → θ2) of maps from θ1 to θ2. Moreover, if Ω denotes the “truth-values” type, then P (θ) is obtained as the functional type (θ → Ω) (considering collections of individuals of type θ as being characteristic maps). We can also define the product type θ1 × θ2 formed by all the ordered pairs of individuals of type θ1 ` and θ2, respectively, as well as the type θ1 θ2 (the disjoint union of θ1 and θ2), etcetera. The standard set-theoretic semantics for higher-order logic is obtained by straightforward generalization of the semantics of first-order logic (cf. [14]). For instance, if θ1 and θ2 are interpreted by sets A1 and A2, respectively, then the A1 functional type (θ1 → θ2) is interpreted as the set A2 of all the maps from A1 to A2. By G¨odel’ssecond , it is immediate to show that there is no (rea- sonable) system complete for the standard (set) semantics of higher-order logic. In fact, if Φ is the second-order Peano’s arithmetic sentence mentioned above then

hN, +, ·, 0, 1i |= ϕ iff (Φ ⇒ ϕ) is second-order valid for every first-order sentence ϕ. By Tarski’s theorem, the left-hand side is not arithmetically definable, then the set of second-order validities cannot be arithmetical either. Thus, there is no effective and complete axiomatization of second-order (cf. [14]). On the other hand, Henkin proves in [5] that it is possible to give an axioma- tization of higher-order logic sound and complete w.r.t. a wider of models, called general models, in which types of the form (θ1 → θ2) are interpreted as of the set of maps from (the of) θ1 to (the interpretation of) θ2. The trick consists of enlarging adequately the class of models, reducing therefore the set of validities, which can be now captured by proof-theoretic methods. From the works of Lawvere (see for example [8, 9]) it was proved that the usual proof-methods for higher-order intuitionistic logic (from now on denoted as hol) are sound and complete w.r.t. an extremely elegant topos semantics. The discover of Lawvere that category theory is able to interpret logical lan- guages in a natural way, opens the possibilities to consider topoi as a large class of new mathematical universes of discourse. The basic idea is to substitute sets (interpreting types) by arbitrary objects in a given topos. Function symbols are interpreted as morphisms, cartesian products are categorial products, re- lation symbols are interpreted as subobjects, functional types are interpreted using exponentials, and so on (see, for instance, [7, 2, 10, 6, 11]). The fact that categorial semantics uses topoi guarantees the minimum amount of categorial operations needed to interpret the logical symbols of higher-order languages. Bell proposes in his book [2] a calculus-style axiomatization of hol called local set theory, which permits to describe syntactically formal properties of topoi. The language proposed by Bell uses product types and power types as type constructors, as well as a distinguished type 1 for singleton (the terminal object). It is well-known that it suffices to describe functional types (which correspond to exponentiation in the topos semantics). The choice of a sequent calculus for local set theory is not surprising: The proof-methods for hol one can found in the literature are, in general, expressed as sequent-calculus or natural-deduction systems. On the other hand, the Hilbert-calculus presentations of hol contain complicated rules of (cf. [5, 1]). The goal of this article is to introduce two very simple and natural Hilbert- style axiomatizations of hol, which are sound and complete w.r.t. topos se- mantics. The first one is obtained by adapting the sequent calculus for local set theory mentioned above, defined in a language with power types but with- out arbitrary functional types. The second one, originally introduced in [4], is an extension of the former to a language with arbitrary functional types, corresponding to Church’s simple type theory. The notions of signature with schema variables and of Hilbert calculus with provisos, as well as the notion of local and global entailment used here, are taken and adapted from [4], and this article should be seen as a companion to that paper. The organization of this article is as follows: In the first section we give an account of the higher-order languages to be considered. The main characteristic is the use of symbols for arbitrary terms (called schema terms, introduced in x [13]) as well as schema terms of the form ξ0 ξ, denoting the substitution of every free occurrence of variable x in ξ for ξ0. Another remarkable feature of our definition is the formalization of provisos in the rules. These features are useful for express rules in higher-order languages, and are specially profitable for fibring logics (cf. [13, 15, 4]). In Section 2 we briefly describe topos semantics, and we use, according to [13, 15, 4], two notions of semantic entailment: Local and global. Local entailment is the usual one, stating, roughly speaking, that the object interpreting the meet of the premises is contained in the object interpreting the conclusion. The global entailment is a weaker notion, stating that the conclusion is true (in a given interpretation) provided that the premises are also true in that model. In third section we introduce the notion of Hilbert calculus, which, again, consider two different notions of entailment, one (global) weaker than the other (local). Of course each syntactical notion of entailment corresponds to the semantical one. Since in categorial logic it is allowed to use “empty domains” interpreting types, the cut rule is no longer valid in semantical terms (whenever some variable occurring free in the cut formula does not occur free in the result). This forces us to consider a weaker notion of . Section 4 describes briefly local set theory. In Section 5 we introduce the first Hilbert-style axiomatization for hol we propose, obtaining the main result: The equivalence with local set theory. Finally, in Section 6 we introduce the second axiomatization of hol expressed in the language of simple type theory, and prove the theorem w.r.t. standard topos semantics. Throughout this paper, the 4 will be used to finish Definitions and Remarks, and the symbol QED will be used to finish proofs (of Propositions, Lemmas, and Corollaries).

1 Higher-Order Languages

In this section we recall the notion of signature introduced in [4]. This is a simplified version, enough for our purposes.

Definition 1.1 Given a set S with distinguished element 1, we denote by Θ(S) the set inductively defined as follows: (i) S ⊆ Θ(S); (ii) if θ1, . . . , θn ∈ Θ(S) for integer n ≥ 2 then (θ1 × · · · × θn) ∈ Θ(S); (iii) if θ ∈ Θ(S) then P (θ) ∈ Θ(S). 4

As usual, we write θn for the n-th power of θ (the product of θ with itself n times) and by convention θ0 is 1 and θ1 is θ.

Definition 1.2 A signature is a tuple Σ = hS, 1, Ξ,X,F i where:

• S is a set with distinguished element 1;

θ • Ξ = {Ξθ}θ∈Θ(S) where each Ξθ is a denumerable set Ξθ = {ξk | k ∈ N};

θ • X = {Xθ}θ∈Θ(S) where each Xθ is a denumerable set Xθ = {xk | k ∈ N};

• F = {Fθθ0 }θ,θ0∈Θ(S) where each Fθθ0 is a set. 4

The elements of S are known as sorts or ground types. The elements of Θ(S) are known as types over S. Ground type 1 is called the unit sort. The type P (1), denoted by Ω, is called the truth value type. The elements of each Ξθ and Xθ are called schema variables and variables of type θ, respectively. The 0 elements of each Fθθ0 are called function symbols of type θθ .

Definition 1.3 The family ST(Σ) = {ST(Σ)θ}θ∈Θ(S) is inductively defined as follows:

• Ξθ ∪ Xθ ⊆ ST(Σ)θ;

0 x • if x ∈ Xθ0 , ξ ∈ Ξθ0 and ξ ∈ Ξθ then ξ0 ξ ∈ ST(Σ)θ;

• if f ∈ Fθθ0 and t ∈ ST(Σ)θ then (f t) ∈ ST(Σ)θ0 ;

• hi ∈ ST(Σ)1;

• if ti ∈ ST(Σ)θi for 1 ≤ i ≤ n with n ≥ 2 then ht1, . . . , tni ∈ ST(Σ)(θ1×···×θn); • if t ∈ ST(Σ)(θ1×···×θn), n ≥ 2 and 1 ≤ i ≤ n then (t)i ∈ ST(Σ)θi ;

• if t1, t2 ∈ ST(Σ)θ then (=θht1, t2i) ∈ ST(Σ)Ω;

• if t1 ∈ ST(Σ)θ and t2 ∈ ST(Σ)P (θ) then (∈θht1, t2i) ∈ ST(Σ)Ω;

• if x ∈ Xθ and t ∈ ST(Σ)Ω then (setθx t) ∈ ST(Σ)P (θ). 4

The elements of each ST(Σ)θ are called schema terms of type θ. Schema terms of type Ω are also known as schema formulae. Schema terms without occurrences of schema variables are called terms: T (Σ)θ denotes the set of x terms of type θ. Note that schema terms with occurrences of ξ0 ξ are not terms. Schema formulae without schema variables are called formulae. We write SL(Σ) and L(Σ) for ST(Σ)Ω and T (Σ)Ω, respectively. As we shall see in Section 3, schema variables are used in Hilbert calculi to express arbitrary terms within rules. Thus, with respect to semantics we are just interested in terms, and schema terms will be useful just as a tool for Hilbert calculi. x Every occurrence of a variable x in a schema term (setθx δ) or in ξ0 ξ, inside a schema term t, is said to be bound in t. Any other occurrence of x in a schema term t is said to be free in t. In particular, the unique bound occurrences of a 0 variable x in a term t are in the scope of a term (setθx ϕ) occurring in t. If t, t x are schema terms and x is a variable of the same type that t then tt0 denotes the schema term obtained from t by substituting every free occurrence of x in 0 0 t by t . We say that a term t ∈ ST(Σ)θ is free for a variable x ∈ Xθ in a term 0 x t if, for every variable y occurring free in t , every occurrence of y in tt0 not already in t is free. Frequently we will omit the types attached to the symbols. As usual, we will adopt infix notation, writing for example (t1 = t2) instead of (=θ ht1, t2i). We also write {x : γ} for (setθx γ), and t1 ∈θ t2 (or even t1 ∈ t2) instead of (∈θ ht1, t2i). Other logical operations can be introduced through abbreviations (cf. [2]):

• Equivalence: (δ1 ⇔ δ2) for (δ1 =Ω δ2).

• True: t for (hi =1 hi).

• Conjunction: (δ1 ∧ δ2) for (hδ1, δ2i =(Ω×Ω) ht, ti).

• Implication: (δ1 ⇒ δ2) for ((δ1 ∧ δ2) ⇔ δ1).

θ θ θ • Universal quantification: (∀θxk δ) for ({xk : δ} =P (θ) {xk : t}).

Ω Ω • False: f for (∀Ωx1 x1 ). • Negation: (¬ δ) for (δ ⇒ f).

• Disjunction: (δ1 ∨ δ2) for

Ω Ω Ω Ω (∀Ωxi (((δ1 ⇒ xi ) ∧ (δ2 ⇒ xi )) ⇒ xi )),

Ω where xi is the first variable of type Ω not occurring free in hδ1, δ2i. θ • Existential quantification: (∃θxk δ) for

Ω θ Ω Ω (∀Ωxi (∀θxk((δ ⇒ xi ) ⇒ xi ))),

Ω where xi is the first variable of type Ω not occurring free in δ.

2 Topos Semantics

Higher-order languages can be interpreted in any topos (see, for instance, [7, 2, 10, 6, 11]). In order to interpret Σ-terms in a given topos we need to introduce the notion of context. By a Σ-context we mean a finite sequence ~x = x1 . . . xn of distinct variables. We denote by [] the empty context. Given a context ~x = x1 . . . xn where the variables x1, . . . , xn are of type θ1, . . . , θn, respectively, we write θ~x for θ1 ×· · ·× θn and say that θ~x is the type of the context ~x. By definition θ[] is 1. The set ST(Σ, ~x)θ is composed by all Σ-schema terms t of type θ such that every variable occurring free in t appears in the context ~x. The sets ST(Σ, ~x), SL(Σ, ~x), T (Σ, ~x) and L(Σ, ~x) are defined analogously. Given a finite set Γ of terms we may refer to its canonical context formed exclusively by the variables occurring free in some term t of Γ (this canonical context is unique once we fix a total ordering of the variables).

Definition 2.1 Let Σ be a signature. A Σ-structure is a pair M = hE, ·M i such that E is a (non-degenerate) topos and ·M is a such that:

• θM is an object of E for all θ ∈ Θ(S) such that 1M is terminal 1, (θ1 × θ · · · × θn)M is θ1M × · · · × θnM and P (θ)M is the exponential Ω M (thus, ΩM is identified with the subobject classifier Ω);

0 • if f ∈ Fθθ0 then fM : θM → θM in E. 4

Given a Σ-structure M and a context ~x of type θ~x let θ~xM be θ1M × · · · × θnM .

Definition 2.2 If t ∈ T (Σ, ~x)θ and M is a Σ-structure then we define induc- M tively a morphism [[t]]~x : θ~xM → θM as follows: M • [[xi]]~x is the canonical projection over θiM ; M • [[hi]]~x is the unique map from θ~xM to 1; M M • [[(ft)]]~x is the composite fM ◦ [[t]]~x ;

[[t]]M ~x 0 θ~xM / θM BB BB BB BB BB fM [[(ft)]]M BB ~x BB BB B  θM M M M • [[ht1, . . . , tmi]]~x is ([[t1]]~x ,..., [[tm]]~x );

([[t ]]M ,...,[[t ]]M ) 1 ~x m ~x m θ / Q θ0 ~xM P i=1 iM PPP PPP PPP PPP PP pi MPP [[ti]] PP ~x PPP PPP PPP P' 0 θiM

M M 0 0 • [[(t)i]]~x is pi ◦[[t]]~x , where t is of type (θ1 ×· · ·×θm) and pi is the canonical 0 projection over θiM ;

[[t]]M ~x Qm 0 θ~xM / i=1 θiM LL LLL LLL LLL LL pi [[(t) ]]M LL i ~x LL LLL LLL & 0 θiM

M • [[(t1 =θ t2)]]~x is the characteristic map of m : dom(m) ,→ θ~xM , the M monomorphism obtained from the equalizer of {[[ti]]~x : θ~xM → θM }i=1,2;

M [[t1]]~x  m / dom(m) / θ~xM θM M / [[t2]]~x

M M M θM • [[(t1 ∈θ t2)]]~x is eval ◦ ([[t2]]~x , [[t1]]~x ), where eval :Ω × θM → Ω is the evaluation map associated to the exponential ΩθM ;

M M ([[t2]] ,[[t1]] ) ~x ~x θ θ~xM / Ω M × θM QQQ QQQ QQQ QQQ QQQ eval M QQQ [[(t1∈θt2)]]~x QQ QQQ QQQ QQQ  Q( Ω

M x M • [[{x : ϕ}]]~x is the exponential transpose of [[ϕy ]]~xy : θ~xM × θM → Ω with respect to θM , where y is the first variable free for x in ϕ not occurring in ~x.

x M [[ϕy ]]~xy : θ~xM × θM / Ω

M θ [[{x : ϕ}]]~x : θ~xM / Ω M 4 Definition 2.3 An interpretation system is a pair S = hΣ, Mi where Σ is a signature and M is a class of Σ-structures. 4

Using our abbreviations, it can be proved that quantifiers and connectives are interpreted in any topos in the usual way (see for instance [10, 11]). As mentioned in Section 1, schema variables are just used for express rules in Hilbert calculi and we are not interested in interpret them. In order to define semantic entailment we need to introduce the following no- tation: Given an object A in a topos E, then trueA : A → Ω is the characteristic map of the monomorphism idA : A → A. Recall that Sub(A) is the collection of equivalence classes [m] of monomorphisms m : dom(m) ,→ A, where m ∼ n iff there exists a (necessarily unique) isomorphism f : dom(m) → dom(n) such that m = n ◦ f.  m dom(m) / A O z= zz zz zz −1 z f f zz zz n zz  zz  . zz dom(n)

Given [mi] ∈ Sub(A)(i = 1, 2) we say that [m1] ≤ [m2] iff there exists a morphism f : dom(m1) → dom(m2) such that m1 = m2 ◦ f. Then hSub(A), ≤i ^ is a Heyting algebra. If X is a finite of Sub(A) then X will denote the infimum of X w.r.t. the Heyting algebra-structure of Sub(A). Usually, monomorphisms are identified with their equivalence classes (see, for instance, [10]).

Definition 2.4 Let S be an interpretation system. Given a finite subset Ψ ∪ {ϕ} of L(Σ, ~x) we say:

S • Ψ globally entails ϕ within S and ~x, written Ψ p~x ϕ, iff, for every M ∈ M: ^ M M [[ψ]]~x = trueθ~xM implies [[ϕ]]~x = trueθ~xM ; ψ∈Ψ

S • Ψ locally entails ϕ within S and ~x, written Ψ d~x ϕ, iff, for every M ∈ M, ^ M M [[ψ]]~x ≤ [[ϕ]]~x . 4 ψ∈Ψ

If Ψ ∪ {ϕ} ⊆ L(Σ, ~x) is finite and ~y is the canonical context of Ψ ∪ {ϕ} then S S we write Ψ o ϕ instead of Ψ o~y ϕ, for o ∈ {p, d}. It is easy to prove that S S Ψ o ϕ implies Ψ o~x ϕ (and the converse is not necessarily true, because the possibly empty domains used in the interpretation of types of Σ). The usual notion of semantic entailment considered in categorial semantics (and in set-theoretic semantics for first-order logic) is the local one. On the other hand, we will define two different notions of syntactical inference, one for each concept of semantic entailment. In several contexts (for example, and predicate logic) it is useful to maintain the distinction between the two notions of (semantic and syntactical) (cf. [13, 15, 4]). Consider, for instance, the necessitation rule for normal modal logic: α . α The meaning of that rule is global: If α is true (is a theorem) then α is true (is a theorem). On the other hand, the stronger (local) version of the rule is not valid: α ⇒ α is not a theorem. The same happens with Generalization rule in first-order logic: α . ∀xα If α is true (is a theorem) then ∀xα is true (is a theorem). Clearly, the stronger (local) version of the rule is not valid: α ⇒ ∀xα is not a theorem. This shows that there are two kinds of inference rules, corresponding to each notion of semantic entailments, as we will see in next section.

3 Hilbert Calculi

In this section we recall (a simplified version of) the notion of Hilbert calculus introduced in [4]. In order to represent arbitrary terms in rules of Hilbert calculi we will use schema variables. Moreover, some rules will have provisos which control their range of application. Thus we need to introduce the following concepts. By a Σ-substitution ρ we mean a Θ(S)-indexed family of maps from Ξθ to T (Σ)θ. As usual we write ξρ instead of ρθ(ξ). Any Σ-substitution ρ induces x x a map ρb : ST(Σ) → T (Σ) defined inductively as usual, with: ρb(ξ0 ξ) = (ξρ)ξ0ρ, where the right-side expression is the Σ-term obtained from ξρ by substituting 0 every free occurrence of x by ξ ρ. Note that ρb(δ) ∈ T (Σ)θ if δ ∈ ST(Σ)θ. We denote ρb(δ) by δρ. Let Sbs(Σ) be the set of all Σ-substitutions. By a Σ-proviso we mean a map π : Sbs(Σ) → 2. Intuitively, π(ρ) = 1 iff the Σ-substitution ρ is allowed. (In [4] it is introduced a different notion of proviso which is suitable to perform fibring of deduction systems.) Provisos are very common in rules of logics. For instance, it is well known that a substitution instance ξρ⇒∀x ξρ of the schema formula ξ⇒∀x ξ is valid in first-order predicate logic provided that x is not free in ξρ; in this case we have π(ρ) = 1 iff x is not free in ξρ. We denote by Prov(Σ) the set of all Σ-provisos. The unit proviso u maps every Σ-substitution to 1. Binary product of provisos π u π0 is defined as expected: (π u π0)(ρ) = π(ρ) u π0(ρ).

Definition 3.1 A Σ-rule is a triple hΓ, δ, πi where Γ ∪ {δ} ⊆ SL(Σ) and π is a Σ-proviso. 4

When Γ = ∅ the conclusion δ of the rule is also known as an axiom. When Γ is finite the rule is said to be finitary.

Definition 3.2 A deduction system is a triple D = hΣ, Rd, Rpi where Σ is a signature and both Rp and Rd are sets of finitary Σ-rules and Rd ⊆ Rp. 4 The elements of Rp are called proof rules and those of Rd are known as derivation rules.

Definition 3.3 A ~x-proof within a deduction system D of ϕ ∈ L(Σ, ~x) from Ψ ⊆ L(Σ, ~x) is a finite sequence ϕ1 . . . ϕn of formulae in L(Σ, ~x) such that ϕn is ϕ and for each i = 1, . . . , n:

• either ϕi ∈ Ψ;

• or there is a rule h{γ1, . . . , γk}, δ, πi ∈ Rp and a Σ-substitution ρ such that:

1. π(ρ) = 1;

2. ϕi = δρ;

3. for each j = 1, . . . , k, there is a ij ∈ {1, . . . , i−1} such that ϕij = γjρ.

D When there is such a ~x-proof in D of ϕ from Ψ, we write Ψ `p~x ϕ. And when D D there is a context ~x such that Ψ `p~x ϕ we write Ψ `p ϕ. 4

Definition 3.4 A ~x-derivation within a deduction system D of ϕ ∈ L(Σ, ~x) from Ψ ⊆ L(Σ, ~x) is a finite sequence ϕ1 . . . ϕn of formulae in L(Σ, ~x) such that ϕn is ϕ and for each i = 1, . . . , n:

• either ϕi ∈ Ψ;

D • or ∅ `p~x ϕi;

• or there is a rule h{γ1, . . . , γk}, δ, πi ∈ Rd and a Σ-substitution ρ such that:

1. π(ρ) = 1;

2. ϕi = δρ;

3. for each j = 1, . . . , k, there is a ij ∈ {1, . . . , i−1} such that ϕij = γjρ.

D When there is such a ~x-derivation in D of ϕ from Ψ, we write Ψ `d~x ϕ. And D D when there is a context ~x such that Ψ `d~x ϕ we write Ψ `d ϕ. 4

As usual, with respect to both proofs and derivations, we may drop the D D reference to the assumptions when Γ = ∅. Note that `p~x ϕ iff `d~x ϕ.

Definition 3.5 A logic system is a tuple L = hΣ, M, Rd, Rpi such that S = hΣ, Mi is an interpretation system and D = hΣ, Rd, Rpi is a deduction system. 4

Definition 3.6 A logic is said to be sound iff, for o ∈ {p, d}, any context ~x and every finite Ψ ∪ {ϕ} ⊆ L(Σ, ~x):

D S • Ψ `o~x ϕ implies Ψ o~x ϕ. A logic system L is said to be complete iff, for o ∈ {p, d} and finite Ψ∪{ϕ} ⊆ L(Σ):

S D • Ψ o ϕ implies Ψ `o ϕ. 4

D hΣ,{M}i We say that a Σ-structure M satisfies D if Ψ `o~x ϕ implies Ψ o~x ϕ for every Ψ, ϕ, ~x and o ∈ {p, d}.

Remark 3.7 We recall here the observation made in [4] about the strangeness of Definition 3.6. It is clear that the intended definition of soundness of a logic system L is, for o ∈ {p, d},

D S Ψ `o ϕ implies Ψ o ϕ. Unfortunately, this definition is not correct in the realm of logic systems, be- cause the (possibly) empty domains interpreting the types of Σ. In general, S S S from Ψ, ψ o ϕ and Ψ o ψ we cannot infer Ψ o ϕ, for o ∈ {p, d} (see, for instance, [2]). On the other hand, it is obvious that any deduction system D D D D satisfies the following property: From Ψ, ψ `o ϕ and Ψ `o ψ we infer Ψ `o ϕ, for o ∈ {p, d}. Therefore the standard definition of soundness must be changed, and we must live with the fact that it is possible to have

D S Ψ `o ϕ but Ψ 6 o ϕ even in a sound logic system L. 4

4 Local Set Theories

As mentioned in the Introduction, the logic of topoi is, in general, expressed through a sequent calculus or in -style (see, for instance, [2, 6]). One reason for this is probably related to the problems that the definition of soundness involves for Hilbert calculi (cf. Remark 3.7 and [4]). In this section we recall the sequent calculus called local set theory introduced by Bell in [2], which is sound (in the usual sense) and complete for (local) topos semantics. And in Section 5 we will give a Hilbert calculus which is equivalent to local set theory, as long as ~x-derivations are considered.

Definition 4.1 Let Σ be a signature as in Definition 1.2 but allowing terms of the form hti, which are identified with t. A Σ-sequent (or simply a sequent) is a pair hΨ, ϕi, where Ψ ∪ {ϕ} is a finite set of formulae over Σ. 4

A sequent hΨ, ϕi will be denoted by (Ψ : ϕ) or simply Ψ : ϕ. If Ψ = ∅ then we will write (: ϕ) or : ϕ. As usual,

ϕ, Ψ: ψ Ψ, ϕ : ψ and Φ, Ψ: ψ will stand for ({ϕ} ∪ Ψ: ψ), (Ψ ∪ {ϕ} : ψ) and (Φ ∪ Ψ: ψ), respectively. If Ψ x x is a finite set of formulae then Ψτ will stands for the finite set {ϕτ | ϕ ∈ Ψ}. Definition 4.2 Local Set Theories (cf. [2]) A local set theory is a sequent calculus defined as follows ϕ : ϕ

Unity : x1 = hi z z Equality x = y, ϕx : ϕy (x and y free for z in ϕ)

Product1 :(hx1, . . . , xni)i = xi (1 ≤ i ≤ n)

Product2 x = h(x)1,..., (x)ni (n ≥ 1) Comprehension : x ∈ {x : ϕ} Ψ: ϕ Thinning ψ, Ψ: ϕ Ψ: ϕ ϕ, Ψ: ψ Cut (any free variable of ϕ free in Ψ or ψ) Ψ: ψ Ψ: ϕ Substitution x x (τ free for x in Ψ and ϕ) Ψτ : ϕτ Ψ: x ∈ σ ⇔ x ∈ τ (x not free in Ψ, σ, τ) Ψ: σ = τ ϕ, Ψ: ψ ψ, Ψ: ϕ Equivalence 4 Ψ: ϕ ⇔ ψ

In [2], the term hti is defined to be t, for every term t. This allows us to prove the sequent (: ∀x(x =θ x)) for all θ. Recall from [2] the following: Let S be a set of . Then the local set theory S generated by S is defined as follows: (Ψ : ϕ) ∈ S iff Ψ `S ϕ iff there exists a proof of (Ψ : ϕ) possibly using sequents of S as assumptions in the rules. If S = ∅ then we write Ψ ` ϕ instead of Ψ `S ϕ. The following result was proved in [2]. Proposition 4.3 The following is true in any local set theory:

ϕ, Ψ: ψ Ψ: ϕ ⇒ ψ (1) and Ψ: ϕ ⇒ ψ ϕ, Ψ: ψ Ψ: ψ (2) provided either (i) x is not free in Ψ or (ii) x is not free in ψ. Ψ: ∀x ψ (3) ∀x ψ ` ψ provided x is free in ψ.

ϕx, Ψ: ψ (4) τ provided that τ is free for x in ϕ, x is free in ϕ and any free ∀x ϕ, Ψ: ψ variable of τ is free in ∀x ϕ, Ψ or ψ. In Section 5 we will define a deduction system called HOL and prove that inferences in local set theories correspond to deductions in HOL, obtaining the theorem of adequacy of HOL w.r.t. topos semantics. Because the different definition of soundness we state in 3.6, we need to extend the notion of inference in local set theories (cf. Definition 4.5). Remark 4.4 For convenience, we adopt the following notation. Let Ψ be a finite subset of L(Σ); then (V Ψ) denotes a formula obtained from Ψ by taking the conjunction of all the formulae in Ψ in an arbitrary order and association (if Ψ = ∅ then we take (V Ψ) to be t). It is easy to prove that, if Ψ ∪ {ψ} is a V V finite subset of L(Σ) and ( Ψ)1,( Ψ)2 are two conjunctions defined as above V V V V then {( Ψ)1} ` ( Ψ)2, therefore {( Ψ)1 ⇒ ψ} ` ( Ψ)2 ⇒ ψ. 4

Definition 4.5 Let S be a set of sequents formed by formulae in L(Σ) and let Ψ∪{ϕ} be a finite subset of L(Σ, ~x) for some context ~x = x1 . . . xn. Let (~x = ~x) V be a formula ( {(x1 = x1),..., (xn = xn)}) obtained as in Remark 4.4. Then Ψ `S~x ϕ will stands for Ψ, (~x = ~x) `S ϕ. 4

As usual we omit the reference to the theory S when S = ∅. Let S = hΣ, Mi be the interpretation system such that M is the class of all the Σ-structures M = hE, ·M i. Using the soundness and completeness theorem of local set theory stated in [2] we obtain easily the following theorem of adequacy:

Theorem 4.6 Let ~x be a context, Ψ ∪ {ϕ} a finite subset of L(Σ, ~x) and S a SS set of sequents in L(Σ). Then Ψ `S~x ϕ iff Ψ d~x ϕ, where SS = hΣ, MSi and MS is the subclass of M formed by all the models of S. In particular: Ψ `~x ϕ S SS S iff Ψ d~x ϕ;Ψ `S ϕ iff Ψ d ϕ and Ψ ` ϕ iff Ψ d ϕ.

5 Hilbert-style axiomatization of Higher-order logic

In this section we will adapt the sequent calculus-style presentation of local set theory to a Hilbert-style one, defining a deduction system called HOL. The main results to be stated are the following:

HOLS • Ψ `d~x ϕ implies Ψ `S~x ϕ;

HOLS • Ψ `S ϕ implies Ψ `d ϕ, where HOLS is obtained from HOL by adding the sequents of S as (under an appropriate form). In order to do this, we begin with some notation. For any schema formula δ, any type θ, any variable x of type θ and any schema term δ1 of type θ we define the following provisos:

• (δ1 B x : δ)(ρ) = 1 iff δ1ρ is free for x in δρ; • (x ≺ δ)(ρ) = 1 iff x occurs free in δρ;

• (x 6≺ δ)(ρ) = 1 iff x does not occur free in δρ.

Definition 5.1 Hilbert calculus for intuitionistic hol. We define the deduction system HOL = hΣ, Rp, Rdi as follows (here i ∈ N, k ≥ 2 and θ, θ1, ..., θk are types):

•Rd is the set composed by: taut1: h∅, ξ1 ⇒ (ξ2 ⇒ ξ1), ui;

taut2: h∅, (ξ1 ⇒ (ξ2 ⇒ ξ3)) ⇒ ((ξ1 ⇒ ξ2) ⇒ (ξ1 ⇒ ξ3)), ui;

taut3: h∅, (ξ1 ⇒ ξ2) ⇒ ((ξ1 ⇒ ξ3) ⇒ (ξ1 ⇒ (ξ2 ∧ ξ3))), ui;

taut4: h∅, ξ1 ⇒ (ξ2 ⇒ (ξ1 ∧ ξ2)), ui;

uni: h∅, ∀x1(x1 = hi), ui; equa : h∅, (ξ = ξ ) ⇒ (xi ξ ⇒ xi ξ ), (ξ x : ξ ) u (ξ x : ξ )i; i,θ 1 2 ξ1 3 ξ2 3 1 B i 3 2 B i 3 refθ: h∅, ∀x1(x1 = x1), ui;

projk,θ1,...,θk,i: h∅, ∀x1 · · · ∀xk((hx1, . . . , xki)i = xi), ui for 1 ≤ i ≤ k;

prodk,θ1,...,θk : h∅, ∀x1(x1 = h(x1)1,..., (x1)ki), ui;

comphθ: h∅, ∀x1(x1 ∈ {x1 : ξ1} ⇔ ξ1), ui; subs : h∅, (∀x ξ ) ⇒ xi ξ , (ξ x : ξ ) u (x ≺ ξ )i; i,θ i 2 ξ1 2 1 B i 2 i 2 extθ: h∅, (∀x1(x1 ∈ ξ1 ⇔ x1 ∈ ξ2) ⇒ (ξ1 = ξ2), (x1 6≺ ξ1) u (x1 6≺ ξ2)i;

equiv: h∅, (ξ1 ⇒ ξ2) ⇒ ((ξ2 ⇒ ξ1) ⇒ (ξ1 ⇔ ξ2)), ui;

MP: h{ξ1, ξ1 ⇒ ξ2}, ξ2, ui;

•Rp is obtained by adding to Rd the following rules:

GENi,θ: h{ξ1 ⇒ ξ2}, ξ1 ⇒ (∀xiξ2), (xi 6≺ ξ1)i. 4

Of course, rules with subscripts are in fact “schema-rules” (in the usual sense). Thus, each i ∈ N and each type θ define a particular instance of equai,θ, and so on. Since, in contrast with the approach in [2], we do not define terms of the form hti (1-tupling), we need to include the axioms ref θ. From now on, we will omit the subscripts in the name of the rules. V V Remark 5.2 If Ψ∪{ψ} is a finite subset of L(Σ, ~x) and ( Ψ)1,( Ψ)2 are two V HOL V conjunctions defined as in Remark 4.4 then {( Ψ)1} `d~x ( Ψ)2. Therefore V HOL V {( Ψ)1 ⇒ ψ} `d~x ( Ψ)2 ⇒ ψ. 4

Given a set S of sequents we define the set of rules ^ RS = {h∅, ( Ψ) ⇒ ϕ, ui | (Ψ : ϕ) ∈ S}, V where ( Ψ) is defined as in Remark 4.4. The system HOLS is given by

hΣ, Rp ∪ RS, Rd ∪ RSi.

Proposition 5.3 HOLS satisfies the Metatheorem of Deduction with respect to ~x-derivations: For every context ~x and finite Ψ ∪ {ϕ, ψ} ⊆ L(Σ, ~x),

HOLS HOLS ϕ, Ψ `d~x ψ iff Ψ `d~x ϕ ⇒ ψ.

Proof: By straightforward induction on the length of a ~x-derivation of ψ from HOLS Ψ ∪ {ϕ} we get Ψ `d~x ϕ ⇒ ψ. The converse is immediate by MP. QED The following useful properties of HOL can be easily proved.

Lemma 5.4 Let ϕ, ψ, ψ0 ∈ L(Σ, ~x). The following holds in HOL.

HOL 1. `d[] t.

HOL 2. {ϕ} `d~x (t ⇒ ϕ). HOL 3. {ϕ} `p~x (∀xϕ).

0 HOL 0 4. {(ϕ ⇒ ψ), (ψ ⇒ ψ )} `d~x (ϕ ⇒ ψ ). 0 HOL 0 5. {(ϕ ⇒ ψ), (ϕ ⇒ ψ )} `d~x (ϕ ⇒ (ψ ∧ ψ )). HOL 6. {ϕ ∧ ψ} `d~x ϕ. HOL 7. {ϕ ∧ ψ} `d~x ψ. 0 HOL 0 8. {ϕ ⇒ (ψ ⇒ ψ )} `d~x ((ϕ ∧ ψ) ⇒ ψ ).

HOLS Lemma 5.5 Let ~x be a context and let ϕ ∈ L(Σ, ~x). Then `d~x ϕ implies `S~x ϕ.

Proof: By induction on the length n of a ~x-derivation of ϕ from ∅ within HOLS. If n = 0 then we have the following cases: (1) ϕ is an instance of (taut i)(i = 1, ..., 4). The result follows from the completeness of pure local set theory and Thinning. (2) ϕ is an instance (∀x)(x ∈ σ ⇔ x ∈ τ) ⇒ (σ = τ) of ext. Then x does not occur free in hσ, τi. Consider the following proof from S in pure local set theory:

1. x ∈ σ ⇔ x ∈ τ : x ∈ σ ⇔ x ∈ τ Tautology

2. (∀x(x ∈ σ ⇔ x ∈ τ)) : x ∈ σ ⇔ x ∈ τ Proposition 4.3(3), 1

3. (∀x(x ∈ σ ⇔ x ∈ τ)) : σ = τ Extensionality, 2

4. (~x = ~x), (∀x(x ∈ σ ⇔ x ∈ τ)) : σ = τ Thinning, 3

5. (~x = ~x):(∀x(x ∈ σ ⇔ x ∈ τ)) ⇒ σ = τ Proposition 4.3(1), 4.

x (3) ϕ is an instance (∀xψ) ⇒ ψτ of subs. Then τ is free for x in ψ and x occurs free in ψ, and we can construct the following proof from S in pure local set theory:

1. ψ : ψ Tautology

2. (∀xψ): ψ Proposition 4.3(3), 1

x 3. (∀xψ): ψτ Substitution, 2 x 4. (~x = ~x), (∀xψ): ψτ Thinning, 3 x 5. (~x = ~x):(∀xψ) ⇒ ψτ Proposition 4.3(1), 4. (4) The other cases for n = 0 are easy. Suppose that the result is true for every ~x-derivation within HOLS in k ≤ n steps, and let ϕ obtained from ∅ through a ~x-derivation in n + 1 steps. We have the following cases: (a) ϕ is an instance of an axiom. The proof is as above. (b) ϕ is obtained from ψ and ψ⇒ϕ by MP. Thus we can construct the following proof from S in pure local set theory: 1. (~x = ~x): ψ (IH)

2. (~x = ~x): ψ ⇒ ϕ (IH)

3. ψ, (~x = ~x): ϕ Proposition 4.3(1), 2

4. (~x = ~x): ϕ Cut 3,1. Note that the application of Cut is legitimated by the presence of a suitable (~x = ~x) which captures all variable occurring free in ψ. (c) ϕ is ψ1 ⇒ (∀xψ2) obtained from ψ1 ⇒ ψ2 by GEN. Thus x does not occur free in ψ1. We have the following cases: CASE 1: x does not occur free in ψ2. Then we construct the following proof from S in pure local set theory:

1. (~x = ~x): ψ1 ⇒ ψ2 (IH)

2. ψ1, (~x = ~x): ψ2 Proposition 4.3(1), 1

3. ψ1, (~x = ~x):(∀xψ2) Proposition 4.3(2), 2

4. (~x = ~x): ψ1 ⇒ (∀xψ2) Proposition 4.3(1), 3.

CASE 2: x occurs free in ψ2. Then ~x is, let’s say, ~yx, and we can construct the following proof from S in pure local set theory:

1. x = x, (~y = ~y): ψ1 ⇒ ψ2 (IH)

2. (∀x(x = x)), (~y = ~y): ψ1 ⇒ ψ2 Proposition 4.3(4), 1 3. : (∀x(x = x))

4. (~y = ~y): ψ1 ⇒ ψ2 Cut 2,3

5. ψ1, (~y = ~y): ψ2 Proposition 4.3(1), 4

6. ψ1, (~y = ~y):(∀xψ2) Proposition 4.3(2), 5

7. (~y = ~y): ψ1 ⇒ (∀xψ2) Proposition 4.3(1), 6

8. (~x = ~x): ψ1 ⇒ (∀xψ2) Thinning, 7. This concludes the proof. QED

Proposition 5.6 Let ~x be a context and let Ψ ∪ {ϕ} be a finite subset of HOLS L(Σ, ~x). Then Ψ `d~x ϕ implies Ψ `S~x ϕ. Proof: Is an immediate consequence of Propositions 5.3 and 4.3(1), and Lemma 5.5. QED

Lemma 5.7 Let Ψ ∪ {ϕ} be a finite subset of L(Σ). Then Ψ `S ϕ implies HOLS V `d ( Ψ) ⇒ ϕ.

Proof: Induction on the length n of the proof of the sequent (Ψ : ϕ) from S. If n = 0 then we have two possibilities: (1) (Ψ : ϕ) is an axiom of the pure local set theory. The result follows easily using the axioms of HOL and Lemma 5.4. For example, any instance of axiom Equality can be derived in HOL as follows:

z z 1. ((x = y) ⇒ (ψx ⇒ ψy)) (equa) z z 2. (((x = y) ∧ ψx) ⇒ ψy) (Lemma 5.4(8), 1), provided that both x, y are free for z in ψ. (2) (Ψ : ϕ) is an instance of a sequent in S. The conclusion is immediate, by the definition of RS. Assume that the result is true for any proof of length ≤ n, and consider a sequent (Ψ : ϕ) which is proved from S in n + 1 steps. We have the following new cases: (a) (Ψ : ϕ) is of the form (ψ, Φ: ϕ), and it is obtained from (Φ : ϕ) by Thinning. Then there exists a context ~x and a ~x-derivation within HOLS of ((V Φ) ⇒ ϕ) from ∅, by induction hypothesis. From one of such ~x-derivations we can construct the following ~x-derivation in HOLS: 1. ((V Φ) ⇒ ϕ) (IH)

2. ((ψ ∧ (V Φ)) ⇒ (V Φ)) (Lemma 5.4(7), Proposition 5.3)

3. ((ψ ∧ (V Φ)) ⇒ ϕ) (Lemma 5.4(4), 2,1).

(b) (Ψ : ϕ) is obtained from (Ψ : ψ) and (ψ, Ψ: ϕ) by Cut. There exists a V V context ~x and ~x-derivations in HOLS of (( Ψ) ⇒ ψ) and ((ψ ∧ ( Ψ)) ⇒ ϕ), by induction hypothesis and Remark 5.2. From one of such ~x-derivations we can construct the following ~x-derivation in HOLS:

1. ((V Ψ) ⇒ ψ) (IH)

2. ((ψ ∧ (V Ψ)) ⇒ ϕ) (IH)

3. ((V Ψ) ⇒ (V Ψ))

4. ((V Ψ) ⇒ (ψ ∧ (V Ψ))) (Lemma 5.4(5) 1,3)

5. ((V Ψ) ⇒ ϕ) (Lemma 5.4(4), 4,2).

x x (c) (Ψ : ϕ) is of the form (Φτ : ψτ ), and it is obtained from (Φ : ψ) by Substitution. Note that τ is free for x in (V Φ) ⇒ ψ. If x does not occur free in V ( Φ) ⇒ ψ then (Ψ : ϕ) is (Φ : ψ) and there exists a ~x-derivation in HOLS of ((V Ψ) ⇒ ϕ), by induction hypothesis. If x occurs free in (V Φ) ⇒ ψ then there V exists a ~x-derivation in HOLS of (( Φ) ⇒ ψ), by induction hypothesis. From one of such ~x-derivations we can construct the following ~y-derivation in HOLS, for some context ~y:

1. ((V Φ) ⇒ ψ) (IH)

2. (∀x((V Φ) ⇒ ψ)) (Lemma 5.4(3), 1)

V V x 3. (∀x(( Φ) ⇒ ψ)) ⇒ (( Φ) ⇒ ψ)τ (subs) V x x 4. ( Φτ ) ⇒ ψτ (MP 2,3). (d) (Ψ : ϕ) is of the form (Ψ : σ = τ), and it is obtained from (Ψ : x ∈ σ⇔x ∈ τ) by Extensionality. Note that x does not occur free in h(V Ψ), σ, τi. There exists V a ~x-derivation in HOLS of ( Ψ) ⇒ (x ∈ σ ⇔ x ∈ τ), by induction hypothesis. From one of such ~x-derivations we can construct the following ~x-derivation in HOLS: 1. (V Ψ) ⇒ (x ∈ σ ⇔ x ∈ τ) (IH)

2. (V Ψ) ⇒ (∀x(x ∈ σ ⇔ x ∈ τ)) (GEN 1)

3. (∀x(x ∈ σ ⇔ x ∈ τ)) ⇒ (σ = τ)(ext)

4. (V Ψ) ⇒ (σ = τ) (Lemma 5.4(4), 2,3).

(e) (Ψ : ϕ) is (Ψ : ψ1 ⇔ψ2), and it is obtained from (ψ1, Ψ: ψ2) and (ψ2, Ψ: ψ1) V by Equivalence. Then there exists ~x-derivations in HOLS of ((ψ1 ∧( Ψ))⇒ψ2) V and ((ψ2 ∧ ( Ψ)) ⇒ ψ1), by induction hypothesis and Remark 5.2. From one of such ~x-derivations we can construct the following ~x-derivation in HOLS: V 1. ((ψ1 ∧ ( Ψ)) ⇒ ψ2) (IH) V 2. ((ψ2 ∧ ( Ψ)) ⇒ ψ1) (IH) V 3. (( Ψ) ⇒ (ψ1 ⇒ ψ2)) (1) V 4. (( Ψ) ⇒ (ψ2 ⇒ ψ1)) (2)

5. ((ψ1 ⇒ ψ2) ⇒ ((ψ2 ⇒ ψ1) ⇒ (ψ1 ⇔ ψ2))) (equiv) V 6. (( Ψ) ⇒ ((ψ2 ⇒ ψ1) ⇒ (ψ1 ⇔ ψ2))) (Lemma 5.4(4), 3,5) V V V 7. ((( Ψ) ⇒ ((ψ2 ⇒ ψ1) ⇒ (ψ1 ⇔ ψ2))) ⇒ ((( Ψ) ⇒ (ψ2 ⇒ ψ1)) ⇒ (( Ψ) ⇒ (ψ1 ⇔ ψ2)))) (taut2) V V 8. ((( Ψ) ⇒ (ψ2 ⇒ ψ1)) ⇒ (( Ψ) ⇒ (ψ1 ⇔ ψ2))) (MP 6,7) V 9. (( Ψ) ⇒ (ψ1 ⇔ ψ2)) (MP 4,8). QED Proposition 5.8 Let Ψ ∪ {ϕ} be a finite subset of L(Σ). Then Ψ `S ϕ implies HOLS Ψ `d ϕ. Proof: Immediate by Lemma 5.7 and Proposition 5.3. QED

From Propositions 5.6 and 5.8 we obtain the desired result.

Theorem 5.9 (Adequacy of HOL) Let SS = hΣ, MSi such that MS is the class of all the Σ-structures satisfying S. Then:

1. HOLS is d-sound and d-complete w.r.t. SS, that is, for every context ~x and finite Ψ ∪ {ϕ} ⊆ L(Σ, ~x):

HOLS SS • Ψ `d~x ϕ implies Ψ d~x ϕ. SS HOLS • Ψ d ϕ implies Ψ `d ϕ.

2. HOLS is p-sound and p-complete w.r.t. SS, that is, for every context ~x and finite Ψ ∪ {ϕ} ⊆ L(Σ, ~x):

HOLS SS • Ψ `p~x ϕ implies Ψ p~x ϕ.

SS HOLS • Ψ p ϕ implies Ψ `p ϕ. Proof: (1) It is an immediate consequence of Theorem 4.6 and Propositions 5.6 and 5.8. (2) Recall the notation introduced in Remark 4.4 and Definition 4.5. Let Ψ,~x HOLS be the deduction system obtained from HOLS by adding the axiom ^ h∅, ( Ψ) ∧ (~x = ~x), ui,

Ψ,~x Ψ,~x and let SS = hΣ, MS i be the corresponding interpretation system. Then, by definition of proofs and derivations and by item (1):

Ψ,~x HOLS HOLS M Ψ,~x Ψ `p~x ϕ implies `d~x ϕ implies [[ϕ]]~x = trueθ~xM for every M ∈ MS .

But the last affirmation implies the following: For every M ∈ MS, M M if [[ψ]]~x = trueθ~xM for every ψ ∈ Ψ then [[ϕ]]~x = trueθ~xM .

SS This means that Ψ p~x ϕ and then HOLS is p-sound w.r.t. SS. Finally, suppose SS that Ψ p ϕ. Then, for every M ∈ MS: M M if [[ψ]]~x = trueθ~xM for every ψ ∈ Ψ then [[ϕ]]~x = trueθ~xM , where ~x is the canonical context of Ψ ∪ {ϕ}. Then

M M [[ϕ]]~x = [[ϕ ∧ (~x = ~x)]]~x = trueθ~xM

Ψ,~x Ψ,~x SS for every M ∈ MS , that is, d (ϕ ∧ (~x = ~x)). By item (1) we infer HOLΨ,~x S HOLS `d (ϕ ∧ (~x = ~x)). Therefore Ψ `p ϕ and then we obtain the desired result. QED 6 Extending the language

In [4] it is shown that it is possible to extend the set Θ(S) of Definition 1.1 to a wider collection allowing functional types instead of the particular cases P (θ). That is, the language to be considered is as in Church’s simple type theory (cf. [3, 5]). Of course the logic obtained is the same than HOL, because arbitrary exponentials can be expressed in any topos just using exponentials of the form ΩA, finite limits and the properties of Ω (see for instance [10]).

Definition 6.1 Given a set S with distinguished element 1, we denote by Θ∗(S) the set inductively defined as follows: (i) s ∈ Θ∗(S) whenever s ∈ S; ∗ ∗ (ii) (θ1 × · · · × θn) ∈ Θ (S) whenever θ1, . . . , θn ∈ Θ (S) for integer n ≥ 2; (iii) (θ → θ0) ∈ Θ∗(S) whenever θ, θ0 ∈ Θ∗(S). 4

Definition 6.2 The signature Σ∗ is defined analogously to Σ in Definition 1.2, replacing Θ(S) by Θ∗(S) and requiring that Ω is also a distinguished element of S (therefore Ω is now a primitive symbol). 4

∗ ∗ Definition 6.3 The family ST(Σ ) = {ST(Σ )θ}θ∈Θ∗(S) is inductively defined as in Definition 1.3, replacing Θ(S) by Θ∗(S), P (θ) by (θ → Ω) and the clause concerning ∈θ by the following:

∗ 0 ∗ 0 ∗ • if t ∈ ST(Σ )(θ→θ0) and t ∈ ST(Σ )θ then (appθθ0 ht, t i) ∈ ST(Σ )θ0 . 4

0 0 We write t(t ) instead of (appθθ0 ht, t i). Additionally, we write (∈θ ht1, t2i) or t1 ∈θ t2 or t1 ∈ t2 for (appθΩht2, t1i). ∗ AΣ -structure M is a Σ-structure such that ΩM is the subobject classifier 0 0 θM 0 M M 0 M Ω, (θ → θ )M = (θM ) and [[(appθθ0 ht, t i)]]~x is eval ◦ ([[t]]~x , [[t ]]~x ), where 0 θM 0 eval :(θM ) × θM → θM is the evaluation map associated to the exponential 0 θM (θM ) . ([[t]]M ,[[t0]]M ) ~x ~x 0 θ θ~xM / (θ ) M × θM QQ M QQQ QQQ QQQ QQQ QQQ eval [[t(t0)]]M QQQ ~x QQQ QQQ QQQ QQ( 0 θM

Finally, the full version of HOL introduced in [4] is as follows. Let ti ∈ ∗ ST(Σ )(θi→Ω) (for i = 1, 2). The following notation for schema terms will be useful:

• t1 × t2 for {hx, yi :(x ∈ t1) ∧ (y ∈ t2)};

• t1 ⊆ t2 for ∀x(x ∈ t1 ⇒ x ∈ t2);

x • ∃!xϕ for ∃x(ϕ∧∀y(ϕy ⇒(x = y))) where y is the first variable of the same type than x, different from x and not occurring in ϕ; t1 • t2 for {z ⊆ t1 × t2 : ∀x(x ∈ t1 ⇒ ∃!y((y ∈ t2) ∧ (hx, yi ∈ z))}; θ ∗ • Uθ for {x1 : t}, where θ ∈ Θ (S).

Definition 6.4 The deduction system HOL∗ defined over Σ∗ is obtained from HOL by replacing axioms extθ by the following ones:

Uθ funθθ0 : h∅, ∀x1(x1 ∈ Uθ0 ⇒ ∃!x2∀x3∀x4(hx3, x4i ∈ x1 ⇔ x2(x3) = x4)), ui. 4

It is easy to prove that the following “extensionality” properties are derived in HOL∗:

extθθ0 : ∀x1∀x2(∀x3(x1(x3) =θ0 x2(x3)) ⇒ x1 =(θ→θ0) x2).

∗ In particular, axioms extθ (with their provisos) are derived in HOL . The main result is the following.

Theorem 6.5 Let S∗ = hΣ∗, M∗i be the interpretation system such that M∗ is the class of all Σ∗-structures. Then HOL∗ is sound and complete w.r.t. S∗, that is, for o ∈ {p, d} and Ψ ∪ {ϕ} ⊆ L(Σ, ~x) finite:

HOL∗ S∗ 1. Ψ `o~x ϕ implies Ψ o~x ϕ. S∗ HOL∗ 2. Ψ o ϕ implies Ψ `o ϕ.

∗ Proof: Since axioms extθ can be are derived in HOL , the system is rich enough to construct a canonical model (simply adapting the completeness proof of [2] or the completeness lemma in [4]). Then HOL∗ is d-complete. On the other hand, axioms funθθ0 are sound in every topos. Again, the proof is adapted from [4]. It is well-known that, in any topos, using the properties of the subobject classifier Ω, finite limits and exponentials of the form ΩA then it is possible to construct arbitrary exponentials (see, for instance, [10]). The existence of ∗ exponentials guarantees the soundness of axioms funθθ0 , therefore HOL is d- sound. The adequacy of HOL∗ for global entailment is easily obtained from the local adequacy. QED

The generalization of Theorem 6.5 to theories with additional axioms is obvious. This shows that HOL∗ is another system of higher-order intuitionistic logic sound and complete for topos semantics, but defined in a richer language than those of HOL or local set theory. In fact, the language of HOL∗ corresponds to Church’s simple type theory. It should be clear that axioms funθθ0 are enough to express λ-abstraction. Acknowledgments

The authors are grateful to Claudio Hermida and Jørgen Villadsen for many useful pointers into categorical logic and for a careful reading of a previous version of this paper. This work was partially supported by Funda¸c˜aopara a Ciˆenciae a Tecnologia (FCT, Portugal), namely via the FEDER Project FibLog POCTI/MAT/372 39/2001. The first author was supported by the post-doctoral grant 01/1045-0 of Funda¸c˜aode Amparo `aPesquisa do Estado de S˜aoPaulo (FAPESP), Brazil.

References

[1] P.B. Andrews. An Introduction to and Type Theory: To Truth Through Proof. Kluwer Academic Publishers, Dordrecht, 2002. Second Edition.

[2] J. L. Bell. Toposes and Local Set Theories. Oxford University Press, 1988.

[3] A. Church. A foundation for the simple theory of types. Journal of Symbolic Logic, 5:56–68, 1940.

[4] M. E. Coniglio, A. Sernadas, and C. Sernadas. Fibring logics with topos semantics. Journal of Logic and Computation, 13(4):595–624, 2003.

[5] L. Henkin. Completeness in the theory of types. Journal of Symbolic Logic, 15:81–91, 1950.

[6] B. Jacobs. Categorical Logic and Type Theory, volume 141 of Studies in Logic and the Foundations of Mathematics. Elsevier, Amsterdam, 1999.

[7] J. Lambek and P.J. Scott. Introduction to Higher-order Categorical Logic. Cambridge University Press, Cambridge, 1986.

[8] F. Lawvere. Adjointness in foundations. Dialectica, 23:281–296, 1969.

[9] F. Lawvere. Equality in hyperdoctrines and comprehension schema as an adjoint functor. In Proceedings of the American Mathematical Society Symposium on Pure Mathematics XVII, pages 1–14, 1970.

[10] S. Mac Lane and I. Moerdijk. Sheaves in Geometry and Logic. Springer- Verlag, New York, 1994.

[11] M. Makkai and G.E. Reyes. First-Order Categorical Logic, volume 611 of Lecture Notes in Mathematics. Springer-Verlag, Berlin, 1977.

[12] B. Russell. Mathematical logic as based on the theory of types. American Journal of Mathematics, 30:222–262, 1908.

[13] A. Sernadas, C. Sernadas, and C. Caleiro. Fibring of logics as a categorial construction. Journal of Logic and Computation, 9(2):149–179, 1999. [14] J. van Benthem and K. Doets. Higher-order logic. In D. Gabbay and F. Guenthner, editors, Handbook of Philosophical Logic: Volume I: Ele- ments of , pages 189–243. Reidel, Dordrecht, 2001. Second Edition.

[15] A. Zanardo, A. Sernadas, and C. Sernadas. Fibring: Completeness preser- vation. Journal of Symbolic Logic, 66(1):414–439, 2001.