Proofs: Risch-Norman heuristic integration
These are the human proofs of Risch-Norman heuristic integration, at full length.
Every answer of the Risch-Norman heuristic is an antiderivative full
This proof shows: correctness.
Setting. is a field of characteristic (in the code, ). The differential field is with derivation , where , the constants of are , and with and . The scaled derivation is , so on polynomials , and maps into itself. The input is with , given by its factors, and a finite list of extra candidates. The output is FAIL or with and .
Theorem. (a) If the algorithm returns , then , every , and in any differential extension of that contains for each (elements with ),
(b) The algorithm returns FAIL exactly when no in the span of the monomials of total degree at most and no constants satisfy (a) with the and the chosen in L1 and L2.
FAIL does not say that has no elementary integral. Part (b) only says that the search in the chosen finite family was complete.
Lemma 1 (the derivative of the guess)
Let over the candidates of L2, and for unknowns and in , let . Then
Proof. The quotient rule holds for any derivation: . Multiplying by turns into on polynomials, so . For the logarithms, . Multiply the bracket by and use .
Lemma 2 (the linear system)
The right side of Lemma 1 is linear in the unknowns : is -linear because the constants of are , and the products are with fixed polynomials. Write it as , where , and . These are the columns built in L5 and the right side built in L6. A polynomial is zero exactly when every coefficient is zero, so the right side of Lemma 1 vanishes exactly when the vector of unknowns solves the linear system with one equation for each monomial that occurs in some column or in .
Lemma 3 (step L7)
Gauss-Jordan elimination over returns a solution of a linear system when one exists, and reports that none exists otherwise.
Proof. Each step swaps two rows, scales a row by a nonzero element of , or adds a multiple of one row to another. These are invertible, so the solution set stays the same. At the end the matrix is in reduced row echelon form with pivot columns . A row below the first has zero coefficients. If such a row has a nonzero right side, it reads and the system has no solution. Otherwise set every free unknown to and the pivot unknown of row to the right side of row . Each of the first rows has a in its pivot column, zeros in the other pivot columns, and only free unknowns elsewhere, so every equation holds. All arithmetic is exact in .
Proof of the theorem
is a product of powers of the factors of . These are nonzero, since is the denominator of , so . The candidates are nonzero factors of or nonzero extra polynomials, so . Also . So , and the bracket in Lemma 1 is zero exactly when the right side of Lemma 1 is the zero polynomial.
(a) If L7 returns a vector, Lemma 3 says it solves the system, and Lemma 2 says that the right side of Lemma 1 is zero for it. Divide by in the field of fractions: the bracket is zero, which is the claim. Candidates with are dropped from the output, and this does not change the sum.
(b) If some of total degree at most and some constants satisfy (a), then the bracket is zero, so by Lemma 1 and Lemma 2 their coefficients solve the system, and Lemma 3 returns a solution. Conversely, by (a), a returned vector gives such and . So FAIL is returned exactly when no such choice exists.
The zero integrand gives , and no logarithms, whose derivative is .
Remark (what is not proved). The theorem is about soundness. The choice of in L1 follows the structure of the integral in the purely transcendental case: a normal factor of multiplicity in occurs with multiplicity at most in the denominator of the rational part, as in Hermite reduction. The guess may still be too small in three ways. The degree bound can be too low. A special factor can need another exponent. The logarithmic part can need arguments that are not among the candidates, or constants outside . In each case the algorithm returns FAIL although an elementary integral exists.