 This lecture is part of an online course in algebraic geometry about schemes and we will be discussing morphisms of schemes. So there is an obvious definition of a morphism of a scheme, which is to define it to be morphism of ringed spaces. Unfortunately, this doesn't work. It gives the wrong answer. And we have to use a less obvious definition of morphism, which we're going to define a morphism of schemes to be a morphism of locally ringed spaces. So a locally ringed space is just a ringed space such that every stalk is a local ring. And a morphism of locally ringed spaces is not defined to be just a morphism of ringed spaces, but a morphism of ringed spaces with an extra property that we will see later. So first let's start by discussing what is a morphism of ringed spaces. So let's motivate this by taking two topological spaces X and Y and taking a continuous function between them. Now X is open sets U and for each open set U we have a sheaf taking values on U. So the sheaf of X is going to be the sheaf of continuous real valued functions on X. So OX of U is just the continuous real valued functions on Y. And similarly, if we've got a set, open set Y, V inside Y, then we have a ring OY of V. And now suppose that F of U is contained in V. And then we get a restriction map from any continuous function on V to a continuous function on U. So we get a map between these rings. And this data is more or less what you use to define a morphism of ringed spaces. The morphism of ringed spaces consist of first a continuous map from X to Y, where X and Y are the underlying spaces. And secondly, for each U such that F of U is contained in an open set V, we have a map from OY of V to OX of U that has to be compatible with all sorts of restriction homomorphisms and so on. If you unravel this, what it means is we've actually got a map of sheaves from O of Y to F star O of X. If you unravel the definition of F star O of X, you find a morphism from this to this is essentially just the same as a morphism like this. Alternatively, we can think of this as being a homomorphism of sheaves from F to the minus one O of Y to O of X. So these two sorts of morphisms are equivalent. Technically speaking, this functor is a joint to this functor, so it doesn't really matter which you work with. We can define a morphism of ringed spaces to be a continuous map from X to Y together with an element of whichever one of these two sets. You prefer so that these are going to be homomorphisms of sheaves of rings. So that gives us a homomorphism of ringed spaces. And it's hard to see what's wrong with it. Well, if you look carefully, there is a bit of a problem. So suppose we have a homomorphism of rings. So these are rings. And then it's easy to see this induces a homomorphism of ringed spaces from spec of S to spec of R. I'm not going to give the details of this because it's completely routine. For instance, any prime ideal, you can take an inverse prime there. So we get a map from the underlying space of that to the underlying space of that. And then you can define homomorphisms of sheaves. Now, if you've got the spectrum of a ring R, then you can take the global sections of its sheaf. So the global sections of a sheaf just mean the values of a sheaf on the whole space, which is spectrum of R. But it's useful to use this notation gamma for global sections. So gamma just means global sections. And similarly, we have the global sections of O of spec of S. And the morphism of ringed spaces induces a homomorphism of rings from this space to that space. And this space, as we saw, is just a rather complicated way of talking about the ring R. And this space is just a complicated way of talking about the ring S. So we've got a homomorphism of rings from R to S. So let's see what we've got. If you've got a homomorphism of rings, we get a homomorphism of ringed spaces. And if we've got a homomorphism of ringed spaces, we can get back a homomorphism of rings. And it's easy to check that if you start with a homomorphism of rings, go to morphism ringed spaces and then back to here. The composition of these two maps is the identity. So what exactly is the problem? The problem is that this map here is injective, but not surjective in general. And this map here is surjective, but not injective. The problem is, there turn out to be, you can sometimes get morphisms of ringed spaces that don't come from homomorphism of rings. And this is a real headache. So let's see an explicit example of such a funny homomorphism of rings spaces. So I'm going to take R to be ZP. This is the integers localized at the prime P, which consists of all integers M over N with P, not dividing N. And I'm going to take S to be the rational numbers. And you notice there's exactly one homomorphism of rings from ZP to Q, which is just the obvious embedding. So we've got one map from R to S. And now let's look at the spectra of these spaces or spectrums. I'm never quite sure what the plural is. So the spectrum of R has two points. One point comes from the maximal ideal P. And the other point comes from the ideal zero. And we can look at the stalks at these two points. So the stalk here is just the rational numbers Q. And the stalk at this point here is just ZP. And this ring here has just one point because it's a field and the stalk is just the rational numbers. So if this is spectrum of R and this is spectrum of S, we can define a natural map F from the spectrum of S to the spectrum of R. So it has to take this point to a point here. And you can see it actually takes it to the green point because the inverse image of zero is just zero. And now this gives the homomorphism of locally-ringed spaces as a topological map. We've also got to define what it does to sheaves. And the easy way is just to take the map from F from minus one of O of spectrum R. And we want to map from this to this sheaf here. The sheaf over S, you can really just identify it with its stalk because it's only got one point. And this space is just Q. So we've just got the identity map from Q to Q. And this gives us the homomorphism of ringed spaces corresponding to the homomorphism of rings. However, there is a second homomorphism of ringed spaces, which goes like this. So here we can take our blue point. And instead of mapping it to the green point, we can map it to the purple point. And let's call this morphism G. And to define a homomorphism of ringed spaces, we need to say what it does to sheaves. So we look at what is G to the minus one of O spectrum R. And this time it's just ZP. So here we've got the, we pull back the inverse image of this stalk, which is just ZP. And in order to define a homomorphism of ringed spaces, we need to define a map from this to the stalk of this point, which is just Q. And this is easy because we can just take the natural embedding from ZP to Q. So this is a second homomorphism of ringed spaces. So we've got two homomorphism of ringed spaces from the spectrum of S to the spectrum of R, but only one homomorphism of rings from R to S. And this is a good morphism. And this is a bad morphism. That messes everything up. We don't want to have morphisms like this. So we need to figure out what is wrong with it exactly. Well, we need to add a condition that excludes these sorts of homomorphisms. We want to add condition to exclude bad morphisms of ringed spaces. We need to figure out what bad actually means. So let's take a look at a geometric example. Suppose you've got a space X and Y, and we will again think of these as being topological spaces. We might take a point P here. This is a homomorphism from X to Y, and the point P might have an image F of P. And if G is a function on V, suppose F P is contained in some open set V, and it vanishes at F of P, if and only if its pullback G F vanishes at the point P. It's rather obvious. Well, now we can consider a map from the local ring at F P to the local ring at P. This map is just the obvious thing where you just sort of take a function here and pull it back to there. And we see that the maximal ideal here is equal to the inverse image of the maximal ideal here. And this fact is really just the same as what we said here. We said a function vanishes at F P, if and only if it vanishes at P. Well, the maximal ideals of the local rings in this particular case are just the functions vanishing at a point. So when our sheaf of a ringed space is just a sheaf of real valued functions, we see that we have this extra condition that the maximal ideal of a local ring gets pulled back to the maximal ideal. And this is going to be the extra condition we need. So we say that a homomorphism R to S of local rings is called a local homomorphism. If the maximal ideal of R is equal to F minus one, this is F of the maximal ideal of S. So let's see an example where this fails. Let's just take Z P and map it to Q. So here the maximal ideal is nought and here the maximal ideal is multiples of P. So we can see that F minus one nought is not the maximal ideal. So this is not a local homomorphism. And if we go back to the picture we had earlier, we see that we're getting this bad, none local morphism of local rings. So this is not a local homomorphism. So this is this sort of morphism of ringed spaces kind of corresponds to some sort of very weird function of ringed spaces where you take a function that has a zero here and pull it back. And it's no longer zero here or something like that. Very unsatisfactory. So we can now define a morphism of locally ringed spaces is a homomorphism of ringed spaces such that each induced homomorphism of local rings is a local homomorphism. And you can check that if you've got a homomorphism of rings, then you can take the induced homomorphism of locally ringed spaces. Then this is a homomorphism of locally ringed spaces. So you can easily check that it has this property on local rings. I'm not going to check this in detail because it's fairly straightforward. Now suppose A and B are rings and suppose you've got a map from the spectrum of B to the spectrum of A. And we want to know, does this come from a homomorphism of rings from A to B? Well, let's take a look. First of all, F certainly induces some homomorphism from A to B. Remember, A is the global sections of some sheaf over this and B is the global sections. So F induces a homomorphism of rings. And we can take a prime ideal P of B and look at the stalk of P. And there will also be a point F of P here. So we can look at the stalk of A F of P, which will be the localization of A at P. And now there are two possible ways to get a prime of A from P. First of all, we can take F of P, the image under this map here. Alternatively, since P is a prime of P, we can take phi to the minus one of P. And are these the same? Well, in general, they're not. In the example we saw earlier, these are two different maps. One of them was zero and one of them was all multiples of P. But now suppose that this map here is a local homomorphism. Then if we take the point P here, we can pull it back to B. And we can pull it back here to get phi to the minus one of P. On the other hand, if it's a local homomorphism, then its image here is going to the maximal ideal of A F P. And if we pull that back, we will get F of P. So this diagram commutes. So if this is a local homomorphism, this implies that F of P equals phi to the minus one of P. So the two possibly different maps from this space to this space, the one given by the homomorphism of ring spaces and the one induced by the homomorphism of rings are in fact the same. And from this it easily implies that the F is induced by the homomorphism phi from A to B. So F does indeed come from a homomorphism of local rings. And I'm not going to give details of this. I'll just leave this as an exercise because the tricky part is showing this condition here. And once you've done that, the rest is fairly straightforward. So to summarize what we've done so far. Homomorphisms of rings from R to S are the same as homomorphisms of locally ring spaces from spec of S to spec of R. What this means is the category of rings is equivalent to the opposite of the category of affine schemes. So saying that opposite just means the direction of morphisms changes. So here we've got a map of rings from R to S, but the map between the spectra goes in the opposite direction. So opposite just means the reverse direction of all arrows. And saying two categories are equivalent means roughly that there's a natural correspondence between homomorphisms of elements in one category and homomorphisms between corresponding elements in the other category. The exact definition of equivalence of categories is a bit technical and hairy and I'm not going to give it, but it's kind of reasonably obvious what's going on. So advantage of this is we can now define morphisms of schemes in, well, we can now handle morphisms of schemes in a reasonably easy way. It may have occurred to you that the definition of a morphism of scheme is really rather difficult to work with. And nobody wants to check that something is a morphism of schemes by going back to the definition, but we can now construct morphisms of schemes much more easily. So suppose we've got a scheme X and a scheme Y. What we do to construct morphism is we just cover Y by affine schemes, by affine sub-schemes, should say by open affine sub-schemes. And then we cover X by lots of little open affine sub-schemes such that the image of each open sub-scheme of X will be in the image of some open sub-scheme of Y. So for each X, so for each open sub-scheme, so open affine sub-scheme. So for each open affine sub-scheme in our cover, choose a map to some open affine sub-scheme of Y. And this is easy because we know the maps from the affine sub-schemes of X to affine sub-schemes of Y because they're just given by homomorphisms of rings. And we are supposed to know that homomorphisms of rings. And now we have just have to check these are compatible on all intersections. And if we do that, then we will get a homomorphism of locally ringed spaces. In other words, a morphism of schemes. So this is why we really want the morphisms between affine schemes to correspond exactly to homomorphisms of rings, because this gives us total control over morphisms of affine schemes. And once we have control over morphisms of affine schemes, we can get good control over morphisms of schemes just by covering them by affine schemes. I'll just finish off with an example. Let's show the plane C squared minus the origin or more precisely the corresponding scheme is not affine. In other words, it's not an isomorphic to an affine scheme. Well, if you take the scheme C squared minus naught, in other words, you just take the scheme spectrum of CXY and remove the origin from it. We've got a natural map from this scheme to that scheme because it's just an open sub-scheme. However, if you look at the ring of global functions on this, the ring of global functions we calculated earlier was CXY and the ring of global functions on this was also CXY. So if this were an affine scheme, the morphisms from this scheme to any other scheme would correspond exactly to morphisms of rings from this ring to this ring. However, since this is an isomorphism, it would mean that this scheme would have to be isomorphic to this ring if it were affine. But since it obviously isn't isomorphic to this ring, this is not affine. Okay, that's all about morphisms of schemes.