A modular relation for the chromatic symmetric functions of (3+1)-free posets

We consider a linear relation which expresses Stanley's chromatic symmetric function for a poset in terms of the chromatic symmetric functions of some closely related posets, which we call the modular law. By applying this in the context of (3+1)-free posets, we are able to reduce Stanley and Stembridge's conjecture that the chromatic symmetric functions of all (3+1)-free posets are e-positive to the case of (3+1)-and-(2+2)-free posets, also known as unit interval orders. In fact, our reduction can be pushed further to a much smaller class of posets, for which we have no satisfying characterization. We also obtain a new proof of the fact that all 3-free posets have e-positive chromatic symmetric functions.