Waiting..
Auto Scroll
Sync
Top
Bottom
Select text to annotate, Click play in YouTube to begin
00:00:01
okay uh hi everyone welcome to the tutorial first tutorial of the uh applied category theory conference um it's happening this coming week and i'm glad you could all come
00:00:15
so as i said before uh if you have questions just put him in the chat and paulo will answer them or uh and then maybe he'll ask he'll tell them to me
00:00:26
um so i'm gonna talk about is an introduction to applied category theory and i put it down there in purple something really good that's happening in the world because somehow while uh
00:00:39
in the u.s our our national pride is kind of an all-time low apparently or a low recent low uh in a world where things are kind of confusing i personally find category theory to be
00:00:52
something very positive that is really up and coming and that i think is worth taking a look at so um yeah
00:01:04
so as an introduction actually i don't have very many slides because this whole this whole this whole talk will be an introduction in some sense uh so i want to say who is this
00:01:17
intro really for um if you know what a category and functor already if you already know what these are then you're probably not going to learn much from this but you're still welcome if you don't know what a category or a
00:01:30
functor are or even know much math or remember math that then it's more for you i've tried to design it as a way of it's a a way of just kind of introducing what this whole subject is about
00:01:42
so because you don't know what categories and functors are and yet i'm telling you they're kind of the basis of this whole subject let me just quickly say kind of what they are so a category is a network
00:01:55
of relationships hmm that's not very good writing a category is a network of relationships so that's uh that's pretty vague it's a math thing so it really is pure
00:02:16
math uh it can it's as rigorous as any other kind of math and so when you see network of relationships it really is a precise idea but i'm not going to tell you the precise idea today in like precise mathematical terms a
00:02:30
functor is a connection between categories so if you have a category and some kind of like network of relationships of different things that are connected together i don't know maybe they're just arrows or something
00:02:42
all sorts of different things all talking to each other in different ways then that whole thing could be in a network of of a higher level with different networks of relationships mine yours
00:02:56
bob's alice's and these different networks of relationships can be connected uh by what are called functors so um but you don't have to know that's very vague and so what before we
00:03:16
kind of look into categories and functors and and what this whole subject is and we're not really going to go into it deeply again but we're going to try to say how it feels to do category theory i want to ask what math even is so there
00:03:28
was a time when you took when you took math classes in college or high school or middle school and you might have learned about algebra and that's a study of equations maybe x
00:03:42
squared equals y or something and then there's like geometry and that's a study of shapes maybe different shapes but even before that there's
00:03:59
my number is pretty bad today two three one right and what do all these different things have in common i it's kind of hard i i want to leave that as an open question i don't presume to know what math is
00:04:11
but one thing i think it is is it's like stable thought patterns that can survive and last a really long time so the number two whether you're today or uh three thousand years ago or
00:04:23
something you probably understood it as a couple dots or maybe you understood it as a couple goats sorry my couple of different goats or something so you have some world where you're
00:04:43
looking in that world and you're seeing two of something and that notion of two our understanding of like maybe who alexander the great was or what a person is may have changed through time but two i think is a relatively stable
00:04:56
thought pattern and because it's so stable it can it can be passed and communicated between people in the same way numbers algebra geometry these are relatively stable thought patterns that can be translated between
00:05:09
people and can allow us to coordinate um so again that's all pretty vague but but what i want to say is that all of these things are kind of
00:05:20
part of a larger structure of math and that category theory likes to think about and when we think categorically we like to think about uh math as a whole and as its parts and
00:05:32
how they kind of how those parts fit together uh into that whole and so i want to start with something more concrete but uh simple so i'm going to just draw some numbers
00:05:44
here and um i'm going to draw an arrow from one number to another if so the arrow means
00:05:55
so there's an arrow from a to b means that a divides evenly or perfectly into b if you don't remember what that means it means that like
00:06:07
you can have two three twos to get six or two threes to get six right so they go in evenly but two does not go evenly into five uh two does go evenly into 10.
00:06:22
3 goes evenly into 15 5 goes evenly into 15 and 5 goes evenly into 10 and all these go into 30. and of course there's lots of numbers i didn't draw here but these are eight numbers i guess with
00:06:35
arrows when one goes evenly into another but also there's an arrow uh there's a path from one all the way up to 30 or from one all the way up to six and uh that's because one goes perfectly into six so not only an arrow
00:06:48
means it divides evenly but any path means that it divides evenly into it and so this is a network of relationships there's a lot more things in this network there's four
00:07:00
that i didn't draw and stuff like that but um it's a network of relationships and so it's a category and uh it's um it's one that somebody invented namely uh i think i got this from eugenia chang
00:07:13
it's a little category that's someone invented for explanatory purposes and category theorists invent categories all the time they invent them for reasons that they have for thinking about the world in their particular way
00:07:26
and we're going to look at this little category of eight objects and some number of arrows uh as uh because it's going to help us explain an idea from category theory
00:07:38
namely the notion of product so in category theory we look for general patterns uh that persist or we find all around mathematics
00:07:49
so product very vaguely is um or in very loose terms is the last thing that goes into both so that's like a very weird grammatical
00:08:04
construction but the product of a and b is the is the last thing that goes into both a and b and what the heck am i talking about there well um
00:08:20
let's talk about let's say you have two numbers in this thing here six and ten and you want to look at the product the product of these two in this network of
00:08:32
relationships well it's something that goes into 6 and 10 and i didn't tell you what goes into means yet but what i mean is has an arrow into 6 and 10. and so what things on here have an arrow
00:08:44
into 6 and 10 or a path well 6 doesn't have an arrow to 10 so that's out and 15 doesn't have an arrow to 10 but 2 does have an arrow to six and to ten so that's good and one has an
00:08:56
arrow to both six and ten but the last thing that has an arrow or a path to both six and ten is two so two would be the product of six and 10. and product is a weird
00:09:08
word it's a category theoretic word but what we're going to say instead is that what's going on here i would open this up to ideas but maybe you already can tell
00:09:20
or some of you remember this terminology it's not too important but it's called the greatest common divisor the greatest common divisor of two and ten is the last thing that goes into both it's the biggest number
00:09:35
that divides evenly into both 6 and 10. so the gcd of 6 and 15 is the last thing that goes into both and that's three
00:09:48
and the gcd of 15 and 15 is 15 because it goes into both and it's the last thing that goes into both now why would i say why would i do this weird thing well gcd it's like
00:10:00
oh i remember that from my past that's kind of weird okay gcd is important in category theory apparently i don't know if i've ever used it in my life okay that's me being some being uh thinking about how i might imagine
00:10:13
you're seeing this some people but let's just reverse the arrows and then we'll see and then you'll say uh okay gcd and whatever this is well i still don't know if this goes into my life
00:10:26
and but we'll try to just keep going through lots of different parts of math or lots of different examples of the same construct over and over and see different ideas coming out and that's the idea of category theories to
00:10:38
find these commonalities so what what is the last thing that goes into both here so let's say you have two things two and three and you want something that goes into both the last thing that goes into both well
00:10:51
30 goes into both because it goes in that way into two uh and it goes i don't know lots of different ways into three different ways into two so 30 goes into both but the last thing
00:11:04
that goes into both two and three is what's called the least common multiple last thing that goes into both six and ten
00:11:19
is thirty so that's the least common multiple of six and ten so okay all we did was reverse the arrows and we have two different categories this one this is alice's category this one's bob's actually this one's eugenia's
00:11:32
category this one is eugene's category and uh they're just opposites of each other the arrows go the other way and we're getting gcd and lcm but
00:11:44
let's just keep going with the number theme because it's easy so what if we use this number scheme instead this is a category also i'm sorry
00:11:56
yep so uh people are asking if there are also undrawn arrows from each number to itself there are undrawn arrows from each number to itself thanks for asking
00:12:10
i didn't draw any paths except for paths of length one so there's also a path whoops there's also a path from two all the way to thirty so that's a length two path but as someone's asking there's also
00:12:24
a path from a number to itself it's just a length zero path it's kind of like you're already where you are um it's called the identity so uh here in this picture that i've drawn what's
00:12:37
the last thing that goes into both a and b well if you pick a and b and you say i want something that goes into both well 2 goes into both and 1
00:12:50
goes into both but four does not go into both so the last thing that goes into both where you as powder just asked and as some people astutely asked the last thing that goes into both
00:13:03
say three and five is the min it's the smaller of the two that's pretty well yeah so what what is the min it's the last thing that goes into both
00:13:20
so we've recovered gcd greatest common divisor which you might have forgotten lcm the least common multiple which you might have forgotten but min everyone kind of knows what's smaller for three or five
00:13:31
what's smaller four or seven it's the last thing that goes into both and in the same way if we reverse the arrows in the same way as above we could reverse the arrows and see this is another category
00:13:45
everyone you in category theory people make up categories all the time to explain things that they're seeing and in this category the last thing that goes into both three and five
00:13:57
is five so you get max and this notion of product which is the last thing that goes into both is recovering meaning uh we're getting back um
00:14:10
notions from all over um kind of like number theory the theory of numbers um we're getting the notion of min max gcd lcm least common multiple stuff like
00:14:22
that let's do another totally different kind of example that doesn't involve numbers but instead less involves like space so here's a space and maybe you could so
00:14:35
in alice's space what she's seeing here is every dot in this whole region is in this space whereas maybe uh somebody else they just want to look at like this many dots and either way you look
00:14:49
at it this following conversation will make sense so you could think of these as being all the dots in the space or you could think of there being every possible dot and what i'm going to be looking at in my network of
00:15:01
relationships that i'm going to use is subsets so there's that subset there's this subset
00:15:14
the red subset is not contiguous but it's still a subset uh the green subset that's this one here um and the purple subset that'll be uh this one
00:15:38
um okay um so in this network of relationships the black one includes all of the dots the green one includes some of the dots
00:15:52
the purple one includes some of the dots the blue one includes some of the dots and the red one includes some of the dots and i'm going to draw a little arrow between them when there can when one set of dots is
00:16:07
contained in another set of dots and so the purple one is contained in the red one and now i've drawn part of this network of relationships but the network of relationships i'm
00:16:21
talking about has all possible subsets here so any subset you can draw so you have this one that would be down here pointing to blue and you have etc so all possible subsets are in this
00:16:35
network of relationships it's a huge network of relationships with probably hundreds of thousands or millions of dots in it in this network of release so this network of relation is of relationships is somehow talking
00:16:48
about this set and subsets over there so here's subsets subsets okay now we're going back to this category theory id of the product
00:17:03
so suppose you have two subsets say blue and red what's the gcd or lcm or whatever it is the product of
00:17:19
blue and red well it's the last thing that goes into both but what's a thing here a thing is a subset so what's the last thing that goes into both blue and red
00:17:40
it's a subset as a number of dots and it has to go into blue and red meaning it has to be a subset of both blue and red but it can't be it has to be the biggest possible subset it's the last one that goes into both
00:17:52
so it's it's actually this intersection here is the intersection intersection intersection just means in the venn diagram it's this part it's the last thing that
00:18:09
goes into both the left-hand side and the right-hand side and in the same way if we reverse the arrows here we could do it again okay we could do the same story again
00:18:24
we could take this picture and we could copy it and um but we could instead of having the arrows go
00:18:36
in the direction we did up there we could have the arrows go in the backwards direction whoops so now we have black and we have red and again the last thing that goes into both is something important
00:18:49
every time we do this we seem to see something important happening when we pick at least when we pick these good networks of relationships the ones that i picked for this example we're seeing good things happen we're
00:19:00
seeing old-fashioned mathematical ideas uh coming out so green is in black and this one this one and this one and then purple is in red and so oops i went
00:19:13
backwards i wanted to draw my arrows backwards this time the last thing that goes into both now say you want the last thing that goes into both blue and red again
00:19:28
the last thing that goes into both well into has become backwards so the last thing that both red and blue go into now the last thing that both red and blue go
00:19:39
into well i guess it'd be the first thing so we've reversed everything we've made opposite land so uh the first thing that goes into both blue and red
00:19:50
is um well it's the union it's the it's it's this really weird picture uh that would be
00:20:07
kind of both of these guys the union i'm sorry it contains both and it's the smallest thing that does i follow hey someone is pointing out that there should be also a red to purple
00:20:20
arrow oops thanks yep so this is a big network of relationships i've only drawn five dots in and really there's hundreds of thousands or millions of dots in here and for any two dots in this in this
00:20:34
picture here you pick any two dots in this picture and they will have a product and that product will correspond over in this picture to the union of the um
00:20:46
two or two subsets um so this same idea gcd lcm min max union uh it also comes to from you can find it in programming people use it
00:21:01
in regular set theory it turns out that the product of three and five maybe you've heard of products maybe when you think product you think times and that's great because in the theory of sets there's a category called the category
00:21:15
of sets where the product of 3 and 4 would be this 12 element set here and that's i'm not going to tell you the category you can learn about it it's one of the most famous categories that there
00:21:27
is if you learn category theory and get to know all the celebrities of categories uh the category of sets is a big celebrity and category theory um and there you get this notion of
00:21:40
product but uh again it generalizes lots and lots of things that we find all over the place so let me back out again from these specifics and say what we're doing category theory
00:21:52
looks for common patterns throughout math and now starting in this applied category theory era it's kind of always been applied but it's getting more even more applied now we look for patterns beyond pure math
00:22:07
so i wanted to point out what might be obvious or might not be obvious and that was that all of math was invented by somebody to help them think about some aspect of their world there was somebody who had the the time
00:22:22
the privilege the inclination to try to take something they were seeing in their world and put it down into a rigorous pattern into a rigorous uh language and method
00:22:36
for thinking so for example there is euclid and euclid thought about shapes and lines he noticed
00:22:49
shapes and lines were important for thinking about geometry um for thinking about distance for thinking about relationships in space and so he wrote down in this
00:23:02
classic book called the elements um a bunch of books uh the the rules for thinking about shapes and lines and things like that um skipping ahead you have newton
00:23:15
and leibniz and these people thought about rates of change how fast one celestial body is moving with roulette relative to another
00:23:28
how fast things change in time if you have more if you have more masks do you get less covid or the same amount you get much better much more much less how do they relate to each other uh just
00:23:41
trying to think about you know if i do this how fast does it change that um so what else who else was there there is pascal and vermont
00:23:56
and these people thought about probability games of chance how likely are things so they they invented the field of probability because they wanted to understand how
00:24:08
chance works and they did it their own way they you if you had tried to do it back then you would you might have done it differently or you might have done something similar
00:24:20
so that's that's an open question but the point is these people invented uh these ideas so what else who else was there there's bool bool invented logic
00:24:33
so um like and and or and how and and or work um what are the rules for logic for thinking uh for mathematical statements now they're put together
00:24:47
there's who else would i want to say there's no there she thought about what abstract alg what algebra really is like what are the rule systems for algebra for manipulating
00:25:02
x's and y's variables numbers things like that she also thought about physics and how conservation laws are related to symmetries and very in um
00:25:16
so right so abstract algebra there is say touring this is the last one i'll do computation what is computation how does it really work how should we think about it so all these people invented something
00:25:30
and those things that they invented changed their world and allowed people to communicate across distances and coordinate with each other to think about how probability works or how shapes and lines work or how
00:25:41
things change with respect to each other so for all of these people they invented a system of thinking they thought about they invented math to think about some aspect of life
00:25:53
category theory was invented in the 40s to consider bridges between all of them and so from my point of view i'm seeing it as like the very project of math itself what do i is being considered in category theory and what do i mean by
00:26:06
that i mean if all these people thought about their world and said i think what i need to talk about that no one said yet is formal logic the rules of thinking or i i think that the rule what i need to say
00:26:18
that no one's thought about is abstract algebra the rules of algebraic manipulations all these people took something from the world and they expressed it in mathematics and now what we're doing is we're finding these common themes throughout
00:26:30
all those all those different approaches and that doesn't mean that we have this grab this kind of clued together thing with 42 uh we you know all the famous mathematicians are clued together into
00:26:42
some crazy weird uh grab bag thing it means that we found some common patterns and abstractions that reach that that take all of these ideas
00:26:54
and put them together uh or allow them to live in a larger world where they are they can remain themselves they can the rules of probability remain the rules of probability and category theory when category theory
00:27:08
thinks about geometry the rules of geometry stay the same when it thinks about calculus we look at how calculus actually is and we think about it from category theory point of view so we are not changing
00:27:20
these things we're letting them be there but we're finding some system or principles that that encompass or allow us to speak about and translate between all sorts of different aspects
00:27:31
of math and by doing that we're kind of finding what math is in some sense uh not all it could be but but all that it has been it in some sense is being found in
00:27:44
category theory so let me go to categories again be a little more concrete again um so so some different categories there's the
00:27:57
category of space and continuous mappings so in this one the network of relationships would include things like this space there
00:28:08
that would be in the network of relationships and another one would be this sphere here that would be in the network of relationships and what are the arrows what are the connections how are things
00:28:21
related things are related by continuous mapping so a way of putting this space in this sphere continuously continuously means that as someone walks around in this space
00:28:36
uh uh without jumping they don't just like go from there all the way to there in some weird jump um they walk also continuously through the mapped space
00:28:49
and so this world of relationships this network of relationships or category called top for topological spaces has in it every single possible topological space and you say well how could it possibly
00:29:02
have every single one um it's kind of like x has every number in it quote unquote it's not quite the same it's a kind of weird analogy but it's a world of thinking
00:29:14
it's an abstract platonic realm or something where you can think about every space and all the continuous mappings between them so all the triangles are in there all the squares but so are all the 3d shapes
00:29:27
that you could think oh by the way the product in the category of spaces if you take a circle the open circle and the open circle and you product them together
00:29:39
it turns out you get the taurus that little shape there what's going on there is that if someone walks around here it's like they're walking around the taurus around the doughnut and as they walk
00:29:53
here it's like they're walking through the donut so this notion of gcd and our greatest common divisor and man and max and all that sort of stuff turns out to give us the taurus
00:30:07
from the two circles so that's a category the category of all spaces and continuous mappings there's also the category of resources and processes oh i meant to copy that in oh well um
00:30:19
maybe i'll go try to find it this thing i don't know if i can copy this in but i'm just going to look at it here then so here's resources and processes so this is a category it's the category
00:30:36
of all resources you can make say uh yeah so what are some objects in here we've kind of drawn things funny a little bit different but when preparing a lemon meringue pie
00:30:47
all of these guys whoops are going to be resources crust is a resource it's good to have crust and lemon is a resource and butter is a resource and the arrows are more general kinds of
00:31:00
arrows this thing is serving that thing there make lemon filling is serving as a kind of multi-arrow that takes lemon butter sugar and yolk and produces
00:31:11
lemon filling um so that's what this thing is here okay so in this little character i'm drawing now um it's a resource theory and lemon filling is a resource and
00:31:29
meringue is a resource some white eggy stuff and all of these boxes are converters that take like an egg and convert it into two things yolk and
00:31:43
white and that's what the separate egg does and make lemon filling takes lemon butter sugar and yolk and makes lemon filling and fill crusts make some kind of like pre pie thing
00:31:54
and when you add meringue you get this unbaked pie and so what we're getting is a network of resources and how they can be combined that is a category called a resource theory
00:32:09
um in algebra we deal with unknowns right if you want if you remember back to algebra you might have like y minus x squared equals 3 and y plus x
00:32:24
equals 9 or something like that then you graph this and y minus x squared equals 3 y equals x squared plus 3 okay i'm just going to do some quick math here
00:32:37
y equals 9 minus x that's like this so in this network of relationships i guess what i could say the network of relationships is is all systems of equations in x and y
00:32:55
in two variables so you've got all these different systems of equations like here's a system of equations x equals two y equals seven that's a system of equations that's another system of equations
00:33:08
and i have a arrow from this one to this one because if x equals two and y equals seven then y minus x squared equals three and y plus x equals nine so you might say well how
00:33:21
do you come up with this that an arrow is like if then you never told me that in advance it's true i made up my own category and my category has in it all systems of equations in x and y
00:33:34
and whenever one implies another then i have an arrow and this allows you to look at um all shapes you know sine waves and all sorts of stuff in the plane
00:33:48
in two variables x and y and allows you to think about how different ones of them include other ones of them you could even allow like x plus y is less than seven or something and get like
00:34:00
get like subsets that are really big so this is another world there's another network of relationships um algebraic equations and how they imply each other or logic here's maybe one of the last
00:34:14
ones then i'll start i'll just open it up to questions in a few minutes but in logic you might have things like if a or b then c
00:34:28
that is a rule okay that's a logical statement someone else has a logical statement says if a then c but also if b then c
00:34:43
and you can ask whether these two things are the same statement one and statement two and in in logic it's all about whether one statement implies another statement
00:34:56
so in fact these two statements would be the same if a or b happens then c happens well then if a happens c happens and if b happens then c happens so or in logic maybe you think about
00:35:07
these weird uh i remember these kind of weird logic puzzles where like you have some facts remember these things like uh you have like people person
00:35:20
another person and people might be in relationship with each other and then you have like jobs and then you have like uh days or something i don't know if you've seen these logic puzzles and these are where you
00:35:34
take facts and you put them together to solve things and it's not quite what people mean by logic in math but it's pretty close maybe it even is i don't know i probably should have thought that
00:35:45
through a little more um taking facts and putting them together this is the maybe i should have been careful because all these other ones i've talked about really are rigorously uh categories whereas this one here um
00:35:59
is it a category or not that's something that someone if they are interested in they could actually try to pursue the question is that a category and how does thinking about it as a category help me uh solve it oops so
00:36:13
one last thing i don't know if this will be useful either but i kind of wanted to summarize before i open it up to questions and you can ask questions about the math or anything else but like category theory has a lot of
00:36:27
good stuff from a lot of different takes a lot of positive things i think so like in social terms the conservatives would say well i like that it benefits from the wisdom of math already invented you're not
00:36:39
throwing anything away you're not you're not throwing it all away and starting over you're taking what we already have and you're you're using it that's great and a libertarian might say i really like that you're free to create as you see fit you can make anything you
00:36:52
want and you're working within this background framework that's minimally invasive it doesn't make a lot of rules for you but it is highly functional i like that it kind of keeps everyone in line while
00:37:03
like satisfying some formal contracts or something while still being uh i'm still free to create and a progressive might say i like about category that theory that everyone can contribute to
00:37:15
making their own world making it more rich adding new ideas uh making it more meaningful understanding connections between things a modern viewpoint would say i like that
00:37:26
it's completely rigorous that it's been used in proving well-known conjectures that people thought were important to prove but also that it's interesting it's useful in science and technology and a postmodern person might say i like
00:37:40
that um that no perspective is right that that there's just all sorts of different categories but that navigating between these perspectives lets you look at problems from all sides or a hippie might say i like that it's
00:37:53
all about relationship and connection or irrelevant i don't know what that means maybe a practical person might say that i like that it's that we can actually use it to organize and learn from big data in
00:38:06
today's world or to manage complexity of software projects that are that are very large and changing all the time i like that you can think about ai and other complex systems with this stuff i think it's relevant and
00:38:19
practical for right now so that's that's my uh tutorial or that's the the part i'm going to record and now i'm going to open it up for questions
End of transcript