LNDEQ-TRS: Labelled Natural Deduction Rewriting System
- LNDEQ-TRS is a term rewriting system for explicit equality proofs, using computational paths to record how two terms are equal.
- The system employs groupoid-like rewrite rules and normalization via termination and confluence to guarantee unique normal forms.
- LNDEQ-TRS underpins formal proofs such as the Seifert–van Kampen theorem by translating complex path equalities into explicit, decidable rewrite derivations.
Searching arXiv for the cited papers to ground the article. LNDEQ-TRS, written in the cited development as , 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 (Ramos et al., 2 Dec 2025).
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
read as “ is rewrite equal to .” The development presents this relation as the mechanism by which equality proofs are normalized and compared (Ramos et al., 2 Dec 2025).
The system acts on computational paths
for terms . Its basic constructors correspond to standard groupoid operations on equality proofs.
| Constructor | Type | Role |
|---|---|---|
| Reflexivity | Empty rewrite sequence | |
| Symmetry | Path inversion | |
| Transitivity | Path composition | |
| Congruence | Action of functions on paths | |
| Transport | 0 | Reindexing in families |
These constructors are supplemented by type-specific path constructors, including 1-, 2-, and transport-related structure. Computational paths are therefore syntactic composites built from reflexivity, symmetry, transitivity, congruence, transport, and the corresponding type-former rules (Ramos et al., 2 Dec 2025).
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 (Koroteev et al., 2018) and from the “Transferability Reduced Smooth (TRS)” ensemble training strategy in adversarial robustness (Yang et al., 2021).
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: 3
4
5
These rewrites encode left and right unit, inverse cancellation, involutivity of symmetry, and associativity of composition (Ramos et al., 2 Dec 2025).
Beyond this basic fragment, LNDEQ-TRS includes 6-rules and 7-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
8
where 9 is a context built from the path constructors. The paper does not list all 0 rules, but it emphasizes that the system contains both the core groupoid fragment and many type-former-specific rules (Ramos et al., 2 Dec 2025).
A crucial design constraint is preservation of the underlying equality proof. Each path carries an associated proof
1
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 2 (Ramos et al., 2 Dec 2025).
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
3
while confluence means that if
4
then there exists 5 such that
6
The cited development attributes these properties to earlier work and treats them as the basis for normalization (Ramos et al., 2 Dec 2025).
From termination and confluence it follows that every path has a unique normal form 7. 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 (Ramos et al., 2 Dec 2025).
The central canonicity statement is: 8 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 (Ramos et al., 2 Dec 2025).
The normalization theorem also supports the quotient definition of the fundamental group. Writing
9
the framework defines
0
Group structure descends from path structure: 1 The group laws are inherited from rewrite laws in LNDEQ-TRS; for example, associativity follows from the rewrite
2
Accordingly, the fundamental group is not postulated independently but internalized as a quotient of loop space by a decidable rewrite equality (Ramos et al., 2 Dec 2025).
4. Higher-inductive pushouts and the encode–decode method
The cited formalization uses computational paths to define pushouts as higher-inductive types. Given types 3 and maps 4, 5, the pushout
6
has point constructors
7
and a path constructor
8
The recursion principle is also expressed in computational-path terms: to define 9, one gives functions on the left and right summands together with path data onGlue, and the computation rule is stated using rewrite equality: 0
This makes the path-level content of higher-inductive elimination explicit (Ramos et al., 2 Dec 2025).
A key technical lemma is glue naturality. For a path 1 in 2, the development states that
3
where 4 and similarly for 5. 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 (Ramos et al., 2 Dec 2025).
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 6. 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 (Ramos et al., 2 Dec 2025).
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 (Ramos et al., 2 Dec 2025).
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 (Ramos et al., 2 Dec 2025).
Amalgamated free products are obtained by quotienting by an amalgamation relation. Given a common subgroup 7 and maps
8
the relation identifies occurrences of 9 on the left with occurrences of 0 on the right, together with the internal group reduction relations. The resulting quotient is the amalgamated free product
1
In the Lean development this is implemented by an equivalence closure AmalgEquiv extending AmalgRelation (Ramos et al., 2 Dec 2025).
The main theorem is the Seifert–van Kampen isomorphism
2
with amalgamation via the induced maps
3
The Lean formalization realizes this as a SimpleEquiv (Ramos et al., 2 Dec 2025).
LNDEQ-TRS is indispensable to the proof that decode respects amalgamation. The required loop equality in the pushout is
4
which is exactly a statement in rewrite equality. The same rewriting infrastructure supports the round-trip arguments by simplifying composites to canonical normal forms (Ramos et al., 2 Dec 2025).
Two applications illustrate the method. For the figure-eight,
5
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
6
and uses distinct word representatives to witness non-commutativity (Ramos et al., 2 Dec 2025).
For the 7-sphere,
8
so Seifert–van Kampen yields
9
Since both copies of 0 are trivial, every decoded word rewrites to the identity loop 1, and thus
2
The proof again depends on normalization in LNDEQ-TRS (Ramos et al., 2 Dec 2025).
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 3-sphere application (Ramos et al., 2 Dec 2025).
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 (Ramos et al., 2 Dec 2025).
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 (Ramos et al., 2 Dec 2025).
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 (Ramos et al., 2 Dec 2025).