  Heaps of pieces were introduced by Viennot and have applications to algebraic
combinatorics, theoretical computer science and statistical physics. In this
paper, we how certain combinatorial properties of heaps studied by Fan and by
Stembridge are closely related to the properties of a certain linear map
$\partial_E$ associated to a heap $E$. We examine the relationship between
$\partial_E$ and $\partial_F$ when $F$ is a subheap of $E$. This approach
allows neat statements and proofs of results on certain associative algebras
(generalized Temperley--Lieb algebras) that are otherwise tricky to prove. The
key to the proof is to interpret the structure constants of the aforementioned
algebras in terms of the maps $\partial$.
