Independent Quantities in Canonical Transformations I was looking through some lecture slides and I came across this page:

I understand that the equation highlighted blue (top right corner) is obtained from the Principle of Least Action. Given a generating function $F(q, Q)$, its time derivative can be expressed in terms of q and Q. Substituting dF/dt into the 'POLA equation' (please correct me with names), we get the first equation highlighted yellow. 
My question is, why is it that we are able to equate components like did in the slide to get expressions for $Q$, $p$ and $K$? If its because $p$, $q$, $P$, $Q$ are independent, how will I prove that their  independence?
 A: *

*Consider the Hamiltonian Lagrangian one-form
$$\mathbb{L}_H~:=~\sum_{i=1}^np_i \mathrm{d}q^i-H \mathrm{d}t \tag{1}$$
and the Kamiltonian Lagrangian one-form
$$\mathbb{L}_K~:=~\sum_{i=1}^n P_i \mathrm{d}Q^i-K \mathrm{d}t. \tag{2}$$
In order to guarantee that the two Lagrangian one-forms (1) & (2) lead to equivalent stationary action principles
$$ S_H~:=~\int \! \mathbb{L}_H, \qquad S_K~:=~\int \! \mathbb{L}_K, \tag{3}$$
and equivalent EL eqs. (aka. the Hamilton/Kamilton eqs.), we impose that their difference
$$\mathbb{L}_H-\mathbb{L}_K ~=~\mathrm{d}F \tag{4} $$ 
is an exact 1-form off-shell, i.e. a boundary term in the action (3). The one-form identity (4) leads to a standard definition$^1$ of a CT. The $2n+1$ components of the one-form identity (4) yield $2n+1$ independent conditions for a CT, cf. OP's question.

*Concretely, the lecture slide considers a so-called type 2 CT. Here the $2n$ variables $(Q^k,p_{\ell})$ are functions of $2n+1$ independent variables $(q^i, P_j,t)$. 
--
$^1$ For various definitions of a CT, see e.g. this Phys.SE post.  
