Let $\| x \| =\sqrt{x^T x}$ be the Euclidean norm on $\mathbb{R}^n$. Consider the point $z \in \mathbb{R}^n$, and the plane $P = \{x \in \mathbb{R}^n : a^T x = b\}$ where $0 \neq a \in \mathbb{R}^n$, $b \in \mathbb{R}$. Orthogonal projection gives the point \begin{align}\label{1}\tag{1} y = z - \frac{(a^T z - b)}{a^T a} a \end{align} such that \begin{align}\label{2}\tag{2} y \in P \qquad \text{and} \qquad \inf_{x \in P} \|x-z \| = \|y-z \|. \end{align} Moreover, \begin{align}\label{3}\tag{3} \inf_{x \in P} \|x-z \| = \frac{| a^T z - b |}{\|a\|} \end{align}
Suppose we replace $\mathbb{R}$ by $\mathbb{Q}_p$ and the norm is now $\| x \| =\max_{1 \leq i \leq n}|x_i|_p$.
Question 1 How can I find a formula like \eqref{1} for some point $y \in \mathbb{Q}_p^n$ satisfying \eqref{2}.
Question 2 How can I find a formula like \eqref{3}?
Inspired by the comment by @user1952009 on "Reciprocal" of $p$-adic vector?, I've got an answer for Question 2: $$ \inf_{x \in P} \|x-z\|_p = \frac{|a^T z - b|_p}{\|a\|_p} $$
We prove the equality as two inequalities.
For the $\leq$ part, pick $j$ such that $\|a\|_p = |a_{j}|_p$ and let $x = z - (a^T z - b)(0,\ldots,0,a_{j}^{-1},0,\ldots,0)$. Then we find $|x-z|_p = \|a\|_p^{-1} |a^T z - b|_p$ and $a^Tx = b$.
For the $\geq$ part, for all $x$ with $a^Tx=b$, we have $$ |a^T z - b|_p = |a^T z - a^T x|_p = | \sum_{i} a_i(z_{i} - x_{i}) |_p \leq \max_{i} |a_i(z_{i} - x_{i})|_p \leq \|a\|_p \|x-z\|_p. $$
Edit: I guess this also answers Question 1: $y$ may be taken to be the point $x$ constructed in the first part of the proof.