Let $L=\mathbb{R}^2\times U(1)$ be the trivial $U(1)$-bundle over $\mathbb{R}^2$. Define a connection $\nabla=d+A$ where $A=fdx+gdy$ is an $\mathbb{R}$ valued $1$-form on $L$. That is, $\nabla$ gives a distribution $\mathcal{H}$ on $L$ - the horizontal distribution.
The distribution $\mathcal{H}$ is obtained as the graph of $-A$ as a linear map from $\mathbb{R}^2\rightarrow\mathbb{R}$. A horizontal lift $\tilde{X}$ of a vector field $X$ on $\mathbb{R}^2$ is given by $\tilde{X}=(X,-A(X))$.
Let $\alpha$ be the projection onto the vertical direction on $L$ i.e. $\ker(\alpha)=\mathcal{H}$, and define the curvature $2$-form $\Omega_{\nabla}$ of the connection $\nabla$ by
$$\Omega_{\nabla}(X,Y)=\alpha([\tilde{X},\tilde{Y}])$$
The following is expected to be true $$\Omega_{\nabla}=-dA?$$
Here is my confusion:
Let $z$ be the local vertical coordinate, $X=\partial_x$ and $Y=\partial_y$. Then $\tilde{X}=-f\partial_z+\partial_x$ and $\tilde{Y}=-g\partial_z+\partial_y$. And $$-dA(X,Y)=-X(A(Y)+Y(A(X))+A([X,Y])=-\partial_xg+\partial_yf$$ while $$[\tilde{X},\tilde{Y}]=(f(\partial_zg)-g(\partial_zf)-\partial_xg+\partial_yf)\partial_z$$ therefore $$\Omega_{\nabla}(X,Y)=\alpha([\tilde{X},\tilde{Y}])=f(\partial_zg)-g(\partial_zf)-\partial_xg+\partial_yf.$$ Where is the mistake? Thank you.
A horizontal vector field should be in the kernel of your connection. In your case $\tilde{X}$ cannot be the lift of $X$ as it is not horizontal (the same applies to $\tilde{Y}$). In your coordinates, the horizontal distribution can be written as $\alpha (-g \partial_x + f \partial_y) + \gamma \partial_z$ where $\alpha$ and $\gamma$ are smooth functions on $P$.