Does $f(a,b)$ being directly proportional to $a$ and $b$ separately imply that $f(a,b)$ is directly proportional to $ab?$

For example, in physics, if $$\text{F} \propto m_1m_2$$ and $$\text{F} \propto \frac{1}{r^2},$$ then $$\text{F} \propto (m_1m_2)\left(\frac{1}{r^2}\right)= \frac{m_1m_2}{r^2}.$$

This property (combining proportionality) intuitively makes sense, but I have never seen it formally written in a textbook.

Could someone please rigorously prove this property (and fully specify its conditions?), or give a counterexample?

P.S. I know that this question has been answered, including here, but I do not understand the explanations: e.g., I don’t understand how $k=f(C)$ or $k′=g(B).$


Let $F$ be a function depending on two variables $x$ and $y$. Assume that $F$ is proportional to $x$. This means that the value of $\frac{F(x,y)}{x}$ only depends on the value of $y$. Thus for non-zero $x$ and $y$, $\frac{F(x,y)}{x}=\frac{F(1,y)}{1}$, meaning $$\frac{F(x,y)}{x}=F(1,y).$$

Further, assume that $F$ is proportional to $y$. Analogously, we acquire for non-zero $x$ and $y$, $$\frac{F(x,y)}{y}=F(x,1).$$

To prove that $F$ is proportional to $xy$, it suffices to show that $\frac{F(x,y)}{xy}$ is constant. Indeed, combining both formulas above, we obtain

$$\frac{F(x,y)}{xy}=\frac{F(1,y)}{y}=F(1,1).$$


Theorem

Let $f$ be a function with domain $\mathbb R^2.$

Then, $$f(a,b)\propto ab$$ iff $$\:f(a,b)\propto a\quad\text {and}\quad f(a,b)\propto b.$$

Proof

Suppose that $\:f(a,b)\propto a\:$ and $\:f(a,b)\propto b.$

Then, since the domain is an improper subset of $\mathbb R^2,$ $$\forall\,a,b,\quad f(a,b)=g(b)\,a\tag1$$ and $$\forall\,a,b,\quad f(a,b)=h(a)\,b.\tag2$$

Putting $b=1$ and combining $(1)$ and $(2):$ $$\forall\,a,\quad g(1)\;a=h(a).\tag3$$

Substituting $(3)$ into $(2):$ $$\forall\,a,b,\quad f(a,b)=g(1)\;ab,$$ i.e., $$f(a,b)\propto ab.$$

The proof of the converse is similar.


In the following examples, the theorem's condition is not satisfied, i.e., there's an additional dependency between variables $x$ and $y.$

  1. Let $z=y$ and $y=2x.$

    Then $z=2x.$

    Now, there exists no real $k$ such that for each $x,\;2x=k(2x^2).$

    I.e., there exists no real $k$ such that for each $x,\;z=k(xy).$

    Hence, $z$ is directly proportional to each of $x$ and $y,$ but not to $xy.$

  2. Let $z=3xy$ and $y=2x.$

    Then $z=6x^2.$

    Now, there exists no real $k$ such that for each $x,\;6x^2=kx.$

    I.e., there exists no real $k$ such that for each $x,\;z=kx.$

    Hence, $z$ is directly proportional to $xy,$ but not to $x.$