Let $(X,\mathcal{O}_X)$ be a quasi-compact ringed space which is locally isomorphic to an affine variety. Let $x\in X$, $\mathcal{F}$ be a coherent sheaf on $X$, and $n$ be the minimum number of generators of $\mathcal{F}_x$ as an $\mathcal{O}_{X,x}$-module.
For any open affine $U\subseteq X$ we have $\mathcal{O}_{X,x}\cong A_{\mathfrak{m}_x}$ as rings, and $\mathcal{G}_x\cong M_{\mathfrak{m}_x}$ as $A_{\mathfrak{m}_x}$-modules, where $M=\mathcal{F}(U)$, $A=\Gamma(U,\mathcal{O}_X)$, $\mathfrak{m}_x=\{f\in A\mid f(x)=0\}$, and $\mathcal{G}=\mathcal{F}\mid_U$. Let $m$ be the minimum number of generators of $M_{\mathfrak{m}_x}$ as an $A_{\mathfrak{m}_x}$-module.
Then is $m=n$?
My confusion is in relating $\mathcal{F}_x$ and $\mathcal{G}_x$. Would it follow that $\mathcal{F}_x\cong\mathcal{G}_x$ as abelian groups because for any sheaf $\mathcal{H}$ we have $$\mathcal{H}_x=\mathop{\lim_{\longrightarrow}}_{V\ni x}\mathcal{H}(V)$$ and since $\mathcal{G}=\mathcal{F}\mid_U$ it doesn’t matter where we “start” because we are passing to smaller and smaller sets anyway? If so, how could I make this argument formally?
I’m still not sure we can then conclude that $m=n$, since the actions might not be compatible with the isomorphism of abelian groups.
Any help would be much appreciated.
Update: Many thanks for the advice in the comments, I have an affirmative answer to the following statement in this question here:
Suppose we have a directed set $\langle I,\leq\rangle$, with a direct system $\langle A_i,f_{ij}\rangle$ of rings and a direct system $\langle M_i,g_{ij}\rangle$ of abelian groups, such that each $M_i$ is an $A_i$ module via $h_i:A_i\times M_i\to M_i$. Then suppose that these actions are compatible with the direct system, so $$g_{ij}(h_i(a,m))=h_j(f_{ij}(a),g_{ij}(m))$$ Then we have an action $$\mathop{\lim_{\longrightarrow}}A_i\times\mathop{\lim_{\longrightarrow}}M_i\to\mathop{\lim_{\longrightarrow}}M_i$$ which is determined by this system.
Then I think this proves the result. Since our sets are cofinal, we'll get isomorphic rings and abelian groups with the same action inherited from the direct systems, and so they should have the same dimension as modules?