p-adic period map in Lawrence and Venkatesh In Lawrence and Venkatesh's paper on the Mordell conjecture, they prove that there are finitely many $K$-rational points on a hyperbolic curve $X$, where $K$ is a number field, by showing that there exists an analytic function on the $p$-adic curve $X(K_v)$ vanishing on $X(K)$, where $v$ is some arbitrary place above $p$, a prime of good reduction for the curve $X$.
LV prove the existence of such a $p$-adic analytic function by showing that there is some analytic map $\Phi : X(K_v)\longrightarrow \mathcal{F}$, called the $p$-adic period map, which has a certain flag variety $\mathcal{F}$ as its target, with the property that:

*

*The image of $\Phi$ in $\mathcal{F}$ has Zariski closure of dimension greater than that of the Zariski closure of the image of $\Phi|_{X(K)}$.

They deduce that there has to exist a non-zero $p$-adic analytic function on $X(K_v)$ that vanishes on $X(K)$. My question is: why is this a consequence of the previous statement, i.e. why does the inequality of dimensions imply the existence of such a function?
If this is somehow helpful, this is explicitly stated in Lemma 3.3 of their paper.
 A: Let $V_K,V_{K_v}$ be the Zariski closures of images of $\Phi$ and $\Phi|_{X(K)}$, respectively. Since $V_{K_v}$ has higher dimension than $V_K$, it is a proper subvariety, which means there must be some nonzero regular function $f$ on $V_{K_v}$ which vanishes on $V_K$. Since $X(K_v)$ is Zariski dense in $V_{K_v}$ (by definition), $f$ must be nonzero on some element of $\Phi(X(K_v))$. That is to say, $f\circ\Phi$ is nonzero on $X(K_v)$, but it will vanish on $X(K)$. Hence $f\circ\Phi$ is the desired function.
Edit: the above doesn't quite work, since $V_{X(K)}$ need not be affine. But also the statement as written in the post is different from the one cited in Lemma 3.3 (indeed the statement in the OP is wrong - as $X(K_v)$ is compact, it admits no nonconstant analytic functions).
The statement in the lemma instead amounts to a local version of this statement: let $\Omega$ be the $v$-adic unit disk in $X(K_v)$ and let $S\subseteq\Omega$ be a subset such that $\Phi(S)$ is contained in a proper subvariety of the Zariski closure of $\Phi(X(K_v))$ (for instance, in the setting of the question, $S=\Omega\cap X(K)$). Then there is a nonzero analytic function on $\Omega$ which vanishes on $S$.
Using the argument I gave above, we can prove this locally: by taking an affine subset $U$ of $V_{K_v}$, we can find a regular function which vanishes on its intersection with $\Phi(S)$. It implies that $\Phi^{-1}(U)\cap S$ is contained in a vanishing locus of an analytic function on $\Phi^{-1}(U)$. This should be sufficient for finiteness as $S$ is covered by finitely many such subsets.
