Prop: Let R be a commutative ring and I be an ideal.
Then [p]I is a unit in R/I if and only if ⟨p⟩ is coprime with I.
Proof: 1∈Rp+I is equivalent to ⟨p⟩+I=R.
Cor: For R UFD, f∈R[X]/⟨Xn⟩ is a unit if and only if f(0) is a unit in R.
Proof: R being a domain implies Xa (a<n) are the only factors of Xn.
Suppose f(0) is a unit, then f is coprime with Xn in K[X], where K is the fractional field of R.
Suppose fg=1 in K[X].
Since the content of f is associated to 1, by Gauß's lemma, C(fg^) is also associated to 1.
Since fg^=h⋅Xn+f(0)g^(0), [f(0)g^(0)]−1g^ is the inverse of f modulo Xn.
The "only if" part is trivial.
Prop: If fg=h⋅Xn+1, then (2−fg)g⋅f=−h2⋅X2n+1.
This proposition gives a binary lifting algorithm to calculate f−1 modulo Xn,
in O(nlogn).
Let R be a commutative ring and f:=∑i=0∞biXi∈R[[X]] be a power series.
Suppose f(a)∈Rp for some a,p∈R, i.e. a is a root to f modulo p.
Then, use the substitution X=a+Yp we have
Therefore, we have f(a+Yp)∈Rp2 iff f(a)+f′(a)pY∈Rp2.
Since p∣f(a), if f′(a) is invertible in R/p2R, we have p∣f(a)f′(a)−1.
Thus, Y=a−f(a)f′(a)−1 is a root to f modulo p2 in this case.
Furthermore, if R is a UFD then f′(a) is invertible in R/p2R iff p∤f′(a).
Now, substitute R with R[X] and p with Xm.
Consider g∈R[X,Y], but it can have infinite terms on Y.
If there is some a∈R s.t. g(0,a)=0,∂Y∂g(0,a)∈R×,
then we can calculate the "root" of g(X,f(X)) in R[X]/⟨Xn⟩ for any n:
Let f0(X)=a and n0=1
Let fi(X)=a−g(X,fi−1)(∂Y∂g(0,fi−1))−1 and ni=2ni−1.
Note that X∣g(X,fi−1). Thus, if the first derivative is invertible, all derivatives are invertible.
Let K be a field.
For f∈K[X] of degree d, let fT(X):=Xdf(1/X) be the reverse of coefficients of f.
Suppose f=gq+r, where f,g are of degree n,m resp.
Then, fT(X)=gT(X)qT(X)+Xnr(1/X).
Since r is of degree at most m−1, Xn−m+1∣Xnr(1/X).
Also, q(X) is of degree n−m<n−m+1.
Thus, q=[fT⋅(gT)−1]T(mod Xn−m+1) and r=f−gq.
Let A be an R-algebra, and g∈A× of order n.
Suppose ∑i=0n−1gik=0 for all 1≤k<n (generally true if gk−1 is not a zero divisor).
For a sequence a=(a0,…,an−1)∈Rn, its discrete Fourier transform
is F(a)=(F0(a),…,Fn−1(a))∈An where
Fk(a)=i=0∑n−1aigik
If n is invertible in A, the inverse of DFT is
ai=n1k=0∑n−1Fk(a)g−ik
This is given by the zero sum condition.
The DFT of the cyclic convolution a∗b is the pointwise product of their DFT:
Thus, DFT can be used to compute convolution.
However, directly computing the sum does not reduce the time complexity.
Now we try to accelerate this. Suppose n=2m.
where Fk′ is the DFT of length n/2 using g2 as the primitive root instead of g.
Repeating this, we get O(nlogn) fast Fourier transform (FFT) algorithm.
Let K be a field and f∈K[X] is of degree d.
If we know its value on d+1 different points x0,…,xd∈K and f(x0),…,f(xd)∈K,
then we can recover the coefficients of f.
Let li∈K[X] be defined as:
li(X):=j=i∏xi−xjX−xj
Then, li is 1 at xi and 0 at other points xj=xi.
Let l:=∑i=0dyili, then f=l.
Because otherwise, f−l will be a polynomial of degree d but have d+1 disjoint roots.
To evaluate f(x), we can directly substitute x into li, and get an O(d2) algorithm.
Let fk(n)=∑i=1nik.
By induction we can prove fk is a polynomial of degree k+1.
To calculate fk(n), it suffices to compute fk(0),…,fk(k+1) and then interpolate.
Let R be an commutative ring, f∈R[X] be a polynomial with degree less than n, x1,…,xn∈R be points.
Compute f(x1),…,f(xn).
Let p0(X)=∏i=1⌊n/2⌋(X−xi) and p1(X)=∏i=⌊n/2⌋+1n(X−xi).
Define r0(X)=fmodp0 and r1(X)=fmodp1.
Then it suffices to evaluate r0 on x1,…,x⌊n/2⌋ and r1 on x⌊n/2⌋+1,…,xn,
as f(x)=r0(x) for all x∈{x1,…,x⌊n/2⌋}.
This divide-and-conquer algorithm works in O(nlog2n).
In special case there are algorithms that run faster, e.g. O(nlogn), but need more memory.
By Hamilton-Cayley theorem, the characteristic polynomial of M is an annihilator of M.
Let p(X):=Xd−∑i=1dciXd−i and rn(X):=Xnmodp.
Then, An=rn(A).
Thus, if rn(X)=∑i=0d−1siXi,
then an=∑i=0d−1siai.
However, there is a much cleaner way to view this.
Recall that given c∈R, we have R[X]/⟨X−c⟩≅R via X↦c.
This somehow gives an solution for ai=cai−1 as ai=ci.
We want to generalize this, but a1×a1=a2.
This inspires us that we should forget the multiplication.
Consider R[X] as a abelian group.
Then, define f:R[X]→R as f(uXi)=u⋅ai for all u∈R and i∈N.
By the distributivity of R, f is a well-defined group homomorphism.
Let I=⟨p⟩ be the ideal generated by p.
We claim that I is in the kernel of f.
Since f preserves the addition, so it suffices to show that f(uXip)=0 for all u∈R and i∈N.
This is clearly true since
u(ai+d−c1ai+d−1−…−cdai)=u⋅0=0
Observe that now R becomes a cocone of the diagram 1←I↪R.
And R/I is exactly the coproduct of this diagram, with canonical map π:R→R/I via f↦(fmodp).
By the universality, f=f↾R/I∘π.
Hence, an=f(Xnmodp)=∑i=0d−1siai, with si defined above.
This is the inverse problem: given a recurrence sequence aiinfty (first 2d elements are enough),
can we compute its recurrence relation ai=∑j=1dcjai−j?
Again we use a polynomial to represent the recurrence relation.
Suppose pi∈R[X] s.t. pi works for aj, 0=j<i.
Formally, this means f(Xjmodpi)=aj and f(Xj−degpipi)=0.
Let the error
Suppose pk=pi is some polynomial we have different from pi.
Let pi+1=pi+ekeipkXi−k.
Clearly, f(Xi−degpi+1pi+1)=0, so pi+1 works for ai.
One can verify it works for all aj, 0≤j≤i.
Now we want to minimize the degree of final p.
The flexibility we have is pk when fixing the error.
Massey argues that we can use the last pk s.t. degpk+1>degpk.