Convex Optimisation I: Theory