In mathematical logic, **algebraic logic** is the reasoning obtained by manipulating equations with free variables.

What is now usually called classical algebraic logic focuses on the identification and algebraic description of models appropriate for the study of various logics (in the form of classes of algebras that constitute the algebraic semantics for these deductive systems) and connected problems like representation and duality. Well known results like the representation theorem for Boolean algebras and Stone duality fall under the umbrella of classical algebraic logic (Czelakowski 2003).

Works in the more recent abstract algebraic logic (AAL) focus on the process of algebraization itself, like classifying various forms of algebraizability using the Leibniz operator (Czelakowski 2003).

A homogeneous binary relation is found in the power set of *X* × *X* for some set *X*, while a heterogeneous relation is found in the power set of *X* × *Y*, where *X* ≠ *Y*. Whether a given relation holds for two individuals is one bit of information, so relations are studied with Boolean arithmetic. Elements of the power set are partially ordered by inclusion, and lattice of these sets becomes an algebra through *relative multiplication* or composition of relations.

"The basic operations are set-theoretic union, intersection and complementation, the relative multiplication, and conversion."^{[1]}

The *conversion* refers to the converse relation that always exists, contrary to function theory. A given relation may be represented by a logical matrix; then the converse relation is represented by the transpose matrix. A relation obtained as the composition of two others is then represented by the logical matrix obtained by matrix multiplication using Boolean arithmetic.

An example of calculus of relations arises in erotetics, the theory of questions. In the universe of utterances there are statements *S* and questions *Q*. There are two relations π and α from *Q* to *S*: *q* α *a* holds when *a* is a direct answer to question *q*. The other relation, *q* π *p* holds when *p* is a presupposition of question *q*. The converse relation π^{T} runs from *S* to *Q* so that the composition π^{T}α is a homogeneous relation on *S*.^{[2]} The art of putting the right question to elicit a sufficient answer is recognized in Socratic method dialogue.

The description of the key binary relation properties has been formulated with the calculus of relations. The univalence property of functions describes a relation R that satisfies the formula where I is the identity relation on the range of R. The injective property corresponds to univalence of , or the formula where this time I is the identity on the domain of R.

But a univalent relation is only a partial function, while a univalent total relation is a function. The formula for totality is Charles Loewner and Gunther Schmidt use the term **mapping** for a total, univalent relation.^{[3]}^{[4]}

The facility of complementary relations inspired Augustus De Morgan and Ernst Schröder to introduce equivalences using for the complement of relation R. These equivalences provide alternative formulas for univalent relations (), and total relations ().
Therefore, mappings satisfy the formula Schmidt uses this principle as "slipping below negation from the left".^{[5]} For a mapping f,

The **relation algebra** structure, based in set theory, was transcended by Tarski with axioms describing it. Then he asked if every algebra satisfying the axioms could be represented by a set relation. The negative answer^{[6]} opened the frontier of abstract algebraic logic.^{[7]}^{[8]}^{[9]}

Algebraic logic treats algebraic structures, often bounded lattices, as models (interpretations) of certain logics, making logic a branch of order theory.

In algebraic logic:

- Variables are tacitly universally quantified over some universe of discourse. There are no existentially quantified variables or open formulas;
- Terms are built up from variables using primitive and defined operations. There are no connectives;
- Formulas, built from terms in the usual way, can be equated if they are logically equivalent. To express a tautology, equate a formula with a truth value;
- The rules of proof are the substitution of equals for equals
^{[clarification needed]}, and uniform replacement. Modus ponens remains valid, but is seldom employed.

In the table below, the left column contains one or more logical or mathematical systems, and the algebraic structure which are its models are shown on the right in the same row. Some of these structures are either Boolean algebras or proper extensions thereof. Modal and other nonclassical logics are typically modeled by what are called "Boolean algebras with operators."

Algebraic formalisms going beyond first-order logic in at least some respects include:

- Combinatory logic, having the expressive power of set theory;
- Relation algebra, arguably the paradigmatic algebraic logic, can express Peano arithmetic and most axiomatic set theories, including the canonical ZFC.

Logical system | Lindenbaum–Tarski algebra |
---|---|

Classical sentential logic | Boolean algebra |

Intuitionistic propositional logic | Heyting algebra |

Łukasiewicz logic | MV-algebra |

Modal logic K | Modal algebra |

Lewis's S4 | Interior algebra |

Lewis's S5, monadic predicate logic | Monadic Boolean algebra |

First-order logic | Complete Boolean algebra, polyadic algebra, predicate functor logic |

First-order logic with equality | Cylindric algebra |

Set theory | Combinatory logic, relation algebra |

See also: Symbolical algebra |

Algebraic logic is, perhaps, the oldest approach to formal logic, arguably beginning with a number of memoranda Leibniz wrote in the 1680s, some of which were published in the 19th century and translated into English by Clarence Lewis in 1918.^{[10]}^{: 291–305 } But nearly all of Leibniz's known work on algebraic logic was published only in 1903 after Louis Couturat discovered it in Leibniz's Nachlass. Parkinson (1966) and Loemker (1969) translated selections from Couturat's volume into English.

Modern mathematical logic began in 1847, with two pamphlets whose respective authors were George Boole^{[11]} and Augustus De Morgan.^{[12]} In 1870 Charles Sanders Peirce published the first of several works on the logic of relatives. Alexander Macfarlane published his *Principles of the Algebra of Logic*^{[13]} in 1879, and in 1883, Christine Ladd, a student of Peirce at Johns Hopkins University, published "On the Algebra of Logic".^{[14]} Logic turned more algebraic when binary relations were combined with composition of relations. For sets *A* and *B*, a relation over *A* and *B* is represented as a member of the power set of *A*×*B* with properties described by Boolean algebra. The "calculus of relations"^{[9]} is arguably the culmination of Leibniz's approach to logic. At the Hochschule Karlsruhe the calculus of relations was described by Ernst Schröder.^{[15]} In particular he formulated Schröder rules, though De Morgan had anticipated them with his Theorem K.

In 1903 Bertrand Russell developed the calculus of relations and logicism as his version of pure mathematics based on the operations of the calculus as primitive notions.^{[16]} The "Boole–Schröder algebra of logic" was developed at University of California, Berkeley in a textbook by Clarence Lewis in 1918.^{[10]} He treated the logic of relations as derived from the propositional functions of two or more variables.

Hugh MacColl, Gottlob Frege, Giuseppe Peano, and A. N. Whitehead all shared Leibniz's dream of combining symbolic logic, mathematics, and philosophy.

Some writings by Leopold Löwenheim and Thoralf Skolem on algebraic logic appeared after the 1910–13 publication of *Principia Mathematica*, and Tarski revived interest in relations with his 1941 essay "On the Calculus of Relations".^{[9]}

According to Helena Rasiowa, "The years 1920-40 saw, in particular in the Polish school of logic, researches on non-classical propositional calculi conducted by what is termed the logical matrix method. Since logical matrices are certain abstract algebras, this led to the use of an algebraic method in logic."^{[17]}

Brady (2000) discusses the rich historical connections between algebraic logic and model theory. The founders of model theory, Ernst Schröder and Leopold Loewenheim, were logicians in the algebraic tradition. Alfred Tarski, the founder of set theoretic model theory as a major branch of contemporary mathematical logic, also:

- Initiated abstract algebraic logic with relation algebras
^{[9]} - Invented cylindric algebra
- Co-discovered Lindenbaum–Tarski algebra.

In the practice of the calculus of relations, Jacques Riguet used the algebraic logic to advance useful concepts: he extended the concept of an equivalence relation (on a set) to the heterogeneous case with the notion of a difunctional relation. Riguet also extended ordering to the heterogeneous context by his note that a staircase logical matrix has a complement that is also a staircase, and that the theorem of N. M. Ferrers follows from interpretation of the transpose of a staircase. Riguet generated *rectangular relations* by taking the outer product of logical vectors; these contribute to the *non-enlargeable rectangles* of formal concept analysis.

Leibniz had no influence on the rise of algebraic logic because his logical writings were little studied before the Parkinson and Loemker translations. Our present understanding of Leibniz as a logician stems mainly from the work of Wolfgang Lenzen, summarized in Lenzen (2004). To see how present-day work in logic and metaphysics can draw inspiration from, and shed light on, Leibniz's thought, see Zalta (2000).