This is part of Hartshorne's proof of one of Bertini's theorems (II.8.18). There are a couple of points in the proof here that I do not understand. Denote $V = \Gamma(\mathbb{P}^n, \mathcal{O}(1))$.
First, we let $x \in X$ be a closed point and fix some linear form $f_0 \in V$ so that $x$ is not in the hyperplane determined by $f_0$. Put succinctly, $x \in D_+(f_0)$. Denote $\varphi_x:V \to \mathcal{O}_{X,x}/m_x^2$ to be the natural map introduced in the book.
Explicitly, $\varphi_x$ can be understood to be a composition of restrictions and trivializations. On $D_+(f_0)$, we know $\mathcal{O}(1)$ is trivialized by $f \mapsto f/f_0$ so we just do this and restrict to $X$, and then to $x \in D_+(f_0) \cap X$.
The claims I am unsure about are the following. First, it is claimed that $\varphi_x$ is surjective since $m_x$ is generated by linear forms given that $x$ is closed. Second, it is claimed that $\dim_k \mathcal{O}_{X,x}/m_x^2 = \dim X + 1$.
My confusion stems from the fact that this only shows that $\varphi_x$ is surjective onto $m_x$, and not necessarily on the whole of $\mathcal{O}_{X,x}/m_x^2$. Why does $\varphi_x$ also map to all the functions outside of $m_x$?
For the second fact, the assumption that $X$ is smooth we have that $\dim_k m_x/m_x^2 = \dim X$ so why does adding the rest of $\mathcal{O}_{X,x}$ only add one dimension? My guess is that we have an exact sequence $$0 \to m_x/m_x^2 \to \mathcal{O}_{X, x}/m_x^2 \to \mathcal{O}_{X,x}/m_x \to 0$$ by the third isomorphism theorem, and the fact that $\mathcal{O}_{X,x}/m_x = k$ as a closed point, but I'm not really sure if this works.
Thanks very much!