I'm interested in showing the existence of a generating function. Explicitly:


Suppose $\Lambda\subset T^\*M\times T^\*M$ is a Lagrangian submanifold. Consider the projection $\pi:(x\_1,\xi\_1,x\_2,\xi\_2)\mapsto(x\_1,\xi\_2)$. If $\pi|\_\Lambda$ is a diffeomorphism, how might I show that there exists a generating function $G(x\_1,\xi\_2)$ such that $\Lambda=\{(x\_1,\frac{\partial{G}}{\partial{\xi\_2}},-\frac{\partial{G}}{\partial{x\_1}},\xi\_2)\}$?



Generating functions and Lagrangian submanifolds
When $(M\_1,\omega\_1)$ and $(M\_2,\omega\_2)$ are symplectic manifolds then we endow $M\_1\times M\_2$ with the symplectic form $\omega\_1\ominus\omega\_2:=\pi\_1^\ast\omega\_1-\pi\_2^\ast\omega\_2,$ (where $\pi\_i:M\_1\times M\_2\to M\_i$ denotes the projection on the $i$-th factor.)


Let $\Lambda$ be an arbitrary Lagrangian submanifold of $M\_1\times M\_2,\omega\_1\ominus\omega\_2),$ and $i:\Lambda\to M\_1\times M\_2$ the inclusion map.  

Fixed $p\in\Lambda$, for any primitive $\theta$ of $\omega\_1\ominus\omega\_2$ in a neighborhood of $p,$ there exists a smooth local function $S$ around $p$ such that $dS=i^\ast\theta.$ (Because of Poincaré Lemma and $0=i^\ast(\omega\_1\ominus\omega\_2)=i^\ast d\theta=d(i^\ast\theta).$)  

Such a function $S$ is called generating function for $\Lambda,$ and, being only locally defined, it depends on the choice of $\theta.$




---


To be more specific:  

In your context $\omega\_i=d\xi\_i\wedge dx\_i$ is the canonical $2$-form on $M\_i=\mathbb{R}^{2n},$ for $i=1,2,$ and $\Lambda$ is the image of $i:(u,f(u,v),g(u,v),v)\in\mathbb{R}^{2n}\to(u,v)\in\mathbb{R}^{4n}.$  

As remarked above the local generating functions for $\Lambda$ are sensitive to our choice of the local primitive $\theta\_i$ of $\omega\_i.$


Let us choose $\theta\_1=\xi\_1 dx\_1$ and $\theta\_2=-x\_2d\xi\_2.$  

Then the corresponding generating function is determined (up to a constant) by $dS=i^\ast(\theta\_1\ominus\theta\_2)=fdu+gdv,$ i.e.: $f=\frac{\partial S}{\partial u},\ g=\frac{\partial S}{\partial v}.$


