  We describe an algebraic way to code the causal information of a discrete
spacetime. The causal set C is transformed to a description in terms of the
causal pasts of the events in C. This is done by an evolving set, a functor
which to each event of C assigns its causal past. Evolving sets obey a Heyting
algebra which is characterised by a non-standard notion of complement.
Conclusions about the causal structure of the causal set can be drawn by
calculating the complement of the evolving set. A causal quantum theory can be
based on the quantum version of evolving sets, which we briefly discuss.
