I'm asked to find a primitive recursive formula the function: $$ f: N × N → N, f(n, k) = {n \choose k} $$
My attempt: I know that $$ {n \choose k} = \frac{n!}{k! (n-k)!} $$ and so a primitive recursive function $$ g(n, k) $$ would be: $$g(n, k) = div(fact(n), mul(fact(k), fact(sub(n - k))) $$ where div, fact, mul and sub are primitive recursive functions for integer division, factorial, multiplication and subtraction, so g would be, as a composition of primitive recursive functions, also primitive recursive. The problem is I cannot prove that f and g are actually equivalent. How can I do this? Any help would be much appreciated.