# Rationality of power series whose coefficients are the ranks of a sequence of matrices

Recently, I stumbled several times about the problem to decide whether a certain formal power series $$f = \sum_{n=0}^\infty d_n T^n \in \mathbb{Q}[\![T]\!]$$ is actually a rational function, where the $d_n = \dim_k(\ker(A_n))$ are the dimensions of kernels of a sequence of $k$-linear maps $A_n\colon k^{b_n} \to k^{b_n}$ over some field $k$. More precisely, the $A_n$ arise as follows: Let $R$ be an infinite dimensional $k$-algebra and let $A\colon R^b \to R^b$ be an $R$-linear map. Take a decreasing sequence of ideals $I_n \subseteq R$ of finite codimension and consider the induced maps $A_n \colon (R/I_n)^b \to (R/I_n)^b$.

(To provide some context: I became interested in this in the setting of Lück's approximation theorem where $R = k[G]$ the group ring of an infinite residually finite group $G$ and $R/I_n = k[G/G_n]$ are group rings of a sequence finite quotients.)

At the moment I have no idea where to look for suitable methods. The case of Hilbert series of graded modules seems to be related, but I don't know how to apply it.

Question 1: Do you know examples where the rationality of a power series has been studied whose coefficients where given by the kernel dimensions (or ranks) of a sequence of linear maps?

Here is a concrete example. Let $R = k[X_1,\dots, X_r]$ be a polynomial ring in $r$ variables. Take a polynomial $g \in R$ and consider $A\colon h \mapsto gh$. Take $I_n = \langle X^n_1,\dots, X_r^n \rangle \subseteq R$. Then $$d_n = \dim_k (\ker( h + I_n \mapsto gh + I_n))$$ is the dimension of the kernel of multiplication with $g$ on the finite dimensional $k$ vector space $R/I_n$.

Question 2: (a) Is the series $f = \sum_{n=0}^\infty d_n T^n$ rational in this concrete situation?

(b) If yes, does this hold, if we use the power series ring $R' = k[\![X_1,\dots,X_r]\!]$ and $g\in R'$ instead?

(Remark: (a) and (b) are obviously true for $r=1$ but already for $r=2$ this is unclear to me.)