This note proceeds the previous note on the topoi of sheaves on topological spaces. The plan at the moment is not to introduce various results of Grothendieck topoi but to covey the readers on how this concept of Grothendieck topology and topos generalizes the ordinary notion of sheaves on topological spaces. The purpose is to provide a stepping stone toward our next topic which is about the Lawvere–Tierney topology.
So far we have used the structure of open sets $\mathcal{O}(X)$ to model the concept of locality. For each open $U \in \mathcal{O}(X)$, we attach a set of data locally to $U$, which means basically to define a functor $\mathcal{O}(X)^{op} \to \mathbf{Set}$ where $\mathcal{O}(X)$ is seen as a category. Hence, a straightforward generalization of the usual notion of topology in our point of view is to replace $\mathcal{O}(X)$ with an arbitrary category $\mathcal{C}$ with some structure.
For an object $C$, we say $S$ a sieve on $C$ when $S$ is a family of morphisms to $C$ such that \[ (f : X \to C) \in S \Rightarrow f \circ g \in S \] for any $g : Y \to X$. (Note that it is equivalent to a subsubject of $\mathbf{y}_C$ in $\mathbf{Sets}^{\mathcal{C}^{op}}$.) Given a morphism $h : D \to C$, define a mapping from the sieves on $C$ to the sieves on $D$ by \[ h^* : S \mapsto \{f \mid h\circ f \in S\}. \] Intuitively, seeing $C$ as an open set, a sieve on $C$ is a collection of opens in $C$. Hence, a topology determines amongst the sieves, which are open coverings: A mapping $J$ is a Grothendieck topology if it maps each object $C$ to a collection of sieves on $C$ such that
A pair $(\mathcal{C}, J)$ of a small category and its Grothendieck topology is called a site. As the analogy between $\mathcal{O}(X)$ and $(\mathcal{C}, J)$ suggests, we call a sieve $S$ on $C$ a $J$-covering of $C$ when $S \in J(C)$.
A presheaf on a small category $\mathcal{C}$ is a contravariant functor $P : \mathcal{C}^{op} \to \mathbf{Set}$ and we write $\mathbf{PSh}(\mathcal{C})$ for the functor category. For a presheaf $P$ and a Grothendieck topology $J$, for a cover $S \in J(C)$, a matching family assigns to each $(f : D \to C) \in S$ an element $x_f \in P(D)$ such that \[ P(g)(x_f) = x_{f \circ g} \quad \text{for each }g : E \to D. \] We call an element $x \in P(X)$ an amalgamation of the matching family if \[ P(f)(x) = x_f \] for each $f \in S$. A sheaf for $J$ is a presheaf where every matching family has a unique amalgamation.