---
title: Metric Equational Theories
url: https://www.emergentmind.com/topics/metric-equational-theories-mets
type: topic
---

# Metric Equational Theories

Searching arXiv for recent and foundational papers on Metric Equational Theories and related categorical, algebraic, and program-semantic frameworks.
Metric Equational Theories (METs) are formal systems for reasoning about equality up to distance. In the quantitative-algebraic setting, they replace ordinary equations by approximate equations such as \(s =_\epsilon t\), interpreted as the assertion that \(d(\overline{s},\overline{t}) \leq \epsilon\) in a metric model; in continuous model theory, a metric theory equips each sort with a pseudo-metric and requires function and relation symbols to be uniformly continuous; and in enriched higher-order settings, equations may be labeled by elements of a quantale \(\mathcal V\), as in \(\Gamma \vdash v =_q w : A\) [1612.06054] [1607.03068] [2105.08473]. Across these formulations, METs generalize binary equality to quantitative comparison, and they connect proof theory, universal algebra, category theory, and semantics of probabilistic, timed, and higher-order computation.

## 1. Basic formal forms

A central first-order formulation treats a quantitative algebra of signature \(\Sigma\) as a metric space \((A,d)\) with non-expansive operations \(f^A : A^{\operatorname{ar}(f)} \to A\), where the product is equipped with the sup-metric [2005.07509]. In this setting, a quantitative equational theory, or MET, is a set of quantitative inferences of the form
\[
\big\{ t_i =_{\epsilon_i} s_i \big\}_{i\in I} \vdash s =_\epsilon t,
\]
meaning that whenever \(d(\iota(t_i),\iota(s_i)) \leq \epsilon_i\) for all premises, one must have \(d(\iota(s),\iota(t)) \leq \epsilon\) under any interpretation [2005.07509]. The deductive apparatus extends ordinary equational logic with congruence, substitution, triangle inequality, reflexivity, the Archimedean property, and non-expansiveness. For an \(n\)-ary operation \(f\), the non-expansiveness rule takes the form
\[
\{ t_i =_{\epsilon_i} s_i \}_{i} \vdash f(t_1,\dots,t_n) =_{\max \epsilon_i} f(s_1,\dots,s_n).
\]

A second formulation arises in continuous model theory. There, a metric theory assigns to each sort a pseudo-metric \(d_S\), and all function and relation symbols are uniformly continuous with respect to those metrics [1607.03068]. The associated categorical structure is a metric logical category \((R,d)\), where each object carries a pseudo-metric and morphisms are uniformly continuous. This yields a categorical counterpart of metric theories and interpretations, and it places METs inside the broader framework of continuous syntactic categories and metric logical functors [1607.03068].

A third formulation generalizes further from metrics to quantales. In the \(\mathcal V\)-equational setting, an equation \(t =_q s\) is labeled by an element \(q\) of a quantale \((\mathcal V,\otimes,k,\leq)\), so that ordinary equations, inequations, metric equations, and ultrametric equations all appear as instances [2105.08473]. In the metric case, \(q\) is a non-negative rational or real bounding distance; in the Boolean case, the same format recovers ordinary equations or inequations.

## 2. Algebraic semantics and variety theory

The algebraic semantics of METs extends classical universal algebra from sets to metric spaces. A metric \(\Sigma\)-algebra is a \(\Sigma\)-algebra equipped with a metric, while a quantitative algebra is the special case in which all operations are non-expansive [1612.06054]. Satisfaction of an M-equation
\[
X \vdash s =_\varepsilon t
\]
means that for every valuation \(v : X \to A\), the induced interpretations satisfy
\[
d^A(v^\sharp(s), v^\sharp(t)) \leq \varepsilon
\]
[1612.06054].

A central result is the metric analogue of Birkhoff’s HSP theorem. Varieties of metric algebras, that is, classes defined by metric equations, are exactly the classes closed under metric subalgebras, products, and quotients [1612.06054]. The 2017 refinement distinguishes strict varieties, defined by metric equations, from continuous varieties, defined by continuous families of basic quantitative inferences. For strict varieties, closure under subalgebras, products, and quotients is again exact; for continuous varieties, the corresponding closure properties are subalgebras, products, reflexive quotients, and ultraproducts [1703.03535].

The technical replacement for congruence is the congruential pseudometric. A congruential pseudometric \(\theta\) on a metric algebra is a pseudometric bounded above by the ambient metric such that its zero-set is a classical congruence [1703.03535]. Quotients correspond to congruential pseudometrics via the metric identification \(A/\theta\), and the collection of congruential pseudometrics forms a complete lattice [1703.03535]. This supplies a metric version of the isomorphism-theoretic machinery of universal algebra.

The limitations of strict metric equations are also explicit. The class of normed vector spaces cannot be defined by metric equations, because it is not closed under all metric quotients [1612.06054]. The same phenomenon is emphasized in the 2017 treatment: normed vector spaces are not a strict variety for the usual signature [1703.03535]. The literature therefore identifies the need for broader formula classes, notably basic quantitative inferences and continuous families of such inferences [1612.06054] [1703.03535].

## 3. Enriched categorical and internal-language semantics

Quantale-enriched formulations recast METs as internal languages for enriched categories. A \(\mathcal V\)-equation-in-context is a judgment
\[
\Gamma \vdash v =_q w : A,
\]
where \(q\) lies in a basis of \(\mathcal V\) and \(v,w\) are typed terms in linear \(\lambda\)-calculus [2105.08473]. The deductive system contains rules such as reflexivity, transitivity, weakening, an Archimedean rule based on the way-below relation, joins, and compatibility with operations and substitutions [2105.08473]. In the metric specialization, the rule set becomes the familiar reflexivity, symmetry, triangle, weakening, Archimedean, and join principles for bounds \(q \in [0,\infty]\cap \mathbb Q\) [2208.14356].

The semantic structures are \(\mathcal V\)-enriched autonomous categories. A \(\mathcal V\)-category \((X,a)\) consists of a set \(X\) and a function \(a : X \times X \to \mathcal V\) satisfying
\[
k \leq a(x,x), \qquad a(x,y)\otimes a(y,z) \leq a(x,z).
\]
For \(\mathcal V = ([0,\infty],\ge,+,0)\), this recovers generalized metric spaces [2105.08473]. A \(\mathcal V\)-enriched autonomous category is a symmetric monoidal closed category whose hom-sets are \(\mathcal V\)-categories, whose composition and tensor are \(\mathcal V\)-functors, and whose adjunction \((-\otimes X)\dashv (X \multimap -)\) is \(\mathcal V\)-enriched [2105.08473].

The principal theorems are soundness, completeness, and internal-language results. If \(\Gamma \vdash v =_q w : A\) is provable, then every interpretation in a \(\mathcal V\)-enriched autonomous category satisfies the corresponding enrichment bound between \(\llbracket v\rrbracket\) and \(\llbracket w\rrbracket\); conversely, if every model satisfies the judgment, then it is derivable [2105.08473]. The syntactic category of a suitable \(\mathcal V\)-equational linear \(\lambda\)-theory is \(\mathcal V\)-equivalent to the original enriched autonomous category, so the calculus functions as an internal language [2105.08473]. The syntactic-semantic equivalence extends to the affine setting, and concrete systems are developed for real-time, probabilistic, and quantum higher-order programs [2208.14356].

## 4. From discrete arities to countable metric arities

A major recent development generalizes earlier Quantitative Equational Theories (QETs) by changing the admissible arities of operations. In QETs, operations have finite discrete arity. In the MET framework of 2025, operations no longer have finite sets as arities; instead, arities are drawn from countable metric spaces, following the enriched Lawvere-theoretic principle that arities should be the \(\kappa\)-presentable objects of the underlying \(\lambda\)-accessible category [2509.14094]. This extension is designed to present algebraic structure over \(Met\) that cannot be captured with finite discrete arities.

The shift in arities has a proof-theoretic consequence: the validity of terms can no longer be guaranteed independently of the validity of equations [2509.14094]. The resulting calculus therefore uses both formational judgments \(\Gamma \vdash t\;ok\) and structural judgments \(\Gamma \vdash s =_\epsilon t\). The application rule is
\[
\infer[\mathbf{App}]{\Gamma \vdash f((t_i))\ ok}{\forall i:\Gamma \vdash t_i\ ok,\ \forall i,j,\ d(i,j)<\infty:\Gamma \vdash t_i =_{d(i,j)} t_j},
\]
and this is paired with quantitative rules such as non-expansiveness, substitution, symmetry, triangle, continuity, and maximum [2509.14094]. The system is sound and complete, and every countable-arity \(Met\)-Lawvere theory arises from an MET; conversely, every MET yields a countable-arity Lawvere theory [2509.14094].

The canonical example is Cauchy completion. Let \(N\) be the natural numbers with metric \(d(n,m)=\frac{1}{2^{\min(n,m)}}\). The limit operation is governed by the axiom
\[
\{ x_n =_{d(n,m)} x_m \mid n,m \in N \} \vdash \lim(x_1,x_2,\ldots) =_{1/2^n} x_n,
\]
which expresses that a Cauchy sequence has a limit within \(1/2^n\) of its \(n\)-th term [2509.14094]. This example is explicitly identified as impossible in QETs [2509.14094].

At the categorical level, these developments align with two parallel results. First, discrete equational theories in a general symmetric monoidal closed category correspond to monads preserving surjections; for \(Met\), this recovers the characterization of metric theories with discrete arities [2204.02590]. Second, \(V\)-enriched multi-sorted equational theories have an underlying classical theory \(|T|\), and free \(T\)-algebras are obtained as suitable liftings of free \(|T|\)-algebras; when \(V\) is the category of pseudo-metric spaces, this supplies explicit free constructions for metric-enriched theories [2308.04531].

## 5. Program semantics, effects, and quantitative reasoning

METs have become a standard proof-theoretic language for quantitative program semantics. One line of work lifts the convex set monad from sets to metric spaces by means of the Hausdorff and Kantorovich liftings, obtaining a monad
\[
\mathcal C'(X,d) = (\mathcal C(X), H(K(d))),
\]
where \(H\) is the Hausdorff lifting and \(K\) is the Kantorovich lifting [2005.07509]. The main theorem states that this monad is presented by the quantitative equational theory of convex semilattices, so that
\[
QA(CS) \cong \mathcal{EM}_{\mathcal C'}
\]
[2005.07509]. This provides an algebraic account of nondeterministic and probabilistic choice at the level of distances.

A closely related development adds termination. Monads combining nondeterminism, probability, and termination are presented equationally by pointed convex semilattices, with bottom and black-hole axioms such as \(x \oplus \star = x\) and \(x +_p \star = \star\), together with their metric counterparts [2012.00382]. The resulting presentation theorems connect the Eilenberg–Moore categories of the monads with the corresponding equational or quantitative theories, while also exhibiting negative results: some monad combinations with the black-hole axiom do not admit nontrivial metric presentations [2012.00382].

For higher-order calculi, METs also organize the comparison between operational and semantic program distances. In a linear lambda-calculus, the observational metric and logical metric coincide, every admissible metric \(d\) satisfies
\[
d^{\mathrm{obs}} = d^{\mathrm{ext}} \leq d \leq d^{\mathrm{eq}},
\]
and the denotational and interactive metrics lie in between observational and equational metrics, with strict inclusions in some cases [2302.05022]. The interactive metric is strictly more discriminating than the denotational one [2302.05022]. This places the equational metric induced by MET-style proof systems at the top of a refinement lattice of program metrics.

Resource-sensitive higher-order systems extend this picture. A sound and complete \(\mathcal V\)-equational system for graded lambda-calculus uses graded modal types and a Lipschitz exponential comonad satisfying
\[
r \cdot a(f,g) \leq a(D_r f, D_r g),
\]
capturing the quantitative effect of using a resource \(r\) times [2304.02082]. Timed and probabilistic examples show how quantitative bounds propagate compositionally through higher-order programs [2304.02082].

## 6. Logical completions, higher-order quantitative relations, and limitations

Within categorical logic for continuous model theory, metric logical categories and metric logical functors provide a categorical equivalent of metric theories and interpretations [1607.03068]. The model-functor correspondence is expressed by
\[
Mod^*(L_C,T_C) \cong \operatorname{Hom}(C, Met),
\]
and the expansion by imaginaries \(T^\eq\) is the maximal conservative expansion of a metric theory [1607.03068]. The associated notion of metric pre-topos packages the closure properties needed for elimination of imaginaries and conceptual completeness [1607.03068]. This is a distinct but closely connected line of development: it treats METs as objects of categorical logic rather than primarily as algebraic presentations.

Recent work on differential logical relations pushes the higher-order quantitative setting beyond ordinary metrics. The notion of quasi-quasi-metric is introduced as a ternary quantale-valued relation satisfying quasi-reflexivity and transitivity, and the resulting cartesian closed category reflects the construction of differential logical relations [2603.01317]. Differential prelogical relations are then defined as quasi-quasi-metrics on collections of programs. The poset of such relations has a finest differential prelogical relation presented as a formal quantitative equational theory, but it lacks a coarsest differential prelogical relation [2603.01317]. This contrasts with typed lambda calculi, where contextual equivalence serves as the coarsest program equivalence [2603.01317].

Two recurring limitations frame the present state of METs. First, strict metric equations do not capture all natural analytic classes, as illustrated by normed vector spaces [1612.06054]. Second, not all combinations of algebraic effects remain well behaved at the metric level, as shown by monads with black-hole behavior [2012.00382]. A plausible implication is that METs are best understood not as a single fixed formalism, but as a family of related quantitative proof systems whose exact shape depends on the target semantics: metric algebras, continuous first-order structures, enriched Lawvere theories, or higher-order program models.

Source: https://www.emergentmind.com/topics/metric-equational-theories-mets