Representing electromagnetic tensor as the curl of four vector potential and Lorentz gauge condition [Question is from electrodynamics section of 2nd chapter in Weinberg's Cosmology and gravitation text book]
This section first introduces electromagnetic tensor and reduces Maxwell's four equations into just two.
$\partial_{\alpha} F^{\alpha\beta} = -J^\beta \tag{2.7.6}$
$\epsilon^{\alpha\beta\gamma\delta} \partial_{\beta} F_{\gamma\delta} = 0  \tag{2.7.7}$
Where F is the electromagnetic tensor, J is the current density four vector and $\epsilon$ is the levi civita symbol.
Later in this section it says that equation (2.7.7) allows us to write $F_{\gamma\delta}$ as the curl of a four vector A.
$F_{\gamma\delta} = \partial_{\gamma}A_{\delta} - \partial_{\delta}A_{\gamma} \tag{2.7.11}$
How exactly is equation (2.7.7) allowing us to write F as curl of A ?
(2.7.11) satisfies equation (2.7.7) but does that alone make it a valid assumption?
Then the textbook reads, "we can change $A_\gamma$ by a term $\partial_{\gamma} \phi$ without affecting $F_{\gamma\delta}$. So $A_\gamma$ may be defined so that $\partial^\alpha A_\alpha =0 \tag{2.7.12}$
Here changing $A_\gamma$ by a term $\partial_{\gamma} \phi$ means adding this term, right?
And how are we defining $A_\gamma$ as $\partial^\alpha A_\alpha =0 $ ?
[ I understand this is called gauge condition]
 A: *

*For your first question, you're right that $(2.7.11)$ satisfies $(2.7.7)$. The converse holds locally (on contractible domains such as open balls, or ellipsoids or the whole of $\Bbb{R}^4$ for example), and this is known as Poincare's lemma. In terms of differential forms, $F$ is a $2$-form and $(2.7.11)$ says "$F$ is exact" while $(2.7.7)$ says "$F$ is closed", and Poincare's lemma says "all closed forms are locally exact". Note that this is the higher dimensional analogue of facts you're probably well aware of from vector calculus: that "vanishing divergence implies locally there exists a vector potential" ($\nabla \cdot \mathbf{B}=0$ implies $B=\nabla \times \mathbf{A}$ locally), and that "vanishing curl implies locally is a gradient" (i.e $\nabla \times \mathbf{E}=0$ implies $\mathbf{E}=\nabla \phi$ locally). For the special case that we work in a star-shaped open neighborhood of the origin in $\Bbb{R}^n$ (yes this works for $\Bbb{R}^n$ even for $n\neq 4$), by explicitly carrying out the proof of Poincare's lemma we have
\begin{align}
A_{\beta}(x)&=\int_0^1tF_{\alpha\beta}(tx)\,dt\cdot x^{\alpha}.
\end{align}
I leave it to you to carry out the explicit differentiation under the integral sign etc to show that $(2.7.11)$ follows from the assumption $(2.7.7)$.


*"Here changing $A_{\gamma}$ by a term $\partial_{\gamma}\phi$ means adding this term right?" Yes. In terms of differential forms, this is also succinctly stated as "if $F=dA$ and $\phi$ is a smooth function then $d(A+d\phi)=dA+d(d\phi)=dA+0=F$".


*One basically has to choose $\phi$ to solve an appropriate non-homogeneous wave equation. Now, I'm not too sure about PDE theory but I would guess that under nice conditions, simple constant-coefficient PDEs (such as the wave equation) are guaranteed to have local solutions. So, for simplicity, let me suppose we're working
in $\Bbb{R}^4$ with the flat Lorentzian metric, say signature $(-,+,+,+)$ (I set speed of light $c=1$ for convenience). Suppose we have found $A$ such that $F=dA$ (i.e $2.7.11$ holds). Then consider $A'=A+d\phi$. Then the divergence-free condition $(2.7.12)$ holds for $A'$ if and only if
\begin{align}
\partial^{\alpha}(A_{\alpha}+\partial_{\alpha}\phi)&=\partial^{\alpha}A_{\alpha}+(\partial^{\alpha}\partial_{\alpha}\phi) =0,
\end{align}
i.e if and only if
\begin{align}
\partial^{\alpha}\partial_{\alpha}\phi&=-(\partial^{\alpha}A_{\alpha})
\end{align}
Note that we are given $A$ so we know the RHS; let us call it $-f$. This is a wave-equation for the unknown function $\phi$:
\begin{align}
-\frac{\partial^2\phi}{\partial t^2}+\frac{\partial^2\phi}{\partial x^2}+\frac{\partial^2\phi}{\partial y^2}+\frac{\partial^2\phi}{\partial z^2}&=-f
\end{align}
(We can also write it as $\Delta_g\phi=-f$, i.e the "Laplacian with respect to the metric tensor $g$" equal to $-f$). If we manage to solve this equation, then we can find the desired $A'$ which satisfies the divergence-free condition $(2.7.12)$.
