<<

Theory

Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order languages First-order theories

Categorical semantics Topos Theory Classes of ‘logical’ categories The interpretation of logic in categories The interpretation of formulae Examples

Soundness and completeness Olivia Caramello as mathematical universes The internal language Kripke-Joyal semantics

For further reading Topos Theory Interpreting first-order logic in categories Olivia Caramello

Introduction • In Logic, first-order languages are a wide class of formal Interpreting logic in categories languages used for talking about mathematical structures of First-order logic any kind (where the restriction ‘first-order’ means that First-order languages quantification is allowed only over individuals rather than over First-order theories collections of individuals or higher-order constructions on Categorical semantics them). Classes of ‘logical’ categories • A first-order language contains sorts, which are meant to The interpretation of formulae represent different kinds of individuals, terms, which denote Examples individuals, and formulae, which make assertions about the Soundness and completeness individuals. Compound terms and formulae are formed by Toposes as mathematical using various logical operators. universes • It is well-known that first-order languages can always be The internal language interpreted in the context of (a given model of) set theory. In Kripke-Joyal semantics this lecture, we will show that these languages can also be For further reading meaningfully interpreted in a , provided that the latter possesses enough categorical structure to allow the interpretation of the given fragment of logic. In fact, sorts will be interpreted as objects, terms as arrows and formulae as , in a way that respects the logical structure of compound expressions. 2 / 40 Topos Theory Signatures Olivia Caramello

Introduction Interpreting logic in categories Definition First-order logic First-order A first-order signature Σ consists of the following data. languages First-order theories a) A set Σ-Sort of sorts. Categorical semantics b) A set Σ-Fun of function symbols, together with a map Classes of ‘logical’ categories assigning to each f ∈ Σ-Fun its type, which consists of a finite The interpretation of formulae non-empty list of sorts: we write Examples

Soundness and completeness f : A1 ···An → B

Toposes as mathematical universes to indicate that f has type A1,...,An,B (if n = 0, f is called a The internal constant of sort B). language Kripke-Joyal semantics c) A set Σ-Rel of relation symbols, together with a map assigning For further to each Σ-Rel its type, which consists of a finite list of sorts: reading we write R  A1 ···An

to indicate that R has type A1,...An.

3 / 40 Topos Theory Terms Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order For each sort A of a signature Σ we assume given a supply of languages First-order theories variables of sort A, used to denote individuals of kind A. Categorical Starting from variables, terms are built-up by repeated semantics Classes of ‘logical’ ‘applications’ of function symbols to them, as follows. categories The interpretation of formulae Definition Examples Let Σ be a signature. The collection of terms over Σ is defined Soundness and completeness recursively by the clauses below; simultaneously, we define the Toposes as sort of each term and write t : A to denote that t is a term of sort mathematical universes A. The internal language Kripke-Joyal a) x : A, if x is a variable of sort A. semantics

For further b) f (t1,...,tn): B if f : A1 ···An → B is a function symbol and reading t1 : A1,...,tn : An.

4 / 40 Topos Theory Formation rules for formulaeI Olivia Caramello

Introduction Consider the following formation rules for recursively building Interpreting logic in categories classes of formulae F over Σ, together with, for each formula φ, First-order logic the (finite) set FV (φ) of free variables of φ. First-order languages First-order theories (i) Relations: R(t1,...,tn) is in F, if R  A1 ···An is a relation Categorical symbol and t1 : A1,...,tn : An are terms; the free variables of semantics Classes of ‘logical’ this formula are all the variables occurring in some ti . categories The interpretation of formulae (ii) Equality: (s = t) is in F if s and t are terms of the same sort; Examples FV (s = t) is the set of variables occurring in s or t (or both). Soundness and completeness (iii) Truth: > is in F; FV (>) = /0. Toposes as mathematical (iv) Binary conjunction: (φ ∧ ψ) is in F, if φ and ψ are in F; universes The internal FV (φ ∧ ψ) = FV (φ) ∪ FV (ψ). language Kripke-Joyal semantics (v) Falsity: ⊥ is in F; FV (⊥) = /0. For further (vi) Binary disjunction: (φ ∨ ψ) is in F, if φ and ψ are in F; reading FV (φ ∨ ψ) = FV (φ) ∪ FV (ψ). (vii) Implication: (φ ⇒ψ) is in F, if φ and ψ are in F; FV (φ ⇒ψ) = FV (φ) ∪ FV (ψ). (viii) : ¬φ is in F, if φ is in F; FV (¬φ) = FV (φ).

5 / 40 Topos Theory Formation rules for formulaeII Olivia Caramello

Introduction Interpreting logic in (ix) Existential quantification: (∃x)φ is in F, if φ is in F and x is a categories

First-order logic variable; FV ((∃x)φ) = FV (φ) \{x}. First-order languages (x) Universal quantification: (∀x)φ is in F, if φ is in F and x is a First-order theories variable; FV ((∀x)φ) = FV (φ) \{x}. Categorical semantics Classes of ‘logical’ (xi) Infinitary disjunction: ∨φi is in F, if I is a set, φi is in F for categories i∈I The interpretation of formulae Examples each i ∈ I and FV (∨φi ) := ∪FV (φi ) is finite. i∈I i∈I Soundness and completeness (xii) Infinitary conjunction: ∧φi is in F, if I is a set, φi is in F for Toposes as i∈I mathematical universes each i ∈ I and FV (∧φi ) := ∪FV (φi ) is finite. The internal language i∈I i∈I Kripke-Joyal semantics A context is a finite list ~x = x1,...,xn of distinct variables (the For further empty context, for n = 0 is allowed and indicated by []). reading Notation: We will often consider formulae-in-context, that is formulae φ equipped with a context ~x such that all the free variables of φ occur among ~x; we will write either φ(~x) or {~x . φ}.

6 / 40 Topos Theory Classes of formulae Olivia Caramello

Introduction Definition Interpreting logic in categories In relation to the above-mentioned forming rules: First-order logic • The set of atomic formulae over Σ is the smallest set closed First-order languages under Relations and Equality). First-order theories • The set of Horn formulae over Σ is the smallest set containing Categorical semantics the class of atomic formulae and closed under Truth and Binary Classes of ‘logical’ categories conjunction. The interpretation of formulae • The set of regular formulae over Σ is the smallest set containing Examples the class of atomic formulae and closed under Truth, Binary Soundness and completeness conjunction and Existential quantification. Toposes as • The set of coherent formulae over Σ is the smallest set mathematical universes containing the set of regular formulae and closed under False The internal language and Binary disjunction. Kripke-Joyal semantics • The set of first-order formulae over Σ is the smallest set closed

For further under all the forming rules except for the infinitary ones. reading • The class of geometric formulae over Σ is the smallest class containing the class of coherent formulae and closed under Infinitary disjunction. • The class of infinitary first-order formulae over Σ is the smallest class closed under all the above-mentioned forming rules.

7 / 40 Topos Theory Sequents Olivia Caramello

Introduction Interpreting logic in categories First-order logic Definition First-order languages First-order theories • By a sequent over a signature Σ we mean a formal Categorical expression of the form( φ `~ ψ), where φ and ψ are formulae semantics x Classes of ‘logical’ over Σ and ~x is a context suitable for both of them. The categories The interpretation of intended interpretation of this expression is that ψ is a logical formulae Examples consequence of φ in the context ~x, i.e. that any assignment Soundness and of individual values to the variables in ~x which makes φ true completeness

Toposes as will also make ψ true. mathematical universes • We say a sequent (φ `~x ψ) is Horn (resp. regular, coherent, The internal language ...) if both φ and ψ are Horn (resp. regular, coherent, ...) Kripke-Joyal semantics formulae. For further reading Notice that, in full first-order logic, the general notion of sequent is not really needed, since the sequent (φ `~x ψ) expresses the same idea as (> `[] (∀~x)(φ ⇒ψ)).

8 / 40 Topos Theory First-order theories Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order languages First-order theories Definition Categorical semantics • By a theory over a signature Σ, we mean a set T of sequents Classes of ‘logical’ categories over Σ, whose elements are called the (non-logical) axioms The interpretation of formulae of T. Examples

Soundness and • We say that T is an algebraic theory if its signature Σ has a completeness single sort and no relation symbols (apart from equality) and Toposes as mathematical its axioms are all of the form > `~x φ where φ is an atomic universes ~ The internal formula (s = t) and x its canonical context. language Kripke-Joyal • We say is a Horn (resp. regular, coherent, ...) theory if all semantics T

For further the sequents in T are Horn (resp. regular, coherent, ...). reading

9 / 40 Topos Theory Deduction systems for first-order logicI Olivia Caramello

Introduction Interpreting logic in categories • To each of the fragments of first-order logic introduced above,

First-order logic we can naturally associate a deduction system, in the same First-order languages spirit as in classical first-order logic. Such systems will be First-order theories formulated as sequent-calculi, that is they will consist of Categorical semantics inference rules enabling us to derive a sequent from a Classes of ‘logical’ categories collection of others; we will write The interpretation of formulae Examples Γ Soundness and completeness σ

Toposes as mathematical universes to mean that the sequent σ can be inferred by a collection of The internal language sequents Γ. A double line instead of the single line will mean Kripke-Joyal semantics that each of the sequents can be inferred from the other. For further • Given the axioms and inference rules below, the notion of reading proof is the usual one, and allowing the axioms of theory T to be taken as premises yields the notion of proof relative to a theory T. Consider the following rules.

10 / 40 Topos Theory Deduction systems for first-order logicII Olivia Caramello

Introduction Interpreting logic in categories • The rules for finite conjunction are the axioms

First-order logic First-order languages (φ `~x >) ((φ ∧ ψ) `~x φ) ((φ ∧ ψ) `~x ψ) First-order theories

Categorical semantics and the rule Classes of ‘logical’ (φ `~ ψ)(φ `~ χ) categories x x The interpretation of (φ ` (ψ ∧ χ)) formulae ~x Examples • Soundness and The rules for finite disjunction are the axioms completeness Toposes as (⊥ ` )( ` ( ∨ )) ( ` ∨ ) mathematical ~x φ φ ~x φ ψ ψ ~x φ ψ universes The internal language and the rule Kripke-Joyal semantics (φ `~x χ)(ψ `~x χ) For further ((φ ∨ ψ) `~ χ) reading x • The rules for infinitary conjunction (resp. disjunction) are the infinitary analogues of the rules for finite conjunction (resp. disjunction).

11 / 40 Topos Theory Deduction systems for first-order logic III Olivia Caramello

Introduction Interpreting logic in • The rules for implication consist of the double rule categories

First-order logic First-order (φ ∧ ψ `~x χ) languages First-order theories (ψ `~x (φ ⇒ χ)) Categorical semantics Classes of ‘logical’ • The rules for existential quantification consist of the double categories The interpretation of rule formulae Examples (φ `~x,y ψ) Soundness and completeness ((∃y)φ `~x ψ)

Toposes as mathematical provided that y is not free in ψ. universes The internal • The rules for universal quantification consist of the double language Kripke-Joyal rule semantics (φ ` ψ) For further ~x,y reading (φ `~x (∀y)ψ) • The distributive axiom is

((φ ∧ (ψ ∨ χ)) `~x ((φ ∧ ψ) ∨ (φ ∧ χ)))

12 / 40 Topos Theory Deduction systems for first-order logicIV Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order languages First-order theories

Categorical • The Frobenius axiom is semantics Classes of ‘logical’ categories ((φ ∧ (∃y)ψ) ` (∃y)(φ ∧ ψ)) The interpretation of ~x formulae Examples ~ Soundness and where y is a variable not in the context x. completeness • The is Toposes as mathematical universes The internal (> `~ φ ∨ ¬φ) language x Kripke-Joyal semantics

For further reading

13 / 40 Topos Theory Fragments of first-order logic Olivia Caramello

Introduction Interpreting logic in Definition categories In addition to the usual structural rules of sequent-calculi (Identity First-order logic First-order axiom, Equality rules, Substitution rule, and Cut rule), our languages First-order theories deduction systems consist of the following rules: Categorical semantics Horn logic finite conjunction Classes of ‘logical’ categories Regular logic finite conjunction, existential The interpretation of formulae quantification and Frobenius axiom Examples Soundness and Coherent logic finite conjunction, finite disjunction, completeness

Toposes as existential quantification, distributive mathematical universes axiom and Frobenius axiom The internal language Geometric logic finite conjunction, infinitary Kripke-Joyal semantics disjunction, existential quantification, For further ‘infinitary’ distributive axiom, reading Frobenius axiom Intuitionistic first-order logic all the finitary rules except for the law of excluded middle Classical first-order logic all the finitary rules

14 / 40 Topos Theory Provability in fragments of first-order logic Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order languages Definition First-order theories

Categorical We say a sequent σ is provable in an algebraic (regular, coherent, semantics ...) theory if there exists a derivation of σ relative to , in the Classes of ‘logical’ T T categories appropriate fragment of first-order logic. The interpretation of formulae Examples In geometric logic, intuitionistic and classical provability of Soundness and geometric sequents coincide. completeness Toposes as Theorem mathematical universes If a geometric sequent σ is derivable from the axioms of a The internal language geometric theory using ‘classical geometric logic’ (i.e. the rules Kripke-Joyal T semantics of geometric logic plus the Law of Excluded Middle), then there is For further reading also a constructive derivation of σ, not using the Law of Excluded Middle.

15 / 40 Topos Theory Categorical semantics Olivia Caramello

Introduction Interpreting logic in categories

First-order logic • Generalizing the classical Tarskian definition of satisfaction of First-order languages first-order formulae in ordinary set-valued structures, one can First-order theories obtain, given a signature Σ, a notion of Σ-structure in a Categorical semantics category with finite products, and define, according to the Classes of ‘logical’ categories categorical structure present on the category, a notion of The interpretation of formulae interpretation of an appropriate fragment of first-order logic in Examples it. Soundness and completeness • Specifically, we will introduce various classes of ‘logical’ Toposes as mathematical categories, each of them providing a semantics for a universes The internal corresponding fragment of first-order logic: language Kripke-Joyal Cartesian categories Horn logic semantics

For further Regular categories Regular logic reading Coherent categories Coherent logic Geometric categories Geometric logic Heyting categories First-order logic

16 / 40 Topos Theory Structures in categories Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order languages First-order theories Definition Categorical Let C be a category with finite products and Σ be a signature. A semantics Classes of ‘logical’ Σ-structure M in C is specified by the following data: categories The interpretation of (i) A function assigning to each sort A in Σ-Sort, an object MA formulae Examples of C . For finite strings of sorts, we define Soundness and completeness M(A1,...,An) = MA1 × ··· × MAn and set M([]) equal to the

Toposes as terminal object 1 of C . mathematical universes (ii) A function assigning to each function symbol f : A1 ···An → B The internal language in Σ-Fun an arrow Mf : M(A1,...,An) → MB in C . Kripke-Joyal semantics (iii) A function assigning to each relation symbol R A1 ···An in For further  reading Σ-Rel a MR  M(A1,...,An) in C .

17 / 40 Topos Theory Homomorphisms of structures Olivia Caramello

Introduction Definition Interpreting logic in categories A Σ-structure homomorphism h : M → N between two Σ-structures M First-order logic and N in C is a collection of arrows hA : MA → NA in C indexed by the First-order languages sorts of Σ and satisfying the following two conditions: First-order theories (i) For each function symbol f : A ···A → B in Σ-Fun, the diagram Categorical 1 n semantics Classes of ‘logical’ categories Mf M(A1,...,An) / MB The interpretation of formulae Examples h ×···×h A1 An hB Soundness and completeness   N(A1,...,An) / NB Toposes as Nf mathematical universes The internal commutes. language ··· Σ Kripke-Joyal (ii) For each relation symbol R  A1 An in -Rel, there is a semantics commutative diagram in C of the form For further reading MR / M(A1,...,An)

h ×···×h A1 An   NR / M(A1,...,An)

18 / 40 Topos Theory The category of Σ-structures Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order languages First-order theories Definition Categorical semantics Given a category C with finite products, Σ-structures in C and Classes of ‘logical’ categories Σ-homomorphisms between them form a category, denoted by The interpretation of formulae Σ-str(C ). Identities and composition in Σ-str(C ) are defined Examples componentwise from those in C . Soundness and completeness

Toposes as Remark mathematical universes If C and D are two categories with finite products, then any The internal language T : C → D which preserves finite products and Kripke-Joyal semantics monomorphisms induces a functor Σ-str(T ):Σ-str(C ) → Σ-str(D) For further in the obvious way. reading

19 / 40 Topos Theory The interpretation of terms Olivia Caramello

Introduction Interpreting logic in categories

First-order logic Definition First-order languages Let M be a Σ-structure in a category C with finite products. If First-order theories {~x . t} is a term-in-context over Σ (with ~x = x1,...,xn, Categorical semantics xi : Ai (i = 1,...,n) and t : B, say), then an arrow Classes of ‘logical’ categories The interpretation of ~ formulae [[x . t]]M : M(A1,...,An) → MB Examples Soundness and in is defined recursively by the following clauses: completeness C Toposes as a) If t is a variable, it is necessarily xi for some unique i ≤ n, and mathematical universes then [[~x . t]]M = πi , the ith product projection. The internal language b) If t is f (t ,...,t ) (where t : C , say), then [[~x . t]] is the Kripke-Joyal 1 m i i M semantics composite For further reading ([[~x.t1]]M ,...,[[~x.tm]]M ) Mf M(A1,...,An) / M(C1,...,Cm) / MB

20 / 40 Topos Theory Interpreting formulae in categories Olivia Caramello

Introduction Interpreting logic in categories • In order to interpret formulae in categories, we need to have First-order logic a certain amount of categorical structure present on the First-order languages category in order to give a meaning to the logical connectives First-order theories

Categorical which appear in the formulae. semantics Classes of ‘logical’ • In fact, the larger is the fragment of logic, the larger is the categories The interpretation of amount of categorical structure required to interpret it. For formulae Examples example, to interpret finitary conjunctions, we need to form Soundness and pullbacks, to interpret disjunctions we need to form unions of completeness subobjects, etc. Toposes as mathematical universes • Formulae will be interpreted as subobjects in our category; The internal language specifically, given a category C and a Σ-structure M in it, a Kripke-Joyal A1 An semantics ~ ~ formula φ(x) over Σ where x = (x1 ,...,xn ), will be For further interpreted as a subobject reading

[[~x . φ]]M  M(A1,...,An) defined recursively on the structure of φ.

21 / 40 Topos Theory Cartesian categories Olivia Caramello

Introduction Interpreting logic in categories First-order logic Recall that by a finite limit in a category C we mean a limit of a First-order languages functor F : J → C where J is a finite category (i.e. a category First-order theories with only a finite number of objects and arrows). Categorical semantics In any category C with pullbacks, pullbacks of monomorphisms Classes of ‘logical’ categories are again monomorphisms; thus, for any arrow f : a → b in C , we The interpretation of formulae have a pullback functor Examples Soundness and ∗ completeness f : SubC (b) → SubC (a) . Toposes as mathematical universes Definition The internal language A cartesian category is any category with finite limits. Kripke-Joyal semantics As we shall see below, in cartesian categories we can interpret For further reading atomic formulae as well as finite conjunctions of them; in fact, conjunctions will be interpreted as pullbacks (i.e. intersections) of subobjects.

22 / 40 Topos Theory Regular categories Olivia Caramello

Introduction Definition Interpreting logic in categories • Given two subobjects m1 : a1  c and m2 : a2  c of an object c in a First-order logic First-order category C , we say that m1 factors through m2 if there is a languages (necessarily unique) arrow r : a → a in such that m ◦ r = m . First-order theories 1 2 C 2 1

Categorical (Note that this defines a preorder relation ≤ on the collection semantics SubC (c) of subobjects of a given object c.) Classes of ‘logical’ categories • We say that a cartesian category C has images if we are given an The interpretation of formulae operation assigning to each of C a subobject Im(f ) of its Examples codomain, which is the least (in the sense of the preorder ≤) Soundness and completeness subobject of cod(f ) through which f factors.

Toposes as • A regular category is a cartesian category C such that C has mathematical universes images and they are stable under pullback. The internal language Kripke-Joyal semantics Fact

For further Given an arrow f : a → b in a regular category C , the pullback functor reading ∗ f : SubC (b) → SubC (a) has a left adjoint ∃f : SubC (a) → SubC (b), which assigns to a subobject m : c  a the image of the composite f ◦ m. As we shall see below, in regular categories we can interpret formulae built-up from atomic formulae by using finite conjunctions and existential quantifications; in fact, the existential quantifiers will be interpreted as images of certain arrows. 23 / 40 Topos Theory Coherent categories Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order languages Definition First-order theories A coherent category is a regular category C in which each Categorical ∗ semantics SubC (c) has finite unions and each f : SubC (b) → SubC (a) Classes of ‘logical’ categories preserves them. The interpretation of formulae As we shall see below, in coherent categories we can interpret Examples

Soundness and formulae built-up from atomic formulae by using finite completeness conjunctions, existential quantifications, and finite disjunctions; in Toposes as mathematical fact, finite disjunctions will be interpreted as finite unions of universes The internal subobjects. language Kripke-Joyal semantics

For further Note in passing that, if coproducts exist, a union of subobjects of reading an object c may be constructed as the image of the induced arrow from the coproduct to c.

24 / 40 Topos Theory Geometric categories Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order languages Definition First-order theories

Categorical • A (large) category C is said to be well-powered if each of the semantics Classes of ‘logical’ preorders SubC (a), a ∈ Ob(C ), is equivalent to a small categories The interpretation of category. formulae Examples • A geometric category is a well-powered regular category Soundness and whose subobject lattices have arbitrary unions which are completeness

Toposes as stable under pullback. mathematical universes The internal As we shall see below, in coherent categories we can interpret language Kripke-Joyal formulae built-up from atomic formulae by using finite semantics

For further conjunctions, existential quantifications, and infinitary reading disjunctions; in fact, disjunctions will be interpreted as unions of subobjects.

25 / 40 Topos Theory Quantifiers as adjoints Olivia Caramello

Introduction ⊆ × Interpreting logic in Let X and Y be two sets. For any given subset S X Y , we can categories consider the sets First-order logic First-order languages ∀ S := {y ∈ Y | for all x ∈ X,(x,y) ∈ S} and First-order theories p

Categorical semantics ∃pS := {y ∈ Y | there exists x ∈ X,(x,y) ∈ S} . Classes of ‘logical’ categories The interpretation of The projection map p : X × Y → Y induces a map (taking inverse formulae ∗ Examples images) at the level of powersets p : P(Y ) → P(X × Y ). If we Soundness and completeness regard these powersets as poset categories (where the

Toposes as order-relation is given by the inclusion relation) then this map mathematical universes becomes a functor; also, the assignments S → ∀pS and S → ∃pS The internal language yield ∀p,∃p : P(X × Y ) → P(Y ). Kripke-Joyal semantics Theorem For further reading The functors ∃p and ∀p are respectively left and right adjoints to the functor p∗ : P(Y ) → P(X × Y ) which sends each subset T ⊆ Y to its inverse image p∗T under p. The theorem generalizes to the case of an arbitrary function in place of the projection p.

26 / 40 Topos Theory Heyting categories I Olivia Caramello

Introduction Interpreting logic in categories Definition First-order logic A Heyting category is a coherent category C such that for any First-order ∗ languages arrow f : a → b in C the pullback functor f : SubC (b) → SubC (a) First-order theories has a right adjoint ∀f : Sub (a) → Sub (b) (as well as its left Categorical C C semantics adjoint ∃f : SubC (a) → SubC (b)). Classes of ‘logical’ categories The interpretation of formulae Theorem Examples Let a1  a and a2  a be subobjects in a Heyting category. Then Soundness and completeness there exists a largest subobject (a1 ⇒a2)  a such that Toposes as (a1 ⇒a2) ∩ a1 ≤ a2. Moreover, the binary operation on subobjects mathematical universes thus defined is stable under pullback. The internal language In particular, all the subobject lattices in a Heyting category are Kripke-Joyal semantics Heyting . For further reading Thus, in a Heyting category we may interpret full finitary first-order logic. Fact Any geometric category is a Heyting category.

27 / 40 Topos Theory Heyting categories II Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order languages First-order theories Theorem Categorical Any elementary topos is a Heyting category. semantics Classes of ‘logical’ categories The interpretation of Sketch of proof. formulae Examples Let E be an elementary topos. The existence of a left adjoint to Soundness and the pullback functor follows from the existence of images, while completeness

Toposes as the existence of the right adjoint follows from the cartesian closed mathematical universes structure. The internal language The object Ω has the structure of an internal Heyting in ; Kripke-Joyal E semantics in fact, the Heyting algebra structure of the subobject lattices in E For further reading is induced by this internal structure via the Yoneda Lemma.

28 / 40 Topos Theory The interpretation of first-order formulaeI Olivia Caramello

Introduction Interpreting logic in Let M be a Σ-structure in a category C with finite limits. A categories ~ ~ First-order logic formula-in-context {x . φ} over Σ (where x = x1,...,xn and xi : Ai , First-order say) will be interpreted as a subobject [[~x . φ]] M(A ,...,A ) languages M  1 n First-order theories according to the following recursive clauses: Categorical semantics • If φ(~x) is R(t1,...,tm) where R is a relation symbol (of type Classes of ‘logical’ categories B ,...,Bm, say), then [[~x . φ]] is the pullback The interpretation of 1 M formulae Examples

Soundness and [[~x . φ]]M / MR completeness

Toposes as mathematical universes  ([[~x.t1]]M ,...,[[~x.tm]]M )  The internal language M(A1,...,An) / M(B1,...,Bm) Kripke-Joyal semantics For further • If φ(~x) is (s = t), where s and t are terms of sort B, then reading [[~x . φ]]M is the equalizer of [[~x . s]]M ,[[~x . t]]M : M(A1,...,An) → MB.

• If φ(~x) is > then [[~x . φ]]M is the top element of SubC (M(A1,...,An)).

29 / 40 Topos Theory The interpretation of first-order formulaeII Olivia Caramello

Introduction Interpreting logic in categories • If φ is ψ ∧ χ then [[~x . φ]]M is the intersection (= pullback) First-order logic First-order languages First-order theories [[~x . φ]]M / [[~x . χ]]M Categorical semantics Classes of ‘logical’ categories The interpretation of   formulae [[~x . ψ]]M / M(A1,...,An) Examples

Soundness and completeness • If φ(~x) is ⊥ and C is a coherent category then [[~x . φ]]M is the Toposes as ( ( ,..., )) mathematical bottom element of SubC M A1 An . universes The internal • If φ is ψ ∨ χ and C is a coherent category then [[~x . φ]]M is language Kripke-Joyal the union of the subobjects [[~x . ψ]]M and [[~x . χ]]M . semantics For further • If φ is ψ ⇒ χ and C is a Heyting category, [[~x . φ]]M is the reading implication [[~x . ψ]]M ⇒[[~x . χ]]M in the Heyting algebra SubC (M(A1,...,An)) (similarly, the negation ¬ψ is interpreted as the of [[~x . ψ]]M ).

30 / 40 Topos Theory The interpretation of first-order formulae III Olivia Caramello

Introduction Interpreting logic in categories • If φ is (∃y)ψ where y is of sort B, and C is a regular category, First-order logic First-order then [[~x . φ]]M is the image of the composite languages First-order theories π Categorical ~ semantics [[x,y . ψ]]M / M(A1,...,An,B) / M(A1,...,An) Classes of ‘logical’ categories The interpretation of formulae where π is the product projection on the first n factors. Examples • If φ is (∀y)ψ where y is of sort B, and is a Heyting Soundness and C completeness category, then [[~x . φ]]M is ∀π ([[~x,y . ψ]]M ), where π is the Toposes as mathematical same projection as above. universes The internal • [[~ . ]] language If φ is ∨φi and C is a geometric category then x φ M is i∈I Kripke-Joyal semantics the union of the subobjects [[~x . φi ]]M . For further reading • If φ is ∧φi and C has arbitrary intersections of subobjects i∈I then [[~x . φ]]M is the intersection of the subobjects [[~x . φi ]]M .

31 / 40 Topos Theory Models of first-order theories in categories Olivia Caramello

Introduction Definition Interpreting logic in categories Let M be a Σ-structure in a category C . First-order logic a) If σ = φ `~x ψ is a sequent over Σ interpretable in C , we say that σ is First-order languages satisfied in M if [[~x . φ]]M ≤ [[~x . ψ]]M in SubC (M(A1,...,An)). First-order theories b) If T is a theory over Σ interpretable in C , we say M is a model of T if Categorical semantics all the axioms of T are satisfied in M. Classes of ‘logical’ ( ) Σ ( ) categories c) We write T-mod C for the full subcategory of -str C whose The interpretation of objects are models of T . formulae Examples We say that a functor F : → between two cartesian (resp. regular, Soundness and C D completeness coherent, geometric, Heyting) categories is cartesian (resp. regular, Toposes as coherent, geometric, Heyting) if it preserves finite limits (resp. finite limits mathematical universes and images, finite limits and images and finite unions of subobjects, The internal language finite limits and images and arbitrary unions of subobjects, finite limits Kripke-Joyal and images and Heyting implications between subobjects). semantics For further Theorem reading If T is a regular (resp. coherent, ...) theory over Σ, then for any regular (resp. coherent, ...) functor T : C → D the functor Σ-str(T ):Σ-str(C ) → Σ-str(D) defined above restricts to a functor T-mod(T ): T-mod(C ) → T-mod(D). If T is moreover conservative (that is, reflects isomorphisms) then the functor Σ-str(T ) reflects the property of being a T-model. 32 / 40 Topos Theory Examples Olivia Caramello

Introduction Interpreting logic in categories • A topological can be seen as a model of the theory of First-order logic groups in the category of topological spaces. First-order languages First-order theories • Similarly, an algebraic (resp. Lie) group is a model of the Categorical theory of groups in the category of algebraic varieties (resp. semantics Classes of ‘logical’ the category of smooth manifolds). categories The interpretation of formulae • A sheaf of rings (more generally, a sheaf of models of a Horn Examples theory T) on a X can be seen as a model Soundness and completeness of the theory of rings (resp. of the theory T) in the topos Toposes as Sh(X) of sheaves on X. mathematical universes • A sheaf of models of a geometric theory over a signature Σ The internal T language in a topos Sh(X) of sheaves on a topological space X is a Kripke-Joyal semantics Σ-structure in Sh(X) whose stalks are models of T. For further reading • A bunch of set-based models of a theory T indexed over a set I can be seen as a model of T in the functor category [I,Set]. More generally, we have that T-mod([C ,Set]) ' [C ,T-mod(Set)].

33 / 40 Topos Theory Soundness and completeness Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order languages First-order theories Theorem (Soundness) Categorical Let be a Horn (resp. regular, coherent, first-order, geometric) semantics T Classes of ‘logical’ theory over a signature , and let M be a model of in a categories T T The interpretation of cartesian (resp. regular, coherent, Heyting, geometric) category formulae Examples C . If σ is a sequent (in the appropriate fragment of first-order Soundness and logic over Σ) which is provable in , then σ is satisfied in M. completeness T

Toposes as mathematical Theorem (Completeness) universes The internal Let be a Horn (resp. regular, coherent, first-order, geometric) language T Kripke-Joyal theory. If a Horn (resp. regular, coherent, Heyting, geometric) semantics For further sequent σ is satisfied in all models of T in cartesian (resp. regular, reading coherent, Heyting, geometric) categories, then it is provable in T.

34 / 40 Topos Theory Toposes as mathematical universes Olivia Caramello

Introduction Interpreting logic in We say that a first-order formula φ(~x) over a signature Σ is valid categories in an elementary topos E if for every Σ-structure M in E the First-order logic First-order sequent > `~x φ is satisfied in M. languages First-order theories Theorem Categorical semantics Let Σ be a signature and φ(~x) a first-order formula over Σ. Then Classes of ‘logical’ categories φ(~x) is provable in intuitionistic (finitary) first-order logic if and The interpretation of formulae only if it is valid in every elementary topos. Examples

Soundness and completeness Sketch of proof. Toposes as The soundness result is part of a theorem mentioned above. The mathematical universes completeness part follows from the existence of canonical Kripke The internal language models and the fact that, given a poset P and a Kripke model U Kripke-Joyal ∗ semantics on P there is a model U in the topos [P,Set] such that the For further ∗ reading first-order sequents valid in U are exactly those valid in U . Hence an elementary topos can be considered as a mathematical universe in which one can do mathematics similarly to how one does it in the classical context of sets (with the only exception that one must in general argue constructively).

35 / 40 Topos Theory The internal language of a toposI Olivia Caramello

Introduction Interpreting logic in Given a category C with finite products, in particular an categories

First-order logic elementary topos, one can define a first-order signature ΣC , First-order languages called the internal language of C , for reasoning about C in a First-order theories set-theoretic fashion, that is by using ‘elements’. Categorical semantics Classes of ‘logical’ Definition categories The signature Σ has one sort A for each object A of , one The interpretation of C p q C formulae function symbol f : A ,··· , A → B for each arrow Examples p q p 1q p nq p q Soundness and f : A1 × ··· × An → B in C , and one relation symbol completeness pRq  pA1q···pAnq for each subobject R  A1 × ··· × An. Toposes as mathematical universes Note that there is a canonical ΣC -structure in C , which assigns A The internal to A , f to f and R to R . language p q p q p q Kripke-Joyal semantics The usefulness of this definition lies in the fact that properties of

For further C or constructions in it can often be formulated in terms of reading satisfaction of certain formulae over ΣC in the canonical structure; the internal language can thus be used for proving things about C .

36 / 40 Topos Theory The internal language of a toposII Olivia Caramello

Introduction Interpreting logic in categories If C is an elementary topos, we can extend the internal language First-order logic First-order by allowing the formation of formulae of the kind τ ∈ Γ, where τ is languages A First-order theories a term of sort A and Γ is a term of sort Ω . Indeed, we may

Categorical interpret this formula as the subobject whose classifying arrow is semantics Classes of ‘logical’ the composite categories The interpretation of formulae hτ,Γi ∈A Examples W / A × ΩA / Ω Soundness and completeness

Toposes as where W denotes the product of (the objects representing the) mathematical universes sorts of the variables occurring either in τ or in Γ (considered The internal language without repetitions) and hτ,Γi denotes the induced map to the Kripke-Joyal semantics product. For further Note that an object A of C gives rise to a constant term of type reading ΩA. Thus in a topos we can also interpret all the common formulas that we use in Set Theory.

37 / 40 Topos Theory Kripke-Joyal semanticsI Olivia Caramello

Introduction Interpreting logic in Kripke-Joyal semantics represents the analogue for toposes of categories the usual Tarskian semantics for classical first-order logic. First-order logic First-order In the context of toposes, it makes no sense to speak of elements languages First-order theories of a structure in a topos, but we can replace the classical notion of Categorical element of a set with that of generalized element of an object: a semantics Classes of ‘logical’ generalized element of an object c of a topos E is simply an arrow categories The interpretation of α : u → c with codomain c. formulae Examples Definition Soundness and completeness Let E be a topos and M be a Σ-structure in E . Given a first-order Toposes as mathematical formula φ(x) over Σ in a variable x of sort A and a generalized universes element α : U → MA of MA, we define The internal language Kripke-Joyal semantics U |=M φ(α) iff α factors through [[x . φ]]M  MA For further reading Of course, the definition can be extended to formulae with an arbitrary (finite) number of free variables. In the following proposition, the notation + denotes binary coproduct.

38 / 40 Topos Theory Kripke-Joyal semanticsII Olivia Caramello

Introduction Proposition Interpreting logic in categories If α : U → MA is a generalized element of MA while φ(x) and ψ(x) First-order logic First-order are formulas with a free variable x of sort A, then languages First-order theories • U |= (φ ∧ ψ)(α) if and only if U |= φ(α) and U |= ψ(α). Categorical semantics • U |= (φ ∨ ψ)(α) if and only if there are arrows p : V → U and Classes of ‘logical’ categories q : W → U such that p + q : V + W → U is epic, while both The interpretation of formulae V |= φ(α ◦ p) and W |= ψ(α ◦ q). Examples

Soundness and • U |= (φ ⇒ψ)(α) if and only if for any arrow p : V → U such completeness that V |= φ(α ◦ p), then V |= ψ(α ◦ p). Toposes as mathematical • U |= (¬φ)(α) if and only if whenever p : V → U is such that universes ∼ The internal V |= φ(α ◦ p), then V = 0 . language E Kripke-Joyal semantics If φ(x,y) has an additional free variable y of sort B then For further • reading U |= (∃y)φ(α,y) if and only if there exist an epi p : V → U and a generalized element β : V → B such that V |= φ(α ◦ p,β). • U |= (∀y)φ(α,y) if and only if for every object V , for every arrow p : V → U and every generalized element c : V → B one has V |= φ(α ◦ p,β).

39 / 40 Topos Theory For further reading Olivia Caramello

Introduction Interpreting logic in categories

First-order logic First-order languages R. I. Goldblatt. First-order theories Topoi. The categorial analysis of logic, vol. 98 of Studies in Categorical semantics Logic and the Foundations of Math. Classes of ‘logical’ categories North-Holland, 1979 (revised second edition, 1984). The interpretation of formulae Examples P. T. Johnstone. Soundness and Sketches of an Elephant: a topos theory compendium. Vols. completeness

Toposes as 1-2, vols. 43-44 of Oxford Logic Guides mathematical universes Oxford University Press, 2002. The internal language S. Mac Lane and I. Moerdijk. Kripke-Joyal semantics Sheaves in geometry and logic: a first introduction to topos For further reading theory Springer-Verlag, 1992.

40 / 40