The three foundations of learning