Roots of Unity Filter Part 4 - Proof
Note
I originally wrote a three part series back in 2019 that covered the roots of unity filter, a technique that I used a couple times during my stint with competitive math. However, I never really had a proof for why the roots of unity filter worked and I instead just had empirical evidence that it would work for all cycle lengths between and and all of their offsets. This was enough for me to use it in my competitive math career, but I always felt uneasy that I left such a big hole on my website that was saying "just trust me." Six years later and after graduating both high school and college, I'm finally revisiting this to provide a proof 😅. It isn't necessarily that difficult or insightful, but it feels wrong to leave something up for so long that was unproven.
Recap
As a reminder, the roots of unity filter says that given a polynomial of degree :
a period length , and an offset , we have:
where is the th root of unity and the coefficients are:
For our proof, we will multiply both sides of our expression by to get:
Handling
We first handle the simpler case where there is no offset, or . In reality, we could provide a general proof that does not handle this separately, but I think the case is easier to digest and parts of it are used in the general case.
In this case, we have for all . As a result, our RHS sum becomes just . Our LHS is the sum of all coefficients for all multiplied by .
We focus on the coefficient of for any . On the LHS, this is . We do the same for the RHS for each of the terms . The term of note is . Since , we have this term is just , showing the coefficient is for each of the different terms. Therefore, the total coefficient of is on the RHS, matching the LHS.
We then look at the coefficient of any other term for any and . Here, we have the LHS side coefficient is . For each of the RHS terms , the term of note is . Focusing on this term, we get:
Therefore, our RHS coefficient for is given as:
We apply the geometric sum formula, which is applicable since :
As a result, our RHS coefficient for is . This covers all possible terms, proving the case for the roots of unity filter.
Handling
We use the same proof structure, except in this case, we no longer have and instead will get some power of . We first focus on the coefficient of , which is on the LHS. For the RHS, we note that the term of note in each is:
Note that the exponent of must be divisible by , meaning the coefficient evaluates to just for each of the terms, leading to a total contribution of .
Next, we focus on the coefficient of for any and . This has a LHS coefficient of , and the RHS coefficient is given as:
We can simplify this to:
Applying the insight from the case, we have is just , and we are left with:
This is the exact same expression as in the case, where we showed this evaluates to , thus proving the general case.