---
title: 'LNDEQ-TRS: Labelled Natural Deduction Rewriting System'
url: https://www.emergentmind.com/topics/lndeq-trs
type: topic
---

# LNDEQ-TRS: Labelled Natural Deduction Rewriting System

Searching arXiv for the cited papers to ground the article.
LNDEQ-TRS, written in the cited development as \(\mathrm{LND}_{\mathrm{EQ}\text{-TRS}}\), is the *Labelled Natural Deduction Equality Term Rewriting System* that governs computational paths: explicit equality witnesses represented as sequences of rewrites. In the formalization of the Seifert–van Kampen theorem via computational paths, LNDEQ-TRS is the rewriting backbone that specifies how such paths are simplified, compared, and composed; its terminating and confluent behavior yields unique normal forms, makes path equality decidable, and turns coherence witnesses into explicit rewrite derivations [2512.03175].

## 1. Definition, scope, and syntactic domain

LNDEQ-TRS is a term rewriting system for explicit equality proofs. In the computational-paths framework, a path is not treated as an abstract inhabitant of an identity type alone; it is a syntactic object recording *how* two terms are equal. The rewrite relation generated by LNDEQ-TRS induces a path equality
\[
p \approx q,
\]
read as “\(p\) is rewrite equal to \(q\).” The development presents this relation as the mechanism by which equality proofs are normalized and compared [2512.03175].

The system acts on computational paths
\[
p : \mathrm{Path}(a,b)
\]
for terms \(a,b : A\). Its basic constructors correspond to standard groupoid operations on equality proofs.

| Constructor | Type | Role |
|---|---|---|
| Reflexivity | \(\rho(a) : \mathrm{Path}(a,a)\) | Empty rewrite sequence |
| Symmetry | \(\sigma(p) : \mathrm{Path}(b,a)\) | Path inversion |
| Transitivity | \(\tau(p,q) : \mathrm{Path}(a,c)\) | Path composition |
| Congruence | \(\mathrm{congrArg}(f,p)\) | Action of functions on paths |
| Transport | \(\mathrm{transport}(P,p)\) | Reindexing in families |

These constructors are supplemented by type-specific path constructors, including \(\beta\)-, \(\eta\)-, and transport-related structure. Computational paths are therefore syntactic composites built from reflexivity, symmetry, transitivity, congruence, transport, and the corresponding type-former rules [2512.03175].

In this usage, “TRS” denotes a *term rewriting system*. The acronym is distinct from the “trigonometric Ruijsenaars–Schneider (tRS) Hamiltonians” in quantum K-theoretic integrable systems [1802.04463] and from the “Transferability Reduced Smooth (TRS)” ensemble training strategy in adversarial robustness [2104.00671].

## 2. Rewrite laws and the structure of path equality

The core fragment of LNDEQ-TRS consists of groupoid-like reductions collapsing redundant uses of reflexivity, inversion, and composition. The development highlights the following rules:
\[
\tau(\rho(a), p) \Rightarrow p,\qquad
\tau(p,\rho(b)) \Rightarrow p,
\]
\[
\tau(p,\sigma(p)) \Rightarrow \rho(a),\qquad
\tau(\sigma(p),p) \Rightarrow \rho(b),
\]
\[
\sigma(\sigma(p)) \Rightarrow p,\qquad
\tau(\tau(p,q),r) \Rightarrow \tau(p,\tau(q,r)).
\]
These rewrites encode left and right unit, inverse cancellation, involutivity of symmetry, and associativity of composition [2512.03175].

Beyond this basic fragment, LNDEQ-TRS includes \(\beta\)-rules and \(\eta\)-rules for products, sums, functions, and related type formers; transport laws describing the interaction of transport with symmetry, reflexivity, congruence, and composed paths; and context rules of the form
\[
p \Rightarrow q \implies C[p] \Rightarrow C[q],
\]
where \(C[\cdot]\) is a context built from the path constructors. The paper does not list all \(\sim 50\) rules, but it emphasizes that the system contains both the core groupoid fragment and many type-former-specific rules [2512.03175].

A crucial design constraint is preservation of the underlying equality proof. Each path carries an associated proof
\[
\mathrm{toEq} : a = b,
\]
and each rewrite rule is chosen to preserve that proof. The induced equivalence closure of one-step rewrites, denoted `RwEq` in Lean, is the formal realization of rewrite equality \(\approx\) [2512.03175].

## 3. Termination, confluence, and canonical forms

The decisive structural properties of LNDEQ-TRS are **termination** and **confluence**. Termination means that there is no infinite rewrite chain
\[
p_0 \Rightarrow p_1 \Rightarrow p_2 \Rightarrow \cdots,
\]
while confluence means that if
\[
p \Rightarrow^* q_1,\qquad p \Rightarrow^* q_2,
\]
then there exists \(r\) such that
\[
q_1 \Rightarrow^* r,\qquad q_2 \Rightarrow^* r.
\]
The cited development attributes these properties to earlier work and treats them as the basis for normalization [2512.03175].

From termination and confluence it follows that every path has a unique normal form \(\mathrm{nf}(p)\). This has three direct consequences. First, rewrite equality reduces to equality of normal forms. Second, there is a canonical simplest representative of each equality proof. Third, path equality becomes decidable by computing normal forms and comparing them [2512.03175].

The central canonicity statement is:
\[
\text{for any } p,q : \mathrm{Path}(a,b),\qquad
p \approx q \iff p.\mathrm{toEq} = q.\mathrm{toEq}.
\]
This theorem links the rewrite-theoretic account of paths to proof equality in Lean. It is the linchpin for the claim that the encode–decode method becomes fully constructive once path equality is decidable via normalization [2512.03175].

The normalization theorem also supports the quotient definition of the fundamental group. Writing
\[
\Omega(A,a) := \mathrm{Path}(a,a),
\]
the framework defines
\[
\pi_1(A,a) := \Omega(A,a)/\approx.
\]
Group structure descends from path structure:
\[
[\alpha]\cdot[\beta] := [\tau(\alpha,\beta)],\qquad
[\alpha]^{-1} := [\sigma(\alpha)],\qquad
e = [\rho(a)].
\]
The group laws are inherited from rewrite laws in LNDEQ-TRS; for example, associativity follows from the rewrite
\[
\tau(\tau(p,q),r)\Rightarrow \tau(p,\tau(q,r)).
\]
Accordingly, the fundamental group is not postulated independently but internalized as a quotient of loop space by a decidable rewrite equality [2512.03175].

## 4. Higher-inductive pushouts and the encode–decode method

The cited formalization uses computational paths to define pushouts as higher-inductive types. Given types \(A,B,C\) and maps \(f:C\to A\), \(g:C\to B\), the pushout
\[
P := \mathrm{Pushout}(A,B,C,f,g)
\]
has point constructors
\[
\mathrm{inl}:A\to P,\qquad \mathrm{inr}:B\to P,
\]
and a path constructor
\[
\mathrm{glue}(c) : \mathrm{Path}\big(\mathrm{inl}(f(c)),\mathrm{inr}(g(c))\big)
\quad \text{for each } c:C.
\]
The recursion principle is also expressed in computational-path terms: to define \(\mathrm{rec}:P\to D\), one gives functions on the left and right summands together with path data `onGlue`, and the computation rule is stated using rewrite equality:
\[
\mathrm{congrArg}(\mathrm{rec},\mathrm{glue}(c)) \approx \mathrm{onGlue}(c).
\]
This makes the path-level content of higher-inductive elimination explicit [2512.03175].

A key technical lemma is *glue naturality*. For a path \(p:\mathrm{Path}(c_1,c_2)\) in \(C\), the development states that
\[
(\mathrm{inlPath}(f_*(p)), \mathrm{glue}(c_2))
\;\approx\;
(\mathrm{glue}(c_1), \mathrm{inrPath}(g_*(p))),
\]
where \(f_*(p)=\mathrm{congrArg}(f,p)\) and similarly for \(g\). In Lean, the corresponding axiom is formulated as a statement in `RwEq`. Operationally, this says that a path staying in the `inl`-image is rewrite equal to a zig-zag using `glue`, an `inr`-path, and the inverse of a `glue` path [2512.03175].

LNDEQ-TRS enters the encode–decode proof at three points. The decode map is constructed explicitly from path constructors and compositions, and its correctness depends on rewrite equalities such as glue naturality. The encode map is axiomatized but required to respect `RwEq`, ensuring that it descends from loop space to the quotient \(\pi_1(P)\). Finally, the round-trip identities—decode after encode and encode after decode up to amalgamation—are verified by normalization of composite path expressions involving compositions, inverses, and glue paths [2512.03175].

A common misconception is that the rewriting system serves only as a normalization convenience. In this formalization, it is more substantial: the encode–decode argument depends on explicit path calculations, and those calculations are certified precisely because coherence is represented by concrete rewrite derivations rather than by opaque higher equalities [2512.03175].

## 5. Free products, amalgamation, and Seifert–van Kampen

The Seifert–van Kampen theorem is proved by combining computational paths on the topological side with word quotients on the algebraic side. Free products are modeled by alternating word representations:
`FreeProductWord G1 G2` consists of `nil`, `consLeft`, and `consRight`, and concatenation is defined recursively, associatively up to definitional equality [2512.03175].

Amalgamated free products are obtained by quotienting by an amalgamation relation. Given a common subgroup \(H\) and maps
\[
i_1 : H \to G_1,\qquad i_2 : H \to G_2,
\]
the relation identifies occurrences of \(i_1(h)\) on the left with occurrences of \(i_2(h)\) on the right, together with the internal group reduction relations. The resulting quotient is the amalgamated free product
\[
G_1 *_H G_2.
\]
In the Lean development this is implemented by an equivalence closure `AmalgEquiv` extending `AmalgRelation` [2512.03175].

The main theorem is the Seifert–van Kampen isomorphism
\[
\pi_1\big(\mathrm{Pushout}(A,B,C,f,g),\mathrm{inl}(f(c_0))\big)
\;\cong\;
\pi_1(A,f(c_0)) *_{\pi_1(C,c_0)} \pi_1(B,g(c_0)),
\]
with amalgamation via the induced maps
\[
f_* : \pi_1(C,c_0)\to \pi_1(A,f(c_0)),\qquad
g_* : \pi_1(C,c_0)\to \pi_1(B,g(c_0)).
\]
The Lean formalization realizes this as a `SimpleEquiv` [2512.03175].

LNDEQ-TRS is indispensable to the proof that decode respects amalgamation. The required loop equality in the pushout is
\[
\mathrm{inlPath}(f_*(p))
\approx
\mathrm{glue}(c_0)\cdot \mathrm{inrPath}(g_*(p))\cdot \mathrm{glue}(c_0)^{-1},
\]
which is exactly a statement in rewrite equality. The same rewriting infrastructure supports the round-trip arguments by simplifying composites to canonical normal forms [2512.03175].

Two applications illustrate the method. For the figure-eight,
\[
\pi_1(S^1 \vee S^1)\cong \mathbb{Z} * \mathbb{Z},
\]
because the wedge is a pushout along the unit type, whose fundamental group is trivial, so the amalgamation collapses to an ordinary free product. The development stresses that there is no rewrite sequence equating
\[
\mathrm{loop}_A\cdot \mathrm{loop}_B
\quad\text{and}\quad
\mathrm{loop}_B\cdot \mathrm{loop}_A,
\]
and uses distinct word representatives to witness non-commutativity [2512.03175].

For the \(2\)-sphere,
\[
S^2 := \Sigma S^1 = \mathrm{Suspension}(S^1)
= \mathrm{Pushout}(\mathbf{1},\mathbf{1},S^1,!,!),
\]
so Seifert–van Kampen yields
\[
\pi_1(S^2)\cong \pi_1(\mathbf{1}) *_{\pi_1(S^1)} \pi_1(\mathbf{1})
\cong 1 *_\mathbb{Z} 1.
\]
Since both copies of \(\pi_1(\mathbf{1})\) are trivial, every decoded word rewrites to the identity loop \(\rho\), and thus
\[
\pi_1(S^2)\cong 1.
\]
The proof again depends on normalization in LNDEQ-TRS [2512.03175].

## 6. Lean 4 formalization and conceptual significance

The Lean 4 development organizes the theory around three primitives: `Path` for explicit equality proofs, `Step` for one-step rewrites in LNDEQ-TRS, and `RwEq` for the equivalence closure of `Step`. The fundamental group is defined as a quotient by `RwEq`, and the development formalizes free products, amalgamated free products, the decode map, amalgamation compatibility, the Seifert–van Kampen equivalence, the wedge sum, and the \(2\)-sphere application [2512.03175].

The formalization is deliberately mixed in status. The pushout higher-inductive structure and the encode map for pushouts are assumed as axioms, together with compatibility of encode with rewrite equality. By contrast, the decode map, amalgamation compatibility, and the applications are fully mechanized, and the paper reports a formalized development of 2050 lines. Termination and confluence of LNDEQ-TRS are not re-proved in Lean; they are assumed from prior work and used informally in reasoning about normalization [2512.03175].

The broader conceptual claim is that computational paths convert higher coherence from an implicit meta-level resource into explicit syntax. Traditional HoTT presentations typically treat paths as abstract inhabitants of identity types, path equality is not generally decidable, and higher coherence is often handled through abstract homotopy-theoretic arguments. In the computational-paths setting governed by LNDEQ-TRS, equality proofs are syntactic, path equality is decidable via normalization, and coherence witnesses are realized as rewrite derivations [2512.03175].

This suggests a distinct constructive profile for higher-inductive arguments. Rather than hiding the algebra of paths behind truncation or abstract coherence, the formalization makes it computational: if two path expressions have the same normal form, the rewrite system supplies the witness of their equivalence. In the cited Seifert–van Kampen development, that perspective is not ancillary. It is the mechanism by which pushout paths, amalgamation relations, and fundamental-group computations become explicit, checkable, and compatible with mechanization [2512.03175].

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