User:Michiexile/MATH198/Lecture 10

From HaskellWiki

This lecture will be shallow, and leave many things undefined, hinted at, and is mostly meant as an appetizer, enticing the audience to go forth and seek out the literature on topos theory for further studies.

Subobject classifier

One very useful property of the category Set is that the powerset of a given set is still a set; we have an internal concept of object of all subobjects. Certainly, for any category (small enough) C, we have a contravariant functor Sub():CSet taking an object to the set of all equivalence classes of monomorphisms into that object; with the image Sub(f) given by the pullback diagram

If the functor Sub() is representable - meaning that there is some object XC0 such that Sub()=hom(,X) - then the theory surrounding representable functors, connected to the Yoneda lemma - give us a number of good properties.

One of them is that every representable functor has a universal element; a generalization of the kind of universal mapping properties we've seen in definitions over and over again during this course; all the definitions that posit the unique existence of some arrow in some diagram given all other arrows.

Thus, in a category with a representable subobject functor, we can pick a representing object ΩC0, such that Sub(X)=hom(X,Ω). Furthermore, picking a universal element corresponds to picking a subobject Ω0Ω such that for any object A and subobject A0A, there is a unique arrow χ:AΩ such that there is a pullback diagram

One can prove that Ω0 is terminal in C, and we shall call Ω the subobject classifier, and this arrow Ω0=1Ω true. The arrow χ is called the characteristic arrow of the subobject.

In Set, all this takes on a familiar tone: the subobject classifier is a 2-element set, with a true element distinguished; and a characteristic function of a subset takes on the true value for every element in the subset, and the other (false) value for every element not in the subset.

Defining topoi

Definition A topos is a cartesian closed category with all finite limits and with a subobject classifier.

It is worth noting that this is a far stronger condition than anything we can even hope to fulfill for the category of Haskell types and functions. The functional programming relevance will take a back seat in this lecture, in favour of usefulness in logic and set theory replacements.

Properties of topoi

The meat is in the properties we can prove about topoi, and in the things that turn out to be topoi.

Theorem Let E be a topos.

  • E has finite colimits.

Power object

Since a topos is closed, we can take exponentials. Specifically, we can consider [AΩ]. This is an object such that hom(B,[AΩ])=hom(A×B,Ω)=Sub(A×B). Hence, we get an internal version of the subobject functor. (pick B to be the terminal object to get a sense for how global elements of [AΩ] correspond to subobjects of A)

Internal logic

We can use the properties of a topos to develop a logic theory - mimicking the development of logic by considering operations on subsets in a given universe:

Classically, in Set, and predicate logic, we would say that a predicate is some function from a universe to a set of truth values. So a predicate takes some sort of objects, and returns either True or False.

Furthermore, we allow the definition of sets using predicates:

{xU:P(x)}

Looking back, though, there is no essential difference between this, and defining the predicate as the subset of the universe directly; the predicate-as-function appears, then, as the characteristic function of the subset. And types are added as easily - we specify each variable, each object, to have a set it belongs to.

This way, predicates really are subsets. Type annotations decide which set the predicate lives in. And we have everything set up in a way that opens up for the topos language above.

We'd define, for predicates P,Q acting on the same type:

{xA:}=A
{xA:}=
{x:(PQ)(x)}={x:P(x)}{x:Q(x)}
{x:(PQ)(x)}={x:P(x)}{x:Q(x)}
{xA:(¬P)(x)}=A{xA:P(x)}

We could then start to define primitive logic connectives as set operations; the intersection of two sets is the set on which both the corresponding predicates hold true, so =. Similarily, the union of two sets is the set on which either of the corresponding predicates holds true, so =. The complement of a set, in the universe, is the negation of the predicate, and all other propositional connectives (implication, equivalence, ...) can be built with conjunction (and), disjunction (or) and negation (not).

So we can mimic all these in a given topos:

We say that a universe U is just an object in a given topos. (Note that by admitting several universes, we arrive at a typed predicate logic, with basically no extra work.)

A predicate is a subobject of the universe.

We can now proceed to define all the familiar logic connectives one by one, using the topos setting. While doing this, we shall introduce the notation tA:AΩ for the morphism tA=A1trueΩ that takes on the value true on all of A. We note that with this convention, χA0, the characteristic morphism of a subobject, is the arrow such that χA0i=tA0.

Conjunction: Given predicates P,Q, we need to define the conjunction PQ as some PQ:UΩ that corresponds to both P and Q simultaneously.

We may define true×true:1Ω×Ω, a subobject of Ω×Ω. Being a subobject, this has a characteristic arrow :Ω×ΩΩ, that we call the conjunction arrow.

Now, we may define χP×χQ:UΩ×Ω for subobjects P,QU - and we take their composition χP×χQ to be the characteristic arrow of the subobject PQ.

And, indeed, this results in a topoidal version of intersection of subobjects.

Implication: Next we define 1:Ω1Ω×Ω to be the equalizer of and proj1. Given v,w:UΩ, we write v1w if v×w factors through 1.

Using the definition of an equalizer we arrive at v1w iff v=vw. From this, we can deduce

u1true
u1u
If u1v and v1w then u1w.
If u1v and v1u then u=v

and thus, 1 is a partial order on [UΩ]. Intuitively, u1v if v is at least as true as u.

This relation corresponds to inclusion on subobjects. Note that 1:Ω1Ω×Ω, given from the equalizer, gives us Ω1 as a relation on Ω - a subobject of Ω×Ω. Specifically, it has a classifying arrow :Ω×ΩΩ. We write hk=()h×k. And for subobjects P,QA, we write PQ for the subobject classified by χPχQ.

It turns out, without much work, that this PQ behaves just like classical implication in its relationship to .

Membership: We can internalize the notion of membership as a subobject UU×ΩU, and thus get the membership relation from a pullback:

For elements x×h:1U×ΩU, we write xUh for x×hU. Yielding a subset of the product U×ΩU, this is readily interpretable as a relation relating things in U with subsets of U, so that for any x,h we can answer whether xUh. Both notations indicate evAh×x=true.

Universal quantification: For any object U, the maximal subobject of U is U itself, embedded with 1U into itself. There is an arrow τU:1ΩU represents this subobject. Being a map from 1, it is specifically monic, so it has a classifying arrow U:ΩUΩ that takes a given subobject of U to true precisely if it is in fact the maximal subobject.

Now, with a relation r:RB×A, we define a.R by the following pullback:

where λχR comes from the universal property of the exponential.

Theorem For any s:SB monic, Sa.R iff S×AR.

This theorem tells us that the subobject given by a.R is the largest subobject of B that is related by R to all of A.

Falsum: We can define the false truth value using these tools as wΩ.w. This might be familiar to the more advanced Haskell type hackers - as the type

x :: forall a. a

which has to be able to give us an element of any type, regardless of the type itself. And in Haskell, the only element that inhabits all types is undefined.

From a logical perspective, we use a few basic inference rules:

and connect them up to derive

for any ϕ not involving w - and we can always adjust any ϕ to avoid w.

Thus, the formula w.w has the property that it implies everything - and thus is a good candidate for the false truth value; since the inference

is the defining introduction rule for false.


Negation: We define negation the same way as in classical logic: ¬ϕ=ϕfalse.


Disjunction: We can define

PQ=w.((ϕw)(ψw))w

Note that this definition uses one of our primary inference rules:

as the defining property for the disjunction, and we may derive any properties we like from these.

Existential quantifier: Finally, the existential quantifier is derived similarly to the disjunction - by figuring out a rule we want it to obey, and using that as a definition for it:

x.ϕ=w.(x.ϕw)w

Here, the rule we use as defining property is

Before we leave this exploration of logic, some properties worth knowing about: While we can prove ¬(ϕ¬ϕ) and ϕ¬¬ϕ, we cannot, in just topos logic, prove things like

¬(ϕψ)(¬ϕ¬ψ)
¬¬ϕϕ

nor any statements like

¬(x.¬ϕ)(x.ϕ)
¬(x.ϕ)(x.¬ϕ)
¬(x.¬ϕ)(x.ϕ)

We can, though, prove

¬(x.ϕ)(x.¬ϕ)

If we include, extra, an additional inference rule (called the Boolean negation rule) given by

then suddenly we're back in classical logic, and can prove ¬¬ϕϕ and ϕ¬ϕ.

Examples: Sheaves, topology and time sheaves

The first interesting example of a topos is the category of (small enough) sets; in some sense clear already since we've been modelling our axioms and workflows pretty closely on the theory of sets.

Generating logic and set theory in the topos of sets, we get a theory that captures several properties of intuitionistic logic; such as the lack of Boolean negation, of exclusion of the third, and of double negation rules.

For the more interesting examples, however, we shall introduce the concepts of topology and of sheaf:

Definition A (set-valued) presheaf on a category C is a contravariant functor E:CopSet.

Presheaves occur all over the place in geometry and topology - and occasionally in computer science too: There is a construction in which a functor ASet for a discrete small category A identified with its underlying set of objects as a set, corresponds to the data type of bags of elements from A - for aA, the image F(a) denotes the multiplicity of a in the bag.

Theorem The category of all presheaves (with natural transformations as the morphisms) on a category C form a topos.

Example Pick a category on the shape

A contravariant functor on this category is given by a pair of sets G0,G1 and a pair of function source,target:G1G0. Identities are sent to identities.

The category of presheaves on this category, thus, is the category of graphs. Thus graphs form a topos.

The subobject classifier in the category of graphs is a graph with two nodes: in and out, and five arrows:

inallin
inbothin
insourceout
outtargetin
outneitherout

Now, given a subgraph HG, we define a function χH:GΩ by sending nodes to in or out dependent on their membership. For an arrow a, we send it to all if the arrow is in H, and otherwise we send it to both/source/target/neither according to where its source and target reside.

To really get into sheaves, though, we introduce more structure - specifically, we define what we mean by a topology:

Definition Suppose P is a partially ordered set. We call P a complete Heyting algebra if

  • There is a top element 1 such that x1xP.
  • Any two elements x,y have an infimum (greatest lower bound) xy.
  • Every subset QP has a supremum (least upper bound) pPp.
  • x(yi)=xyi

Note that for the partial order by inclusion of a family of subsets of a given set, being a complete Heyting algebra is the same as being a topology in the classical sense - you can take finite unions and any intersections of open sets and still get an open set.

If {xi} is a subset with supremum x, and E is a presheaf, we get functions ei:E(x)E(xi) from functoriality. We can summarize all these ei into e=iei:E(x)iE(xi).

Furthermore, functoriality gives us families of functions cij:E(xi)E(xixj) and dij:E(xj)E(xixj). These can be collected into c:iE(xi)ijE(xixj) and d:jE(xj)ijE(xixj).

Definition A presheaf E on a Heyting algebra is called a sheaf if it satisfies:

x=xi

implies that

is an equalizer. If you have seen sheaves before, you may recognize this as the covering axiom.

In other words, E is a sheaf if whenever x=xi and c(α)=d(α), then there is some α¯ such that α=e(α¯).

Theorem The category of sheaves on a Heyting algebra is a topos.

For context, we can think of sheaves over Heyting algebras as sets in a logic with an expanded notion of truth. Our Heyting algebra is the collection of truth values, and the sheaves are the fuzzy sets with fuzziness introduced by the Heyting algebra.

Recalling that subsets and predicates are viewed as the same thing, we can view the set E(p) as the part of the fuzzy set E that is at least p true.

As it turns out, to really make sense of this approach, we realize that equality is a predicate as well - and thus can hold or not depending on the truth value we use.

Definition Let P be a complete Heyting algebra. A P-valued set is a pair (S,σ) of a set S and a function σ:SP. A category of fuzzy sets is a category of P-valued sets. A morphism f:(S,σ)(T,τ) of P-valued sets is a function f:ST such that τf=σ.

From these definitions emerges a fuzzy set theory where all components of it being a kind of set theory emerges from the topoidal approach above. Thus, say, subsets in a fuzzy sense are just monics, thus are injective on the set part, and such that the valuation, on the image of the injection, increases from the previous valuation: (T,τ)(S,σ) if TS and σ|T=τ.

To get to topoi, though, there are a few matters we need to consider. First, we may well have several versions of the empty set - either a bona fide empty set, or just a set where every element is never actually there. This issue is minor. Much more significant though, is that while we can easily make (S,σ) give rise to a presheaf, by defining

E(x)={sS:σ(s)x}

this definition will not yield a sheaf. The reason for this boils down to E(0)=S1. We can fix this, though, by adjoining another element - - to P giving P+. The new element is imbued with two properties: it is smaller, in P+, than any other element, and it is mapped, by E to 1.

Theorem The construction above gives a fuzzy set (S,σ) the structure of a sheaf on the augmented Heyting algebra.

Corollary The category of fuzzy sets for a Heyting algebra P forms a topos.

Final note While this construction allows us to make membership a fuzzy concept, we're not really done fuzzy-izing sets. There are two fundamental predicates on sets: equality and membership. While fuzzy set theory, classically, only allows us to make one of these fuzzy, topos theory allows us - rather easily - to make both these predicates fuzzy. Not only that, but membership reduces - with the power object construction - to equality testing, by which the fuzzy set theory ends up somewhat inconsistent in its treatment of the predicates.

Literature

At this point, I would warmly recommend the interested reader to pick up one, or more, of:

  • Steve Awodey: Category Theory
  • Michael Barr & Charles Wells: Categories for Computing Science
  • Colin McLarty: Elementary Categories, Elementary Toposes

or for more chewy books

  • Peter T. Johnstone: Sketches of an Elephant: a Topos Theory compendium
  • Michael Barr & Charles Wells: Toposes, Triples and Theories

Exercises

No homework at this point. However, if you want something to think about, a few questions and exercises:

  1. Prove the relations showing that 1 is indeed a partial order on [UΩ].
  2. Prove the universal quantifier theorem.
  3. The extension of a formula ϕ over a list of variables x is the sub-object of the product of domains A1××An for the variables x1,,xn=x classified by the interpretation of ϕ as a morphism A1××AnΩ. A formula is true if it classifies the entire product. A sequent, written Γ:ϕ is the statement that using the set of formulae Γ we may prove ϕ, or in other words that the intersection of the extensions of the formulae in Γ is contained in the extension of ϕ. If a sequent Γ:ϕ is true, we say that Γ entails ϕ. (some of the questions below are almost embarrassingly immediate from the definitions given above. I include them anyway, so that a catalogue of sorts of topoidal logic inferences is included here)
    1. Prove the following entailments:
      1. Trivial sequent: ϕ:ϕ
      2. True: :true (note that true classifies the entire object)
      3. False: false:ϕ (note that false classifies the global minimum in thepreorder of subobjects)
    2. Prove the following inference rules:
      1. Implication: Γ,ϕ:ψ is equivalent to Γ:ϕψ.
      2. Thinning: Γ:ϕ implies Γ,ψ:ϕ
      3. Cut: Γ,ψ:ϕ and Γ:ψ imply Γ:ϕ if every variable free in ψ is free in Γ or in ϕ.
      4. Negation: Γ,ϕ:false is equivalent (implications both ways) to Γ:¬ϕ.
      5. Conjunction: Γ:ϕ and Γ:ψ together are equivalent to Γ:ϕψ.
      6. Disjunction: Γ,ϕ:θ and Γ,ψ:θ together imply Γ,ϕψ:θ.
      7. Universal: Γ:ϕ is equivalent to Γ:x.ϕ if x is not free in Γ.
      8. Existential: Γ,ϕ:ψ is equivalent to Γ,x.ϕ:ψ if x is not free in Γ or ψ.
      9. Equality: :q=q.
      10. Biconditional: (vw)(wv):v=w. We usually write vw for v=w if v,w:AΩ.
      11. Product: p1u=p1u,p2u=p2u:u=u for u,uA×B.
      12. Product revisited: :(p1(s×s)=s)(p2(s×s)=s).
      13. Extensionality: xA.f(x)=g(x):f=g for f,g[AB].
      14. Comprehension: (λxA.s)x=s for xA.
    3. Prove the following results from the above entailments and inferences -- or directly from the topoidal logic mindset:
      1. :¬(ϕ¬ϕ).
      2. :ϕ¬¬ϕ.
      3. :¬(ϕψ)(¬ϕ¬ψ).
      4. :(¬ϕ¬ψ)¬(ϕψ).
      5. :(¬ϕ¬ψ)¬(ϕψ).
      6. ϕ(θψ) is equivalent to (ϕθ)(ϕψ).
      7. x.¬ϕ is equivalent to ¬x.ϕ.
      8. xϕ¬x.¬ϕ.
      9. x¬ϕ¬x.ϕ.
      10. xϕ¬x.¬ϕ.
      11. ϕ:ψ implies ¬ψ:¬ϕ.
      12. ϕ:ψϕ.
      13. ϕϕ:ϕ.
      14. ϕψ:ϕψ (but not the converse!).
      15. ¬¬¬ϕ is equivalent to ¬ϕ.
      16. (ϕψ)θ is equivalent to ϕ(ψθ) (currying!).
    4. Using the Boolean negation rule: Γ,¬ϕ:false is equivalent to Γ:ϕ, prove the following additional results:
      1. ¬¬ϕ:ϕ.
      2. :ϕ¬ϕ.
    5. Show that either of the three rules above, together with the original negation rule, implies the Boolean negation rule.
      1. The converses of the three existential/universal/negation implications above.
    6. The restrictions introduced for the cut rule above block the deduction of an entailment :x.ϕx.ϕ. The issue at hand is that A might not actually have members; so choosing one is not a sound move. Show that this entailment can be deduced from the premise xA.x=x.
    7. Show that if we extend our ruleset by the quantifier negation rule x¬x.¬, then we can derive the entailment :w:w=tw=false. From this derive :ϕ¬ϕ and hence conclude that this extension gets us Boolean logic again.
  4. A topology on a topos E is an arrow j:ΩΩ such that jtrue=true, jj=j<math>and<math>j=j×j. For a subobject SA with characteristic arrow χS:AΩ, we define its j-closure as the subobject S¯A classified by jχS.
    1. Prove:
      1. SS¯.
      2. S¯=S¯¯.
      3. ST¯=S¯T¯.
      4. ST implies S¯T¯.
      5. f1(S)¯=f1(S¯).
    2. We define S to be j-closed if S=S¯. It is j-dense if S¯=A. These terms are chosen due to correspondences to classical pointset topology for the topos of sheaves over some space. For a logical standpoint, it is more helpful to look at j as a modality operator: "it is j-locally true that" Given any u:1Ω, prove that the following are topologies:
      1. (u):ΩΩ (the open topology, where such a u in a sheaf topos ends up corresponding to an open subset of the underlying space, and the formulae picked out are true on at least all of that subset).
      2. u):ΩΩ (the closed topology, where a formula is true if its disjunction with u is true -- corresponding to formulae holding over at least the closed set complementing the subset picked out)
      3. ¬¬:ΩΩ. This may, depending on the topos, end up being interpreted as true so far as global elements are concerned, or not false on any open set, or other interpretations.
      4. 1Ω.
    3. For a topos E with a topology j, we define an object A to be a sheaf iff for every X and every j-dense subobject SX and every f:SA there is a unique g:XA with f=gs. In other words, A is an object that cannot see the difference between j-dense subobjects and objects. We write Ej for the full subcategory of j-sheaves.
      1. Prove that any object is a sheaf for 1Ω.
      2. Prove that a subobject is dense for ¬¬ iff its negation is empty. Show that true+false:1+1Ω is dense for this topology. Conclude that 1+1 is dense in Ω¬¬ and thus that E¬¬ is Boolean.