Volume C1 · Basic concepts · TAOCP Section 1.2.9
Generating functions
Draft. This chapter is written and checked by the tools of the project, and a person has not reviewed it yet. Read it with care.
Read it next to Section 1.2.9 of the book. The nodes and the exercises of the section.
Generating functions, their operations and the table of series
Overview
Section 1.2.9 of TAOCP puts a sequence into one power series and then works on the series. Parts A to C are the operations on the coefficients: sum, shift and product. Part D changes the variable, and with roots of unity picks out the terms in one residue class. Part E is the derivative and the integral. Part F is the table of the series used most: binomial, exponential, logarithm, and those with the Stirling and Bernoulli numbers. Part G is the notation and Cauchy's integral for a coefficient. The end of the section finds the sum of all products of of numbers , with repeats, as a polynomial in the power sums . The section uses the binomial coefficients of Section 1.2.6, the harmonic numbers of Section 1.2.7 and the Fibonacci numbers of Section 1.2.8.
The ideas
A series is a store for a sequence. Two series are equal exactly when the sequences are equal, so an identity between series is an identity between sequences. This helps most when the sequence has an inductive definition, since the series may satisfy a short equation.
Formal series need no convergence. The section says that convergence is of little use when one looks for a solution, because the answer can be checked in another way. C1 takes this one step further. A formal power series is a sequence of coefficients, with the sum and the product that the section defines. All results of parts A to E and of the end of the section are identities between formal series, and they have no condition of convergence. For the real or complex number , the identity is true as an identity between numbers whenever all the series that occur converge, which is so for small. The section recalls two facts about convergence: if the series converges at it converges for , and it converges at some exactly when is bounded.
Each operation on sequences has a matching operation on series. A sum of sequences is a sum of series, a shift of the index is a product with a power of , a convolution is a product of series, a factor is the change of to , a factor is the operator , and a division by is an integral. Each proof is a check on one coefficient.
The table is the working set. Each series of part F is proved from the earlier ones, with a differential equation, a recurrence of the Stirling numbers, or Lagrange's theorem.
Definitions, results and proofs
Definition (the generating function of a sequence, TAOCP eq. 1.2.9(1)). For a sequence of numbers, its generating function is the series
Node: TA07MBSY30 · Lean: TAOCP.ogf, TAOCP.S1_2_9.eq1 · status: proved
Explanation. Two series are equal when all their coefficients are equal, so holds the sequence and nothing else. Series are added and multiplied by the rules of polynomials, so they form a ring, and a series with constant term has an inverse.
Example. The Fibonacci numbers have the series of Section 1.2.8.
Proof. A definition has no proof. The one fact to check is that the map is one to one, and it is, since by the definition of equality.
Theorem (addition, TAOCP eq. 1.2.9(2)). Let and be the generating functions of and , and let be numbers. Then
Node: TANA9671WF · Lean: TAOCP.S1_2_9.eq2 · status: proved
Explanation. The map from sequences to series is linear. A sequence that is a combination of simpler sequences has a series that is the same combination of their series.
Example. For the series is , and the first terms are . This is exercise 1.2.9-1.
Proof. The coefficient of on the left is , since the product of a series with a number acts on each coefficient, and the sum of two series is the sum of the coefficients.
Theorem (shift to the right, TAOCP eq. 1.2.9(3)). For each integer ,
Node: TAEPGHJ1Y5 · Lean: TAOCP.S1_2_9.eq3 · status: proved
Explanation. A product with puts zeros in front of the sequence. If is read as for , the right side is a sum over all . In Mathlib this is the rule for the coefficient of a product with , PowerSeries.coeff_X_pow_mul'.
Example. For the constant sequence, , which is .
Proof. The term becomes . Put : the term is with .
Theorem (shift to the left, TAOCP eq. 1.2.9(4)). For each integer , the series generates , that is,
Node: TA059AA1H6 · Lean: TAOCP.S1_2_9.eq4 (partial) · status: proved
Explanation. The left shift drops the first terms. It turns a recurrence into an equation for .
Example. For and : , which generates again.
Proof. The term with becomes . With the term is .
Theorem (the geometric series, TAOCP eq. 1.2.9(5)).
Node: TAT7S423VY · Lean: TAOCP.S1_2_9.eq5 · status: proved
Explanation. This is the series of the constant sequence and the most used series of the table. The proof shows the method of A and B together: shift, subtract and solve. In Mathlib, PowerSeries.invUnitsSub is the series , and PowerSeries.invUnitsSub_mul_sub is the equation that it is the inverse of . The change gives the series of as .
Example. Take : the partial sums of approach . The series of the powers of is .
Proof. Let be the series of . Then is the series of by eq. (3), and has coefficients , so . The series has constant term , so it has the inverse .
Theorem (the product of two series, TAOCP eq. 1.2.9(6)). The product of the generating functions of and is the generating function of with
Node: TAJBVBEXFN · Lean: TAOCP.S1_2_9.eq6 · status: proved
Explanation. The sequence is the convolution of and . The rule is the definition of the product of polynomials. Eq. (3) is the case where is . Lean: TAOCP.coeff_ogf_mul, PowerSeries.coeff_mul.
Example. With , the coefficient (Section 1.2.8). With : , so .
Proof. Each product has degree . The coefficient of in the product is the sum of over the pairs with , and the pairs are for .
Theorem (partial sums, TAOCP eq. 1.2.9(7)).
Node: TAQ6GWNMKX · Lean: TAOCP.S1_2_9.eq7 · status: proved
Explanation. A division by is a running total. This is eq. (6) with for all .
Example. For , the series is , and the division by gives , with coefficients , which are the partial sums .
Proof. By eq. (5), has all coefficients . Eq. (6) with gives .
Theorem (a product of three series, TAOCP eq. 1.2.9(8)). The product of the series of , , is the series of with
Node: TA8DWZ3VPQ · Lean: TAOCP.S1_2_9.eq8 · status: proved
Explanation. The product of three series is the product of two, and one more use of eq. (6) gives a sum over triples.
Example. With all three sequences equal to : is the number of triples of nonnegative integers with sum . For there are , and .
Proof. By eq. (6), has the coefficient with . Substitute : the double sum is over all with , each triple once.
Theorem (a product of many series, TAOCP eq. 1.2.9(9)). Let be sequences for such that the product makes sense, which is so when and for (or for another condition that makes each coefficient a finite sum). Then
Node: TA54TKPC2N · Lean: TAOCP.S1_2_9.eq9 (partial) · status: proved
Explanation. The rule is the same as for three factors: pick a term from each factor, with total degree . The condition makes each coefficient a finite sum, since the factor changes the series only from degree on.
Example. The product has , and all other . The coefficient of is the number of ways to write as a sum of distinct positive integers. For they are , , , , which are . The expansion of the product starts .
Proof. For fixed , only the factors with can contribute to the coefficient of by a term other than , so the infinite product has the same coefficient of as the finite product of the first factors. For a finite product the formula is the extension of the proof of eq. (8) by induction on the number of factors.
Definition (the binomial convolution, TAOCP eq. 1.2.9(10)). The binomial convolution of and is the sequence
Node: TA6JYSV9R7 · Lean: TAOCP.S1_2_9.eq11 (partial) · status: not stated yet
Explanation. It arises when a recurrence has binomial coefficients. The next theorem gives the series to use.
Example. With : . With (the first four terms): .
Proof. A definition has no proof. The sum has terms for each , and the index runs over , since the binomial coefficient is outside.
Theorem (the product of exponential generating functions, TAOCP eq. 1.2.9(11)). If is given by eq. (10), then
Node: TARXNJTW3G · Lean: TAOCP.S1_2_9.eq11 · status: proved
Explanation. The series is the exponential generating function of . The product of two exponential generating functions is the exponential generating function of the binomial convolution. The project defines the exponential generating function as TAOCP.egf, with its coefficients in TAOCP.coeff_egf, and TAOCP.egf_one says that the series of the sequence of ones is PowerSeries.exp. The project has no statement of eq. (11) yet. This is exercise 1.2.9-2.
Example. With the series are each, and , so as in the example above.
Proof. By eq. (6) the coefficient of in the product is . Write . The sum is .
Theorem (even and odd terms, TAOCP eq. 1.2.9(12)).
Node: TA5Q2B1361 · Lean: TAOCP.S1_2_9.eq12_even, TAOCP.S1_2_9.eq12_odd · status: not stated yet
Explanation. The change multiplies the term of degree by , so the odd terms change sign and the even terms do not. The half sum keeps the even terms and the half difference keeps the odd terms. This is part D of the section.
Example. For : , and .
Proof. . In the sum the coefficient is , which is for even and for odd . The difference has .
Theorem (terms in one residue class, TAOCP eq. 1.2.9(13)). Let and . For ,
Node: TA8FPN2QPA · Lean: TAOCP.S1_2_9.eq13 · status: proved
Explanation. This extends eq. (12), the case . The sum over the -th roots of unity of a power is for a multiple of and otherwise, so the sum keeps the terms with . For and with , the series equals . This is exercise 1.2.9-14.
Example. Take , , , . The left side is , and evaluation of the right side with complex numbers gives .
Proof. The right side has the coefficient of equal to , since has the term . If , then and the sum is . Otherwise and , so . Hence the coefficient is if and otherwise.
Theorem (the derivative, TAOCP eq. 1.2.9(14)).
Node: TA2DNG0JNM · Lean: TAOCP.S1_2_9.eq14, TAOCP.S1_2_9.eq14_mul_X · status: proved
Explanation. The derivative is taken term by term, and it obeys . The series generates , so a multiplication of a term by a polynomial in is a differential operator on . In Mathlib the derivative is PowerSeries.derivative.
Example. From , and the series is , as in eq. (16). The series generates .
Proof. The term has the derivative , and since the constant term goes to . The renaming gives the form of the theorem.
Theorem (the integral, TAOCP eq. 1.2.9(15)).
Node: TATED5YGAF · Lean: TAOCP.S1_2_9.eq15, TAOCP.S1_2_9.integral, TAOCP.S1_2_9.derivative_integral · status: proved
Explanation. The integral is defined term by term and has the constant term . It divides the coefficient of by . The derivative of the integral of is , and the integral of is . So the integral undoes the derivative on the series with constant term .
Example. The integral of has the terms , which is eq. (17).
Proof. The integral of from to is . With the term becomes .
Theorem (the series of , TAOCP eq. 1.2.9(16)).
Node: TACR2S4P0N · Lean: TAOCP.S1_2_9.eq16, TAOCP.S1_2_9.eq16_derivative · status: proved
Explanation. It is the derivative of eq. (5). It is also the square of eq. (5): the number of pairs with is .
Example. The coefficients for . At the series is .
Proof. The derivative of is by eq. (14). The derivative of is , by the rule for the derivative of a product applied to : it gives , so .
Theorem (the logarithm of , TAOCP eq. 1.2.9(17)).
Node: TAXVG6PSGJ · Lean: TAOCP.S1_2_9.lnInvOneSub, TAOCP.S1_2_9.eq17, TAOCP.S1_2_9.eq17_real · status: proved
Explanation. The logarithm of a series with constant term is defined as the series with constant term whose derivative is . For this derivative is . So the series is the integral of eq. (5).
Example. At : . The first four terms give .
Proof. The derivative of is , since and the derivative of is . By eq. (15) the integral of is . Both sides have the constant term and the same derivative, so they are equal.
Theorem (the harmonic numbers, TAOCP eq. 1.2.9(18)).
Node: TANVNW1BVM · Lean: TAOCP.S1_2_9.eq18 · status: proved
Explanation. The coefficients of the logarithm are , and a division by gives the partial sums, which are the harmonic numbers of Section 1.2.7. Mathlib has the sequence as harmonic.
Example. The coefficients are , , , , as in the expansion .
Proof. By eq. (7) the product with has the coefficient by eq. (17), with .
Theorem (the binomial series, TAOCP eq. 1.2.9(19)). For each number ,
Node: TARVM5FZ9C · Lean: TAOCP.S1_2_9.eq19, TAOCP.S1_2_9.eq19_real (partial) · status: proved
Explanation. For a nonnegative integer the series is the polynomial of the binomial theorem. For other it is infinite and defines as a series, with (Section 1.2.6). The series converges for . The project has the binomial coefficient of a general number as TAOCP.binom.
Example. With : . At the value is , and the first four terms give , to be compared with .
Proof. Let . By eq. (14) the series has the coefficient of equal to . By the identity , this is . So . For the function has derivative , so .
Theorem (a negative power of , TAOCP eq. 1.2.9(20)). For each integer ,
Node: TAZ98BYBEG · Lean: TAOCP.S1_2_9.eq20 · status: proved
Explanation. This is eq. (19) with and replaced by . The rule of negation of the upper index (Section 1.2.6) turns the coefficient into a binomial coefficient with positive entries. For it is eq. (5), and for it is eq. (16). The coefficient counts the ways to write as an ordered sum of nonnegative integers.
Example. For : , so .
Proof. Put and in eq. (19). The coefficient is . The rule of negation says , and by symmetry.
Theorem (the generalized binomial series, TAOCP eq. 1.2.9(21)). Let be a number and the continuous function of with and at . Then for each number ,
Node: TA4DCTDG01 · status: not stated yet
Explanation. For it is eq. (19). For the coefficient is read as , which is the same number when and the right value when . The book proves the identity in exercise 1.2.6-25. The proof below is a different one: it uses Lagrange's theorem, which follows from eq. (32).
Example. Take , so , and . For : , and the series is . The formula gives the coefficients : gives ; gives ; gives ; gives .
Proof. Put . The equation is , that is with . By Lagrange's theorem, proved below, for each series and each , . Take . Then , and by eq. (19), . So . For the identity with turns this into .
Proof of Lagrange's theorem. Let be the series with , , which exists and is unique by solving for the coefficients one at a time. For small, the map has and is one to one near . By eq. (32), . Change the variable to , with and . The integral becomes over a small circle in . In the second integral , and an integration by parts on a closed curve gives . The term with cancels the first integral. What remains is .
Theorem (the exponential series, TAOCP eq. 1.2.9(22)).
Node: TARSKE6CZN · Lean: TAOCP.S1_2_9.eq22, TAOCP.S1_2_9.eq22_real · status: proved
Explanation. It is the exponential generating function of , equal to its own derivative, and is eq. (11) for powers. Mathlib has the series as PowerSeries.exp, with PowerSeries.coeff_exp, PowerSeries.derivative_exp and PowerSeries.exp_mul_exp_eq_exp_add.
Example. At the partial sums approach .
Proof. The function is the solution of with . Let . By eq. (14), and , so by induction on .
Theorem (the powers of , TAOCP eq. 1.2.9(23)). For each integer ,
Node: TAZVKN94SN · Lean: TAOCP.S1_2_9.eq23, TAOCP.S1_2_9.coeff_exp_sub_one_pow · status: proved
Explanation. The numbers are the Stirling numbers of the second kind, the number of partitions of a -element set into nonempty subsets. The theorem says that is their exponential generating function in . The second form of the left side is the first two terms. This is exercise 1.2.9-5. The project has the numbers as TAOCP.stirling2, with the recurrence TAOCP.stirling2_succ_succ.
Example. For : . The values , , give equal to , and . The second form with the first two terms: .
Proof. Let . The recurrence and eq. (14) give . Take . Its derivative is . Both sequences have the same equation. For , since for . Suppose for an . Then and solve with . The difference has and , so each coefficient of is by induction on the degree. So , which is the claim.
Theorem (the series of , TAOCP eq. 1.2.9(24)).
Node: TA93N0K6KQ · Lean: TAOCP.S1_2_9.eq24, TAOCP.S1_2_9.eq24_real · status: proved
Explanation. It is eq. (17) with replaced by and a change of sign: . The series is the integral of .
Example. At the series is (it converges, but slowly). At : , and the terms .
Proof. By eq. (17) with in place of : . Then .
Theorem (a logarithm times a power, TAOCP eq. 1.2.9(25)). For each integer ,
Node: TAXQBKD1NT · Lean: TAOCP.S1_2_9.eq25 · status: proved
Explanation. For this is eq. (18). The coefficient is a binomial coefficient times a difference of harmonic numbers.
Example. For : the series is . The formula gives for : , and for : . Direct product: has coefficient . For the value is .
Proof. Differentiate eq. (20) with respect to a continuous exponent. Let be a variable: by eq. (19), , where is a polynomial in . The derivative of the left side with respect to is . The derivative of the right side is, by the product rule for , . Put : the product is , and .
Theorem (the powers of the logarithm, TAOCP eq. 1.2.9(26)). For each integer ,
Node: TAGPCNSJ3Z · Lean: TAOCP.S1_2_9.eq26, TAOCP.S1_2_9.coeff_lnInvOneSub_pow · status: proved
Explanation. The numbers are the Stirling numbers of the first kind, the number of permutations of objects with cycles. The theorem is the analogue of eq. (23). The project has them as TAOCP.stirling1, with TAOCP.stirling1_succ_succ.
Example. For : , with , , : and . Check by squaring: has the coefficient .
Proof. Let . The recurrence is . By eq. (14), , so and for . Let , so . Then . So satisfies the same equation, with the same value at . A series with and given is unique, since the coefficients are found one by one: . By induction on from , .
Theorem (the rising power, TAOCP eq. 1.2.9(27)). For each integer ,
Node: TAHV8R3EM0 · Lean: TAOCP.S1_2_9.eq27 · status: proved
Explanation. This is a polynomial identity. It says that the Stirling numbers of the first kind are the coefficients of the rising power . In the project, TAOCP.risingPow is the rising power.
Example. For : . The coefficients are , , , which are the numbers of permutations of three objects with three, two and one cycle: .
Proof. For the product is . Suppose that it holds for . Multiply by : the coefficient of in is , which is by the recurrence of the first kind.
Theorem (a column of the Stirling numbers of the second kind, TAOCP eq. 1.2.9(28)). For each integer ,
Node: TAYPTWYHRJ · Lean: TAOCP.S1_2_9.eq28 · status: proved
Explanation. Here the ordinary generating function of the numbers in , with fixed, is a rational function. It is the version of eq. (23) with in place of .
Example. For : , and for is .
Proof. Let be the left side, so and . In the coefficient of this reads , that is . This is the recurrence of the second kind. The initial values agree: and for . By induction on and , .
Theorem (the Bernoulli numbers, TAOCP eq. 1.2.9(29)). The Bernoulli numbers are defined by the series below, and they satisfy and for :
Node: TA03QCETCT · Lean: TAOCP.S1_2_9.eq29 (partial) · status: proved
Explanation. The series has constant term , so it has an inverse, and the coefficients of the inverse define . The recurrence gives them one by one. The numbers are studied in Section 1.2.11.2. In Mathlib the series is bernoulliPowerSeries, with bernoulliPowerSeries_mul_exp_sub_one, and the numbers bernoulli, with as in the book.
Example. From the recurrence, , (since for ), , , , . In the series the coefficient of is , as in the section.
Proof. By definition . The series . The coefficient of in the product is , which is for and for . Multiply by : for , since .
Theorem (the series with , TAOCP eq. 1.2.9(30)). Let be a number and the continuous function of with and at . Then for each number ,
Node: TAHZ4TRZBF · status: not stated yet
Explanation. This is the analogue of eq. (21) for the exponential function. The proof is Lagrange's theorem again (see exercise 2.3.4.4-29).
Example. With , : the coefficients are for . A direct iteration of from gives the series .
Proof. Let . Then , so with . By Lagrange's theorem (in the proof of eq. (21)), with : .
Definition (the coefficient of , TAOCP eq. 1.2.9(31)). For a series , is the coefficient of in .
Node: TAPN7720F9 · status: proved
Explanation. If is the series of eq. (1) then , and by eq. (7), . By eq. (6), . In Mathlib it is PowerSeries.coeff n, and in the project TAOCP.coeff_ogf.
Example. . . .
Proof. A definition has no proof. The notation is well defined since the coefficients of a series are unique.
Theorem (Cauchy's formula for a coefficient, TAOCP eq. 1.2.9(32)). If the series converges at and , then
Node: TA5HXMXEAY · status: not stated yet
Explanation. The integral over a circle picks one coefficient out of the function, and it is used mostly to estimate a coefficient.
Example. For and , with (smaller than the radius ), a numerical integral with 4000 points on the circle gives , and .
Proof. For the series converges uniformly, so the integral of the sum is the sum of the integrals. The integral of over the circle is for each integer , since has the antiderivative . For the parametrization gives . Hence .
Definition (the complete symmetric functions, TAOCP eq. 1.2.9(33)). For numbers and an integer , the sum of all products of of them, with repeats allowed, is
Node: TAN3JGMDYC · Lean: TAOCP.S1_2_9.eq33 · status: proved
Explanation. In the sum each monomial of degree in the 's occurs once. For the sum has one term, the empty product , so . For it is . For and it is the sum of eq. 1.2.3(13) and the sum of exercise 1.2.3-29.
Example. For : , , , .
Proof. A definition has no proof. The number of terms of is , the number of multisets of size chosen from objects; for and it is .
Definition (the power sums, TAOCP eq. 1.2.9(34)). For an integer ,
Node: TAT8F54AWF · Lean: TAOCP.S1_2_9.powSum · status: not stated yet
Explanation. The notation makes the formulas short. In terms of it, and . The aim of the rest of the section is a formula for in terms of which does not depend on .
Example. For : , , , . Then , and .
Proof. A definition has no proof. The two formulas above are proved as a special case of eq. (38).
Definition (the generating function of the complete symmetric functions, TAOCP eq. 1.2.9(35)).
Node: TAZJA16JA6 · Lean: TAOCP.S1_2_9.hSeries, TAOCP.S1_2_9.hh (partial) · status: not stated yet
Explanation. This is the series of the sequence , with the numbers as parameters. It has constant term , so its logarithm exists.
Example. For and : and . For : .
Proof. A definition has no proof.
Theorem (the product form, TAOCP eq. 1.2.9(36)).
Node: TAZRSZ59NG · Lean: TAOCP.S1_2_9.eq36 · status: proved
Explanation. The product form shows that is over a polynomial in of degree at most . By eq. (5) with the change , each factor generates the powers of , and the product of the series collects, for each monomial, one term of the sum.
Example. For : , which agrees with the series of the previous example, and is .
Proof. By eq. (5) with , . By eq. (9) for a finite product, the coefficient of in the product of the series is the sum of over all . These are the monomials of degree , one each. A product with is a monomial with the exponents the number of 's equal to . So the sum is .
Theorem (the logarithm, TAOCP eq. 1.2.9(37)).
Node: TAWHSX3VCR · Lean: TAOCP.S1_2_9.derivative_hSeries (partial) · status: not stated yet
Explanation. The logarithm turns a product into a sum. Each logarithm is a series by eq. (17), with in place of . The sum over of the coefficient is . The logarithm is now written with the power sums alone.
Example. For , the coefficient of in is , and that of is . Check: .
Proof. The logarithm of a product of series with constant term is the sum of the logarithms, since both sides have the constant term and the derivative of the logarithm of is , which is additive over products by the rule for the derivative of a product. Then eq. (17) gives , and the sum over is .
Theorem (the symmetric functions by power sums, TAOCP eq. 1.2.9(38)). For each integer ,
Node: TAYSX7K3S7 · status: not stated yet
Explanation. This is the answer to the problem of the section. There is one term for each partition of (a way to write as a sum of positive integers, without order), with the number of parts equal to . So the number of terms is . The formula does not depend on the number of variables.
Example. For the partition : , , , and the other are . The term of is . The number of partitions of is , so has terms. For the five terms give , and for , with , the five terms are , , , and , and their sum is .
Proof. By eq. (37), . The exponential of a sum is the product of the exponentials, so . By eq. (22), the factor with index is . By eq. (9), the coefficient of in the product is the sum, over all sequences with , of the product of the coefficients. Such a sequence has for . This is the formula.
Theorem (the recursion for the symmetric functions, TAOCP eq. 1.2.9(39)). For each integer , where is now an index and the count of the numbers is arbitrary,
Node: TA27DQ7W0M · Lean: TAOCP.S1_2_9.eq39 · status: proved
Explanation. This is a recurrence that computes from the earlier values, and it is cheaper than the sum over the partitions. It also solves the problem in reverse: it gives from the 's, as , , (exercise 1.2.9-11). It is one form of Newton's identities between power sums and symmetric functions.
Example. For with : , , , , .
Proof. From eq. (37), . Differentiate: . So . The coefficient of on the left is by eq. (14). On the right it is by eq. (6). Divide by .
Algorithms and programs
Section 1.2.9 has no algorithm and no program. The recursion of eq. (39) computes from the power sums in about operations, but the book gives it as a formula, and C1 adds no algorithm.
The exercises
The table has the 26 exercises of Section 1.2.9. The kind is the class of spec 06.3 that C1 proposes, and the indexer of S0 fixes it in the map.
| Exercise | Rating | Markers | Kind | Lean | Solution |
|---|---|---|---|---|---|
| 1.2.9-1 | 12 | M | K3 | not yet stated | X1, 1.2.9-1 |
| 1.2.9-2 | 13 | M | K1 | not yet stated | X1, 1.2.9-2 |
| 1.2.9-3 | 21 | HM | K1 | not yet stated | X1, 1.2.9-3 |
| 1.2.9-4 | 01 | M | K1 | not yet stated | X1, 1.2.9-4 |
| 1.2.9-5 | 20 | M | K1 | not yet stated | X1, 1.2.9-5 |
| 1.2.9-6 | 15 | HM | K3 | not yet stated | X1, 1.2.9-6 |
| 1.2.9-7 | 15 | M | K1 | not yet stated | X1, 1.2.9-7 |
| 1.2.9-8 | 23 | M | K3 | not yet stated | X1, 1.2.9-8 |
| 1.2.9-9 | 11 | M | K3 | not yet stated | X1, 1.2.9-9 |
| 1.2.9-10 | 25 | M | K3 | not yet stated | X1, 1.2.9-10 |
| 1.2.9-11 | 25 | M | K3 | not yet stated | X1, 1.2.9-11 |
| 1.2.9-12 | 20 | M | K3 | not yet stated | X1, 1.2.9-12 |
| 1.2.9-13 | 22 | HM | K3 | not yet stated | X1, 1.2.9-13 |
| 1.2.9-14 | 21 | HM | K1 | not yet stated | X1, 1.2.9-14 |
| 1.2.9-15 | 28 | M | K3 | not yet stated | X1, 1.2.9-15 |
| 1.2.9-16 | 22 | M | K3 | not yet stated | X1, 1.2.9-16 |
| 1.2.9-17 | 25 | M | K3 | not yet stated | X1, 1.2.9-17 |
| 1.2.9-18 | 25 | M | K3 | not yet stated | X1, 1.2.9-18 |
| 1.2.9-19 | 32 | HM | K1 | not yet stated | X1, 1.2.9-19 |
| 1.2.9-20 | 21 | M | K3 | not yet stated | X1, 1.2.9-20 |
| 1.2.9-21 | 30 | HM | informal | not yet stated | X1, 1.2.9-21 |
| 1.2.9-22 | 21 | M | K3 | not yet stated | X1, 1.2.9-22 |
| 1.2.9-23 | 33 | M | K1 | not yet stated | X1, 1.2.9-23 |
| 1.2.9-24 | 22 | M | K1 | not yet stated | X1, 1.2.9-24 |
| 1.2.9-25 | 23 | M | K3 | not yet stated | X1, 1.2.9-25 |
| 1.2.9-26 | 40 | M | informal | not yet stated | X1, 1.2.9-26 |
The order to do them: 1.2.9-4, 9, 1 and 2 first, since each is a direct use of an equation. Then 1.2.9-5, 7 and 14, which prove eqs. (23), (38) and (13). Exercises 1.2.9-3 and 6 use the derivative, 1.2.9-12 uses a series in two variables, and 1.2.9-13 uses the Laplace transform. Exercises 1.2.9-8, 10, 11 and 18 are about partitions and symmetric functions, and they follow 1.2.9-9. Exercises 1.2.9-15, 16, 17, 20 and 22 ask for a closed form built with the rules of the section, and 1.2.9-24 and 25 use the coefficient notation. Exercise 1.2.9-19 (Gauss) and 1.2.9-23 are the hardest proofs, and 1.2.9-21 and 26 ask for an exploration with no fixed answer, so they come last.
Lean
The Lean code of tamnd/taocp-lean at main has the file TAOCP/V1/S1_2_9.lean, in the namespace TAOCP.S1_2_9. It states eqs. (1) to (9), (11) to (20), (22) to (29), (33) to (36) and (39), and it has the building blocks in TAOCP/Notation/GenFun.lean: TAOCP.ogf for eq. (1), TAOCP.egf for the exponential generating function, TAOCP.coeff_ogf and TAOCP.coeff_egf for the coefficients and TAOCP.coeff_ogf_mul for the product rule. The Stirling numbers are TAOCP.stirling1 and TAOCP.stirling2. The Node lines name the declarations. Where the Lean statement is weaker, the Node line says "partial".
Not yet stated: the generalized binomial series (eq. (21)), the series with (eq. (30)), the notation (eq. (31)), Cauchy's formula (eq. (32)) and the symmetric functions by power sums (eq. (38)). The declaration TAOCP.S1_2_9.eq31 states a use of the notation, that is the partial sum , and it is not the definition of the notation, so this chapter does not name it for eq. (31).
The fidelity choice of Lean is formal power series, PowerSeries, over a ring, or over ℚ where the statement needs division, so that the identities need no condition of convergence. The points where Lean differs from the book are these.
- Eq. (4) is stated without division: is its first terms plus times the series of . The handbook divides by .
- Eqs. (5), (16), (20) and (28) are stated as a product that equals or , so they have no division. For example,
TAOCP.S1_2_9.eq5says that the series of ones times is . - Eq. (9) is stated for a finite product, over a
Finset. The handbook has the infinite product with the condition on the sequences. - Eq. (10) has no declaration of its own. The binomial convolution is written inside
TAOCP.S1_2_9.eq11. - Eq. (12) is stated over
ℚ, and eq. (13) is stated overℂwith . - Eqs. (14) to (16) and (18) to (26) and (28) are formal series over
ℚ, and eq. (27) is stated in a commutative ring. Where the analytic form for real with is also stated, the name ends in_real. - Eq. (19) is stated for a natural exponent as a formal series (
TAOCP.S1_2_9.eq19) and for a real exponent as a convergent sum for (TAOCP.S1_2_9.eq19_real). The formal series with a real exponent is not stated. - Eq. (29) states that the series of times is . The recursion is not stated here.
- Eq. (33) is stated with the number of times that each index occurs. Eq. (35) and eq. (36) are in the other order in Lean:
TAOCP.S1_2_9.hSeriesis the product of eq. (36), andTAOCP.S1_2_9.hhtakes its coefficients.TAOCP.S1_2_9.eq36says that the product of times the series is . For eq. (37) the declarationTAOCP.S1_2_9.derivative_hSeriesstates the derivative of the series, which is eq. (37) after the differentiation. - The operation of the change is
TAOCP.S1_2_9.opD. The values of the first symmetric functions areTAOCP.S1_2_9.hh_zero,TAOCP.S1_2_9.hh_one,TAOCP.S1_2_9.hh_twoandTAOCP.S1_2_9.hh_three.
The Mathlib names that the statements use are these.
- Series:
PowerSeries.mk,PowerSeries.coeff,PowerSeries.coeff_mul,PowerSeries.derivativeandPowerSeries.exp. - Bernoulli and harmonic numbers:
bernoulliandharmonic, with the power seriesbernoulliPowerSeries. - Lagrange's theorem and Cauchy's formula have no counterpart in Mathlib in the form of the book.
Notes and history
Abraham de Moivre introduced generating functions to solve linear recurrences, in a paper of 1722. James Stirling (1730) added the derivative and the integral. Leonhard Euler used them for partitions in papers of 1741 and 1750, and the product of eq. (9) for is exercise 1.2.9-8. Pierre Simon Laplace gave the method its form in 1812. Augustin Louis Cauchy gave the integral of eq. (32) in 1826, and Joseph Louis Lagrange gave his theorem in 1770. The treatment of series without convergence is by E. T. Bell (1923) and Ivan Niven (1969). For a gentle start, the section points to G. Pólya, "On picture writing" (1956), to Chapter 7 of Concrete Mathematics and to the book generatingfunctionology of H. S. Wilf (second edition, 1994). Its last words are a remark of Wilf (1989), who compares a generating function to a line on which a sequence is put up to be seen. Sums of harmonic numbers that extend eqs. (25) and (26) are in papers of D. A. Zave (1976) and J. Spiess (1990).
The project has no errata of Section 1.2.9 to report.
Section 1.2.9 of TAOCP turns a sequence of numbers into one power series, so that the algebra and the calculus of series act on the whole sequence at once. The section lists the operations (sum, shift, product, change of the variable, derivative, integral), the table of the series that every reader must know, the extraction of a coefficient by a contour integral, and one long application: the formulas for the complete symmetric functions in terms of power sums. This chapter of C1 explains each of the 39 numbered equations of the section, proves each one in full, and checks it on numbers.
The source of this page. Something is wrong? Report it.