In the convex constrained optimization problem:
\begin{align} & min \quad f(x) \\ & s.t \quad g_i(x) \leq 0 , \quad i = 1, ... m \\ & \quad \quad h_j(x) = 0, \quad j = 1, ..., n \end{align}
I don't understand why the equality constraints must be affine functions. There is another similiar question but I still don't get it.
If we define $h(x) = p(x) + c = 0$ in which, $p(x)$ is convex and $c \in \mathbb R$, $h(x)$ will be also convex as prove below:
\begin{align} p(tx + (1-t)y) &\leq tp(x) +(1-t)p(y) \\ p(tx + (1-t)y) + c &\leq tp(x) +(1-t)p(y) + tc + (1-t)c \\ p(tx + (1-t)y) + c&\leq t(p(x)+c) +(1-t)(p(y)+c) \\ h(tx + (1-t)y) &\leq th(x) +(1-t)h(y) \end{align}