CADiZ

Reference manual / Z-related commands / In situ replacement commands / Leibniz


The Leibniz command performs rewriting by equalities and equivalences. The expression e1 can be rewritten as the expression e2 if the equality e1 = e2 (or the equality e2 = e1) is, in a general sense defined below, an antecedent of it. Similarly, the predicate p1 can be rewritten as the predicate p2 if the equivalence p1 \iff p2 (or the equivalence p2 \iff p1) is an antecedent of it.

In the case of an equality with the name of a local variable on one side, a quicker way to eliminate all uses of the variable is provided by the one-point command.

The simplest case of Leibniz to explain is that where an equality is an antecedent predicate of the entire conjecture. The e1 must then be in either the antecedent or consequent part of the goal, as in the declaration part the equality would not be an antecedent of the e1.

In the following rules, the postfix notation [new/old] denotes the substitution of the new expression for the old expression, and the notation a(b) means that b appears within a.

| e1 = e2, p[e2/e1] \vdash?
| e1 = e2, p(e1) \vdash?

| e1 = e2 \vdash? p[e2/e1]
| e1 = e2 \vdash? p(e1)

| e2 = e1, p[e2/e1] \vdash?
| e2 = e1, p(e1) \vdash?

| e2 = e1 \vdash? p[e2/e1]
| e2 = e1 \vdash? p(e1)

The expression e1 should be selected and crossed, then the equality e1 = e2 (or e2 = e1) should be selected and inspected.

There are analogous proof rules for performing rewriting on predicates based on an equivalence as an antecedent.

| p1 \iff p2, p[p2/p1] \vdash?
| p1 \iff p2, p(p1) \vdash?

| p1 \iff p2 \vdash? p[p2/p1]
| p1 \iff p2 \vdash? p(p1)

| p2 \iff p1, p[p2/p1] \vdash?
| p2 \iff p1, p(p1) \vdash?

| p2 \iff p1 \vdash? p[p2/p1]
| p2 \iff p1 \vdash? p(p1)

The predicate p1 should be selected and crossed, then the equivalence p1 \iff p2 (or p2 \iff p1) should be selected and inspected.

Since any predicate p1 is equivalent to p1 \iff true, there are analogous rules that rewrite predicates appearing as antecedents to true.

| p1, p[true/p1] \vdash?
| p1, p(p1) \vdash?

| p1 \vdash? p[true/p1]
| p1 \vdash? p(p1)

Similarly, since any predicate \lnot p1 is equivalent to p1 \iff false, there are analogous rules that rewrite predicates whose negations appear as antecedents to false.

| \lnot p1, p[false/p1] \vdash?
| \lnot p1, p(p1) \vdash?

| \lnot p1 \vdash? p[false/p1]
| \lnot p1 \vdash? p(p1)

All of the above Leibniz rules concern the case where the equality or equivalence is an antecedent of the entire goal. Leibniz is also applicable when the equality or equivalence is more narrowly scoped, so long as it is still antecedent to the expression or predicate to be rewritten. This means that it can be a conjunct of any of a surrounding conjunction predicate, the left operand of a surrounding implication predicate, the | part of a surrounding schema text, or the @ part of a surrounding (unique) existential predicate, or, as above, an antecedent predicate of the entire goal.

Several rewritings may be performed in one use of the Leibniz command: all the expressions or predicates to be replaced must be selected and crossed (using the previewer's x command), then the equality or equivalence should be inspected. The Leibniz command must be applicable to all the crossed selections for it to be offered, though not all the rewritings need be in the same direction.

For rewriting by quantified equalities and equivalences, see the rewrite by antecedent command.

Tactic example

"Leibniz" e1 e2 p3

This example rewrites the expressions e1 and e2 according to the equality p3.


IT 30-Mar-2000