Foundations of discrete mathematics