A complete equational axiomatisation of partial differentiation
aa r X i v : . [ c s . L O ] A ug A complete equational axiomatisation of partial differentiation ∗ Gordon D. PlotkinGoogle ResearchMountain View, United States
Abstract
We formalise the well-known rules of partial differentiation in a version of equational logic withfunction variables and binding constructs. We prove the resulting theory is complete with respect topolynomial interpretations. The proof makes use of Severi’s interpolation theorem that all multivariateHermite problems are solvable. We also present a number of related results, such as decidability andequational completeness.
There has been recent increasing interest in categorical axiomatisations of differential structure. Forexample, for forward differentiation, see [2]; for reverse differentiation see [4]; and for tangent structures,see [3]. A natural question is whether the axioms are well chosen. The authors generally show they hold innatural structures. For example, in the case of cartesian differential categories they hold for the categoryof finite powers of the reals and smooth functions. So the axioms are, in that sense, correct. But one canadditionally ask, if, or in what sense, they are complete, that is whether there are missing axioms.Here we interest ourselves in an allied basic logical question which we hope will help with the categoricalone: are the standard rules for manipulating partial derivatives complete? The rules are indeed well known:derivatives of products and sums are given by simple formulas involving their immediate subexpressionsand their partial derivatives; derivatives of real constants and variables are 0 or 1; the chain rule takescare of function applications; and partial derivatives with respect to different variables commute. Theyare surely complete.To prove this, we proceed by first formalising the standard rules of partial differentiation using a suitablekind of equational logic. Our axiom system consists of the ring axioms, addition and multiplication tablesfor the reals, and four axioms for partial differentiation. As partial differentiation involves variable binding,we are outside the scope of standard equational logic. So we instead use an expanded version which allowsbinding constructs and makes use of function variables. An equational logic of this kind, called second-orderequational logic , has been presented by Fiore, Hur, and Mahmoud [6, 7]. We employ a minor, althoughentirely equivalent, variant of their logic.The resulting theory of partial differentiation is naturally interpreted using smooth functions, but, forcompleteness, it turns out that it suffices to use only polynomial functions. Indeed, the theory is completeeven if the interpretation of function variables is restricted to natural number polynomial functions, andthe interpretation of variables to natural numbers. This remains the case if the constants are restricted tothe rationals or to 0 and 1 (equivalently the integers).To establish completeness we employ an interpolation theorem, a well-known theorem of Severi [12] onthe solvability of Hermite interpolation problems. Hermite interpolation generalises Lagrange interpolation. ∗ This is a version with minor corrections of a paper given at MFPS 2020.
1n Lagrange interpolation, one seeks a real polynomial taking prescribed values at prescribed points,and this has an evident generalization to multivariate Lagrange interpolation. In multivariate Hermiteinterpolation, one additionally prescribes values of (possibly higher-order) partial derivatives.Theorem 4 establishes completeness relative to natural number polynomial interpretations of functionvariables and natural number interpretations of variables. (The polynomials are adaptations of real polyno-mials solving suitable Hermite interpolation problems.) We also give a number of other results. Theorem 5characterises the theorems of our equational theory in terms of an equivalence relation between canonicalforms. Theorem 6 shows that the equivalence relation holds if, and only if, it can be established usingjust one axiom for partial differentiation, that the order of partial differentiation by two variables does notmatter (with a slightly more refined notion of canonical form this axiom can be eliminated, when no axiomsfor partial differentiation are needed). Theorem 7 shows that the theory is not only complete with respectto standard interpretations over the reals, it is also equationally complete (also known as Hilbert-Postcomplete), that is, it has no equationally consistent proper extensions, see [14]. This remains the case ifthe constants are restricted to the rationals but not if they are restricted to the integers. Theorem 8 showsthat the subtheory in which the constants are restricted to the rationals is decidable, and that, in casean equation does not hold, a counterexample to it can be found. An important remaining question is thecomplexity of the decision problem.
We assume disjoint sets of variables, ranged over by x, y, z, . . . , and of function variables, ranged over by f, g, h, . . . ; each function variable has a given arity n ≥
0, written f : n . The set of variables is assumeddenumerable, as is the set of function variables of each arity. Expressions have the following forms: e ::= r ( r ∈ R ) | x | e + e | e e | f ( e , . . . , e n − ) ( f : n ) | PDiff( x.e , e )The expression PDiff( x.e , e ) is read as the partial derivative of e with respect to x , evaluated at e .In this expression, the variable x has binding power over e , but not over e . Below, we use the morefamiliar, and more natural, expression ∂e ∂x (cid:12)(cid:12) x = e (while more natural, this expression obscures the role ofthe variable x ). We write ∂∂x e for ∂e∂x (cid:12)(cid:12) x = x , and note that the last occurrence of x is free; we write ∂ n e∂x n − ...∂x for ∂∂x n − . . . ∂∂x e .Free variables and α -equivalence, are defined as usual, and, as is also usual, we identify α -equivalentexpressions. We write FV( e ) for the set of free variables of an expression e and FnV( e ) for the set of itsfunction variables. Every expression e has a size | e | , defined in an evident way.The simultaneous substitution e [ e ′ /x , . . . , e ′ n − /x n − ]of expressions for variables is defined as may be expected, with the clause for PDiff( x.e , e ), with its boundvariable, being:PDiff( x.e , e )[ e ′ /x , . . . , e ′ n − /x n − ] = PDiff( x.e [ e ′ /x , . . . , e ′ n − /x n − ] , e [ e ′ /x , . . . , e ′ n − /x n − ])where x / ∈ FV( e ′ ) ∪ . . . ∪ FV( e ′ n − ). There is also a notion of substitution of abstracts ( x , . . . , x n − ) .e ′ forfunction variables. For f : n , we define e [( x , . . . , x n − ) .e ′ /f ]by structural induction on e as follows: 2 [( x , . . . , x n − ) .e ′ /f ] = rx [( x , . . . , x n − ) .e ′ /f ] = x ( e + e )[( x , . . . , x n − ) .e ′ /f ] = e [( x , . . . , x n − ) .e ′ /f ] + e [( x , . . . , x n − ) .e ′ /f ]( e e )[( x , . . . , x n − ) .e ′ /f ] = e [( x , . . . , x n − ) .e ′ /f ] e [( x , . . . , x n − ) .e ′ /f ] g ( e , . . . , e n − )[( x , . . . , x n − ) .e ′ /f ] = e ′ [ e [( x , . . . , x n − ) .e ′ /f ] /x , . . . ,e n − [( x , . . . , x n − ) .e ′ /f ] /x n − ]( g = f ) g ( e [( x , . . . , x n − ) .e ′ /f ] , . . . ,e n − [( x , . . . , x n − ) .e ′ /f ]) ( g = f )PDiff( x. e , e )[( x , . . . , x n − ) .e ′ /f ] = PDiff( x. e [( x , . . . , x n − ) .e ′ /f ] , e [( x , . . . , x n − ) .e ′ /f ])( x / ∈ FV( e ′ ) \{ x , . . . , x n − } )There is a more general, similarly defined, simultaneous substitution of several abstracts: e [( x , . . . , x n ) .e ′ /f , . . . , ( x k , . . . , x kn k ) .e ′ k /f k ]where f i : n i , for i = 1 , k .The axioms of the theory of partial differentiation consist of those for commutative rings, the additionand multiplication tables for the real constants, and four axioms for partial differentiation. The four axiomsare the usual rules for the differentiation of addition and multiplication, the chain rule for binary functions,and the commutativity of partial differentiation with respect to different variables. ∂ x + y∂x = 1 ∂yx∂x = y∂ f ( g ( x ) , g ( x )) ∂x = ∂f ( x , g ( x )) ∂x (cid:12)(cid:12)(cid:12)(cid:12) x = g ( x ) ∂g ( x ) ∂x + ∂f ( g ( x ) , x ) ∂x (cid:12)(cid:12)(cid:12)(cid:12) x = g ( x ) ∂g ( x ) ∂x∂∂y ∂∂x f ( x, y ) = ∂∂x ∂∂y f ( x, y )The theorems of the theory of partial differentiation are obtained by closing the axioms under theevident rules for equality, congruence, and both kinds of substitution, following the usual pattern forequational systems. In particular, the congruence rule for partial differentiation is as follows: e = e e ′ = e ′ PDiff( x. e , e ′ ) = PDiff( x. e , e ′ )If an equation e = e holds in this theory we write ⊢ e = e
3e next establish a number of expected consequences of the axioms, including a general form of thechain rule. We employ an evident abbreviation P ni = m e i for finite sum expressions. Lemma 1.
The following equations are provable in the theory of partial differentiation:1. ∂x∂x = 1 ∂ f ( x ) + g ( x ) ∂x = ∂f ( x ) ∂x + ∂g ( x ) ∂x ∂ f ( x ) g ( x ) ∂x = g ( x ) ∂f ( x ) ∂x + f ( x ) ∂g ( x ) ∂x ∂ f ( g ( x ) , . . . , g n − ( x )) ∂x = n − X i =0 ∂f ( g ( x ) , . . . , g i − ( x ) , x i , g i +1 ( x ) , . . . , g n − ( x )) ∂x i (cid:12)(cid:12)(cid:12)(cid:12) x i = g i ( x ) ∂g i ( x ) ∂x ∂e∂x = 0 ( x / ∈ FV( e )) Proof.
1. This follows from the axiom for addition, substituting 0 for y .2. This follows from the axiom for addition and the binary chain rule.3. This follows from the axiom for multiplication and the binary chain rule.4. First, note that, substituting 0 for y in the axiom for multiplication, we obtain ∂ ∂x = 0. Next, for thecase n = 0 of the chain rule, substitute ( x , x ) . h () for f and ( z ) . g and g in the binarychain rule to get the following provable equations: ∂h () ∂x = ∂h () ∂x (cid:12)(cid:12)(cid:12) x =0 ∂ ∂x + ∂h () ∂x (cid:12)(cid:12)(cid:12) x =0 ∂ ∂x = ∂h () ∂x (cid:12)(cid:12)(cid:12) x =0 + ∂h () ∂x (cid:12)(cid:12)(cid:12) x =0 = Next, for the unary chain rule, substitute ( x , x ) . h ( x ) for f and ( z ) . g in the binary chainrule to get the following provable equations: ∂h ( g ( x )) ∂x = ∂h ( x ) ∂x (cid:12)(cid:12)(cid:12) x = g ( x ) ∂g ( x ) ∂x + ∂h ( x ) ∂x (cid:12)(cid:12)(cid:12) x =0 ∂ ∂x = ∂h ( x ) ∂x (cid:12)(cid:12)(cid:12) x = g ( x ) ∂g ( x ) ∂x Finally, for n ≥
2, we proceed by induction. The axiom provides the base case, so assuming theinduction hypothesis for n , we prove it for n + 1. Substituting ( z ) . z for g and g in the binary chainrule, and using ∂x∂x = 1, we obtain the following equation: ∂ f ( x, x ) ∂x = ∂f ( x ′ , x ) ∂x ′ (cid:12)(cid:12)(cid:12)(cid:12) x ′ = x + ∂f ( x, x ′ ) ∂x ′ (cid:12)(cid:12)(cid:12)(cid:12) x ′ = x x, y ) . h ( g ( x ) , g ( y ) , . . . , g n ( y )) for f , we obtain: ∂ h ( g ( x ) , g ( x ) , . . . , g n ( x )) ∂x = ∂h ( g ( x ′ ) , g ( x ) , . . . , g n ( x )) ∂x ′ (cid:12)(cid:12)(cid:12)(cid:12) x ′ = x + ∂h ( g ( x ) , g ( x ′ ) , . . . , g n ( x ′ )) ∂x ′ (cid:12)(cid:12)(cid:12)(cid:12) x ′ = x For the first of these two summands we have: ∂h ( g ( x ′ ) ,g ( x ) ,...,g n ( x )) ∂x ′ (cid:12)(cid:12)(cid:12) x ′ = x = ∂h ( g ( x ′ ) ,g ( x ) ,...,g n ( x )) ∂x ′ [ x/x ′ ]= (cid:18) ∂h ( x ,g ( x ) ,...,g n ( x )) ∂x (cid:12)(cid:12)(cid:12) x = g ( x ′ ) ∂g ( x ′ ) ∂x ′ (cid:19) [ x/x ′ ]= ∂h ( x ,g ( x ) ,...,g n ( x )) ∂x (cid:12)(cid:12)(cid:12) x = g ( x ) ∂g ( x ) ∂x with the second equality being an application of the unary chain rule and the other two equalitiesbeing syntactic identities (the second up to α -equivalence).For the second of these, making use of the induction hypothesis (the n -ary chain rule) we have: ∂h ( g ( x ) ,g ( x ′ ) ,...,g n ( x ′ )) ∂x ′ (cid:12)(cid:12)(cid:12) x ′ = x = ∂h ( g ( x ) ,g ( x ′ ) ,...,g n ( x ′ )) ∂x ′ [ x/x ′ ]= (cid:18)P ni =1 ∂h ( g ( x ) ,g ( x ′ ) ,...,g i − ( x ′ ) ,x i ,g i +1 ( x ′ ) ,...,g n ( x ′ )) ∂x i (cid:12)(cid:12)(cid:12) x i = g i ( x ′ ) ∂g i ( x ′ ) ∂x ′ (cid:19) [ x/x ′ ]= P ni =1 ∂h ( g ( x ) ,g ( x ) ,...,g i − ( x ) ,x i ,g i +1 ( x ) ,...,g n ( x )) ∂x i (cid:12)(cid:12)(cid:12) x i = g i ( x ) ∂g i ( x ) ∂x Combining the results, we reach the desired conclusion.5. For n = 0, the chain rule is ∂f () ∂x = 0, where f : 0. Substituting ( ) . e for f we obtain ∂e∂x = 0 as x / ∈ FV( e ).It will prove useful to know the interaction between differentiation and substitution: Lemma 2.
The following are equivalent:1. The general chain rule.2. The following substitution principle, that for all expressions e and e , . . . , e n − we have: ⊢ ∂e [ e /x , . . . , e n − /x n − ] ∂x = n − X i =0 ∂e∂x i [ e /x , . . . , e n − /x n − ] ∂e i ∂x where x , . . . , x n − are distinct variables such that x / ∈ FV( e ) \{ x , . . . , x n − } .Proof. In one direction assume the general chain rule. Choose f : n not in any of the FnV( e i ). Using thegeneral chain rule we have: ⊢ ∂f ( e , . . . , e n − ) ∂x = n − X i =0 ∂f ( e , . . . , e i − , x i , e i +1 , . . . , e n − ) ∂x i (cid:12)(cid:12)(cid:12)(cid:12) x i = e i ∂e i ∂x Then, substituting ( x , . . . , x n − ) . e for f on the left we have the following identities (recall that we identify α -equivalent expressions): ∂f ( e ,...,e n − ) ∂x [( x , . . . , x n − ) . e/f ] = ∂f ( e ,...,e n − )[( x ,...,x n − ) . e/f ] ∂x ( as x / ∈ FV( e ) \{ x , . . . , x n − } )= ∂e [ e /x ,...,e n − /x n − ] ∂x ( as f / ∈ FnV( e , . . . , e n − ))5ext, substituting on the right, we have the identities: (cid:18)P n − i =0 ∂f ( e ,...,e i − ,x i ,e i +1 ,...,e n − ) ∂x i (cid:12)(cid:12)(cid:12) x i = e i ∂e i ∂x (cid:19) [( x , . . . , x n − ) . e/f ]= P n − i =0 (cid:18) ∂f ( e ,...,e i − ,x i ,e i +1 ,...,e n − ) ∂x i (cid:12)(cid:12)(cid:12) x i = e i [( x , . . . , x n − ) . e/f ] (cid:19) ∂e i ∂x ( as f / ∈ FnV( e i ), for i = 0 , . . . , n − )= P n − i =0 (cid:18) ∂f ( e ,...,e i − ,x i ,e i +1 ,...,e n − )[( x ,...,x n − ) . e/f ] ∂x i (cid:12)(cid:12)(cid:12) x i = e i (cid:19) ∂e i ∂x ( as x i / ∈ FV( e ) \{ x , . . . , x n − } )= P n − i =0 ∂e [ e /x ,...,e i − /x i − ,x i /x i ,e i +1 /x i +1 ,...,e n − /x n − ] ∂x i (cid:12)(cid:12)(cid:12) x i = e i ∂e i ∂x ( as f / ∈ FnV( e , . . . , e i − , e i +1 , . . . , e n − ) )= P n − i =0 ∂e [ e /x ,...,e i − /x i − ,e i +1 /x i +1 ,...,e n − /x n − ] ∂x i (cid:12)(cid:12)(cid:12) x i = e i ∂e i ∂x = P n − i =0 ∂e∂x i [ e /x , . . . , e n − /x n − ] ∂e i ∂x and the conclusion follows.In the other direction, assuming the substitution principle, take e to be f ( x , . . . , x n − ) (whenFV( e ) \{ x , . . . , x n − } = ∅ ) and e i to be g i ( x ) for i = 0 , n −
1, to obtain: ⊢ ∂f ( g ( x ) , . . . , g n − ( x )) ∂x = n − X i =0 ∂f ( x , . . . , x n − ) ∂x i [ g ( x ) /x , . . . , g n − ( x ) /x n − ] ∂g i ( x ) ∂x As ∂f ( x , . . . , x n − ) ∂x i [ g ( x ) /x , . . . , g n − ( x ) /x n − ]and ∂f ( g ( x ) , . . . , g i − ( x ) , x i , g i +1 ( x ) , . . . , g n − ( x )) ∂x i (cid:12)(cid:12)(cid:12)(cid:12) x i = g i ( x ) are α -equivalent, we are done.A (real) polynomial is (as usual) an expression containing no function variables or partial differentia-tions; it is a natural number polynomial if all its constants are natural numbers. We write P ( x , . . . , x n − )to indicate that P is a real polynomial whose (necessarily free) variables are included in { x , . . . , x n − } ; forexpressions e , . . . , e n − we may then write P ( e , . . . , e n − ) for P [ e /x , . . . , e n − /x n − ]. We write P ∼ P ′ tomean that the polynomials P and P ′ are equal modulo the axioms for commutative rings and the additionand multiplication tables for the real constants.We remark that our equational system is an instance of a second-order equational logic for binding.This logic has operator constants op of arities of the form ( b , . . . , b n − ; m ) ( b i , m ≥ n abstracts, of respective arities b , . . . , b n − , and m expressions. Withthis notation, + has arity (; 2) and PDiff has arity (1; 1). This system is single-sorted; there is a naturalgeneralisation to a multisorted version.In [6] Fiore and Hur gave a multisorted second-order equational logic, and in [7] Fiore and Mahmoudconsidered the single-sorted case. The differences between their systems and ours are inessential: what weterm ‘function variables’ they term ‘metavariables’; whereas our function variables come with preassignedarities, theirs do not, and they rather utilise suitable environments; their arities are of the simpler form( b , . . . , b n − ) but are no less general, as the extra arguments become 0-ary abstracts; and whereas we haveboth a substitution operation for function variables and a context rule, they employ a single equivalentrule. A single substitution version of their equivalent rule is: e = e e [( x , . . . , x n − ) .e ′ /f ] = e [( x , . . . , x n − ) .e ′ /f ]6hey employ a simultaneous substitution version of this rule, which is, in any case, equivalent to the singlesubstitution rule.Returning to our single-sorted version of second-order equational logic, we say that an equational theoryis equationally inconsistent if x = y is a theorem (with x , y different), and we say that an an equationaltheory is equationally complete if any extension of it by a single non-theorem is equationally inconsistent.Note that this is a syntactic criterion, independent of any particular model.Polynomials provide an example of equational completeness, though one without a binding operator.The theory is that of commutative rings with constants for all reals and addition and multiplication tables(i.e., our theory less partial differentiation). The idea of the proof is that distinct polynomials have distinctvalues for suitable choices of values for their variables. This can be formalised within the logic, and so,given an equation between distinct polynomials, two distinct reals can be proved equal, and that, in turn,enables one to prove x = y .The λβη -calculus provides a partial example with a binding operator. It can be formalised as a second-order theory with a binary application operator ap : (; 2) and a unary lambda abstraction operator λ : (1; 0)and the two equations ap( λ (( x ) . f ( x )) , y ) = f ( y ) λ (( y ) . ap( x, y )) = x While not equationally complete, it is partially so in the sense that, by B¨ohm’s theorem [1], no twodistinct βη -normal forms can be consistently equated. The theory of the Beta-Bernoulli process [13] alsohas binding operators; it is formulated using an equational logic that is a bit different than ours in orderto accommodate algebraic effects. The theory is almost equationally complete, in the sense that it has justone consistent extension. In this extension all quantitative information about probabilities is lost, and socan be ruled out for the purposes at hand. We give a semantics of our partial differentiation expressions using smooth functions h : R n → R . An environment ρ is a function from variables to reals; a function environment ϕ is a function from functionvariables to smooth functions that sends function variables of arity n to smooth functions on R n . Wewrite ρ [ r /x , . . . , r n − /x n − ] for the environment with value r i on x i (for i = 0 , n −
1) and value ρ ( x )on any other variable x ; function environments ϕ [ h /f , . . . , h n − /f n − ], where h i is m -ary if f i : m , aredefined similarly. We write 0 for both the constantly 0 environment and the function environment yieldingconstantly 0 functions.We define the denotation S [[ e ]] ϕρ of an expression relative to a function environment and an environmentby the following clauses: S [[ r ]] ϕρ = r S [[ x ]] ϕρ = ρ ( x ) S [[ e + e ′ ]] ϕρ = S [[ e ]] ϕρ + S [[ e ′ ]] ϕρ S [[ ee ′ ]] ϕρ = S [[ e ]] ϕρ × S [[ e ′ ]] ϕρ S [[ f ( e , . . . , e n − )]] ϕρ = ϕ ( f )( S [[ e ]] ϕρ, . . . , S [[ e n − ]] ϕρ ) S [[PDiff( x. e, e ′ )]] ϕρ = D ( r ∈ R
7→ S [[ e ]] ϕρ [ r/x ])( S [[ e ′ ]] ϕρ )Prima facie this definition may not be proper as the last clause makes sense only if the function r ∈ R
7→ S [[ e ]] ϕρ [ r/x ] is differentiable. However one proves by structural induction that the definitionis proper and, in addition, that for any variables x , . . . , x n − the function sending r , . . . , r n − ∈ R to S [[ e ]] ϕρ [ r /x , . . . , r n − /x n − ] is smooth.The denotation S [[ e ]] ϕρ of an expression depends only on the values ascribed to its free function variablesby ϕ , and its free variables by ρ . When e has no function variables, we just write S [[ e ]] ρ for its denotation,omitting ϕ , and when it is closed (has no free variables of either kind) we just write S [[ e ]]. As usual, we7rite | = e = e to mean that e and e have the same denotation, given any function environment andany environment.We omit the proof of the following standard substitution lemma: Lemma 3.
1. Variable substitution and denotation commute, that is, we have: S [[ e [ e /x , . . . , e n − /x n − ]]] ϕρ = S [[ e ]] ϕρ [ S [[ e ]] ϕρ/x , . . . , S [[ e n − ]] ϕρ/x n − ]
2. Function variable substitution and denotation commute, that is, we have: S [[ e [( x , . . . , x n − ) .e ′ /f ]]] ϕρ = S [[ e ]] ϕ [ u , . . . , u n −
7→ S [[ e ′ ]] ϕρ [ u /x , . . . , u n − /x n − ] /f ] ρ Using this lemma, it is then straightforward to prove consistency:
Theorem 1 (Consistency) . For any expressions e and e we have: ⊢ e = e = ⇒ | = e = e Any polynomial P ( x , . . . , x n − ) defines an n -ary polynomial function on the reals, also written P ( x , . . . , x n − ). Note that P ( r , . . . , r n − ) = S [[ P ]]0[ r /x , . . . , r n − /x n − ]and we recall that P ( x , . . . , x n − ) ∼ P ′ ( x , . . . , x n − ) if, and only if, the two functions P ( x , . . . , x n − )and P ′ ( x , . . . , x n − ) are equal.We say that a function environment is a (natural number) polynomial environment if all its values are(natural number) polynomial functions and that an environment is a natural number environment if allits values are natural numbers. We write | = N e = e to mean that e and e have the same denotation, given any natural number polynomial function environ-ment, and any natural number environment.Our semantics of the theory of partial differentiation employs a concrete notion of function, viz. smoothfunctions over the reals. For the general theory of second-order logic, a more abstract, and thereby moregeneral, notion of function is needed. This can be formulated variously in terms of abstract clones [5],Lawvere theories, or, more conceptually, in terms of monoids in a presheaf category of contexts, see [8, 6, 7]. To show completeness we need suitable canonical forms c ; up to a suitable equivalence relation c ≈ c ′ , theyprovide normal forms for our theory.Let x , x , . . . be a countably infinite sequence of distinct variables. For any function variable f : n ,argument sequence m = i , . . . , i k ∈ [ n ] ∗ (where [ n ] = { , . . . , n − } ), and expressions e , . . . , e n − we set: f m ( e , . . . , e n − ) = ∂ k f ( x , . . . , x n − ) ∂x i . . . ∂x i k [ e /x , . . . , e n − /x n − ]8e note thatFV( f m ( e , . . . , e n − )) = n − [ i =0 FV( e i ) and FnV( f m ( e , . . . , e n − )) = { f } ∪ n − [ i =0 FnV( e i )and that f m ( e , . . . , e n − )[ e/x ] = f m ( e [ e/x ] , . . . , e n − [ e/x ])We remark that if two such expressions f m ( e , . . . , e n − ) and f ′ m ′ ( e ′ , . . . , e ′ n ′ − ) are equal then so are: f and f ′ ; m and m ′ ; n and n ′ ; and e i and e ′ i , for i = 1 , n ; this is used implicitly below to ensure the uniquenessof expression case analyses. We also note that, as may be expected, for any ϕ and ρ we have: S [[ f m ( e , . . . , e n − )]] ϕρ = D m ( ϕ ( f ))( S [[ e ]] ϕρ, . . . , S [[ e n − ]] ϕρ )The chain rule takes the following form for such applications of partial derivatives of functions: Lemma 4.
We have: ⊢ ∂f m ( e , . . . , e n − ) ∂x = n − X i =0 f im ( e , . . . , e n − ) ∂e i ∂x Proof.
Supposing m = i , . . . , i k ∈ [ n ] ∗ , then we have ∂f m ( e ,...,e n − ) ∂x = ∂∂x (cid:16) ∂ k f ( x ,...,x n − ) ∂x i ...∂x ik [ e /x , . . . , e n − /x n − ] (cid:17) = P n − i =0 (cid:16) ∂∂x ∂ k f ( x ,...,x n − ) ∂x i ...∂x ik (cid:17) [ e /x , . . . , e n − /x n − ] ∂e i ∂x (by Lemma 2)= P n − i =0 f im ( e , . . . , e n − ) ∂e i ∂x where the second identity is a provable equality, and the other two are syntactic.We define a set of canonical forms c and a set of atomic expressions a (both sets of expressions) bysimultaneous induction:1. (a) Any atomic expression is a canonical expression.(b) Any r ∈ R is a canonical expression, as are c + c ′ and cc ′ if c and c ′ are.2. (a) Any variable x is an atomic expression.(b) For any f : n , m ∈ [ n ] ∗ , and canonical forms c , . . . , c n − , f m ( c , . . . , c n − ) is an atomic expression.The set of immediate atomic subexpressions of a canonical form c is defined by structural recursion:Im( a ) = { a } Im( r ) = ∅ Im( c + c ′ ) = Im( cc ′ ) = Im( c ) ∪ Im( c ′ )We remark that the canonical forms are closed under substitution: c [ c ′ /x ] is a canonical form if c and c ′ are, as is straightforwardly proved by structural induction on c . Lemma 5.
For any canonical forms c and c there is a canonical form c ′ such that: ⊢ ∂c∂x (cid:12)(cid:12)(cid:12)(cid:12) x = c = c ′ and with FnV( c ′ ) ⊆ FnV( c ) ∪ FnV( c ) and FV( c ′ ) ⊆ FV( c ) ∪ FV( c ) . roof. The proof is by induction on the size of c . The cases where c is a constant, variable, sum, or productmake use of Lemma 1. This leaves the case of an atomic expression f m ( c , . . . , c n − ), where we can prove: ∂f m ( c ,...,c n − ) ∂x (cid:12)(cid:12)(cid:12) x = c = ∂f m ( c ,...,c n − ) ∂x [ c/x ]= (cid:0)P n − i =0 f im ( c , . . . , c n − ) ∂c i ∂x (cid:1) [ c/x ] (by Lemma 4)= P n − i =0 f im ( c [ c/x ] , . . . , c n − [ c/x ]) ∂c i ∂x (cid:12)(cid:12) x = c and recall the canonical forms are closed under substitution and apply the induction hypothesis to the c i . Lemma 6 (Canonicalisation) . For any expression e there is a canonical form CF( e ) such that ⊢ e = CF( e ) and with FnV(CF( e )) ⊆ FnV( e ) and FV(CF( e )) ⊆ FV( e ) .Proof. We prove this by structural induction on e . If e is a variable or a constant it is already a canonicalform. The cases where e is a sum or a product follow from the fact that the canonical forms are closedunder sums and products. The case where e has the form f ( e , . . . , e n − ) is immediate from the inductionhypothesis. Finally, the case where e has the form ∂e ∂x (cid:12)(cid:12) x = e is handled using Lemma 5, and the inductionhypothesis.We have the following corollary of the canonicalisation lemma: Corollary 1.
For any closed expression e , we have: ⊢ e = S [[ e ]] Proof. As e is closed, the same, by Lemma 6, is true of CF( e ), which latter must therefore have noimmediate atomic subexpressions or free variables, and so is a closed polynomial. There is therefore a real r such that ⊢ CF( e ) = r and so, by the lemma, ⊢ e = r . By consistency we have r = S [[ e ]].We next define the equivalence relations that will allow us to characterise provable equality betweencanonical forms. We also define polynomials that will be used to formulate our Hermite interpolationproblems.For any m, m ′ ∈ [ n ] ∗ we write m ∼ m ′ to mean that m is a permutation of m ′ . For any atomicexpressions a, a ′ we write a ≈ a ′ to mean that • a and a ′ are identical variables, or else • for some function variable f : n , and for some m ∼ m ′ , they have the forms f m ( c , . . . , c n − ) and f m ′ ( c ′ , . . . , c ′ n − ) with ⊢ c i = c ′ i for i = 0 , n − a ≈ a ′ = ⇒ ⊢ a = a ′ (1)We now fix an assignment v a of variables (termed separation variables) to atomic expressions such that: v a = v a ′ ⇐⇒ a ≈ a ′ For any canonical form c , we define its node polynomial P c by structural induction: P r = r ( r ∈ R ) P a = v a P c + c ′ = P c + P c ′ P cc ′ = P c P c ′ The separation variables occurring in P c are the v a with a an immediate atomic subexpression of c .We then define our equivalence relation between canonical forms by: c ≈ c ′ ⇐⇒ P c ∼ P c ′ Note that this relation only depends on the choice of the v a for the immediate atomic expressions of c and c ′ . Note too that the relation extends that between atomic expressions, i.e., a ≈ a ′ holds with a, a ′ takenas atomic expressions iff it does when they are taken as canonical forms.10 emma 7.
1. For any canonical expression c with node polynomial P c ( v a , . . . , v a m − ) , for atomic expressions a , . . . , a m − , we have: ⊢ c = P c ( a , . . . , a m − )
2. For any canonical expressions c and c ′ we have: c ≈ c ′ = ⇒ ⊢ c = c ′ Proof.
The first part is established by a straightforward structural induction. In the case where c is anatomic expression a , we have v a = P c = v a and so a ≈ a and so ⊢ a = a , i.e., ⊢ c = P c ( a ).For the second part, suppose that we have canonical expressions c and c ′ such that c ≈ c ′ (and so P c ∼ P c ′ ). Let v a , . . . , v a m − ( j = 0 , m ) include all the variables of P c and P c ′ . As P c ∼ P c ′ , we have: ⊢ P c [ a /v a , . . . , a m − /v a m − ] = P c ′ [ a /v a , . . . , a m − /v a m − ]Applying the first part to c and c ′ , it follows that ⊢ c = c ′ , as required. To establish completeness we use environments distinguishing non-equivalent canonical forms, i.e., canon-ical forms c and c ′ such that c c ′ . We first need to be able to distinguish finite sets of non-equivalentpolynomials (these will be the node polynomials of sub-canonical forms of c or c ′ ): Lemma 8.
Let P i ( x , . . . , x m − ) be n mutually inequivalent polynomials. Then, for some natural numberchoices of x , . . . , x m − , they take on different values.Proof. None of the polynomials Q ij = P i − P j are identically 0 ( i = j ), and so neither is Q = Π ij Q ij . So Q is non-zero for some natural number choices of x , . . . , x m − . That choice differentiates distinct P i .We next need to be able to solve multivariate Hermite interpolation problems in order to give prescribedvalues to atomic expressions. A multivariate Hermite interpolation problem of dimension d ≥ • A finite set of nodes x i ∈ R d ( i = 1 .k ), and • For each node x i , finitely many conditions D m ij ( h )( x i ) = r ij ( m ij ∈ [ d ] ∗ , r ij ∈ R ) on the partialderivatives of a function h : R d → R . The set of conditions must be consistent , in the sense that each r ij is determined by the node x i and the permutation equivalence class of m ij .A solution to this problem is a d -ary polynomial function satisfying all the conditions. According toa theorem of Severi [12] (and see [9, 10]) every such problem has a solution by a polynomial of degree k (max( | m ij | ) + 1) − C of canonical forms is saturated if the following two conditions hold:1. For any canonical form c and immediate atomic subexpression a of cc ∈ C = ⇒ a ∈ C f m ( c , . . . , c n − ) ∈ C = ⇒ c , . . . , c n − ∈ C Theorem 2 (Polynomial Separation) . Let C be a finite set of canonical forms. Then there is a polynomialfunction environment ϕ and an environment ρ that distinguish any two inequivalent elements of C .Proof. We can assume w.l.o.g. that C is saturated. By Lemma 8 we can find an assignment ρ of reals tothe separation variables of the node polynomials P c , ( c ∈ C ) which separates them, i.e., makes inequivalentones take on different values, r c . As P c ∼ P c ′ iff c ≈ c ′ , we have c ≈ c ′ iff r c = r c ′ . In the case that c is anatomic expression a we have P a = v a and so r a = ρ ( v a ). We define an environment ρ by: ρ ( x ) = (cid:26) r x ( x ∈ C )0 (otherwise)We next set up an n -dimensional Hermite interpolation problem for each function variable f : n appear-ing in the atomic expressions in C . For each atomic expression f m ( c , . . . , c n − ) ∈ C we add a node( r c , . . . , r c n − )and a condition: D m ( h )( r c , . . . , r c n − ) = r f m ( c ,...,c n − ) Note that the nodes are determined by the values of the node polynomials.To show these conditions consistent, let a = f m ( c , . . . , c n − ) and a ′ = f m ′ ( c ′ , . . . , c ′ n − ) be two atomicexpressions in C such that m ∼ m ′ and r c i = r c ′ i for i = 0 , n −
1. Then, by the above, we have c i ≈ c ′ i ,and so, by part (2) of Lemma 7, ⊢ c i = c ′ i , for i = 0 , n −
1. So a ≈ a ′ as atomic expressions and so too,therefore, as canonical forms. It follows that r a = r a ′ , as required for consistency.We can therefore obtain a polynomial function environment by taking ϕ ( f ) to be an m -ary interpolatingpolynomial for the corresponding Hermite interpolation problem, if f appears in some c ∈ C , and constantly0, otherwise.We claim that: S [[ c ]] ϕρ = r c for every c ∈ C . We establish the claim by structural induction on the expressions in C .First, consider a variable x ∈ C . We have S [[ x ]] ϕρ = ρ ( x ) = r x , as required.Next, consider an atomic expression f m ( c , . . . , c n − ) ∈ C . By saturation we have c , . . . , c n − ∈ C . So,by the induction hypothesis, we have S [[ c i ]] ϕρ = r c i for i = 0 , n −
1. We then have: S [[ f m ( c , . . . , c n − )]] ϕρ = D m ( ϕ ( f ))( S [[ c ]] ϕρ, . . . , S [[ c n − ]] ϕρ )= D m ( ϕ ( f ))( r c , . . . , r c n − )= r f m ( c ,...,c n − ) with the last line holding as ϕ ( f ) solves the Hermite interpolation problem for f set up above.Lastly, consider a canonical form c ∈ C which is not an atomic expression. Let v a ′ , . . . , v a ′ n − be thevariables of P c . For every a ′ i there is an immediate atomic subexpression a i of c such that a i ≈ a ′ i (and so v a ′ i = v a i ). By part (1) of Lemma 7 we then have ⊢ c = P c [ a /v a , . . . , a n − /v a n − ]As C is saturated, it contains the a i . Since c is not itself an atomic expression, we can apply the inductionhypothesis to the a i and so we have S [[ a i ]] ϕρ = r a i .We may then calculate that: S [[ c ]] ϕρ = S [[ P c [ a /v a , . . . , a n − /v a n − ]]] ϕρ = S [[ P c ( v a , . . . , v a n − )]] ϕρ [ S [[ a ]] ϕρ/v a , . . . , S [[ a n − ]] ϕρ/v a n − ]= S [[ P c ( v a , . . . , v a n − )]] ϕρ [ r a /v a , . . . , r a n − /v a n − ]= S [[ P c ( v a , . . . , v a n − )]] ϕρ [ ρ ( v a ) /v a , . . . , ρ ( v a n − ) /v a n − ]= r c r c . This concludes the inductive proof.Finally, taking c c ′ ∈ C , we have r c = r c ′ , and so, by the above, S [[ c ]] ϕρ = S [[ c ′ ]] ϕρ , and so, asrequired, ϕ and ρ distinguish any two inequivalent elements of C , concluding the proof.We next strengthen the polynomial separation theorem to natural number separation: Theorem 3 (Natural Number Separation) . Let C be a finite set of canonical forms. Then there is a naturalnumber polynomial function environment ϕ N and a natural number environment ρ N that distinguish anytwo inequivalent elements of C .Proof. By polynomial separation (Theorem 2), there is a polynomial function environment ϕ and anenvironment ρ such that distinguish any two inequivalent elements of C .Let f i : m i (for i = 0 , n −
1) be the function variables occurring in the c ∈ C , and, for i = 0 , n − P i ( x , . . . , x m i − ) be polynomials defining ϕ ( f i ). Let r , . . . , r q − be the constants occurring in these P i and, for i = 0 , n −
1, let Q i ( x , . . . , x m i − , y , . . . , y q − ) be natural number polynomials such that Q i [ r /y , . . . , r q − /y q − ] = P i and where no y k occurs freely in any c ∈ C . (The Q i can be obtained from the P i by replacing r k by y k ,for k = 0 , q − c ∈ C , set d c = CF( c [ . . . , ( x , . . . , x m i ) . Q i /f i , . . . ]). As f i is a list of function variables includingall those of c , and as FnV( c ) ⊆ FnV( e ) by Lemma 6, we see that c [ . . . , ( x , . . . , x m i ) . Q i /f i , . . . ] has nofunction variables and so, again by Lemma 6, neither does its canonical form d c . As any canonical formwith no function variables is a polynomial, it follows that d c is a polynomial.Setting ρ = ρ [ . . . , r k /y k , . . . ], we calculate: S [[ c ]] ϕρ = S [[ c ]] ϕ [ . . . , ( u , . . . , u m i ∈ R
7→ S [[ P i ]] ρ [ . . . , u j /x j , . . . ]) /f i , . . . ] ρ = S [[ c ]] ϕ [ . . . , ( u , . . . , u m i ∈ R
7→ S [[ Q i [ . . . , r k /y k , . . . ]]] ρ [ . . . , u j /x j , . . . ]) /f i , . . . ] ρ = S [[ c ]] ϕ [ . . . , ( u , . . . , u m i ∈ R
7→ S [[ Q i ]] ρ [ . . . , u j /x j , . . . , r k /y k , . . . ]) /f i , . . . ] ρ = S [[ c ]] ϕ [ . . . , ( u , . . . , u m i ∈ R
7→ S [[ Q i ]] ρ [ . . . , u j /x j , . . . ]) /f i , . . . ] ρ = S [[ c [ . . . , ( x , . . . , x m i ) . Q i /f i , . . . ]]] ϕρ = S [[ d c ]] ρ where we have used Lemma 3, canonicalisation, and consistency (Theorem 1). As ϕ , ρ separate inequivalent c ∈ C we therefore see that the corresponding d c are inequivalent as functions and so as polynomials. ByLemma 8 there is a natural number environment ρ N separating any two inequivalent d c , and so any d c and d ′ c with c and c ′ inequivalent.Next, define a natural number polynomial function environment ϕ N by setting: ϕ N ( f ) = (cid:26) u , . . . , u n i ∈ R
7→ S [[ Q i ]] ρ N [ u /x , . . . , u n i /x n i ] ( f = f i )0 (otherwise)For any c ∈ C we have: S [[ c ]] ϕ N ρ N = S [[ c ]]0[ . . . , ( u , . . . , u n i ∈ R
7→ S [[ Q i ]] ρ N [ . . . , u j /x j , . . . ]) /f i , . . . ] ρ N = S [[ c [ . . . , ( x , . . . , x m i ) . Q i /f i , . . . ]]]0 ρ N = S [[ d c ]] ρ N again making use of Lemma 3, canonicalisation, and consistency.So as ρ N separates d c and d c ′ whenever c and c ′ are inequivalent, we see that the natural numberpolynomial function environment ϕ N and the natural number environment ρ N separate any two inequivalentelements of C , concluding the proof. 13e can now prove completeness relative to natural number polynomial function environments andnatural number environments: Theorem 4 (Natural number completeness) . For any expressions e and e ′ we have: | = N e = e ′ = ⇒ ⊢ e = e ′ Proof.
Suppose that | = N e = e ′ but, for the sake of contradiction, that e = e ′ . By canonicalisation(Lemma 6) we then have c = c ′ , where c = CF( e ) and c ′ = CF( e ′ ); so, by part (2) of Lemma 7, we have c c ′ . Therefore, by Theorem 3, there is a natural number polynomial function environment ϕ N and anatural number environment ρ N such that S [[ c ]] ϕ N ρ N = S [[ c ′ ]] ϕ N ρ N , obtaining the required contradiction.We next upgrade part (2) of Lemma 7 to an equivalence and use that to analyse the theorems of ourtheory in terms of canonical forms and their ≈ relation; we also obtain a useful characterisation of theequivalence of atomic expressions in terms of the equivalence of their canonical subexpressions: Theorem 5.
1. For any expressions e and e ′ we have: ⊢ e = e ′ ⇐⇒ CF( e ) ≈ CF( e ′ )
2. For any canonical forms c and c ′ we have: ⊢ c = c ′ ⇐⇒ c ≈ c ′
3. For any atomic forms a and a ′ , a ≈ a ′ holds iff:(a) a and a ′ are identical variables, or else(b) for some function variable f : n , and for some m ∼ m ′ , they have the forms f m ( c , . . . , c n − ) and f m ′ ( c ′ , . . . , c ′ n − ) with c i ≈ c ′ i for i = 0 , n − .Proof. For the second part, we already have the implication from right to left, by part (2) of Lemma 7.The other direction follows from consistency and separation. For the first part, by canonicalisation wehave that ⊢ e = e ′ holds iff ⊢ CF( e ) = CF( e ′ ) does, and conclusion follows from the second part. Thethird part follows immediately from the second part and the definition of the equivalence relation betweenatomic expressions.We next seek a local criterion for canonical expression equivalence. Let A be a set of atomic expressions,and let w a ( a ∈ A ) be an A -indexed set of variables. We define polynomials P w,c for canonical forms whoseimmediate atomic subexpressions are included in A by structural induction on c : P w,r = r ( r ∈ R ) P w,a = w a P w,c + c ′ = P w,c + P w,c ′ P w,cc ′ = P w,c P w,c ′ and we say that w is equivalence-characterising if, for all a, a ′ ∈ A , we have: w a = w a ′ ⇐⇒ a ≈ a ′ Lemma 9.
Let c, c ′ be canonical forms, and let A be a set of atomic expressions including the immediateatomic subexpressions of c and c ′ and let w a ( a ∈ A ) be an equivalence-characterising A -indexed set ofvariables. Then: c ≈ c ′ ⇐⇒ P w,c ∼ P w,c ′ roof. It suffices to show that P c ∼ P c ′ holds iff P w,c ∼ P w,c ′ does. Choose a , . . . , a k ∈ A such that w a , . . . , w a k enumerates { w a | a ∈ A } . Then, as both w and v are equivalence-characterising, v a , . . . , v a k enumerates { v a | a ∈ A } . A straightforward induction shows that P c [ w a /v a , . . . , w a k /v a k ] = P w,c , andsimilarly for c ′ . Assuming P c ∼ P c ′ , we then find: P w,c = P c [ w a /v a , . . . , w a k /v a k ] ∼ P c ′ [ w a /v a , . . . , w a k /v a k ] = P w,c ′ that is, P c ∼ P c ′ implies P w,c ∼ P w,c ′ . The converse is proved similarly.As we now show, the equivalence relation on canonical forms can be viewed as a combination ofpolynomial equivalence and the commutativity of partial differentiation with respect to different variables.We write ⊢ RTC e = e ′ to mean that e and e ′ can be proved equal using only the ring axioms, the addition and multiplication tables,and the commutativity axiom for partial differentiation (i.e., without using any partial differentiationaxioms other than commutativity). Lemma 10.
For any canonical form c , and set of atomic expressions A with Im( c ) ⊆ A and such that forall a, a ′ ∈ A if a ≈ a ′ then ⊢ RTC a = a ′ , and for any ≈ -characterising A -indexed variable assignment w wehave ⊢ RTC c = P w,c [ a /v a , . . . , a n /v a n ] where v a , . . . , v a n are the variables of P w,c for a , . . . , a n ∈ A .Proof. The proof is a simple structural induction on c . For an atomic expression a , we have P w,c = v a and v a = v a , by assumption. So as w is ≈ -characterising, we have a ≈ a and so ⊢ RTC a = a , byassumption. Theorem 6.
For any canonical forms c and c ′ we have: ⊢ c = c ′ ⇐⇒ c ≈ c ′ ⇐⇒ ⊢ RTC c = c ′ Proof.
We prove that for all c, c ′ c ≈ c ′ = ⇒ ⊢ RTC c = c ′ by induction on max( | c | , | c ′ | ), when the conclusion follows immediately from Theorem 5.In the case where c (say) is an atomic expression a , then P c ′ ∼ P c = v a , and so ⊢ RTC c ′ = a ′ for some a ′ ∈ Im( c ′ ) with v a ′ = v a . As v a ′ = v a , we have a ≈ a ′ , and we then use the induction hypothesis to prove ⊢ RTC a = a ′ using the characterisation of equivalence of atomic expressions given by part (3) of Theorem 5.Otherwise neither c nor c ′ is an atomic expression and so, setting A = Im( c ) ∪ Im( c ′ ), by in-duction we have ⊢ RTC a = a ′ whenever a ≈ a ′ , for a, a ′ ∈ A . Let w be any ≈ -characterising A -indexed variable assignment. Applying Lemma 10 we find ⊢ RTC c = P w,c [ a /v a , . . . , a n /v a n ] and ⊢ RTC c ′ = P w,c ′ [ a /v a , . . . , a n /v a n ]. Further, by Lemma 9 , we have P w,c ∼ P w,c ′ . It follows that ⊢ RTC P w,c [ a /v a , . . . , a n /v a n ] = P w,c ′ [ a /v a , . . . , a n /v a n ]. Putting these three things together we obtain ⊢ RTC c = c ′ , as desired.As may be evident, one can further strengthen the definition of canonical forms so that fewer axioms areneeded to prove equivalence. For example, the partial differentiations in atomic expressions can be put in astandard order using the commutativity axiom. One can show that two such canonical forms are provablyequal if, and only, if they can be proved so without using any axioms for partial differentiation; the proofof this fact parallels that of Theorem 6. Should one wish, one can go further and rewrite polynomials assums of distinct multinomials; two such canonical forms are provably equal if, and only if, they can beproved so using only the associativity and commutativity of +.15e turn next to equational completeness. Let f i : m i ( i = 1 , k ) and x j ( j = 1 , l ) be thefunction variables and the free variables of two expressions e and e ′ . Then a natural number coun-terexample to the equation e = e ′ consists of natural number polynomials P i ( y , . . . , y m i ) and natu-ral numbers k , . . . , k l such that, the closed terms e = def e [ . . . , ( y , . . . , y m i ) . P i /f i , . . . ][ . . . k j /x j , . . . ] and e ′ = def e ′ [ . . . , ( y , . . . , y m i ) . P i /f i , . . . ][ . . . k j /x j , . . . ] are provably equal to different constants. As we nowsee, the natural number separation theorem yields such counterexamples, and thereby enables us to estab-lish equational completeness: Theorem 7.
The theory of partial differentiation is equationally complete.Proof.
Suppose that e = e ′ . We show that adding the equation e = e ′ makes the theory equationallyinconsistent. As e = e , by natural number polynomial completeness (Theorem 4), there is a naturalnumber polynomial function environment ϕ , and a natural number environment ρ such that S [[ e ]] ϕρ and S [[ e ′ ]] ϕρ differ. We can then define a natural number counterexample to the equation. Let f i : m i ( i = 1 , k )and x j ( j = 1 , l ) be the function variables and the free variables of e and e ′ . For i = 1 , k , take P i ( y , . . . , y m i )to be a natural number polynomial defining ϕ ( f i ) and take k j to be ρ ( x j ), and define e and e ′ as above.By the substitution rule we have ⊢ e = e ′ . By Lemma 3, we have S [[ e ]] = S [[ e ]] ϕρ and S [[ e ′ ]] = S [[ e ′ ]] ϕρ .So S [[ e ]] = S [[ e ′ ]], and therefore by Corollary 4 and consistency, e and e ′ are provably equal to differentconstants.Thus, assuming ⊢ e = e ′ , we can prove distinct real constants S [[ e ]] and S [[ e ′ ]] equal. Using the additionand multiplication tables and the ring axioms, we then find that ⊢ ⊢ x = 0 and so ⊢ x = y .Instead of allowing all reals as constants, one could restrict them, for example to Q or none, except forthe ring constants (equivalently N ). The above development goes through straightforwardly in either ofthese cases, except for equational completeness. The proof of equational completeness for Q goes throughas the required polynomials, being over the natural numbers, and the required reals, being natural numbers,are definable, and the argument from the equality of two distinct rationals to that of two distinct variablesalso goes through.However, the last part of that argument does not go through for N . For example it is then consistentto add the equation 1 + 1 = 0. As a model, one can employ the boolean differential calculus [11]. Oneworks over the boolean ring and defines the partial differentiation of boolean functions h : B n → B by: ∂h ( x , . . . , x n − ) ∂x i = h ( x , . . . , x i − , , x i +1 , . . . , x n − ) + h ( x , . . . , x i − , , x i +1 , . . . , x n − )This can be equivalently written, somewhat more transparently, as: ∂h ( x , . . . , x n − ) ∂x i = h ( x , . . . , x i − , x i + d x i , x i +1 , . . . , x n − ) − h ( x , . . . , x i − , x i , x i +1 , . . . , x n − )taking d x i = 1. Another model of 1 + 1 = 0 can be constructed from the clone of polynomials in severalvariables over the boolean ring, with partial differentiation defined as usual on polynomials over a ring.With the constants restricted to the rationals, the question of decidability of the equational theory ofpartial differentiation makes sense, and we have: Theorem 8.
With the constants restricted to the rationals, the equational theory of partial differentiation isdecidable, and, further, natural number counterexamples to unprovable equations can be effectively obtained.Proof.
We interleave two search procedures. One searches for a proof, the other searches through allpossible natural number counterexamples. Since we know from the proof of equational completeness(Theorem 7) that a natural number counterexample exists if an equation is not provable, this procedurewill terminate, yielding either a proof or a counterexample.16here is another, more direct, way to prove decidability and to find counterexamples. For decidability,one uses the effectiveness of the proof of canonicalisation (Lemma 6) to find canonical forms, and thecharacterisations of the equivalence of atomic expressions and canonical forms given by Theorem 5 andLemma 9, to obtain a recursive algorithm to decide the equivalence of canonical forms.With this decision procedure in hand, and with the observation that the proof in [9] of the Severitheorem is effective, one observes that the proof of polynomial separation (Theorem 2) is effective. So too,therefore is the proof of natural number separation (Theorem 3), and, following the proof of equationalcompleteness (Theorem 7), we finally see that, if they exist, counterexamples can be found effectively.
Acknowledgements
I thank Mart´ın Abadi, Jonathan Gallagher, and Tarmo Uustalu for useful discussions, and Sam Staton forhelpful remarks including indicating how the axioms for partial differentiation could be made finitary.
References [1] Barendregt, Hendrik P., “The Lambda Calculus: Its Syntax and Semantics”, Studies in Logic and theFoundations of Mathematics, , 2nd edition, North-Holland, 1985.[2] Blute, Richard F., Robin Cockett, and Robert A.G. Seely,
Cartesian Differential Categories , Theoryand Applications of Categories, (2009), 622–672.[3] Cockett, Robin and Geoff Cruttwell, Differential Structure, Tangent Structure, and SDG , AppliedCategorical Structures, (2) (2014), 331–417.[4] Cockett, Robin, Geoff Cruttwell, Jonathan Gallagher, Jean-Simon Pacaud Lemay, BenjaminMacAdam, Gordon Plotkin, and Dorette Pronk, Reverse Derivative Categories , Proc. 28th. AnnualConference on Computer Science Logic (eds. Maribel Fern´andez and Anca Muscholl), LIPIcs, ,18:1-18:16, Schloss Dagstuhl, 2020.[5] Cohn, Paul Moritz, “Universal algebra”, Mathematics and Its Applications, , 2nd edn., Dordrecht:Reidel, 1981.[6] Fiore, Marcelo and Chung-Kil Hur, Second-order equational logic , Proc. 24th. International Workshopon Computer Science Logic (eds. Anuj Dawar and Helmut Veith), LNCS , 320–335, Springer,2010.[7] Fiore, Marcelo and Ola Mahmoud,
Second-order algebraic theories , Proc. 35th. International Sympo-sium on Mathematical Foundations of Computer Science (eds. Hlinˇen´y P., Kuˇcera A.), LNCS ,368–380, Springer, 2010.[8] Fiore, Marcelo, Gordon Plotkin, and Daniele Turi,
Abstract syntax and variable binding , Proc. 14th.Annual IEEE Symposium on Logic in Computer Science, 193–202, 1999.[9] Lorentz, Rudolph A., “Multivariate Birkhoff Interpolation”, Lecture Notes in Mathematics, ,Springer, 1992.[10] Lorentz, Rudolph A.,
Multivariate Hermite interpolation by algebraic polynomials: A survey , Journalof Computational and Applied Mathematics, (2000), 167–201.[11] Posthoff, Christian, and Bernd Steinbach, “Logic Functions and Equations”, Springer, 2004.1712] Severi, Francesco, “Vorlesungen ¨uber Algebraische Geometrie”, Teubner, Berlin, 1921.[13] Staton, Sam, Dario Stein, Hongseok Yang, Nathanael L. Ackerman, Cameron E. Freer, and Daniel M.Roy,
The Beta-Bernoulli process and algebraic effects , Proc. 45th. ICALP (eds. Ioannis Chatzigian-nakis, Christos Kaklamanis, D´aniel Marx, and Donald Sannella), LIPIcs, , 141:1–141:15, SchlossDagstuhl, 2018.[14] Taylor, Walter,
Survey 79: Equational logic , Houston Journal of Mathematics,5