User:Michiexile/MATH198/Lecture 10
From HaskellWiki
Michiexile (Talk | contribs) |
Michiexile (Talk | contribs) |
||
Line 47: | Line 47: | ||
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. |
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 open sup for the topos language above. |
+ | 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 <math>P, Q</math> acting on the same type: |
We'd define, for predicates <math>P, Q</math> acting on the same type: |
||
Line 90: | Line 90: | ||
'''Membership''': |
'''Membership''': |
||
− | We can internalize the notion of ''membership'' as a subobject <math>\in^A\subseteq A\times\Omega^A</math>, and thus get the membership relation from a pullback: |
+ | We can internalize the notion of ''membership'' as a subobject <math>\in^U\subseteq U\times\Omega^U</math>, and thus get the membership relation from a pullback: |
:[[Image:ToposMembershipPullback.png]] |
:[[Image:ToposMembershipPullback.png]] |
||
Line 158: | Line 158: | ||
then suddenly we're back in classical logic, and can prove <math>\neg\neg\phi\Rightarrow\phi</math> and <math>\phi\or\neg\phi</math>. |
then suddenly we're back in classical logic, and can prove <math>\neg\neg\phi\Rightarrow\phi</math> and <math>\phi\or\neg\phi</math>. |
||
− | ====Examples==== |
+ | ====Examples: Sheaves, topology and time sheaves==== |
− | ====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 <math>C</math> is a contravariant functor <math>E: C^{op}\to Set</math>. |
||
+ | |||
+ | Presheaves occur all over the place in geometry and topology - and occasionally in computer science too: There is a construction in which a functor <math>A\to Set</math> for a discrete small category <math>A</math> identified with its underlying set of objects as a set, corresponds to the data type of ''bags'' of elements from <math>A</math> - for <math>a\in A</math>, the image <math>F(a)</math> denotes the multiplicity of <math>a</math> in the bag. |
||
+ | |||
+ | '''Theorem''' The category of all presheaves (with natural transformations as the morphisms) on a category <math>C</math> form a topos. |
||
+ | |||
+ | '''Example''' Pick a category on the shape |
||
+ | :[[Image:GraphsAsPresheaves.png]] |
||
+ | A contravariant functor on this category is given by a pair of sets <math>G_0, G_1</math> and a pair of function <math>source, target: G_1\to G_0</math>. 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: |
||
+ | :<math>in \to^{all} in</math> |
||
+ | :<math>in \to^{both} in</math> |
||
+ | :<math>in \to^{source} out</math> |
||
+ | :<math>out \to^{target} in</math> |
||
+ | :<math>out \to^{neither} out</math> |
||
+ | Now, given a subgraph <math>H \leq G</math>, we define a function <math>\chi_H:G\to\Omega</math> by sending nodes to in or out dependent on their membership. For an arrow <math>a</math>, we send it to all if the arrow is in <math>H</math>, 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 <math>P</math> is a partially ordered set. We call </math>P</math> a ''complete Heyting algebra'' if |
||
+ | * There is a top element <math>1</math> such that <math>x\leq 1 \forall x\in P</math>. |
||
+ | * Any two elements <math>x, y</math> have an infimum (greatest lower bound) <math>x\wedge y</math>. |
||
+ | * Every subset <math>Q\subseteq P</math> has a supremum (least upper bound) <math>\bigvee_{p\in P} p</math>. |
||
+ | * <math>x\wedge(\bigvee y_i) = \bigvee x\wedge y_i</math> |
||
+ | |||
+ | 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 <math>\{x_i\}</math> is a subset with supremum <math>x</math>, and <math>E</math> is a presheaf, we get functions <math>e_i:E(x)\to E(x_i)</math> from functoriality. We can summarize all these <math>e_i</math> into <math>e = \prod_i e_i: E(x)\to\prod_i E(x_i)</math>. |
||
+ | |||
+ | Furthermore, functoriality gives us families of functions <math>c_{ij}: E(x_i)\to E(x_i\wedge x_j)</math> and <math>d_{ij}: E(x_j)\to E(x_i\wedge x_j)</math>. These can be collected into <math>c: \prod_i E(x_i)\to\prod_{ij}E(x_i\wedge x_j)?</math> and <math>d:\prod_j E(x_j)\to\prod_{ij}E(x_i\wedge x_j)</math>. |
||
+ | |||
+ | '''Definition''' A presheaf <math>E</math> on a Heyting algebra is called a ''sheaf'' if it satisfies: |
||
+ | :<math>x = \bigvee x_i</math> |
||
+ | implies that |
||
+ | :[[Image:SheafEqualizer.png]] |
||
+ | is an equalizer. |
||
+ | |||
+ | In other words, <math>E</math> is a sheaf if whenever <math>x=\bigvee x_i</math> and <math>c(\alpha) = d(\alpha)</math>, then there is some <math>\bar\alpha</math> such that <math>\alpha = e(\bar\alpha)</math>. |
||
+ | |||
+ | '''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 <math>E(p)</math> as the part of the fuzzy set <math>E</math> that is at least <math>p</math> 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 <math>P</math> be a complete Heyting algebra. A ''<math>P</math>-valued set'' is a pair <math>(S,\sigma)</math> of a set <math>S</math> and a function <math>\sigma: S\to P</math>. A ''category of fuzzy sets'' is a category of <math>P</math>-valued sets. A morphism <math>f:(S,\sigma)\to(T,\tau)</math> of <math>P</math>-valued sets is a function <math>f:S\to T</math> such that <math>\tau\circ f = \sigma</math>. |
||
+ | |||
+ | 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: <math>(T,\tau)\subseteq(S,\sigma) if <math>T\subseteq S</math> and <math>\sigma|_T = \tau</math>. |
||
+ | |||
+ | 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 <math>(S,\sigma)</math> give rise to a presheaf, by defining |
||
+ | :<math>E(x) = \{s\in S: \sigma(s)\geq x\}</math> |
||
+ | this definition will not yield a sheaf. The reason for this boils down to <math>E(0) = S \neq 1</math>. We can fix this, though, by adjoining another element - <math>\bot</math> - to <math>P</math> giving <math>P^+</math>. The new element <math>\bot</math> is imbued with two properties: it is smaller, in <math>P^+</math>, than any other element, and it is mapped, by <math>E</math> to <math>1</math>. |
||
+ | |||
+ | '''Theorem''' The construction above gives a fuzzy set <math>(S,\sigma)</math> the structure of a sheaf on the augmented Heyting algebra. |
||
+ | |||
+ | '''Corollary''' The category of fuzzy sets for a Heyting algebra <math>P</math> 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=== |
===Exercises=== |
Revision as of 01:21, 25 November 2009
IMPORTANT NOTE: THESE NOTES ARE STILL UNDER DEVELOPMENT. PLEASE WAIT UNTIL AFTER THE LECTURE WITH HANDING ANYTHING IN, OR TREATING THE NOTES AS READY TO READ.
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.
Contents |
1 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 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 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 , such that Sub(X) = hom(X,Ω). Furthermore, picking a universal element corresponds to picking a subobject such that for any object A and subobject , there is a unique arrow 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 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.
2 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 proogramming relevance will take a back seat in this lecture, in favour of usefulness in logic and set theory replacements.
3 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.
3.1 Power object
Since a topos is closed, we can take exponentials. Specifically, we can consider . This is an object such that . 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 correspond to subobjects of A)
3.2 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:
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:
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.
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 for the morphism that takes on the value true on all of A. We note that with this convention, , the characteristic morphism of a subobject, is the arrow such that .
Conjunction: Given predicates P,Q, we need to define the conjunction as some that corresponds to both P and Q simultaneously.
We may define , a subobject of . Being a subobject, this has a characteristic arrow , that we call the conjunction arrow.
Now, we may define for subobjects - and we take their composition to be the characteristic arrow of the subobject .
And, indeed, this results in a topoidal version of intersection of subobjects.
Implication: Next we define to be the equalizer of and proj_{1}. Given , we write if factors through .
Using the definition of an equalizer we arrive at iff . From this, we can deduce
- If and then .
- If and then u = v
and thus, is a partial order on . Intuitively, if v is at least as true as u.
This relation corresponds to inclusion on subobjects. Note that , given from the equalizer, gives us Ω_{1} as a relation on Ω - a subobject of . Specifically, it has a classifying arrow . We write . And for subobjects , we write for the subobject classified by .
It turns out, without much work, that this behaves just like classical implication in its relationship to .
Membership: We can internalize the notion of membership as a subobject , and thus get the membership relation from a pullback:
For elements , we write for . Yielding a subset of the product , 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 . Both notations indicate .
Universal quantification: For any object U, the maximal subobject of U is U itself, embedded with 1_{U} into itself. There is an arrow represents this subobject. Being a map from 1, it is specifically monic, so it has a classifying arrow that takes a given subobject of U to true precisely if it is in fact the maximal subobject.
Now, with a relation , we define by the following pullback:
where λχ_{R} comes from the universal property of the exponential.
Theorem For any monic, iff .
This theorem tells us that the subobject given by 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 . This might be familiar to the more advanced Haskell type hackers - as the type
x :: forall a. a
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 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: .
Disjunction:
We can define
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:
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
We can, though, prove
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 .
3.3 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 .
Presheaves occur all over the place in geometry and topology - and occasionally in computer science too: There is a construction in which a functor 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 , 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 G_{0},G_{1} and a pair of function . 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:
Now, given a subgraph , we define a function 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 </math>P</math> a complete Heyting algebra if
- There is a top element 1 such that .
- Any two elements x,y have an infimum (greatest lower bound) .
- Every subset has a supremum (least upper bound) .
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 {x_{i}} is a subset with supremum x, and E is a presheaf, we get functions from functoriality. We can summarize all these e_{i} into .
Furthermore, functoriality gives us families of functions and . These can be collected into and .
Definition A presheaf E on a Heyting algebra is called a sheaf if it satisfies:
implies that
is an equalizer.
In other words, E is a sheaf if whenever and c(α) = d(α), then there is some such that .
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 . A category of fuzzy sets is a category of P-valued sets. A morphism of P-valued sets is a function such that .
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: 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
this definition will not yield a sheaf. The reason for this boils down to . 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.
4 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
5 Exercises
No homework at this point. However, if you want something to think about, a few questions and exercises:
- blah