I'm trying to understand this lemma from my course notes:
It's my understanding that a linear recurrence relation is one of the form $x_n = p(n, x_{n - 1}, \dots, x_{n - k}) = q(n) + b_1 x_{n - 1} + b_2 x_{n - 2} + \dots + b_k x_{n - k}$ for $n \geq k$. This recurrence relation is homogeneous if $q = 0$.
I find the above proof very terse, so below I give my understanding along with comments/questions where I don't understand things.
First part: Rational generating function defines a homogeneous linear recurrence relation
Start with $f(x) = a_0 + a_1 x + \dots = \frac{g(x)}{h(x)}$ where $g(x) = b_l x^l + \dots + b_0$ and $h(x) = c_k x^k + \dots + c_0$. Bring the denominator over to the left so you get $(c_k x^k + \dots + c_i x_i) (a_0 + a_1 x + \dots ) = b_l x^l + \dots + b_0$. We want to set up something like $a_j = \alpha_1 a_{j - 1} + \dots + \alpha_n a_{j - n}$. Because we are trying to set up a linear homogeneous recurrence relation, we clearly need to set up something that will work for all $j > \text{[something]}$, but it's not clear at this stage what that something should be.
Clearly based on the product $(c_k x^k + \dots + c_i x_i) (a_0 + a_1 x + \dots )$ we are going to get products of $a$ coefficients with $c$ coefficients. This suggests that we might have to divide an expression involving $a_j c_{\text{something}}$ by $c_{\text{something}}$ in order to isolate $a_j$. The only two $c_{\text{something}}$s that we know are not equal to zero are $c_i$ and $c_k$ (which may or may not be distinct).
If we try to work with $c_k$ then we would be looking at the coefficient for the $x^{k + j}$ term, which would be something like $c_k a_j + c_{k - 1} a_{j + 1} + \dots + c_i a_{j + (k - i + 1)}$. This doesn't look like the type of expression we're looking for ($a_j = \alpha_1 a_{j - 1} + \dots + \alpha_n a_{j - n}$) so we'll try using $c_i$.
If we use $c_i$ then we are looking at the coefficient for the $x^{i + j}$ term, which would be something like $c_i a_j + c_{i + 1} a_{j - 1} + \dots + c_k a_{j - (k - i)}$. Comparing both sides of $(c_k x^k + \dots + c_i x_i) (a_0 + a_1 x + \dots ) = b_l x^l + \dots + b_0$, we see that $c_i a_j + c_{i + 1} a_{j - 1} + \dots + c_k a_{j - (k - i)} = b_{i + j}$. We want $b_{i + j} = 0$ so that we can just divide by $c_i$ and move terms over and get our desired recurrence relation. This implies a restriction $i + j > l$. We also see that we need $j - (k - i) \geq 0$, so our restrictions on $j$ are that $j > l - i$ and $j \geq k - i$.
Given this, we can divide both sides of $c_i a_j + c_{i + 1} a_{j - 1} + \dots + c_k a_{j - (k - i)} = 0$ by $c_i$ and we get that $a_j = - \frac{1}{c_i} ( c_{i + 1} a_{j - 1} + \dots + c_k a_{j - (k - i)})$, which is our desired recurrence relation.
Why is my bound for $j$ different from that given in the proof ($j > \max \{ k, l \}$)?
Second part: linear recurrence relation (having function $q(n)$ that has its own rational generating function) has a rational generating function
This part doesn't make much sense to me at all. I see that $q$ essentially defines a sequence starting at index $k$, as opposed to zero, so I can see that $q$ could have an associated generating function. However the generating function $g(x)$ given for $q$ is not even a polynomial, much less rational. Is the assumption that $g(x)$ can be expressed in a rational form?
I guess $f(x)$ is supposed to be the generating function for the linear recurrence relation? I suppose a linear recurrence relation defines a sequence so there is guaranteed to be an associated generating function.
We define the function $h$ in such a way that all its coefficients beyond $k - 1$ are zero. Since $g(x)$ is presumed to be rational, we can write $g(x) = \frac{r(x)}{s(x)}$ where $r$ and $s$ are polynomials, therefore to be more thorough we can write $f(x) = \frac{h(x)s(x) + r(x)}{s(x)(1 - b_1 x - b_2 x^2 - \dots - b_k x^k)}$.
Does what I'm saying about this second part make sense? I am trying to talk myself through it. What is the intuition behind the definition of $h(x)$? I guess we're trying to make some kind of finite polynomial and that is the definition that works?
I appreciate any help.