Democratic Foundations of Fair AI via Social Choice