Mathematical justification for Le Chatelier's principle At equilibrium

$$
\begin{align}
K &amp;= \exp\left(\cfrac{TΔS^\circ - ΔH^\circ}{RT}\right)\\
⇒ \frac{\mathrm d \ln K}{\mathrm dT} &amp;= \frac{ΔH^\circ}{RT^2}
\end{align}
$$

If enthalpy change is positive, change in $\ln K$ w.r.t. $T$ is positive. Hence, $\ln K$ and therefore $K$ increase (position of equilibrium shifts to the right) as $T$ increases. And, $\ln K$ and therefore $K$ decrease (position of equilibrium shifts to the left) as $T$ decreases.

If enthalpy change is negative, change in $\ln K$ w.r.t. $T$ is negative. Hence, $\ln K$ and therefore $K$ increase (position of equilibrium shifts to the right) as $T$ decreases. And, $\ln K$ and therefore $K$ decrease (position of equilibrium shifts to the left) as $T$ increases.

Can you give a similarly mathematical reasoning for why a reaction

$$\ce{A(g) &lt;=&gt; 2 B(g)}$$

has its equilibrium position shifted to the left as the pressure of the surroundings increases?
I think that I might have an answer to my own question:

$$K=exp \left( \frac{TΔS^o-ΔH^o}{RT} \right) $$

implies that K is dependent on T, but not on total pressure of system, p (nor concentrations).

For
$$ A_{(g)}⇌2B_{(g)} $$
$$ K= \frac{{p_{B}}^2}{p_{A}} $$
Partial pressure of a gas = mole fraction (mf) x total pressure of system

If p is increased then K initially increases:
$$ K=\frac{(mf_B.p)^2}{mf_A.p} $$
$$ ⇒ K=\frac{{mf_B}^2.p}{mf_A} $$

But p doesn't affect K, yet K has increased. So the mole fraction of A must be increased by shifting the position of equilibrium to the left (thus decreasing the mole fraction of B), in order to re-establish the value of K to before p was increased.