 This algebraic geometry video will just review category theory. So we'll start by giving some examples of categories. So a category has a set of objects and a set of morphisms or sets of morphisms. And a category is usually named after its objects. So we have the category of sets. Now, if we've got any two sets A and B, we can consider the set of functions from A to B. So that means the morphisms are going to be functions. Another example might be the category of groups. And if we've got any two groups, we have this notion of homomorphism between the two groups, which is a sort of function that preserves the group structure. We can also look at the category of topological spaces. And between any two topological spaces, we can consider continuous functions, which you can think of as being functions preserving the topological structure in some sense. Another example in algebraic geometry is the category of commutative rings. Ring in algebraic geometry normally means commutative ring, unless you say otherwise. And here the morphisms are again going to be homomorphisms of rings. And what category theory does is it sort of extracts the common features of these examples. So a category has a collection of objects. So the objects might be sets or groups or topological spaces or something else. And for any two objects, we have a set of morphisms between them. And these are subject to some extra conditions. For example, given objects A, B and C, we have a notion of a composition of morphisms. So if F is a morphism from A to B and G is a morphism from B to C, we have a composed morphism. We first do F then do G. So this has to be a morphism from A to C. So we can compose continuous maps and functions and homomorphisms and so on. This composed morphism has to be given as part of the structure of a category. And then there are some other conditions for each object A. There is an identity morphism. And the composition of identity morphisms with any other morphism is of course the other morphism. So identity behaves as expected, which I can't be bothered to write out. And composition is associative when defined. Of course, composition of morphisms isn't always defined. But if you've got three morphisms such that the composition of any three morphisms from A to B, B to C and C to D, then the composition of these three morphisms is well-defined and doesn't depend on the order. And one of the themes of category theory is you should really focus on the morphisms between objects rather than the objects themselves. So one example of this is how do we define products? So how do we find a product of two objects? Well, we can define a product of sets in a usual way. And we can define a product of groups where we take the underlying product of sets and then define some sort of operation on some sort of group multiplication on this product. And we can define products of topological spaces and so on. And all these definitions of products involve looking objects, and they're all rather different. I mean, the definition of the product of a topological space with another one looks nothing like the definition of a product of two commutative rings, for example. So over in category theory, we define products by not looking at the objects or the elements, which the element doesn't really make sense in category theory, but at the morphisms between them. So suppose we have two objects, A and B, and we want to define a product of A and B. Well, a product of A and B is going to be an object with a map which has morphisms to A and to B. And it has to be universal with this property. What this means is if we've got any object C, and we're given morphisms to B and A, then there's a unique morphism from C to the product, making these two diagrams commute where I commute. I mean, of course, this function is the composition of these two functions. And you can check that the product of sets, the product of topological spaces and the product of rings all have this property. It's called a universal property. Well, you may notice the product isn't actually unique because we could change A times beta to any other isomorphic set, for example. So the product is not unique, but is unique up to unique isomorphism. Well, I haven't actually defined isomorphism, but it's pretty obvious what its meaning should be. So an isomorphism is going to be morphism such that it has a two-sided inverse. So to see this, suppose we've got two products, suppose you've got two maps X and Y of A and D. So what this means is X has maps to A and B and Y has maps to A and B. And they're both universal with this property. Well, since Y is a product and X maps to A and B, there's a unique map from X to Y, making all the diagrams commute. On the other hand, since X is a product, there's also unique map from Y to X, making these diagrams commute. And the composition of these two maps is a map from Y to itself, making these commute. So by uniqueness, it must be the identity of Y. And similarly, the composition of these two must be the identity of X. So they're unique isomorphisms between X and Y, identifying them as products with each other. Now, in category three, you don't really worry about things being unique too much as long as they're unique opt unique isomorphism. So products are, although they're not unique, being unique opt unique isomorphism is in practice good enough. Well, what we're going to do is we want to make varieties or algebraic sets into a category. And there are actually at least two natural ways of doing this because we can use either regular maps which are defined everywhere. So regular maps are a sort of analog of, say, smooth maps in differential geometry. But there's a second way of making varieties and algebraic sets into a category. We can use things called rational maps, which are a little bit strange because they're not actually defined everywhere. They're a bit like rational functions, which are allowed to have a few poles. So we're first going to spend the next few lectures defining, studying regular maps between varieties and algebraic sets. And then later on we will study rational maps. Another notion you can do in category theory is to find the opposite of a category. And the opposite of category just means you reverse all arrows, where arrows is sometimes used as a word for morphism. So if you've got a category C and the opposite category C is CO, then the morphisms of CO from A to B are the same as the morphisms of C from B to A. So this is rather like duality of vector spaces. The morphisms of a vector space from A to B are the same as the morphisms of the duals of space B to the dual of space A. So taking opposite categories, there's a sort of generalization of the notion of dual of a vector space. The reason why we're interested in this is we will see that affine varieties plus regular maps turns out to be more or less dual to the category of finitely generated algebras over field K with no nil potents. So you remember if you've got a finitely generated algebra over a field with no nil potents, we can construct an affine variety from it. And given an affine variety, its coordinate ring is finitely generated algebra over K with no nil potents. However, we had the following problem. If you've got a map between varieties V and W, we don't get a map from the coordinate ring of V to the coordinate ring of W. We get a map from functions on W to functions on V. So morphisms of affine varieties from V to W will turn out to correspond to morphisms of the corresponding rings from the ring of W to the ring of V. So it goes in the wrong direction. This is one of the most confusing things in algebraic geometry. When you go from algebra to geometry, the direction of all the functions kind of gets reversed. If you've done Galois theory, you've encountered a similar problem that smaller fields correspond to bigger Galois groups. It's very, very confusing. So in the next lecture, we will show how to define regular maps between affine varieties in such way that they more or less dual to ring finitely generated algebras with no nil potents. Incidentally, the restriction to finitely generated algebras over a field with no nil potents turns out to be a real nuisance. And it's much more convenient to work with all commutative rings dropping these three conditions. And this leads to the concept of affine scheme. An affine scheme has exactly the same relation to commutative rings that affine varieties have to these special sorts of commutative rings. So when we study the theory of affine schemes, it will be like the theory of affine varieties except we allow our rings to be a bit more general.