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).$