Let $ f \colon \mathbb{N}^2 \rightarrow \mathbb{N} $ be a primitively recursive function, and let $ g \colon \mathbb{N}^2 \rightarrow \mathbb{N} $ be defined as: $$ g(x,y)=\min \{f(0,y), f(1,y),...,f(x,y)\}, x,y \in \mathbb{N}.$$ Prove that $g$ is primitevely recursive.
My idea was to write the function $g$ in the bracket form of cases, where the cases would represent predicates. The problem is that then the predicates would not be mutually exclusive ( there could be $f(i,y)=f(j,y) , i \neq j $)
$g(0,y)=f(0,y)$ and $g(x+1,y)=\min(g(x,y),f(x+1,y))$.