I have a question regarding the restrictive nature of $\forall(R)$ and $\exists(L)$ rules in sequent calculus LK. I don't really understand why the restrictions exists in the first place, so why:
$$ \frac{\Gamma \to \Delta, A(b)}{\Gamma \to \Delta, \forall x A(x)} $$
Does this have the restriction that the variable $b$ cannot be found the in the conclusion (similarly for $\exists$ left). This is coming from having trouble understand why $\forall x \exists y Pxy \to \exists y \forall x Pxy$ is invalid. But if I understood the restriction maybe I would understand why that sequent is invalid! Thank you!
If $b$ is in $\Gamma$ or in $\Delta$, then the occurrence of $b$ in $A$ might depend on some formulas of $\Gamma$ or $\Delta$. If such a dependency exists, you cannot just replace $A(b)$ with $\forall x A(x)$.
$\forall x A(x)$ means that A is valid for any $x$ (so no dependencies). Now, say $b$ occurs in some formulas of $\Gamma$ or of $\Delta$. Then the occurrence of $b$ in $A$ might depend on other variables, which means that $A$ is not valid for all $b$, but for just some $b$. Therefore, you can't conclude that $A$ is valid for all $x$, where $x$ substitutes $b$.
Briefly, we want $b$ not to occur free in $\Gamma$ or in $\Delta$ because else, $R\forall$ extinguishes a possible dependency on $b$. In a dual way, we need this constraint for $L\exists$ too, because this rule might create non-existent dependencies. You can see this at the "deduction" below, for the example sequent.
$\forall x \exists y Pxy \to \exists y \forall x Pxy$ is indeed invalid. In formula $\forall x \exists y Pxy$, $y$ might depend on $x$, while in formula $\exists y \forall x Pxy$, variable $y$ is common forall $x$.
If there weren't those constraints for $L\exists$ and $R\forall$, a deduction for $\forall x \exists y Pxy \Rightarrow \exists y \forall x Pxy$ in LK would be $$Pxy\Rightarrow Pxy\\ \exists yPxy\Rightarrow Pxy\\ \exists yPxy\Rightarrow \forall x Pxy\\ \forall x\exists yPxy\Rightarrow \forall x Pxy\\ \forall x\exists yPxy\Rightarrow \exists y\forall x Pxy$$
The rules applied are $L\exists, R\forall, L\forall$ and $R\exists$ in this order.
Now, if $b$ occurs free in a formula $B$, where $B\in\Gamma$, then $\forall b B(b)$ wouldn't remove or create any dependencies on $b$, since $\forall b B(b)$ is valid when $b$ has only free occurrences in $B$ and $B$ is an assumption. It does matter the fact that $B$ is an assumption, because dependencies are built on the variables of the conclusions from the assumptions. Since $B$ is an assumption and not a conclusion, there is no dependency on $b$ in $B$.
For the case of $R\exists$, if $b$ is free in a formula of $\Gamma$, then $\exists bA(b)$ wouldn't create or remove any dependences on $b$ in $A$. $\exists b A(b)$ is valid if $b$ has only free occurrences in $A$ and $A$ is a conlusion (hence, it cannot create any dependencies).
To sum up...
Quantifier $\forall$ can be considered as an "operator" on variables which removes dependencies and quantifier $\exists$ as an "operator" that creates them. But only assumptions create dependences and only conclusions can remove them. So, applying $\forall$ in the assumptions makes no harm (since assumptions can only create dependencies and $\forall$ is an "operator" that can only remove dependencies). Dually, applying $\exists$ in a conclusion makes no harm.