Equational logic

From HandWiki

First-order equational logic consists of quantifier-free terms of ordinary first-order logic, with equality as the only predicate symbol. The model theory of this logic was developed into universal algebra by Birkhoff, Grätzer, and Cohn. It was later made into a branch of category theory by Lawvere ("algebraic theories").[1] The terms of equational logic are built up from variables and constants using function symbols (or operations).

Syllogism

Here are the four inference rules of logic. [math]\displaystyle{ P[x := E] }[/math] denotes textual substitution of expression [math]\displaystyle{ E }[/math] for variable [math]\displaystyle{ x }[/math] in expression [math]\displaystyle{ P }[/math]. Next, [math]\displaystyle{ b = c }[/math] denotes equality, for [math]\displaystyle{ b }[/math] and [math]\displaystyle{ c }[/math] of the same type, while [math]\displaystyle{ b \equiv c }[/math], or equivalence, is defined only for [math]\displaystyle{ b }[/math] and [math]\displaystyle{ c }[/math] of type boolean. For [math]\displaystyle{ b }[/math] and [math]\displaystyle{ c }[/math] of type boolean, [math]\displaystyle{ b = c }[/math] and [math]\displaystyle{ b \equiv c }[/math] have the same meaning.

Substitution If [math]\displaystyle{ P }[/math] is a theorem, then so is [math]\displaystyle{ P[x := E] }[/math]. [math]\displaystyle{ \vdash P \qquad \rightarrow \qquad \vdash P[x := E] }[/math]
Leibniz If [math]\displaystyle{ P = Q }[/math] is a theorem, then so is [math]\displaystyle{ E[x:= P] = E[x:= Q] }[/math]. [math]\displaystyle{ \vdash P = Q \qquad \rightarrow \qquad \vdash E[x := P] = E[x := Q] }[/math]
Transitivity If [math]\displaystyle{ P = Q }[/math] and [math]\displaystyle{ Q = R }[/math] are theorems, then so is [math]\displaystyle{ P = R }[/math]. [math]\displaystyle{ \vdash P = Q, \; \vdash Q = R \qquad \rightarrow \qquad \vdash P = R }[/math]
Equanimity If [math]\displaystyle{ P }[/math] and [math]\displaystyle{ P \equiv Q }[/math] are theorems, then so is [math]\displaystyle{ Q }[/math]. [math]\displaystyle{ \vdash P, \; \vdash P \equiv Q \qquad \rightarrow \qquad \vdash Q }[/math]

[2]

History

Equational logic was developed over the years (beginning in the early 1980s) by researchers in the formal development of programs, who felt a need for an effective style of manipulation, of calculation. Involved were people like Roland Carl Backhouse, Edsger W. Dijkstra, Wim H.J. Feijen, David Gries, Carel S. Scholten, and Netty van Gasteren. Wim Feijen is responsible for important details of the proof format.

The axioms are similar to those used by Dijkstra and Scholten in their monograph Predicate calculus and program semantics (Springer Verlag, 1990), but our order of presentation is slightly different.

In their monograph, Dijkstra and Scholten use the three inference rules Leibniz, Substitution, and Transitivity. However, Dijkstra/Scholten system is not a logic, as logicians use the word. Some of their manipulations are based on the meanings of the terms involved, and not on clearly presented syntactical rules of manipulation. The first attempt at making a real logic out of it appeared in A Logical Approach to Discrete Math, however the inference rule Equanimity is missing there, and the definition of theorem is contorted to account for it. The introduction of Equanimity and its use in the proof format is due to Gries and Schneider. It is used, for example, in the proofs of soundness and completeness, and it appears in the second edition of A Logical Approach to Discrete Math.[2]

Proof

We explain how the four inference rules are used in proofs, using the proof of [math]\displaystyle{ \lnot p \equiv p \equiv \bot }[/math][clarify]. The logic symbols [math]\displaystyle{ \top }[/math] and [math]\displaystyle{ \bot }[/math] indicate "true" and "false," respectively, and [math]\displaystyle{ \lnot }[/math] indicates "not." The theorem numbers refer to theorems of A Logical Approach to Discrete Math.[2]

[math]\displaystyle{ \begin{array}{lcl} (0) & & \lnot p \equiv p \equiv \bot \\ (1) & = & \quad \left\langle\; (3.9),\; \lnot(p \equiv q) \equiv \lnot p \equiv q,\; \text{with}\ q := p \;\right\rangle \\ (2) & & \lnot (p \equiv p) \equiv \bot \\ (3) & = & \quad \left\langle\; \text{Identity of}\ \equiv (3.9),\; \text{with}\ q := p \;\right\rangle \\ (4) & & \lnot \top \equiv \bot & (3.8) \end{array} }[/math]

First, lines [math]\displaystyle{ (0) }[/math][math]\displaystyle{ (2) }[/math] show a use of inference rule Leibniz:

[math]\displaystyle{ (0) = (2) }[/math]

is the conclusion of Leibniz, and its premise [math]\displaystyle{ \lnot(p \equiv p) \equiv \lnot p \equiv p }[/math] is given on line [math]\displaystyle{ (1) }[/math]. In the same way, the equality on lines [math]\displaystyle{ (2) }[/math][math]\displaystyle{ (4) }[/math] are substantiated using Leibniz.

The "hint" on line [math]\displaystyle{ (1) }[/math] is supposed to give a premise of Leibniz, showing what substitution of equals for equals is being used. This premise is theorem [math]\displaystyle{ (3.9) }[/math] with the substitution [math]\displaystyle{ p := q }[/math], i.e.

[math]\displaystyle{ (\lnot(p \equiv q) \equiv \lnot p \equiv q)[p := q] }[/math]

This shows how inference rule Substitution is used within hints.

From [math]\displaystyle{ (0) = (2) }[/math] and [math]\displaystyle{ (2) = (4) }[/math], we conclude by inference rule Transitivity that [math]\displaystyle{ (0) = (4) }[/math]. This shows how Transitivity is used.

Finally, note that line [math]\displaystyle{ (4) }[/math], [math]\displaystyle{ \lnot \top \equiv \bot }[/math], is a theorem, as indicated by the hint to its right. Hence, by inference rule Equanimity, we conclude that line [math]\displaystyle{ (0) }[/math] is also a theorem. And [math]\displaystyle{ (0) }[/math] is what we wanted to prove.[2]

See also

  • Theory of pure equality

References

  1. equational logic. (n.d.). The Free On-line Dictionary of Computing. Retrieved October 24, 2011, from Dictionary.com website: http://dictionary.reference.com/browse/equational+logic
  2. 2.0 2.1 2.2 2.3 Gries, D. (2010). Introduction to equational logic . Retrieved from http://www.cs.cornell.edu/home/gries/Logic/Equational.html

External links