Category theory provides a foundational framework for mathematics and programming by abstracting away implementation details to focus on relationships between structures; a category consists of objects and morphisms (functions) between them, governed by two fundamental laws: associativity of composition (f ∘ (g ∘ h) = (f ∘ g) ∘ h) and the existence of identity morphisms (f ∘ id = f and id ∘ f = f), enabling powerful abstractions like isomorphisms that capture structural equivalence between different representations.
Category Theory for Programmers: Lecture 1 | MIT OpenCourseWare
Added:so today we're gonna talk where I'm not going to introduce much Haskell probably zero Haskell today and Brendan will start on that a bit tomorrow but I'm gonna talk about kind of foundations for the subject and get all the way to the definition of categories today but first I want to say kind of what programming feels like to me it's kind of like your it's kind of like a program is like a detailed plan of what you're going to do it's so detailed that the computer can follow it right so it's like I don't know where I'm gonna start exactly what time of day it's gonna be or where exactly I'm gonna be but I know I'm gonna start somewhere in this place and then depending on where I go where I start I'll go to some place over there if I start in either of these two places I'll go there in this case I'll go to this one and in the last three I'll go just directly their counterparts over there or something like that and so you say okay here's what I'm gonna do and then then once I get to this place I don't know where I'm gonna end up cuz I don't know exactly where I started but but whatever the case may be I'll do the following thing and you kind of say what you're gonna do no matter what so you could do it by kind of case analysis in this case I'll do this and in that case I'll do that or you could say like here's a pattern I'm gonna follow I'm gonna like read something and then I'll do what it says or whatever and so you make some consoling concise way of saying like what you're going to do in all the various cases and maybe you kind of split off like I'm going to give some information to Bob and I'm gonna give some information to Alice they're both going to compute some stuff on their own and then I'll recompile it at the end and or you know put it back together at the end and do something from there so that whole story of kind of this plan of action is what a program feels like to me and it's also kind of a story that we'll talk about today of categories in the category you can do that sort of thing also but just not by looking at dots or something but in a very abstract way so but before we get to categories the word the words in the definition of category involved words from sets from a set theory and so I have to start with sets so there's a whole theory called set theory that is mainly interested in like cardinalities and and sizes of sets and how different sets axioms for sets and things like that and in that theory they never really tell you what a set is but they tell you if you had some they tell you here's one I'm gonna give you I'm gonna give you a zero empty set I'm gonna give you an infinite set and then I'm gonna give you lots of ways of making new sets but I don't really tell you what a set is all I tell you is if there's something called that and that one set can be an element of another set and it's like you have like this set is an element of this set and so on and it's kind of like a lot of like symbols and and it's kind of a little bit strange for me and so this is like this theory of vermelho Fraenkel set theory and in in today's course and throughout the rest of this course we're not going to be using Zermelo Fraenkel set theory so if you know that then great but this will be much simpler in some sense what a set is for us is one of these things it's a bag of dots so that's a set it doesn't doesn't have lots of braces in it now this set one thing about it is that you can point to any of the elements of it so someone can point to one and another fact about it is if two people are pointing to two elements we can tell if they're looking at the same element or not those are basically all you need for our notion of sets yeah that's right that's right hey sack of dots it's a sack it's a sack of dots okay so this this element is called a and this one's called foo and this one's called smiley face and this one's called four and that's about a stack of dots there we go that's a set and what we could say is like if this set is called X then we could say that a is an X meaning that someone can point to that thing and the pointer is called it's really more like the pointer is called a than the dot is called a from my point of view but we could also say for is in X but we would say v is not in X and so this if this symbol it means is pronounced is an element of so this set has four elements and a is an element of this set okay so some of the nicest s' or a lot of the sets I like I denote n underline so let me instead of writing that I'll just write 0 underline one underline two underlined three underlined so three underlying is one two three it's got three elements and the elements are called 1 2 3 2 an underline has two elements one underlined has one element and this one has no elements and so so those are some sets those are nice little sets and they're also each one is a sack of dots yeah none of these contain 0 there is a set that contains 0 I I started this way someone else might say well I like Python or I like I don't know certain languages where I want this one to start with 0 and I want this one to start with 0 1 and stuff like that no these are 1 underlined and that's one that's one the element that the the little symbol the underscores are the names of the sets they're like the X and the things in the braces oh I could have maybe it would have helped us say this is the set a foo smiley face for yeah thanks so another set I like is the natural numbers and this is the set 0 1 2 3 maybe it's annoying that these don't start with the 0 and this one does I don't know for some reason I like that these and the same more than that but it's a personal choice so this set contains like 42 million or whatever 42,000 and all other natural numbers all they contain 0 and if something's in there then that thing +1 is also in there so a trillion to the trillion power is in this set another set we might use sometimes these are like the mean I bet these are probably the main sets will come up we'll see or derivation z' of them but another one we might see is called the integer this one's called the natural numbers and this one's called the integers and I don't does anyone know what does e stands for I didn't even hear but I said anyway okay negative 2 negative 1 0 1 2 3 what's the word saw solid sada okay German thanks okay so this one contains a positive and negative numbers and 0 and that might come up and other ones might come up like the reals and stuff like that but I don't think they will if they do it's not you can always ask what a symbol means it wouldn't bother me if so yeah if someone if I wrote this and you asked what is that like please do if you've forgotten ok so these are some sets right this one certainly it doesn't look ordered right or does it oh it looked ordered because oh I see okay yeah is happening yeah so there is such a thing as something called an ordered set and an order set is a set with a binary relation and bla bla bla and I'm not sure if we're gonna get two ordered sets today I wasn't planning to but but order is a category theoretic construct it matters but it's but sets don't have them all that matters is that you can point it at elements and tell what you're pointing at the same one or not okay so sets are really like structure they're like the minimal I think they're from my point of view maybe they were chosen as a foundation for math because they're so so simple in some sense there's no real structure to them except you have some dots but there's a huge amount of structure in the relationships between sets in fact there's enough structure in the relationships between sets that you can do all of math from that and it's that that I'll talk about next with functions but I think there might have been a question yeah I'm not going so I guess if we had to we'll say the two sets are equal if they have the same exact elements we're not going to really need that a more important notion is ice and morphism between sects and that we will define yes oh the question was how do you define the Thanks how do you find how do you define equality between two sets and in Zermelo Fraenkel set theory they say two sets are equal if they have exactly the same elements and that's what we'll do - but again it won't come up too much so functions are the relationships that are probably in math as it's been practiced over the centuries been the most important relationships meaning sets there's also something called a relation I talked about a binary relation before and those in some sense are more even more primitive than functions but you could start with functions and define relations or you could define start with relations and defined functions and either way you could get the out one from the other and so since we're in a kind of Haskell class or programming class functions are more important for us so we'll start with these guys and what they are are rules for assigning [Applause] values of one set to values of another two values of another not a very great way of saying it but so there's a set we could call it X and there's a set we could call it Y and a function is a rule for assigning values of Y to values of X so it's a rule meaning it's what I said over here what am I going to do in this case Oh in this case I'll go to that element and in this case I'll also go to that element but in this case I'll go to this element and in this case I'll go to the second element again so that's a function you could write if this function was called F then I would say and this was one two three and four and this was a B and C I would say F of one is B and B is also F of 2 and B is also F of four so this is a legal thing to write if you write equality is in a string this class I'm just saying they're all equal to each other so F of 4 is 2 is B but F of 3 is a I mean it might be nicer to write this in a table form so we have x and y and we have one two three four we have a a B whoops B Bab so it kind of looks like a database okay but the rule is that every element of X in database theory there's something called a key a primary key say every element of X gets only one element of Y if you don't know what a database is that's totally fine too each of these gets exactly one element to it they might overlap you might might have like be several times you might miss C altogether so we know that Y is just a B and C those are its elements or whatever but anyway whether you like this way of looking at it or not a function as a rule of that sort so any questions on functions I'll let you practice with them in a second but any like kind of conceptual yes but that's right so he asked is the square root function and people will often would say that the square root of 4 some some people would say it's 2 and then some other people would say it's plus or minus 2 and if you say it's 2 that's a perfectly good function it's a function from a symbol I haven't yet defined the non-negative reals to the non-negative reals there is one called square root but it's maybe if you're from if you're kind of if you've done a little bit more math you say well this isn't really the good one the better one from my point of view for my higher level point of view or whatever is this two valued function that actually goes to maybe R greater than equal to zero times R less than or equal to zero and I haven't defined these symbols so now I'm like really seductive but for here we'll go to like two comma negative two maybe that's what we're gonna do we're gonna have a two valued function oh but that fails too because zero went to zero comma zero now that's okay see it's both greater than and less than zero so everything's great square root you could define to be this sort of thing and then it's fine the we're gonna define as a set pretty soon and this is a set if if if you know what it means and we could define square root of square root to be this sort of function but you're right it's always one valued so even if it seems to valued we have to fix that up somehow like this weird trick I invented on the fly that I've never heard of or can't really stand behind okay other questions yeah yeah yeah so this rule is is like it you might add a total and deterministic by deterministic it means that there's no choice you can't choose whether you want the positive or negative square root or whatever and by total it means everybody gets one everybody in the domain or the X thing there gets it gets an a value now in the book we're gonna give a precise formal definition and if someone raises their hand at any point and says I want a formal definition I'll do it like that's the kind of question you can ask for and I that one I would actually just go ahead and do but I'm not going to do it unless you ask because it's a matter of understanding and the fact like does it does it make sense to you maybe you already know and you don't need it or there will be no chapter class where it'll be formally defined but if you feel like you need it to follow then go ahead and ask for sure that's not a function that will be a function from some limited domain so let's say you had log I would say oh that's a function from R greater than zero this little subscript I also haven't told you formally what it means but that's how I denote like a subset so it's from all positive real numbers to real numbers so I always force it to be total by changing this if I need to okay other questions so here's a question for you then so turn to a neighbor and figure out how many functions are there period notice getting how many photos from two to three and if you get that one then from M to n okay so turn to someone or figure it out for yourself but feel free to turn to a neighbor and figure out how many functions are there from the set I called - to the set I called three do you know I'd write a program [Music] okay start to wrap that up okay so first of all are any questions from thinking about it any questions from talking your neighbor any questions anywhere or is this good everything is clear enough okay so how many of these are there two total functions from this one to this one huh not sure how many functions are there solely lists um there's this one the one I already drew there's this one whoa okay okay there's two already so how many total are there yeah you know nine yeah they're nine basically each one of these guys gets to choose where it goes so there's three choices for this one three choice over this one and they multiply so there's nine nine they're kind of like 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3 and the fact that this kind of arranges into a nice grid is not a coincidence but what is what exactly is the coincidence and what isn't is it that yeah there's like a tube there's a 3x3 grid so what is the what is the actual pattern here how many functions are there from M to n yeah yeah and to the M and so what that saying is it's an M dimensional cube of N Things on each side that's the pattern and does this formula work when when say n is 0 yeah when let's say there's let's say this thing's empty so M is 0 then it was ambiguous what I wrote here this total and deterministic rule I didn't say what it really was but it's really that every dot here has to get a dot that it goes to and since there are no dots in M equals 0 the rule is vacuously satisfied but there's not Lennie choices on how to satisfy it it's like okay I did what you said but I don't I didn't do anything okay so is that one thing or no things well it did what we said to let's say that's one thing but it there is no choice involved so it's just one thing yeah it means that this this thing went to three and this thing went to three thanks for asking okay so it works even when M is zero does it work when n is zero if this thing was zero then is it true that you always get zero to the power M functions so if M is it is not zero then there are no functions there are no functions from this thing to zero because they all need a place to go and they don't know how to go so it really works when this guy is not zero and the only case left when M is not zero the only case left is when M and n are both zero and then it's a matter of kind of like convention whether what you think and zero to the zero is and in calculus they'll tell you there is no zero to the zero you need to tell me how you're limiting you know are you limiting faster on the zero or under the zero and and they're right in calculus but in natural numbers I think it's for me it's totally clear that I want this I really want this to just be the number of functions because it works in a trillion quadrillion it works in every case except possibly this one where you don't really know what it what you should mean just mean the thing that works because then you never have to think about it again and this always just counts the functions so so for us the convention is that it works perfectly just like how did people come up with like to the negative one is one half because they wanted this convention to work that like when you multiply a to the B times a to the C you get a to the B plus C and if they make this true then they get this beautiful formula and that makes like math is all about like things that are conceptually clear enough that you can just like get going and so we're gonna just make it the case that zero to zero is one there is one function from zero to zero any questions on that okay so that's that's the story of sets and functions oh there's another another one I'll use sometimes which is another set I'll use which is true false true false it's called bool so what's the difference between bool and two yeah their types are different they don't have the same elements and yet somehow it's like whenever someone uses bool and someone else is using true we know we could translate back and forth between them right I'll just make one be true and to be false for some reason as long as I doesn't matter my reasons all I know is I can translate back and forth and that notion of translating back and forth is what an isomorphous is the definition of isomorphism so we put before we go there let me talk about composition of functions and identities and then we'll be able to say what a nice and morphism is and this notion of isomorphism will work in any category you don't know what a category is but we're actually just building up the pieces that we need for categories as we're going here and soon we'll know that there this sets form a category and isomorphisms like between bool and two will make sense in any category that sort of thing so so the first to get there we need to talk about composition and composition of functions is that someone gave us a way of getting from A to B and someone else gave us a way of getting from B to C and we just kind of put them together so the composite of a function f from A to B and a function G from B to C I usually like to write it like this F semicolon G but it's more commonly written G circle f circle F and either one of those is fine this is like a circle prime for writing it backwards it's really nice and lots of cases because you just read in the order that you write F circle G it's kind of not so nice in Haskell or in programming languages because you might want to write like F of a well for various reasons we'll get into but anyway so composition means or G compose F says like G composed F of some element X what is it defined as it's G of f of X that's the definition I'll often write a colon equals to mean like this is a definition this thing is a new function what function is it G composed F is the function from four to five that well what does it do to the top thing it sends it to the third thing because you just follow the arrows there it's that good okay so the second thing goes to the fourth thing the third thing goes to this third thing I see and the fourth thing goes to the top so that's composition of functions it's like sine of cosine for some reason in calculus you're always taking derivatives and things like sine of cosine like in case just in case you need well anyway so so uh I shouldn't make fun of other subjects so you just are taking you know you're taking a big composition of functions you're just doing a lot of things in order and that happens in programming because like you you want to make modular programs you don't want to program for every possible thing that's like as long as you know as long as the number of cases you want to reuse functions over and over right and because of that you're just gonna have like this a few functions that you use in various different ways and composition is one great way of combining functions another one is parallel I mean there are other ways of combining functions I'm getting stuff because it's not parallel like parallel processors it's like you're doing two things Alice and Bob are both each doing something we're gonna combine them later but okay so this is composition of functions and then there's a fact that composition is associative and that means that if someone if there's actually like someone behind this one doing something and we first combined these two functions into one and then did this one it'll be the same thing as first doing this one and then combining these two into one right if but all it really means is you can follow paths unambiguously the fact that we wrote G composed F as like a way of taking two things in making one we could have also taken three things and made one so the formula that I'm saying is true the the associative law is that if you do e and then F and then G it's the same thing as doing E and then F and then G and the fact that you couldn't even hear the difference between the two things I said except for like minor pausing is the fact that they're the same that that's one or G of F of E is G of of okay that's called the associative law yeah yeah so it's annoying from reading like this so here's a nice way of why it's it's kind of nice is like let's say you have you wanted to know what F of a was so usually write F of a and then it gets annoying this this notation here because it's like G combo is like all backwards but what if I think of a as the pointer from 1 to that thing like though the elements of this set are exactly the pointers from 1 because if this is a then a to the 1 is a like functions from 1 to a is a so I can I can just denote this by a pointer by a little a function so this is also a pick out a and then do F and then it just reads smoothly across the board like pick out a then do F then do G so yes sure yeah sounds right i I don't know the like if left operator is a technical term but what you said sounds like if it is it's probably gonna be true uh-huh oh yeah yep yep okay so that's composition and then another important thing that seems very like not important is identity functions but identity functions are our two functions like 0 is two numbers they might have thought it was not a number for a long time or those evil if it was a number but in the end it's like a really nice number because it just is I don't know it's just a nice no we didn't have 0 you couldn't have negatives you wouldn't know what it meant that negative 3 and 3 are related it's just that 3 plus negative 3 is 0 right so the identity function on on 3 say is a function from 3 to 3 and the function is the one that decides everything to kind of itself and this function has a property that if you take any function f and you compose it with the identity so let's say f goes from A to B again there's something if you compose F with the identity on B its f and if you compose F with the identity on a it's also f so if you do this thing and then anything it's as though you didn't do the identity thing and this these two laws here these are laws or just facts about functions are called the unitl facts the associative fact is that functions are so functions compose associatively and the unitl fact is that functions as composed unitl e in other words this is a unit like it's like a 1 or kind of like it doesn't do anything function so these are these are these will eventually be called unitl laws for a category for right now 'glitch they're just kind of facts I don't know any questions about that ok so we're finally ready to say what an isomorphism is a function f from A to B it is called an isomorphism if there exists if someone so someone tells you they have a nice some morphism what they have to do is they have to exhibit a function G from B back to a such that if you do F and G its identity on a and if you do G then F its identity on B actually I should I should probably use the other notation for two reasons I really like this notation but I think that we're going to be using this one more often I think bartosh prefers this notation and that's probably more familiar so I'll try to stick with that one okay so that's the definition of an isomorphism and this is this is the when I said that two and Buhl are isomorphic actually what I said was that um you can go back and forth right that's what I said you can go back and forth and there they're the same what is this going back and forth it's that it's that I don't care if you send one to true or one to false but then send the other one to true and I know that you can kind of go back from that and and and come back where you started so this says there's a function f that's an isomorphism from two to bool because there's some function G I could pick that undoes it and not only does it undo it that G compose F is identity on two but also F then G is identity on bool and so like for all intents and purposes they're the same in the sense that someone has exhibited a way of of making them the same so any questions on that yeah yeah that's a good question so is it the case that if I have two sets and no two of these guys went to the same element of the other set are they Isum or for the two sets isomorphic so someone shook their head so y-yeah that's right yes so this one doesn't reverse it almost reverses you can get back where you started from so it's like yeah I know it it's fine it's fine I don't care they're that reverse is just fine you get back where you started no matter what but it doesn't reverse when you go starting at this one so a property like if you have a function of that sort is called a retraction and so the thing you said is almost their attraction there's if someone is totally bored and knows all this stuff like is it the case that every injection is a is part of a retraction that there's always a way to go back yeah alright so that's the technical the reason for sac is first of all thing it's a funny word but second of all because uh because bag has technical meaning in computer science and it's one where you're allowed to repeat elements so you could say that like you could you could say to is in the set is in this bag twice and I don't I don't mean bag in that sense and I don't know if we're ever going to talk about bags in that sense in this class it's just that the objection if someone had in the beginning it's okay was that and it's totally reasonable in a class for computers for computer people that that would come up okay other questions yeah multi set into the bag yes that's that's fine yeah and again I don't think we're gonna need those anyway okay so now we know what a nice morph is a minute is and why bool and two seemed so similar they're isomorphic and so I think it's where you can now define categories any questions before we do yeah yeah a functions invertible if if there's another function that when you compose them you get the identity now some people would say left invertible or right invertible that would mean like I can get the identity if I do one of them but not the other but if it's invertible in both directions and it's an isomorphism yeah yep other questions okay so um maybe this deserves its own board it's kind of so the weird thing one one one thing that's kind of whoa all right it's it's hand time I guess oh no here we go in category theory one one kind of different thing from other parts of math is how long the definitions often are they're just like go on and on and the person just writing and writing luckily though I've I've said all the parts of this definition in this example that we worked out throughout the entire day here which is that when we define a category called C you can think of C as the category of sets you don't know what the category of sets is yet but just watch as I say stuff and I'm gonna try to make sure you want you know like which parts of this definition correspond to what things you just said and this talk so far so a category consists of some stuff subject to some rules I sometimes call them constituents for a lot like a better name so what are the constituent what do you need if someone says they have a category what can you demand of them you can ask them one give me a set and I want you to call it AAB see of that elements are called objects it's not a set some people say it's a set of objects but then you don't know what an object is it's not a special set it's just a set and the elements of that we're gonna call the objects of c2 for every two objects C and D elements of this set oh sorry the objects in category of sets are sets and if you're worried about Russell's paradox we can talk about that after a class there's something called growth and eek universes that make that problem go away so we're what's what's gonna happen is we're gonna take some big big universe U and we're just going to take elements from that and make them the objects obviously okay so there is a set of objects in your category for any two objects there's a set called C denoted C C comma D this weird-looking thing as a see some people think it looks like an e this is the name of our category so C CD C of C D is the set of morphisms in C these are called morphisms from C to D okay so so far we've the thing we were talking about before the objects would be sets for any two sets there is a set of morphisms from one set to the other the set of all functions from one set to another three for each object see a chosen element ID sub C in morphisms from C to C hmm let me also say I'll denote this so if so here's a little thing for notation if f is in c CD alright f : see arrow d okay and so here I have ID C from C to C so for every set there is a a chosen element I've chosen morphism a chosen function from C to itself that is the identity function and for for uh from morphisms F so for any for any three objects CDE and function and morphism sorry morphisms F from C to D and G from D to e again you could instead write F and C C D and G and C D E there is a morphism a chosen morphism G circ F from C to E and those are the constituents for things I mean lots and lots of things because there's lots lots of these to keep track of but this is what this is what it is and by chosen what I mean is if someone tells you they have a category let's say I say oh vector spaces form a category and you say I don't know what you mean by that what you're allowed to ask me is sorry what are the objects and I say oh the objects of the vector spaces okay that makes sense and what are the morphisms from r2 to r3 because those are both vector spaces right it's like yes those are the linear transformations so if someone asks you if someone tells you they have a category you're supposed to tell them you'd be able to you're supposed to ask be able to ask them what are the objects what are the morphisms what are the identities and how do you compose and then once they tell you those things you can check them on a couple facts you can check them on on two rules and those rules are the Ru natality and associativity pretty basic rules or at least it seemed like in sets so one rule is that for any morphism f from c to d for any of c and d f cirque ID is f and f ID cirque f is f so which one is this is this identity on see your identity on D yeah I think it's C so if I do identity on C and then I do f it's the same thing as just doing F an identity on D composed F is that so that's called the unitl law it's not a law like gravity that's just like true for all time or something it's more like a rule that someone has to satisfy to give if they want to say they have a category and B for any three morphisms this is the associative law I don't know you got c1 c2 c3 e c4 you got F 1 F 2 F 3 then F 3 composed with F 2 composed with F 1 is f 3 composed with F 2 composed with F 1 and the fact that it's ambiguous like the fact that's saying it like that is so hard to hear is not a problem it's just it's actually good like there is no difference between you could just write this as f 3 composed F 2 composed F 1 and not worry about how its parenthesized okay so any questions that's a category this long string of things said yeah yeah so um so how about the category so let's say we have the objects of my C sub bad are the natural numbers okay that's a set of objects and wait what am I about to do oh I'm gonna do a mono eight sorry umm yeah so let's say the objects of C sub bad there's just one object called called smiley face and and C sub bad of C D is gonna be the natural numbers of a smiley face smiley face okay so this has one object and it's got lots and lots of arrows it's got one called one one called two one called three one called zero and one thing I could do is I could say the way you come that the identity on smiley face is zero and if I have the composite if I take a map from smiley face to smiley face called three or M and n what I'm gonna do is I'm going to take M plus n this does not violate any of these rules this would be a perfectly good category stealing a little bit of Brenda's thunder for tomorrow and this is called a ma node it's a category with one object and I miss all the things here work so it says there's one object there is for every two objects while there's only one there is a map there's a set of all maps from C to D all morphisms and those are the natural numbers and there's an identity morphism that's number three where did it go three and for any two morphisms i can compose them and i'd compose them by adding and this satisfies all the rules this one's fine but one that doesn't is m to the power n that one would fail and the reason is that m to the N to the P is not m to the N to the P so it's it violates associativity another one that would fail is if instead of composing by n equal by plus like I did which makes the unity law work if I composed by x then this would be the wrong unit because identity composed for should be four but it turned out to be zero so I'm using x so I could have the wrong unit or I could have non associativity that the help the weird example because like you probably weren't expecting this kind of category and I kind of went directly to the to it but um you see that it's non-associative here yeah okay yeah what I nope nope yeah this is so for people for programmers who know some category theory they tend to think I don't know if this is your situation but they tend to think of a very particular category namely something like a type type system or something like the category of sets I should probably try to get to that but I don't know if I will but here all I required of you to give me a category was to say that for every two objects there there is a set elements of which I'm going to call morphisms that here is a set and I'm going to call 17 a morphism and 17 composed with 32 is 1349 yeah thank you thank say it again you mean that effect of the object there's only one object no what it means is that there's only one homme set there's only one see smiley face smiley face there's only one set of morphisms they all point from that object to that object and when I compose them like one then two I get three say yeah you have a question yes yes yes yes so here's a category it's got two objects one and two so AAB you're see a knob see is 1/2 and Homme and and see from 1 to 1 is just the identity and see from 2 to 1 2 to 1 is gonna be empty and see from 1 to 2 is going to be empty and see from 2 to 2 the morphisms from 2 to 2 will just be the identity this is called the discrete category on two elements so it just kind of got this little identity there and little identity there yeah yeah yeah a lot of times people so one thing you can't a lot of people do is they write instead of C they write Homme sub C from C to D because Homme is short for homomorphism which is kind of where category theory got to start if you know what a group homomorphism is etc they would write Homme but if you don't it doesn't matter Homme is just people might call this the Homme set from C to D it's just a name but this subscript C reminds you what category you're in okay I guess that's time so feel free there's probably lots of questions feel free to come up afterwards and and ask them there's lots of people who can help answer them not just me see you tomorrow
Up Next

Category Theory 6.1: Functors Explained for Programmers
@DrBartosz
64.1K views•2016-09-29

Gain Recalibration in Hippocampal Path Integration: Math Theory
@1024kyz
144 views•2020-07-02

Fourier Series Introduction: The Big Idea Explained
@DrTrefor
387K views•2021-05-03

The Mathematical Impossibility of Accurate World Maps
@Vox
23.3M views•2016-12-02
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Mathematics











































