  In many sciences one often builds large systems out of smaller constituent
parts. Mathematically, to study these systems, one can attach data to the
component pieces via a functor F. This is of great practical use if F admits a
compositional structure which is compatible with that of the system under study
(i.e. if the local data defined on the pieces can be combined into global
data). However, sometimes this does not occur. Thus one can ask: (1) Does F
fail to be compositional? (2) If so, can this failure be quantified? and (3)
Are there general tools to fix failures of compositionality? The kind of
compositionality we study in this paper is one in which one never fails to
combine local data into global data. This is formalized via the understudied
notion of what we call a lavish presheaf: one that satisfies the existence
requirement of the sheaf condition, but not uniqueness. Adapting \v{C}ech
cohomology to presheaves, we show that a presheaf has trivial zeroth
presheaf-\v{C}ech cohomology if and only if it is lavish. In this light,
cohomology is a measure of the failure of compositionality. The key
contribution of this paper is to show that, in some instances, cohomology can
itself display compositional structure. Formally, we show that, given any
Abelian presheaf F : C^op --> A and any Grothendieck pretopology J, if F is
flasque and separated, then the zeroth cohomology functor H^0(-,F) : C^op --> A
is lavish. This follows from observation that, for separated presheaves,
H^0(-,F) can be written as a cokernel of the unit of the adjunction given by
sheafification. This last fact is of independent interest since it shows that
cohomology is a measure of ``distance'' between separated presheaves and their
closest sheaves (their sheafifications). On the other hand, the fact that
H^0(-,F) is a lavish presheaf has unexpected algorithmic consequences.
