Logic & kernel theory

Certificates

Algorithms are untrusted. Each returns, with its answer, a certificate: data from which the kernel derives the answer's claim with a short proof. This page states, for each kind of certificate, the claim, the check, and the theorem that makes the check sufficient. In every case the check is far simpler than the computation that produced the certificate.

Polynomial arithmetic in the checks is literal arithmetic on formal polynomials (the implemented literal kind and its laws), and identities between polynomial expressions are proved by reification (Theorems P-4 and P-5), so the checks are linear in the size of the certificate.

Polynomial algebra

Theorem Z-1 (identity and expansion). A claimed identity \(e_1 = e_2\) between polynomial expressions, or an expansion \(e \mapsto P\), is certified by the reified polynomials; the claim holds for finite atoms (Theorem P-5).

Theorem Z-2 (cancellation needs only divisibility). Let \(p, q, g\) be polynomials with certificates \(p = g p'\) and \(q = g q'\) (the cofactors are the certificate). Then, for finite values of the variables with \(q \ne 0\), \(p / q = p' / q'\).

Proof. \(q = g q' \ne 0\) forces \(g \ne 0\) and \(q' \ne 0\) (Corollary X-7). Then \(p/q = (g p')/(g q') = p'/q'\) by the guarded field laws (Theorem X-5). \(\square\)

Soundness of a cancellation needs nothing more. That \(g\) is a greatest common divisor (so that \(p'/q'\) is fully reduced) is a claim about the quality of the answer; it is certified separately, as follows.

Theorem Z-3 (gcd certificates).

  1. Univariate, over a field. If \(p = g p'\), \(q = g q'\), and \(g = u p + v q\) for polynomials \(u, v\), then \(g\) is a greatest common divisor of \(p\) and \(q\).
  2. Multivariate. Let \(p', q' \in \mathbb Q[x_1, \dots, x_n]\). If \(u p' + v q' = s\) for some nonzero \(s \in \mathbb Q[x_2, \dots, x_n]\), and the contents of \(p'\) and \(q'\) with respect to \(x_1\) are coprime (certified recursively, in fewer variables), then \(p'\) and \(q'\) are coprime.

Proof. (1) Every common divisor \(d\) of \(p\) and \(q\) divides \(up + vq = g\), and \(g\) divides both. (2) \(\mathbb Q[x_1, \dots, x_n]\) is a unique factorization domain (Gauss's lemma). Suppose an irreducible \(h\) divides \(p'\) and \(q'\). Then \(h\) divides \(s\), which does not involve \(x_1\), so \(h\) has degree \(0\) in \(x_1\): \(h \in \mathbb Q[x_2, \dots, x_n]\). An irreducible polynomial free of \(x_1\) that divides a polynomial divides each of its coefficients with respect to \(x_1\), hence its content. So \(h\) divides both contents, contradicting their coprimality. \(\square\)

In the multivariate case a Bézout identity with \(s = 1\) need not exist (the ideal \((x, y)\) is not principal), which is why statement 2 allows a nonzero \(s\) free of \(x_1\); \(s\) is, for example, a resultant.

Theorem Z-4 (factorization). A claimed factorization \(p = c \prod_i f_i^{e_i}\) is certified by multiplying out (Theorem Z-1). Irreducibility of the \(f_i\) is a separate claim, not needed for the equation, and not certified.

Theorem Z-5 (ideal membership). If \(f = \sum_i h_i g_i\) as polynomials (the cofactors \(h_i\) are the certificate), then for finite values of the variables, \(g_1 = \cdots = g_s = 0\) implies \(f = 0\).

Proof. Theorem P-2: evaluation on finite values is a ring homomorphism. \(\square\)

Completeness: if \(f\) lies in the ideal, cofactors exist by definition, and Buchberger's algorithm with cofactor tracking finds them [Cox, Little and O'Shea 2015, ch. 2].

Linear arithmetic

Definition Z-1. Hypotheses are linear constraints \(\ell_i(\bar x) \bowtie_i 0\) with \(\bowtie_i \in \{>, \ge, =\}\) and \(\ell_i\) affine with rational coefficients, over variables with finite real values. A Farkas certificate is a vector of rationals \(\lambda_i\), with \(\lambda_i \ge 0\) when \(\bowtie_i\) is an inequality, such that \(\sum_i \lambda_i \ell_i = c\) is a constant (all variable coefficients cancel) and either \(c < 0\), or \(c \le 0\) and \(\lambda_i > 0\) for some strict inequality.

Theorem Z-6 (Farkas certificates are sound). If a Farkas certificate exists, the hypotheses have no common solution in \(\mathbb R\).

Proof. At a solution, \(\sum_i \lambda_i \ell_i(\bar x) \ge 0\), and \(> 0\) if some strict inequality has a positive multiplier; but it equals \(c\). \(\square\)

Theorem Z-7 (completeness, cited). If a finite system of strict and non-strict linear inequalities and equations with rational coefficients has no real solution, a Farkas certificate with rational multipliers exists. This is Farkas's lemma in Motzkin's form [Schrijver 1986, §7].

A linear goal is proved by refuting its negation. For example, \(x > 2 \vdash x \ne 1\): the negated goal \(x - 1 = 0\) and the hypothesis \(x - 2 > 0\) have the certificate \(\lambda = (-1, 1)\): \(-(x - 1) + (x - 2) = -1\), with a positive multiplier on the strict inequality. The kernel checks the combination by polynomial arithmetic and the inequality reasoning by the ordered-field lemmas of the profile, in a number of steps linear in the certificate. In scalar, the variables must be real and finite (Definition X-P1).

Antiderivatives and Rubi

Definition Z-2. For an open set \(U\) and functions \(F, f\), \(F\) is an antiderivative of \(f\) on \(U\) when, for every \(x \in U\), \(F\) is differentiable at \(x\) and \(F'(x) = f(x)\).

Theorem Z-8 (certifying an antiderivative). Suppose proof-producing differentiation derives \(F'(x) = g(x)\) for all \(x\) satisfying a guard \(G_D(x)\) (each differentiation rule contributes its own condition, such as \(u(x) > 0\) for \(\log u\) on the reals), and simplification derives \(g(x) = f(x)\) under a guard \(G_S(x)\). Then \(F\) is an antiderivative of \(f\) on every open set \(U\) on which \(G_D\) and \(G_S\) hold.

Proof. By Definition Z-2, pointwise. \(\square\)

This is the claim a certified Rubi answer carries: an antiderivative relation on the domain where its guards hold. Rubi's search, which produced \(F\), is not trusted at all.

Theorem Z-9 (definite integrals, cited). If \(F\) is continuous on \([a, b]\), an antiderivative of \(f\) on \((a, b)\), and \(f\) is integrable on \([a, b]\), then \(\int_a^b f = F(b) - F(a)\) (the fundamental theorem of calculus).

The continuity of \(F\) on the whole interval is a separate obligation. Antiderivatives produced by integration systems are often discontinuous across branch cuts, which makes naive evaluation of definite integrals wrong; the obligation catches this [Jeffrey 1993].

Theorem Z-10 (ball refutation). Let \(\hat a\) and \(\hat b\) be balls (midpoint-radius enclosures) containing the true values \(a\) and \(b\), as computed by ball arithmetic [Johansson 2017]. If \(\hat a \cap \hat b = \emptyset\), then \(a \ne b\). If they intersect, nothing follows.

Proof. The enclosure property: each ball contains its true value. \(\square\)

Uses: refuting a candidate antiderivative before attempting a proof (compare \(g(x_0)\) with \(f(x_0)\) at sample points; disjoint balls show the candidate or its derivative is wrong), and the numeric filter for rule libraries (architecture note, section 31.3). The filter's sample points must satisfy the rule's guard, which balls can also establish (a ball inside the region where the guard holds). Because overlap proves nothing, a rule that passes the filter still needs a proof or an imported statement.

Holonomic functions and sequences

Definition Z-3. A function \(f\), analytic on an open connected set, is holonomic (D-finite) when \(L f = 0\) for a nonzero linear differential operator \(L = \sum_{i=0}^{r} p_i(x)\, \partial^i\) with polynomial coefficients and \(p_r \ne 0\). A point \(x_0\) is ordinary for \(L\) when \(p_r(x_0) \ne 0\). A sequence \(a\) is P-recursive when \(\sum_{i=0}^{r} p_i(n)\, a(n+i) = 0\) for all \(n \ge n_0\), with polynomial \(p_i\) and \(p_r(n) \ne 0\) for \(n \ge n_0\).

Theorem Z-11 (closure, cited). Sums and products of holonomic functions are holonomic, with annihilators of order at most \(r_1 + r_2\) and \(r_1 r_2\) respectively; the same holds for P-recursive sequences [Stanley 1980; Kauers and Paule 2011].

Theorem Z-12 (equality of holonomic functions).

  1. Common annihilator. If \(L = Q_1 L_1 = Q_2 L_2\) in the Ore algebra of operators (the cofactors \(Q_1, Q_2\) are the certificate), then \(L\) annihilates every function annihilated by \(L_1\) or by \(L_2\), and hence their sums.
  2. Uniqueness. If \(L f = L g = 0\) on an open connected set \(\Omega\) on which \(f\) and \(g\) are analytic and \(p_r\) has no zero, and \(f^{(k)}(x_0) = g^{(k)}(x_0)\) for \(k < r\) at some \(x_0 \in \Omega\), then \(f = g\) on \(\Omega\).
  3. Sequences. If two sequences satisfy the same recurrence with \(p_r(n) \ne 0\) for all \(n \ge n_0\), and agree for \(n = n_0, \dots, n_0 + r - 1\), they agree for all \(n \ge n_0\).

Proof. (1) \(L(f) = Q_i(L_i f) = Q_i(0) = 0\), and \(L\) is linear. (2) \(h = f - g\) satisfies \(L h = 0\) with zero initial values at the ordinary point \(x_0\); by the existence and uniqueness theorem for linear ordinary differential equations with analytic coefficients [Coddington and Levinson 1955], \(h = 0\) near \(x_0\), and by the identity theorem for analytic functions \(h = 0\) on the connected set \(\Omega\). (3) Induction on \(n\): \(a(n + r)\) is determined by the \(r\) previous values, because \(p_r(n) \ne 0\). \(\square\)

Statement 2 is an admitted theorem until the analysis theories of the analysis page can prove it; statement 3 needs induction. The check itself is operator arithmetic and the comparison of finitely many initial values. Points where \(p_r\) vanishes are singular and must be excluded from \(\Omega\); this is where naive holonomic arguments fail.

Hypergeometric functions. \({}_pF_q(\bar a; \bar b; z)\) satisfies the operator \(\theta \prod_j (\theta + b_j - 1) - z \prod_i (\theta + a_i)\) with \(\theta = z\, d/dz\), of order \(\max(p, q + 1)\) [DLMF, §16.8(i)]. Its coefficient sequence is hypergeometric, so identities between power series of hypergeometric type are certified by Theorem Z-12(3) on coefficients: equal coefficients give equal sums inside the common disc of convergence. The origin is a singular point of the differential operator, so the coefficient route, not Theorem Z-12(2) at \(z = 0\), is the one to use there.

Meijer G functions. The Adamchik–Marichev method evaluates integrals of products of Meijer G functions as Meijer G functions [Adamchik and Marichev 1990]. The underlying convolution theorem holds under conditions on the parameters, and it enters as a proved or imported theorem with those conditions as guards, never on numeric evidence (integration contracts). Its results are checked holonomically where possible (a Meijer G function satisfies a linear differential equation of order \(\max(p, q)\) [DLMF, §16.21]) and refuted numerically otherwise (Theorem Z-10).

Definite sums

Theorem Z-13 (WZ pairs, cited). Let \(F(n, k)\) be a hypergeometric term and \(R(n, k)\) a rational function, \(G = R F\), such that

\[ F(n+1, k) - F(n, k) = G(n, k+1) - G(n, k) \]

for all integers \(n \ge 0\) and \(k\), and for each \(n\), \(F(n, k)\) and \(G(n, k)\) vanish for all but finitely many \(k\). Then \(\sum_k F(n, k)\) does not depend on \(n\) [Petkovšek, Wilf and Zeilberger 1996, ch. 7].

Proof. Sum the equation over \(k\); the right side telescopes to \(0\). \(\square\)

The check divides the equation by \(F(n, k)\), which turns it into an identity of rational functions in \(n\) and \(k\), certified by polynomial arithmetic (Theorem P-6). That identity holds where its denominators are nonzero; the integer points where a denominator vanishes, or where \(F(n, k) = 0\), are not covered and must be checked separately. Overlooking them is the standard pitfall of WZ proofs.

judgment v1.0.0 for Mojo 1.2 · Apache License 2.0 with LLVM Exceptions · Source on GitHub