This post is incomplete. It is intended to be a summary of Hartshorne 2.1 plus a bit more.

Random words/My thoughts/Motivation(?!)

Very often we encounter functions that satisfies “local property”, e.g. continuous, differentiable, smooth functions on manifolds. An idea is that an object can be described by the functions we “allow” on them, e.g. a topological manifold is a manifold with allowed functions being continuous maps, whereas a smooth manifold is a topological manifold with allowed functions being “smooth” maps. Of course, smoothness is not something defined on a topological manifold, but we can try to extract all the smooth functions (defined over any open set), and look at them as a whole. For this purpose, we would need some terminology that allows us to track functions defined on an open set, and allows us to restrict a function to a smaller open set.

This is where presheaves and sheaves come in. A presheaf is something that tries to track data (aka functions) while allowing restrictions. While “restriction” in this sense can be arbitrary, a sheaf imposes more conditions in order to make the “global” functions depend on “local behaviour”.

Definition 1 (Presheaf) Let $X$ be a topological space. A presheaf $\mathcal{F}$ on $X$ is a collection of abelian groups $\mathcal{F}(U)$ for every open set $U$ of $X$.  We also have the restriction morphisms $\rho_{UV}: \mathcal{F}(U) \rightarrow \mathcal{F}(V)$ for open sets $V \subset U$. They are subjected to the following axioms,

1. $\mathcal{F}(\emptyset) = 0$
2. Restriction on itself is identity: $\rho_{UU} =$ identity
3. Composition of restriction: $\rho_{UW} = \rho_{VW} \circ \rho_{UV}$ for open sets $W \subset V \subset U$.

Remark

1. The definition above defines a presheaf of abelian groups. We can of course deal with other categories and consider respective morphisms. However, according to the wikipedia page the first condition is dropped. It is somehow embedded into the definition of sheafs and only when we deal with concrete categories, i.e. a category with a faithful functor to the category of sets.
2. Consider the category whose objects are the open subsets of $X$, and the morphisms are the inclusion maps. A presheaf can then be defined as a contravariant functor from this category to the category of abelian groups.
3. Some terminologies:
Suppose $U$ is open, and $s \in \mathcal{F}(U)$. $s$ is then called a section of $\mathcal{F}$ over $U$.
If $V \subset U$, then the restriction of $s$, i.e. $\rho_{UV}(s)$ is often denoted by $s |_{V}$.

Definition 2(Sheaf) A sheaf $\mathcal{F}$ on $X$ is a presheaf subjecting to two more conditions:

1. (Identity axiom) Let $U$ be open with an open cover $\bigcup U_j$, and let $s \in \mathcal{F}(U)$. If $s |_{U_j} = 0$ for each $U_j$, then $s = 0$.
2. (Gluing axiom) Let $U$ be open with an open cover $\bigcup U_j$, and let $s_j \in \mathcal{F}(U_j)$. If for any $i,j$ we have $s_i |_{U_i \cap U_j} = s_j |_{U_j \cap U_i}$, then there exists $s \in \mathcal{F}(U)$ such that $s |_{U_j} = s_j$ for all $j$ in the index set.

Remark

1. The gluing axiom means that if a bunch of elements are compatible, then one can glue them. The identity axiom then says that this patching is unique.
2. The identity axiom has to be modified in general category, because a zero object may not exist. We change it to if s and t are locally the same, then they are the same.

Stalk, sheafification, effects on stalk.

Maps, kernel, cokerenel, image, quotient, pushforward, pullback

Examples: diff/cts functions, constant sheaf, sheaf hom, skyscraper sheaves

Constructions: direct sum/product, direct limit/inverse limit, extension by 0, gluing.

Notions: support of sheaves, flasque sheaves.