prerequisites: The posts Obtaining Taylor Polynomials with Horner’s method and A dual to Moessner’s sieve

1. Introduction

The goal of this post is to derive Moessner’s sieve from Horner’s method for polynomial division, thus concluding this three part series on Horner’s method.

The post is structured as follows. In Section 2, we introduce and formalize Horner blocks in the context of Taylor polynomials. Having defined Horner blocks, we transform them into Moessner triangles in Section 3 and in the process obtain an alternative formalization of Moessner’s sieve. In Section 4, we state an equivalence relation between Horner’s method and Moessner’s sieve. The post is concluded in Section 5.

2. Horner blocks and Taylor polynomials

In this section, we introduce and formalize the concept of Horner blocks and show how they relate to Taylor polynomials.

We start this section by picking up from where we left off in the previous blog post and represent the repeated application of Horner’s method for polynomial division in a tabular format. Given the polynomial , we can restate its repeated division with the binomial (captured in Formulas 7-9 in the previous blog post) by stacking the calculations on top of each other,

In this way, the three calculations are merged into a triangular array, such that the hypotenuse of the triangle, highlighted in boldface, enumerates the coefficients of the resulting Taylor polynomial,

We call this construction a Horner block and formalize it by first defining a Block to be a List of Polynomials,

type Block = [Polynomial]

which we then use in the definition of the following procedure,

createHornerBlockAcc :: Polynomial -> Int -> Int -> Block
createHornerBlockAcc cs x n
  | n == 0 = []
  | n  > 0 = let cs' = init $ hornersPolyDiv cs x
             in cs' : createHornerBlockAcc cs' x (n - 1)

which performs the repeated application of Horner’s method for polynomial division, hornersPolyDiv, while removing the last entry of each intermediate results – what init does. As in the previous posts, cs corresponds to the coefficients of a polynomial , while x corresponds to the point , and the final argument n specifies the number of divisions to be made. However, we note that there exists an extra base case in Formula \ref{eq:horner-block-example}, as no value is dropped from the initial Polynomial in the Horner block. Hence, we define a wrapper function,

createHornerBlock :: Polynomial -> Int -> Int -> Block
createHornerBlock cs x n
  | n == 0 = []
  | n  > 0 = let cs' = hornersPolyDiv cs x
             in cs' : createHornerBlockAcc cs' x (n - 1)

which performs a single division without removing the last entry, followed by a call to createHornerBlockAcc. Thus, we can obtain the Taylor polynomial of a polynomial at a point by reading the hypotenuse of the Block returned by createHornerBlock when given a list of ’s coefficients and a value of .

3. From Horner blocks to Moessner triangles

In this section, we transform Horner blocks into Moessner triangles and in the process derive an alternative formalization of Moessner’s sieve.

If we let and want to obtain the Taylor polynomial , we can do so in two ways:

  • Repeatedly divide with and obtain the hypotenuse equal to the coefficients of ,
  • Repeatedly divide with , obtain the Taylor polynomial and repeatedly divide it with to get , and lastly repeatedly divide with to get the coefficients of ,

From the above calculations, we first observe that the two result hypotenuses – highlighted in boldface – are identical. Secondly, we observe that the first remainder calculated in each of the three triangles in Formula \ref{eq:horner-x-3-three-divs}, , are equal to the powers of , , and thus equal to the values of , and , which demonstrates that Horner’s method can be used to enumerate the values of for the set of positive natural numbers. Lastly, upon closer examination of the procedure used above, we note that given a polynomial,

the repeated division of with has the following structure,

where every non-shifted row, starting with the first row,

is the partial sum of the former non-shifted row. If we take the results of Formula \ref{eq:horner-x-3-three-divs} and strip away the left-most column and the top row, containing the value of and the exponents, we get the following three Horner blocks,

Here, we note the regular structure of the blocks where every block is created from the hypotenuse of the previous block. Next, we perform the same transformation on Formula \ref{eq:horner-x-3-three-divs-blocks} as seen in Formula \ref{eq:horner-block-stripped}, where every shifted row is removed in order to expose the partial summation pattern between each intermediate result,

Lastly, we remove the redundant rows, which appear as both the hypotenuse of one block and the initial row of the subsequent block, e.g., is both the hypotenuse of the first Horner block and also the first row of the second Horner block. Furthermore, we pile the blocks on top of each other,

resulting in a rotated mirror image of Moessner’s sieve,

where the right-most column enumerates the successive powers of , which is the statement of Moessner’s theorem for .

4. Equivalence of Moessner’s sieve and Horner’s method

Now, if we examine Formula \ref{eq:horner-moessner-x-3} from the perspective of our dual sieve, we observe that the rows of the Horner-based sieve do indeed enumerate the columns of the traditional sieve, just like our triangle creation procedure, createTriangleVertically. Furthermore, we observe that the Horner-based sieve collects the values of the hypotenuse of the previous block in order to create the next, as made explicit in Formula \ref{eq:horner-moessner-x-3}, just like the dual sieve, createTrianglesVertically. Together, these observations suggest that we can state an equivalence relation between createTriangleVertically and createHornerBlock,

forall (r : Int) (σ : Stream),
  let k = 1
  in hypotenuse $
     createHornerBlockAcc (take (S r) σ) k r ==
     hypotenuse $
     createTriangleVertically (take (S r) $ repeat 0)
                              (take (S r) σ)

where we use the prefix of streams, (take (S r) σ), instead of lists to directly capture the relation between the length of the input tuples/polynomial and the number of divisions to be made. The above statement can be proved by induction on the prefix length, r, thus showing that createTriangleVertically and createHornerBlockAcc have a simple to state equivalence relation, which captures the fact that the alternative sieve described above is actually emulating createTrianglesVertically, which accounts for it being the “rotated mirror image” of Moessner’s sieve.

5. Conclusion

In this post, we have derived Moessner’s sieve from Horner’s method.

In order to derive Moessner’s sieve, we transformed the successive calculations of Taylor polynomials, called Horner blocks, into a rotated mirror image of Moessner’s sieve, which we then showed had an equivalence relation to the dual of Moessner’s sieve.

This post - and the previous two - was a small excerpt from my Master’s thesis, in which I also formalize all the discussed optics, in the three blog posts, in Coq and prove the above equivalence between Moessner’s sieve and Horner’s method for polynomial division.1

  1. The observation that you can derive Moessner’s sieve from Horner’s method was first observed - but not proved - by Jan van Yzeren in the paper “A Note on An Additive Property of Natural Numbers” (1959).