The Mathematics of Value-at-Risk