---
title: 'LNDEQ-TRS: Equality Term Rewriting'
url: https://www.emergentmind.com/topics/lndeq-trs-term-rewriting-system
type: topic
---

# LNDEQ-TRS: Equality Term Rewriting

The LNDEQ-TRS ("Labelled Natural Deduction Equality Term Rewriting System") framework encompasses a family of term-rewriting systems designed for expressing, managing, and reasoning about equality and inference rules within formal logic and type theory. These systems leverage linear rewriting rules and explicit computational paths, enabling precise formulation and manipulation of equalities and inference derivations across Boolean logic, labelled deduction, and homotopy type theory. LNDEQ-TRS serves as a nexus for techniques from term rewriting, Boolean function theory, graph theory, and type-theoretic labelled deduction, yielding powerful results on expressiveness, complexity, and proof-theoretic properties.

## 1. Linear Rewriting Rules in Boolean Logic

LNDEQ-TRS for Boolean logic is constructed over the signature $\Sigma = \{\land, \lor, \top, \bot\}$ and a countable set of propositional variables $\mathrm{Var}$ equipped with a fixed involution $x \mapsto \bar{x}$ to handle negation in negation normal form (NNF) [1610.08772]. A rewrite rule is an expression $l \to r$ where $l, r \in Ter$, and $l \neq r$, instantiated in context as $C[\sigma(l)] \to C[\sigma(r)]$ for arbitrary one-hole contexts $C[\cdot]$ and substitutions $\sigma$.

Linearity is defined as:

- Left-linearity: Every variable $x \in \mathrm{Var}$ occurs at most once in $l$
- Right-linearity: Every variable $x \in \mathrm{Var}$ occurs at most once in $r$
- Linear rules: Both the above

A linear term rewriting system (TRS) $R$ is a set of such linear rules, with the critical property that the one-step reduction relation $\to_R$ is decidable in time polynomial in the term size.

Boolean-logic LNDEQ-TRS considers systems $R$ whose rules are all linear and satisfy the semantic soundness condition: for monotone Boolean functions $f_l$ and $f_r$ computed by $l$ and $r$, $f_l \leq f_r$ pointwise (i.e., $\forall \alpha,\ f_l(\alpha) \Rightarrow f_r(\alpha)$). The universe $L$ of all sound linear inferences is then coNP-complete.

## 2. Structure and Syntax of Computational Paths

In intensional Martin-Löf type theory, for terms $a, b : A$, the identity type $\mathrm{Id}_A(a, b)$ is refined in LNDEQ-TRS$_2$ by explicit "computational paths" witnessing the equality [2007.07769]. A computational path $s$, denoted $a =_s b : A$, consists of a finite, reversible sequence of definitional equality steps (rewrites and variable renamings), starting at $a$ and ending at $b$. The constructors for paths include:

- Reflexivity ($\rho$)
- Symmetry ($\sigma(s)$)
- Transitivity ($\tau(s, t)$)
- $\beta$, $\eta$: Primitive reduction steps for $\Pi$-types
- $\xi$, $\mu$, $\nu$: Congruence operations

Judgments in labelled natural deduction take the form $\Gamma \vdash a =_s b : A$, supplementing type- and term-formation with explicit evidence of equality. Term formation for identity types and their introduction ($\mathrm{Id}$-I) and elimination ($\mathrm{Id}$-E) rules are carried with path labels, supporting elimination/redex reduction via $\beta$ and $\eta$ conversions.

## 3. Rewrite Systems: Rules and Hierarchies

LNDEQ-TRS$_2$ employs a rich set of rewrite rules for computational paths [2007.07769]:

- 39 original LND$_{eq}$-TRS rules resolve path redundancies and administrate relations between symmetry, transitivity, and congruence operations among computational paths.
- 7 additional TRS$_2$ rules address redundancies at the rw-equality level (sequences of lower-level rewrites).
- A "cd$_2$" independence-of-choice rule identifies different reduction sequences (left- or right-oriented) producing the same outcome.

Table: Example Path Construct Rewrite Rules in LNDEQ-TRS$_2$

| Rule          | Pattern                             | Result       |
|---------------|-------------------------------------|--------------|
| Symmetry      | $\sigma(\sigma(r))$                 | $r$          |
| Transitivity  | $\tau(r, \sigma(r))$                | $\rho$       |
| Congruence    | $\mu_1(\xi_1(r))$                   | $r$          |

This exhaustive rewriting system ensures termination and confluence: every rewrite sequence is finite and every computational path possesses a unique normal form under rw$_2$-reduction.

## 4. Proof-Theoretic and Complexity Properties

A central result for Boolean-logic LNDEQ-TRS is the polynomial bound on nontrivial derivation lengths [1610.08772]. For a strictly increasing sequence $t_0 < t_1 < \dots < t_\ell$ of constant-free NNF linear terms in $n$ variables representing a nontrivial inference, one finds $\ell = O(n^4)$. The proof employs the "relation web" $W(t)$—a complete graph on variables of $t$, edges labeled by their least common connective. Maximal $\land$-cliques define minterms, while $\lor$-cliques define maxterms.

The intersection lemma yields critical chains $S^{(x)}_i$ (minterms) and $T^{(x)}_i$ (maxterms) such that:
1. $S^{(x)}_0 \supseteq S^{(x)}_1 \supseteq \dots \supseteq S^{(x)}_\ell$
2. $T^{(x)}_0 \subseteq T^{(x)}_1 \subseteq \dots \subseteq T^{(x)}_\ell$
3. $S^{(x)}_i \cap T^{(x)}_i = \{ x \}$

Edge changes in the relation web correspond to minterm shrinkage and maxterm growth, bounding the length of derivations.

Combining this with proof-theoretic complexity, the universe $L$ of sound linear rules is shown to be coNP-complete:
- Soundness checking of $l \to r$ reduces to the validity of $\neg l \lor r$
- Any Boolean tautology can be polynomially encoded to a linear inference

No polynomial-time decidable, sound, complete LNDEQ-TRS exists for Boolean logic unless coNP$=$NP.

## 5. Coinductive and Circular Proof Systems

Advancing from purely syntactic rewriting, logically constrained term rewriting systems (LCTRS) as in LNDEQ-TRS enable coinductive semantics and circular proofs [1804.08308]. Rewrite rules possess logical constraints: $\ell \to r \Leftrightarrow \phi$, with $\ell, r$ of the same sort and constraint $\phi$ in a background signature.

The proof system for reachability (DSTEP$(R)$) defines $\varphi \Longrightarrow \varphi'$ meaning all terminating rewrite sequences from $\varphi$ reach $\varphi'$:
- [Axiom]: For unsatisfiable constraints
- [Subsumption]: Eliminates goals covered by successors
- [Derive$^\forall$]: Symbolic successor derivation

DSTEP is sound and complete: $R \vdash \varphi \Longrightarrow \varphi'$ iff $R \models \varphi \Longrightarrow \varphi'$, with demonic validity as the coinductive semantic criterion.

To finitely represent infinite coinductive proofs, the circularity rule ([circ]) is introduced in DCC$(R,G)$ by allowing guarded, finite circular proof branches. Soundness of circularity is preserved under appropriate guardedness conditions.

## 6. Worked Examples and Practical Implementation

In LND$_{eq}$-TRS$_2$, explicit computational paths are constructed between complex terms, such as reductions in the lambda calculus [2007.07769]. For example, $(\lambda x. (\lambda y. y x)(\lambda w. z w)) v$ to $z v$ can be witnessed by a composite computational path combining $\eta$- and $\beta$-reductions, each step labeled and chained by transitivity. The rewrite calculus explicitly records each transition and provides a unique normal form for the path due to confluence and termination.

A non-trivial equality such as $\mu_f(\tau(p,q)) = \tau(\mu_f(p),\mu_f(q))$ for $f: A \to B$ and paths $p: x = y$, $q: y = z$ in $A$ is derived using the higher-level rule 42 from TRS$_2$, establishing the congruence of path composition under function application.

For LCTRS, practical reachability analysis can be performed with tools such as the "RMT" system [1804.08308], which utilizes DAG-based term representation, maximal sharing, and an SMT-solver backend (default: Z3). Proof search is bounded or goal-directed, yielding either infinite coinductive DSTEP trees or finite circular DCC trees. Verified domains range from arithmetic algorithms (e.g., compositeness, greatest common divisors, summation, and powers) to operational semantics for imperative and functional programming languages.

## 7. Interconnections: Term Rewriting, Boolean Function Theory, and Graph Theory

LNDEQ-TRS integrates concepts from term rewriting theory (rules, contexts, modular equational deduction), Boolean function theory (monotone functions, minterms, maxterms, read-once functions), and graph theory (relation webs, $P_4$-free graphs) [1610.08772]. Soundness and triviality of linear inference rules are characterized via minterm and maxterm inclusions, as per $\forall S \in \mathrm{MIN}(f),\ \exists S' \in \mathrm{MIN}(g), S' \subseteq S \iff f \leq g$.

Gurvich’s theorem on read-once Boolean functions underpins the structural analysis—every minterm meets every maxterm in exactly one variable, a property leveraged to bound derivation lengths. Graph-theoretical invariants, such as clique sizes and edge-flips in relation webs, precisely translate into Boolean function and rewriting measures. Canonical rules like "medial" are characterized graph-theoretically as those which preserve, e.g., $\lor$-edges in the rewriting process.

*This suggests* that LNDEQ-TRS achieves a unique intersection of expressiveness, polynomially-bounded derivational complexity, and deep interconnectivity among foundational areas, while demonstrating inherent computational limitations dictated by complexity-theoretic boundaries such as coNP-completeness.

Source: https://www.emergentmind.com/topics/lndeq-trs-term-rewriting-system