Distributive lattices and coherence in homological algebra