text:
\section{Introduction}

The main aim of this paper is to understand what it means in algebraic terms for the (first-order) theory of a universal class of algebraic structures (algebras) to have a model completion. For classes that have finite presentations --- including all quasivarieties, but not, for example, ordered abelian groups --- a complete characterization was provided by Wheeler in~\cite{Whe76} (see also~\cite{Whe78}) using the well-studied  properties of amalgamation and coherence together with a more complicated property referred to as the conservative congruence extension property. However, as we show in Section~\ref{s:model-completions}, replacing coherence and the conservative congruence extension property with a variable projection property and conservative model extension property yields necessary and sufficient conditions for all universal classes of algebras (Theorem~\ref{t:charact-model-completion}).

Although the mentioned properties can be used to confirm that the theories of ordered abelian groups and linearly ordered MV-algebras have a model completion~\cite{Rob77,LS77}, the conservative model extension property is, in general, rather difficult to prove or refute. We therefore also provide, in Section~\ref{s:model-completion-edpc}, a more elegant characterization for varieties (equational classes) of algebras that have equationally definable principal congruences and the compact intersection property, where the conservative model extension property is replaced by a more amenable equational variable restriction property (Theorem~\ref{t:GZ-charact}). This result generalizes slightly a characterization given by Ghilardi and Zawadowski in~\cite{GZ97} (see also~\cite{GZ02}) by covering varieties such as lattice-ordered abelian groups for which there exists no equation that entails all other equations.

In Section~\ref{s:pdpc}, we prove that for any congruence distributive variety $\cls{V}$ that has both the congruence extension property and a ``guarded'' deduction theorem, if the theory of $\cls{V}$ has a model completion, then $\cls{V}$ has equationally definable principal congruences (Theorem~\ref{t:mc-implies-EDPC-guarded}). Our approach is inspired by the work of Glass and Pierce on lattice-ordered abelian groups in~\cite{GP80} and indeed yields both their result that the theory of this variety does not have a model completion, and the same result  for MV-algebras, first proved by Lacava in~\cite{Lac79}. More generally, in Section~\ref{s:prls}, we use this theorem to show that the theory of a Hamiltonian variety of pointed residuated lattices --- spanning varieties of algebras for substructural logics as well as lattice-ordered abelian groups and MV-algebras (see, e.g.,~\cite{BT03,GJKO07,MPT10}) --- has a model completion if, and only if, the variety is coherent and has equationally definable principal congruences, the amalgamation property, and the equational variable restriction property (Theorem~\ref{t:HamRL-charact}).

Finally, in Section~\ref{s:extension}, we associate with any variety $\cls{V}$ generated by a class of linearly ordered pointed residuated lattices, a variety $\cls{V_\rhd}$ of algebras with an additional binary operation that has equationally definable principal congruences and the same universal theory as $\cls{V}$ in the original language. We then show that if $\cls{V}$ satisfies a certain syntactic condition, the theory of $\cls{V_\rhd}$ has a model completion (Theorem~\ref{t:two-sided-mc}). Notably, this is the case for lattice-ordered abelian groups and MV-algebras, the second case yielding an alternative proof of the fact that the theory of MV$_\Delta$-algebras has a model completion, first announced by X.~Caicedo at a conference in 2008.

\section{Algebraic properties}\label{s:algebraic-properties}

Let us first recall some elementary material on universal algebra, referring to~\cite{BS81} for proofs and references. For convenience, we will assume throughout this paper that $\mathcal{L}$ is an algebraic language (i.e., a first-order language with no relation symbols) containing at least one constant symbol $c$ and that an {\em $\mathcal{L}$-algebra} $\m{A}$ is an  $\mathcal{L}$-structure with universe $A$, calling $\m{A}$ {\em trivial} if $|A| = 1$. We denote by $\Con{\m{A}}$ the congruence lattice of $\m{A}$, and  by $\cg{\m{A}}(S)$ the congruence of $\m{A}$ generated by $S\subseteq A^2$.

The {\em term algebra}  $\m{Tm}_\mathcal{L}(\overline{x})$ for $\mathcal{L}$ over a set $\overline{x}$ is an $\mathcal{L}$-algebra with universe $\mathrm{Tm}_\mathcal{L}(\overline{x})$ consisting of $\mathcal{L}$-terms with variables in $\overline{x}$, such that for any $\mathcal{L}$-algebra $\m{A}$ and map $f\colon\overline{x}\to A$, there exists a unique homomorphism $\tilde{f}\colon\m{Tm}_\mathcal{L}(\overline{x})\to\m{A}$ extending $f$. Atomic $\mathcal{L}$-formulas are {\em $\mathcal{L}$-equations}, written $s \approx t$, and $\mathcal{L}$-equations and their negations are {\em $\mathcal{L}$-literals}. Conjunctions, disjunctions, negations, implications, and bi-implications of $\mathcal{L}$-formulas are built using the symbols $\mathbin{\&}$, $\curlyvee$, $\neg$, $\to$, and $\leftrightarrow$, respectively, with $\top\coloneqq c\approx c$ and $\bot\coloneqq \neg \top$. An {\em $\mathcal{L}$-quasiequation} is an $\mathcal{L}$-formula $\pi \to \varepsilon$, where $\pi$ is a conjunction of $\mathcal{L}$-equations and $\varepsilon$ is an $\mathcal{L}$-equation, assuming that the empty conjunction is $\top$. For an $\mathcal{L}$-term $t$ or $\mathcal{L}$-formula $\alpha$, we denote by $t(\overline{x})$ or $\alpha(\overline{x})$ that its free variables belong to the set $\overline{x}$, and for a conjunction of $\mathcal{L}$-literals $\xi$, we write $\xi^+$ and $\xi^-$ for the conjunctions of $\mathcal{L}$-equations occurring in $\xi$ positively and negatively, respectively.

Let $\cop{H}$, $\cop{I}$, $\cop{S}$, $\cop{P}$, and $\cop{P}_U$ denote the class operators of taking homomorphic images, isomorphic images, subalgebras, products, and ultraproducts, respectively. A class of $\mathcal{L}$-algebras $\cls{K}$ is called a {\em variety} if it is closed under $\cop{H}$, $\cop{S}$, and $\cop{P}$, and a {\em quasivariety} if is closed under $\cop{I}$, $\cop{S}$, $\cop{P}$, and $\cop{P}_U$. The class $\cls{K}$ is a variety if, and only if, it is an equational class, and a quasivariety if, and only if, it is a quasiequational class. Moreover, $\cls{K}$ is a universal class if, and only if, it is closed under  $\cop{I}$, $\cop{S}$, and $\cop{P}_U$, and a positive universal class if, and only if, it is closed under $\cop{H}$, $\cop{S}$, and $\cop{P}_U$.

The variety and quasivariety generated by a class of $\mathcal{L}$-algebras $\cls{K}$ are, respectively, the smallest variety $\cop{HSP}(\cls{K})$  and quasivariety $\cop{ISPP}_U(\cls{K})$ of $\mathcal{L}$-algebras containing $\cls{K}$. An $\mathcal{L}$-equation is valid in $\cls{K}$ if, and only if, it is valid in $\cop{HSP}(\cls{K})$, and an $\mathcal{L}$-quasiequation is valid in $\cls{K}$ if, and only if, it is valid in $\cop{ISPP}_U(\cls{K})$. For future reference, let us note also that any class of $\mathcal{L}$-algebras $\cls{K}$ that is closed under taking finite products satisfies the following {\em disjunction property}: for any conjunctions of $\mathcal{L}$-equations $\ensuremath{\varphi},\pi_1,\dots,\pi_n$,
\[
\cls{K}\models \ensuremath{\varphi}\to\!\!\bigOR_{1\leq i\leq n}\pi_i \iff \cls{K}\models \ensuremath{\varphi}\to \pi_i\,\text{ for some $i\in\{1,\dots,n\}$.}
\]
For a variety of $\mathcal{L}$-algebras $\cls{V}$, the {\em $\cls{V}$-free algebra} $\m{F}_\cls{V}(\overline{x})$ over a set $\overline{x}$ may be identified with the quotient $\m{Tm}_{\mathcal{L}}(\overline{x}) / \theta_\cls{V}(\overline{x})$, where $\theta_\cls{V}(\overline{x})\coloneqq \bigcap{\{\theta\in\Con{\m{Tm}_{\mathcal{L}}(\overline{x})} \mid \m{Tm}_{\mathcal{L}}(\overline{x}) / \theta\in\cls{V}\}}$. For any $\mathcal{L}$-equation $\varepsilon\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})^2$, we let $\hat{\varepsilon}$ denote its image under the natural surjection $\m{Tm}_{\mathcal{L}}(\overline{x})^2\twoheadrightarrow \m{F}_\cls{V}(\overline{x})^2$. The following useful lemma shows that the valid $\mathcal{L}$-quasiequations of $\cls{V}$ can be described in terms of congruences of $\cls{V}$-free algebras.

\begin{lemma}[{cf.~\cite[Lemma~2]{MMT14}}]\label{l:compact-congr-and-consequence-rel}
For any variety of $\mathcal{L}$-algebras $\cls{V}$, conjunction of $\mathcal{L}$-equations $\pi(\overline{x})$, and $\mathcal{L}$-equation $\varepsilon(\overline{x})$,
\[
\cls{V}\models \pi\to \varepsilon \iff \hat{\varepsilon}\in\cg{\m{F}_{\cls{V}}(\overline{x})}(\{\hat{\ensuremath{\sigma}}\mid \ensuremath{\sigma} \text{ is an equation of } \pi\}).
\]
\end{lemma}

A variety $\cls{V}$ has the {\em congruence extension property} if for all $\m{A}\in \cls{V}$, any congruence of a subalgebra of $\m A$ extends to a congruence of $\m A$. The following lemma provides a useful equivalent characterization of this property in terms of congruences of $\cls{V}$-free algebras.

\begin{lemma}[{cf.~\cite[Lemma~17]{MMT14}}]\label{l:cepequiv}
A variety $\cls{V}$ has the congruence extension property if, and only if, for any $\theta\in\Con{\m{F}_{\cls{V}}(\overline{x})}$ and $\theta'\in\Con{\m{F}_{\cls{V}}(\overline{x},\overline{y})}$,
\[
(\theta'\vee\cg{\m{F}_\cls{V}(\overline{x},\overline{y})}(\theta))\cap\mathrm{F}_{\cls{V}}(\overline{x})^2
=
(\theta'\cap\mathrm{F}_{\cls{V}}(\overline{x})^2)\vee\theta.
\]
\end{lemma}

In what follows, we will omit mention of the language $\mathcal{L}$, assuming throughout that a class of algebras $\cls{K}$ is a class of $\mathcal{L}$-algebras, and that terms, equations, formulas, etc.\ are defined over this language.

\subsection{The variable projection property and coherence}

Let us say that a class of algebras $\cls{K}$ has the \emph{variable projection property} if for any finite set $\overline{x},y$ and conjunction of equations $\ensuremath{\varphi}(\overline{x},y)$, there exists a quantifier-free formula $\xi(\overline{x})$ such that $\cls{K}\models\ensuremath{\varphi}\to\xi$ and for any equation~$\varepsilon(\overline{x})$,
\[
\cls{K}\models \ensuremath{\varphi}\to \varepsilon \:\Longrightarrow\:\cls{K}\models \xi\to\varepsilon.
\]
If $\xi(\overline{x})$ is required to be a conjunction of equations for each $\ensuremath{\varphi}(\overline{x},y)$, we say that  $\cls{K}$ has the \emph{equational variable projection property}.

\begin{remark}\label{r:quasiequationalrestriction}
Since $\cls{K}$ satisfies the same quasiequations as the quasivariety $\cop{ISPP}_U(\cls{K})$ that it generates, $\cls{K}$ has the equational variable projection property if, and only if, $\cop{ISPP}_U(\cls{K})$ has this property.
\end{remark}

For varieties, the variable projection property is equivalent both to the  equational variable projection property and to the widely studied algebraic property of coherence. A variety $\cls{V}$ is said to be \emph{coherent} if every finitely generated subalgebra of a finitely presented member of $\cls{V}$ is finitely presented.

\begin{proposition}\label{p:coherence-eq-conseq}
The following statements are equivalent for any variety~$\cls{V}$:
\begin{enumerate}
\item[(1)] $\cls{V}$ is coherent.
\item[(2)] $\cls{V}$ has the equational variable projection property.
\item[(3)] $\cls{V}$ has the variable projection property.
\end{enumerate}
\end{proposition}
\begin{proof}
The equivalence of (1) and (2) is established in~\cite[Theorem 2.3]{KM18}, and (3) is an immediate consequence of (2). To show that (3) implies (2), we fix a finite set $\overline{x},y$ and a conjunction of equations $\ensuremath{\varphi}(\overline{x},y)$, and let $\xi(\overline{x})$ be a quantifier-free formula such that $\cls{V}\models\ensuremath{\varphi}\to\xi$ and for any equation $\varepsilon(\overline{x})$, we have $\cls{V}\models \ensuremath{\varphi}\to \varepsilon \: \Longrightarrow \: \cls{V}\models \xi\to\varepsilon$. Since $\ensuremath{\varphi}$ is satisfiable in $\cls{V}$ (e.g., in any trivial algebra), we can assume without loss of generality that $\xi=\xi_1\curlyvee\cdots \curlyvee\xi_m$, where $\xi_1,\dots,\xi_m$ are conjunctions of literals satisfiable in $\cls{V}$.

Since $\cls{V}\models\ensuremath{\varphi}\to\xi$, also $\cls{V}\models\ensuremath{\varphi}\to\!\bigOR_{1\leq i\leq m}\xi_i^+$. By the disjunction property for varieties, $\cls{V}\models \ensuremath{\varphi}\to \xi^+_i$ for some $i\in\{1,\dots,m\}$. Let $\ensuremath{\sigma}_1,\dots,\ensuremath{\sigma}_n$ be the equations of $\xi^-_i$ and consider any equation $\varepsilon(\overline{x})$ such that $\cls{V}\models \ensuremath{\varphi}\to \varepsilon$. By assumption, $\cls{V}\models \xi\to\varepsilon$, so $\cls{V}\models \xi_i\to\varepsilon$. Hence $\cls{V}\models \xi^+_i\to\varepsilon\curlyvee\!\bigOR_{1\leq j\leq n}{\ensuremath{\sigma}_j}$ and, by the disjunction property for varieties, either $\cls{V}\models \xi^+_i\to\varepsilon$ or $\cls{V}\models \xi_i\to\bot$. But $\xi_i$ is satisfiable in $\cls{V}$, so $\cls{V}\models \xi^+_i\to\varepsilon$.
\end{proof}

Following this last proposition, we will refer to a variety throughout this paper as coherent whenever it has the (equational) variable projection property.

\begin{remark}\label{r:locally-finite-coherent}
An algebra $\m{A}$ is {\em locally finite} if every finitely generated subalgebra of $\m{A}$ is finite, and a class of algebras $\cls{K}$ is locally finite if each $\m{A}\in\cls{K}$ is locally finite. Since any finitely presented algebra of a locally finite variety is finite and any finite algebra of a locally finite variety is finitely presented, every locally finite variety is coherent.
\end{remark}

Below we introduce some well-known classes of algebras that will be employed as running examples throughout the paper. These algebras all possess definable binary operations $\wedge$ and $\vee$ such that $a \le b \: :\Longleftrightarrow\: a\wedge b = a$ defines a lattice order with binary meets and joins given by $\wedge$ and $\vee$, respectively.

\begin{example}\label{ex:linear-orders-evrp}
{\em Linear orders with endpoints} may be considered as bounded lattices $\langle L,\wedge,\vee,0,1\rangle$ where the defined lattice order is linear. The class $\cls{DL^c}$ of linear orders with endpoints is then a positive universal class of algebras that generates the variety $\cls{DL}$ of bounded distributive lattices as a quasivariety. Since $\cls{DL}$ is locally finite, it is coherent, and, by Remark~\ref{r:quasiequationalrestriction}, the class $\cls{DL^c}$ has the equational variable projection property.
\end{example}

\begin{example}\label{ex:Heyting-algebras-and-chains}
A {\em Heyting algebra} is an algebra $\langle H,\wedge,\vee,\himp,0,1\rangle$ such that the reduct $\langle H,\wedge,\vee,0,1 \rangle$ is a bounded distributive lattice and $\himp$ is the right residual of $\wedge$; that is, $a \le b\himp c$ if, and only if, $a \wedge b \le c$ for all $a,b,c\in H$. The fact that the variety $\cls{HA}$ of Heyting algebras is coherent is a direct consequence of Pitts' uniform interpolation theorem for intuitionistic propositional logic~\cite{Pit92}.
\end{example}

\begin{example}\label{ex:ordered-groups-alm-coh}
A {\em lattice-ordered abelian group} is an algebra $\langle L,\wedge,\vee,+,-,0 \rangle$ such that $\langle L,+,-,0 \rangle$ is an abelian group, $\langle L,\wedge,\vee \rangle$ is a lattice, and $a\leq b$ implies $a+c\leq b+c$ for all $a,b,c\in L$. Lattice-ordered abelian groups form a variety $\cls{LA}$ that is coherent (see~\cite{KM18}) and generated as a quasivariety by the positive universal class $\cls{LA^c}$ of \emph{ordered abelian groups}, i.e., the class of linearly ordered members of $\cls{LA}$  (see, e.g.,~\cite{AF88}). It follows from Remark~\ref{r:quasiequationalrestriction} that $\cls{LA^c}$ has the equational variable projection property.
\end{example}

\begin{example}\label{ex:mv-algebras}
An {\em MV-algebra} is an algebra $\langle M,\oplus,\lnot,0\rangle$ satisfying the equations
\[
\begin{array}{rlcrl}
{\rm (MV1)} &  x\oplus(y\oplus z)\approx(x\oplus y)\oplus z & & {\rm (MV4)} &  \lnot\lnot x\approx x\\
{\rm (MV2)} &  x\oplus y\approx y\oplus x & & {\rm (MV5)}  &  x\oplus\lnot0 \approx\lnot 0\\
{\rm (MV3)} &  x\oplus0\approx x & & {\rm (MV6)} &  \lnot(\lnot x\oplus y)\oplus y\approx\lnot(\lnot y\oplus x)\oplus x.
\end{array}
\]
The variety $\cls{MV}$ of MV-algebras is coherent (see~\cite{KM18}), and generated as a quasivariety by the positive universal class $\cls{MV^c}$ of MV-algebras that are linearly ordered with respect to the defined lattice operations $x\wedge y\coloneqq\lnot(\lnot x \oplus \lnot (\lnot x \oplus y))$ and $x\vee y\coloneqq \lnot(\lnot x \oplus y)\oplus y$ (see,~e.g.,~\cite{COM99}). Again, it follows from Remark~\ref{r:quasiequationalrestriction} that $\cls{MV^c}$ has the equational variable projection property.
\end{example}

Notable varieties that are not coherent include the varieties of lattices, semigroups, groups, and modal algebras (see~\cite{KM18} for proofs and references).

\subsection{The conservative model extension property}

Let us say that a class of algebras $\cls{K}$ has the {\it conservative model extension property} if for any finite set $\overline{x},y$ and conjunction of literals $\ensuremath{\psi}(\overline{x},y)$, there exists a quantifier-free formula $\chi(\overline{x})$ satisfying
 \begin{enumerate}
 \item [(i)] $\cls{K}\models \ensuremath{\psi}\to\chi$
 \item [(ii)] for any $\m A \in \cls{K}$ generated by $\overline{a}\in A^{\overline{x}}$ such that $\m A\models\chi(\overline{a})$ and for any equation $\varepsilon(\overline{x})$,
 \[
 \cls{K}\models\ensuremath{\psi}^+\to\varepsilon \:\Longrightarrow\: \m A\models\varepsilon(\overline{a}),
 \]
 there exist an algebra $\m B\in\cls{K}$ extending $\m A$ and $b \in B$ such that $\m B\models \ensuremath{\psi}(\overline{a},b)$.
  \end{enumerate}

\begin{remark}\label{r:satisfiable-and-non-empty}
In the previous definition, we may assume without loss of generality that $\ensuremath{\psi}$ is satisfiable in $\cls{K}$. Just observe that if this is not the case, then $\cls{K}\models \ensuremath{\psi}\leftrightarrow  \bot$ and we can let $\chi\coloneqq \bot$. Moreover, if there is precisely one definable constant in $\cls{K}$ (which is the case, e.g., for lattice-ordered abelian groups), we can assume that $\overline{x}$ is non-empty. To see this, suppose that $\overline{x}=\emptyset$ and let $\chi\coloneqq \top$. Then (i) is clearly satisfied and for (ii), any $\m{A}\in\cls{K}$ generated by $\emptyset$ is trivial and satisfies all equations, so, since $\ensuremath{\psi}$ is satisfiable in $\cls{K}$, we can choose an algebra $\m B\in \cls{K}$ extending $\m{A}$ and $b\in B$ such that $\m B\models \ensuremath{\psi}(b)$.
\end{remark}

In the case where $\cls{K}$ is a universal class of algebras admitting finite presentations (in particular, any quasivariety), the conservative model extension property is implied by the conservative congruence extension property introduced by Wheeler in~\cite{Whe76} (see Proposition~\ref{p:CMEP-CCEP} of Appendix~\ref{app:wheeler}). The following proposition, proved here for the sake of completeness, is then a direct consequence of~\cite[Corollary~1, p.~319]{Whe76}.

\begin{proposition}\label{p:locally-finite}
Every locally finite variety has the conservative model extension property.
\end{proposition}
\begin{proof}
Let $\cls{V}$ be a locally finite variety and consider a finite set $\overline{x},y$ and conjunction of literals $\ensuremath{\psi}(\overline{x},y)$. We can assume that $\ensuremath{\psi}$ is satisfiable in $\cls{V}$. Since $\cls{V}$ is locally finite, the finitely generated free algebra $\m{F}_\cls{V}(\overline{x})$ is finite and has finitely many congruences $\theta_1,\dots,\theta_m$. For each $w\in\mathrm{F}_\cls{V}(\overline{x})^2$, choose an equation $\varepsilon_{w}$ such that $\hat{\varepsilon}_w=w$. Now, for each $j\in\{1,\dots,m\}$, let $\ensuremath{\psi}_j(\overline{x})$ be the conjunction of literals in the set $\{\varepsilon_{w}\mid w\in \theta_j\}\cup\{\neg\varepsilon_{w}\mid w\notin \theta_j\}$. Then, for any algebra $\m A\in \cls{V}$ generated by a tuple $\overline{a}\in A^{\overline{x}}$, we have $\m A\models \ensuremath{\psi}_j(\overline{a})$ if, and only if, the homomorphism $\m{F}_\cls{V}(\overline{x})/\theta_j\to\m A$ mapping $\overline{x}_j$ to $\overline{a}$, where $\overline{x}_j$ is the image of the tuple $\overline{x}$ under the composite map $\m{Tm}(\overline{x})\twoheadrightarrow \m{F}_{\cls{V}}(\overline{x})\twoheadrightarrow \m{F}_\cls{V}(\overline{x})/\theta_j$, is an isomorphism.

Let $S$ be the set of all $j\in\{1,\dots,m\}$ such that there exist $\m B\in \cls{V}$ extending $\m{F}_\cls{V}(\overline{x})/\theta_j$ and $b\in B$ satisfying $\m B\models \ensuremath{\psi}(\overline{x}_j,b)$. Since $\ensuremath{\psi}$ is satisfiable in $\cls{V}$, there exist $\m B\in \cls{V}$ and $(\overline{a},b)\in B^{\overline{x},y}$ such that $\m B\models \ensuremath{\psi}(\overline{a},b)$. The following claim then implies that $S\neq\emptyset$.
\begin{claim*}
Suppose that $\m B\in \cls{V}$ and $\m B\models \ensuremath{\psi}(\overline{a},b)$ for some $(\overline{a},b)\in B^{\overline{x},y}$. Then there exist $j\in\{1,\dots,m\}$ and an embedding $\m{F}_\cls{V}(\overline{x})/\theta_j\hookrightarrow \m B$ mapping $\overline{x}_j$ to $\overline{a}$, and hence $j\in S$.
\end{claim*}
\begin{proof}[Proof of Claim]
By the homomorphism theorem for universal algebra (see, e.g.,~\cite{BS81}), it suffices to observe that the image of the homomorphism $\m{F}_\cls{V}(\overline{x})\to \m B$ mapping the equivalence class of $\overline{x}$ to $\overline{a}$ is isomorphic to $\m{F}_\cls{V}(\overline{x})/\theta_j$ for some  $j\in\{1,\dots,m\}$.
\end{proof}
We now prove that the quantifier-free formula
\[
\chi(\overline{x})\coloneqq \bigOR_{k\in S}{\ensuremath{\psi}_k}
\]
satisfies conditions (i) and (ii) in the definition of the conservative model extension property. For (i), we must show $\cls{V}\models \ensuremath{\psi}\to \chi$. By the Claim, if $\m B\in \cls{V}$ and $(\overline{a},b)\in B^{\overline{x},y}$ satisfy $\m B\models \ensuremath{\psi}(\overline{a},b)$, then there exist $j\in\{1,\dots,m\}$ and an embedding $\m{F}_\cls{V}(\overline{x})/\theta_j\hookrightarrow \m B$ mapping $\overline{x}_j$ to $\overline{a}$. So $\m B\models \ensuremath{\psi}_j(\overline{a})$, which implies $\m B\models \chi(\overline{a})$. For (ii), suppose that $\m A\in \cls{V}$ is generated by a tuple $\overline{a}\in A^{\overline{x}}$ satisfying $\m A\models\chi(\overline{a})$. Let $k\in S$ be such that $\m A\models \ensuremath{\psi}_k(\overline{a})$, and recall that there is an isomorphism $\m{F}_\cls{V}(\overline{x})/\theta_k\to \m A$ mapping $\overline{x}_k$ to $\overline{a}$. By the definition of $S$, there exist $\m B\in \cls{V}$ extending $\m A$ and $b\in B$ such that $\m B\models \ensuremath{\psi}(\overline{a},b)$.
\end{proof}

\begin{example}\label{ex:ordered-groups-cmep}
The class of ordered abelian groups $\cls{LA^c}$ has the conservative model extension property. Consider a finite set $\overline{x},y$ and a conjunction of literals $\ensuremath{\psi}(\overline{x},y)$. We first assume that $y$ appears in each literal of $\ensuremath{\psi}$ and then settle the general case. For any two terms $s,t$, write $s<t$ for the formula $(s\leq t)\mathbin{\&} \neg(s\approx t)$, where $\leq$ is the definable lattice order. In view of Remark~\ref{r:satisfiable-and-non-empty}, we can assume that $\overline{x}\neq\emptyset$. Moreover, without loss of generality (because the members of $\cls{LA^c}$ are linearly ordered), we can assume that $\ensuremath{\psi}=\ensuremath{\psi}_1\curlyvee\cdots\curlyvee\ensuremath{\psi}_m$ and that each disjunct is a conjunction of formulas of the form
\[
py\leq  t,\: py\geq  t, \: py< t, \: py> t,
\]
where each $t$ is a group term with variables in $\overline{x}=x_1,\dots,x_n$, and $p$ is a \emph{fixed} non-zero natural number (e.g., the least common multiple of the coefficients of $y$ in the conjuncts). Let $t_{j_1}(\overline{x}),\dots,t_{j_u}(\overline{x})$ be the terms appearing in $\ensuremath{\psi}_j$ and let $\chi(\overline{x})$ be the formula
\begin{align*}
&\bigAND{\{\bigOR_{1\leq j\leq m} t_{j_i}{\vartriangle} t_{j_k}\mid j_i,j_k\in\{j_1,\dots,j_u\}, {\vartriangle}\in\{<,\leq\}, \text{ and } \cls{LA^c}\models\ensuremath{\psi}\to \bigOR_{1\leq j\leq m} t_{j_i}{\vartriangle}t_{j_k}\}} \: \mathbin{\&} \\
&\bigAND{\{\bigOR_{i\in I}\neg(x_i\eq0)\mid I\subseteq \{1,\dots,n\} \text{ and } \: \cls{LA^c}\models\ensuremath{\psi}\to \bigOR_{i\in I}\neg(x_i\approx 0)\}}.
\end{align*}
Clearly, $\cls{LA^c}\models \ensuremath{\psi}\to\chi$, so condition (i) of the conservative model extension property is satisfied. For (ii), consider $\m A\in \cls{LA^c}$ together with a tuple $\overline{a}\in A^{\overline{x}}$ such that $\m A\models \chi(\overline{a})$. If $\m A$ is the one-element group and there is no $\m B\in\cls{LA^c}$ satisfying (ii), then $\cls{LA^c}\models \ensuremath{\psi}\to \bigOR_{i=1}^n{\neg (x_i\approx 0)}$. So $\cls{LA^c}\models \chi\to \bigOR_{i=1}^n{\neg (x_i\approx 0)}$ by the definition of $\chi$, contradicting the fact that $\m A\models \chi(\overline{a})$. If $\m A$ is non-trivial, let $\m B$ be the divisible hull of $\m A$ and note that $\m B$ is an infinite member of $\cls{LA^c}$. We claim that there is a $b\in B$ such that $\m B\models \ensuremath{\psi}(\overline{a},b)$. If no such $b$ exists, then, for each $1\leq j\leq m$, a pair of inequations $t_{j_i}(\overline{a}){\vartriangle} py$ and $py{\vartriangle} t_{j_k}(\overline{a})$ of $\ensuremath{\psi}_j(\overline{a},y)$ is unsatisfiable, for ${\vartriangle}\in\{<,\leq\}$. We settle the case where all these inequations are of the form $t_{j_i}(\overline{a})< py$ and $py< t_{j_k}(\overline{a})$, the other cases being very similar. Since $\m B$ is divisible and every divisible ordered abelian group is densely ordered, we get $t_{j_k}(\overline{a})\leq t_{j_i}(\overline{a})$. Moreover, $t_{j_i}<py$ and $py< t_{j_k}$ entail $t_{j_i}<t_{j_k}$, and hence $\cls{LA^c}\models\chi\to \bigOR_{1\leq j\leq m}t_{j_i}<t_{j_k}$. But then $\m A\models \chi(\overline{a})$ implies $t_{j_i}(\overline{a})<t_{j_k}(\overline{a})$ for some $1\leq j\leq m$, a contradiction.

Finally, if we have a conjunction of literals of the form $\ensuremath{\psi}(\overline{x},y)\mathbin{\&} \ensuremath{\psi}'(\overline{x})$, where $\ensuremath{\psi}'$ is any conjunction of literals, the quantifier-free formula $\chi\mathbin{\&} \ensuremath{\psi}'$ satisfies the conditions for the conservative model extension property.
\end{example}

\begin{example}\label{ex:linear-orders-cmep}
The positive universal class $\cls{DL^c}$ of linear orders with endpoints, in the language of bounded lattices, has the conservative model extension property. Consider a finite set $\overline{x},y$ and a conjunction of literals $\ensuremath{\psi}(\overline{x},y)$ satisfiable in $\cls{DL^c}$.  Suppose that $\overline{x}=\emptyset$. If there is a non-trivial member of $\cls{DL^c}$ satisfying $\ensuremath{\psi}$, then the formula $\chi\coloneqq \neg (0\approx 1)$ satisfies the conditions for the conservative model extension property. On the other hand, if $\ensuremath{\psi}$ is satisfied only by the trivial algebra, we can set $\chi\coloneqq 0\approx 1$.

Hence, let $\overline{x}\neq\emptyset$. We assume that $y$ appears in all literals of $\ensuremath{\psi}$; the general case then follows by reasoning as in Example~\ref{ex:ordered-groups-cmep}. Since the members of $\cls{DL^c}$ are linearly ordered, $\ensuremath{\psi}$ is equivalent to a formula $\ensuremath{\psi}_1\curlyvee\cdots\curlyvee \ensuremath{\psi}_m$, where each $\ensuremath{\psi}_j$ is a conjunction of formulas of the form $y\leq  x$, $y\geq  x$, $ y< x$, or $y> x$ with $x\in\overline{x}=x_1,\dots,x_n$.

Assume first that the trivial algebra satisfies $\ensuremath{\psi}$ and let $\chi(\overline{x})$ be the formula
\begin{align*}
&\bigAND{\{\bigOR_{(i,j)\in J} x_i{\vartriangle}x_j\mid J\subseteq \{1,\dots,n\}^2, {\vartriangle}\in\{<,\leq\}, \text{ and } \cls{DL^c}\models\ensuremath{\psi}\to \bigOR_{(i,j)\in J}x_i{\vartriangle}x_j\}}.
\end{align*}
Reasoning as in Example~\ref{ex:ordered-groups-cmep}, it is not difficult to see that $\chi$ satisfies the conditions for the conservative model extension property. Just replace the divisible hull of an ordered abelian group with any dense linear order with endpoints that extends the given linear order with endpoints $\m A\in \cls{DL^c}$ (e.g., there is an embedding of $\m A$ into the lexicographic product of $\m A$ and $[0,1]$ which preserves the bounds).

In the case where $\ensuremath{\psi}$ is not satisfied in the trivial algebra, we replace $\chi$ by $\chi \mathbin{\&} \neg(0\approx 1)$.
\end{example}

\section{Model completions}\label{s:model-completions}

Let us first recall some relevant model-theoretic notions, referring to~\cite[Section~3.5]{CK90} for further details. By a {\em theory} we will always mean a  first-order theory, i.e., a set of sentences over some first-order language $\mathcal{L}$.  We let $\mathrm{Th}(\cls{K})$ denote the theory of a class $\cls{K}$ of $\mathcal{L}$-structures, i.e., the set of $\mathcal{L}$-sentences that are satisfied by all members of $\cls{K}$. Two theories $T$ and $T'$ are called \emph{co-theories} if they entail the same universal sentences. Semantically, $T'$ is a co-theory of $T$ if, and only if, every model of $T$ embeds into a model of $T'$ and vice versa. A theory $T^*$ is \emph{model complete} if every formula is equivalent over $T^*$ to an existential formula; that is, model complete theories are those in which alternations of quantifiers can be eliminated. Semantically, a theory $T^*$ is model complete if, and only if, every embedding between models of $T^*$ is elementary. A theory $T^*$ is a \emph{model companion} of a theory $T$ if it is a model complete co-theory of $T$. A {\em model completion} of a theory $T$ is a model companion $T^*$ of $T$ such that for any model $M$ of $T$, the theory of $T^*$ together with the diagram of $M$ is complete.

Let us also recall that a class $\cls{K}$ of $\mathcal{L}$-structures has the {\em amalgamation property} if given any $\m{A},\m{B},\m{C}\in\cls{K}$ and embeddings $f\colon\m{A}\to\m{B}$ and $g\colon\m{A}\to\m{C}$, there exist $\m{D}\in\cls{K}$ and embeddings $h\colon\m{B}\to\m{D}$ and $k\colon\m{C}\to\m{D}$ satisfying $hf = kg$.

Below, we collect some useful facts related to model completions.

\begin{proposition}[{cf.~\cite[Propositions~3.5.13,~3.5.15,~3.5.18, and~3.5.19]{CK90}}]\label{p:modcomp}\
\begin{enumerate}
\item[\rm (a)] A theory has at most one model companion up to logical equivalence.
\item[\rm (b)] If a $\forall\exists$-theory $T$ has a model companion $T^*$, then $T^*$ is logically equivalent to the theory of the existentially closed models of $T$.
\item[\rm (c)] If $T^*$ is a model companion of a theory $T$, then $T^*$ is a model completion of $T$ if, and only if, the class of models of $T$ has the amalgamation property.
\item[\rm (d)] A theory $T^*$ is a model completion of a universal theory $T$ if, and only if, $T^*$ is a co-theory of $T$ that admits quantifier elimination.
\end{enumerate}
\end{proposition}

Our aim in this section is to prove the following characterization of universal classes of algebras whose theories have a model completion.

\begin{theorem}\label{t:charact-model-completion}
Let $\cls{K}$ be a universal class of algebras. The theory of $\cls{K}$ has a model completion if, and only if, $\cls{K}$ has the amalgamation property, variable projection property, and conservative model extension property.
\end{theorem}

For universal classes of algebras with finite presentations, Theorem~\ref{t:charact-model-completion}  specializes to~\cite[Theorem~5]{Whe76} (see Appendix~\ref{app:wheeler}). Observe also that for  locally finite varieties, Remark~\ref{r:locally-finite-coherent} and Proposition~\ref{p:locally-finite} yield the following simpler characterization.

\begin{corollary}[{\cite[Corollary~1 p.~319]{Whe76}}]\label{c:varieties-charact-mc}
Let $\cls{V}$ be a locally finite variety. Then the theory of $\cls{V}$ has a model completion if, and only if, $\cls{V}$ has the amalgamation property.
\end{corollary}

We first settle the `if' part of Theorem~\ref{t:charact-model-completion}.

\begin{proposition}\label{p:model-completion-univ}
Let $\cls{K}$ be a universal class of algebras. If $\cls{K}$ has the amalgamation property, variable projection property, and conservative model extension property, then the theory of $\cls{K}$ has a model completion.
\end{proposition}
\begin{proof}
Fix a countably infinite set of variables $\overline{z}$ and let
\[
J \coloneqq \{(\ensuremath{\psi},y) \mid  \ensuremath{\psi} \text{ is a conjunction of literals with variables in $\overline{z}$, and } y \in \overline{z}\}.
\]
Consider $j = (\ensuremath{\psi},y) \in J$. Let $\overline{x}$ be the set of variables occurring in $\ensuremath{\psi}$ different from $y$. Since $\cls{K}$ has the variable projection property, there exists a quantifier-free formula $\xi_j(\overline{x})$ such that $\cls{K}\models \ensuremath{\psi}^+\to \xi_j$ and for every equation $\varepsilon(\overline{x})$,
\begin{equation}\label{eq:restriction-of-cg-BC}
\cls{K}\models \ensuremath{\psi}^+\to \varepsilon \:\Longrightarrow\: \cls{K}\models \xi_j\to \varepsilon.
\end{equation}
Since $\cls{K}$ has the conservative model extension property, there also exists a quantifier-free formula $\chi_j(\overline{x})$ satisfying the following conditions:
 \begin{enumerate}
 \item[\rm (i)] $\cls{K}\models\ensuremath{\psi}\to\chi_j$
 \item [(ii)] for any  $\m A \in \cls{K}$ generated by $\overline{a}\in A^{\overline{x}}$ such that $\m A\models\chi_j(\overline{a})$ and for any equation $\varepsilon(\overline{x})$,
 \[
 \cls{K}\models\ensuremath{\psi}^+\to\varepsilon \:\Longrightarrow\: \m A\models\varepsilon(\overline{a}),
 \]
 there exist an algebra $\m B\in\cls{K}$ extending $\m A$ and $b \in B$ such that $\m B\models \ensuremath{\psi}(\overline{a},b)$.
\end{enumerate}
We define the first-order sentence
\[
\tau_j\coloneqq\forall\overline{x} \, [(\xi_j\mathbin{\&} \chi_j) \to \exists y.\ensuremath{\psi}].
\]
Let $T\coloneqq \mathrm{Th}(\cls{K})$ be the theory of $\cls{K}$ and set $T^* \coloneqq T \cup \{\tau_j \mid j \in J\}$. We claim that $T^*$ is a model completion of $T$. In view of Proposition~\ref{p:modcomp}.(d), it suffices to show that $T^*$ has quantifier elimination and is a co-theory of $T$.

\medskip
\noindent{\em $T^*$ has quantifier elimination.}
We prove that for any $ (\ensuremath{\psi},y) \in J$,
\begin{equation}\label{eq:quantelim-positive-univ}
T \vdash \forall \overline{x} \, [(\exists y.\ensuremath{\psi} )\to (\xi_j\mathbin{\&} \chi_j)].
\end{equation}
It  follows then from the definition of $T^*$ and~\eqref{eq:quantelim-positive-univ} that $T^*$ entails that any formula $\exists y.\ensuremath{\psi}$, where $\ensuremath{\psi}$ is a conjunction of literals with variables in $\overline{z}$ and $y\in\overline{z}$, is equivalent to a quantifier-free formula. So $T^*$ has quantifier elimination (see, e.g.,~\cite[Lemma 3.2.4]{TZ2012}).

For the proof of~\eqref{eq:quantelim-positive-univ}, fix an arbitrary $j = (\ensuremath{\psi},y) \in J$. It suffices to show that for any algebra $\m A\in\cls{K}$ and map $g \colon \overline{x} \to A$,
\[
\m A, g \models \exists y. \ensuremath{\psi} \:\Longrightarrow\: \m A, g \models \xi_j\mathbin{\&} \chi_j.
\]
Suppose that $\m A, g \models \exists y. \ensuremath{\psi}$. Then $\m{A}, f \models \ensuremath{\psi}$ for some map $f \colon \overline{x},y \to A$ extending $g$. Moreover, since $\cls{K}\models\ensuremath{\psi}^+\to \xi_j$ and $\cls{K}\models\ensuremath{\psi}\to\chi_j$, it follows that $\m A, f \models \xi_j$ and $\m A, f\models \chi_j$. But $\xi_j$ and $\chi_j$ have variables in $\overline{x}$, so $\m A, g\models \xi_j$ and  $\m A, g\models \chi_j$, yielding $\m A, g \models \xi_j\mathbin{\&} \chi_j$.

\medskip
\noindent{\em $T^*$ is a co-theory of $T$.}
Since $T \subseteq T^*$, it suffices to show that any universal sentence entailed by $T^*$ is entailed by $T$. First we show that for any $j = (\ensuremath{\psi},y) \in J$, algebra $\m A\in\cls{K}$, and map $g \colon \overline{x} \to A$,
\begin{multline}\label{eq:cotheory-univ}
\m A, g \models \xi_j\mathbin{\&} \chi_j \:\Longrightarrow\: \text{there exist }  \m B\in \cls{K} \text{ and }\iota \colon \m A \hookrightarrow \m B \text{ such that } \m B, \iota g \models \exists y. \ensuremath{\psi}.
\end{multline}
Suppose that $\m A, g \models \xi_j\mathbin{\&} \chi_j$. We will assume first that the unique homomorphism $\tilde{g} \colon \m{Tm}(\overline{x}) \to \m A$ extending $g$ is surjective, and hence that $\m A$ is generated by the image $\overline{a}$ of $\overline{x}$ under $g$. Note that $\m A \models \chi_j(\overline{a})$.  Moreover, if $\varepsilon(\overline{x})$ is any equation such that $\cls{K}\models\ensuremath{\psi}^+\to\varepsilon$, then \eqref{eq:restriction-of-cg-BC} yields $\cls{K}\models\xi_j\to\varepsilon$ and, since $\m A \models \xi_j(\overline{a})$, also $\m A\models \varepsilon(\overline{a})$. Hence, by (ii), there exist an algebra $\m B$ in $\cls{K}$ extending $\m A$ and $b\in B$ such that $\m B \models \ensuremath{\psi}(\overline{a},b)$. So $\m B, \iota g \models \exists y. \ensuremath{\psi}$, where $\iota \colon \m A\hookrightarrow \m B$ is the inclusion map.

For the general case of~\eqref{eq:cotheory-univ}, let $\m A'$ be the image of $\m{Tm}(\overline{x})$ under $\tilde{g}$ in $\m A$. Since $\cls{K}$ is a universal class and $\m A'$ embeds into $\m A$, also $\m A'\in \cls{K}$. By the previous argument, there exist $\m B'\in \cls{K}$ and  $\iota' \colon \m A' \hookrightarrow \m B'$ such that $\m B', \iota'g \models \exists y. \ensuremath{\psi}$, witnessed by $b \in B'$, say. Since $\cls{K}$ has the amalgamation property, we obtain for the injection $\iota'$ and the inclusion $\m A' \hookrightarrow \m A$, an extension $\iota \colon \m A \hookrightarrow \m B$ with $\m B\in \cls{K}$ and an embedding $\lambda \colon \m B' \hookrightarrow \m B$ such that the following diagram commutes:
\[\begin{tikzcd}
{\m A'} \arrow[hookrightarrow,xshift=-1pt]{d} \arrow[hookrightarrow]{r}{\iota'} & {\m B'} \arrow[hookrightarrow,xshift=-1pt]{d}{\lambda} \\
{\m A} \arrow[hookrightarrow]{r}{\iota} & {\m B}
\end{tikzcd}\]
Since $\ensuremath{\psi}$ is quantifier-free, we have $\m B, \iota g \models \exists y. \ensuremath{\psi}$ witnessed by $\lambda(b)$.

To conclude the proof, let $\alpha$ be a universal sentence such that $T^* \vdash \alpha$. By the compactness theorem of first-order logic, there exists a finite subset $F \subseteq J$ such that $T \cup \{\tau_j \mid j \in F\} \vdash \alpha$. We prove that, in fact, $T \vdash \alpha$. Consider any $\m A\in\cls{K}$. Let $\overline{w}$ be the set of variables appearing in the scope of the universal quantifier in one of the sentences $\{\tau_j \mid j \in F\}$ and let $g \colon \overline{w} \to A$ be any map. By repeatedly applying~\eqref{eq:cotheory-univ}, we obtain $\m B\in\cls{K}$ and $\iota \colon \m A \hookrightarrow \m B$ such that $\m B, \iota g \models \tau_j$ for each $j \in F$. Now, since $T \cup \{\tau_j \mid j \in F\} \vdash \alpha$, we have $\m B, \iota g \models \alpha$. But $\m A$ is a subalgebra of $\m B$ and $\alpha$ is universal, so $\m A, g\models \alpha$. Hence $T \vdash \alpha$ as required.
\end{proof}

\begin{example}\label{ex:ordered-groups-mc}
The positive universal class $\cls{LA^c}$ of ordered abelian groups, defined over the algebraic language with operation symbols $\wedge,\vee,+,-,0$, has the amalgamation property~\cite{Pie72}, variable projection property (see Example~\ref{ex:ordered-groups-alm-coh}), and conservative model extension property (see Example~\ref{ex:ordered-groups-cmep}). Hence Proposition~\ref{p:model-completion-univ} yields the well-known fact that the theory of $\cls{LA^c}$ has a model completion~\cite{Rob77}.\footnote{Note that although the class of ordered abelian groups is often defined using other first-order languages (e.g., with $+$ and the relation $\le$), this difference is immaterial for the existence of a model completion.} Similarly, the class $\cls{MV^c}$ of linearly ordered MV-algebras satisfies the conditions of  Proposition~\ref{p:model-completion-univ} and its theory therefore has a model completion~\cite{LS77}.
\end{example}

\begin{example}
The positive universal class $\cls{DL^c}$ of linear orders with endpoints, defined over the algebraic language of bounded lattices, has the amalgamation property, variable projection property (see Example~\ref{ex:linear-orders-evrp}), and conservative model extension property (see Example~\ref{ex:linear-orders-cmep}). Hence Proposition~\ref{p:model-completion-univ} yields the well-known fact that the theory of $\cls{DL^c}$ has a model completion (see,~e.g.,~\cite{CK90}). It also follows easily that the theory of the positive universal class $\cls{HA^c}$ of linearly ordered Heyting algebras has a model completion. Note that any linear order with endpoints $\m A\in \cls{DL^c}$ can be expanded to a linearly ordered Heyting algebra by defining $a \himp b \coloneqq 1$ if $a \le b$ and  $a \himp b \coloneqq b$ otherwise. Indeed, the theory of $\cls{HA^c}$ is a definitional extension of the theory of $\cls{DL^c}$ (in the sense of, e.g.,~\cite{Hod97}), where the binary function symbol $\himp$ is defined by the formula
\[
\xi(x,y,z)\coloneqq (x\leq y \mathbin{\&} z\approx 1) \, \curlyvee \, (y<x \mathbin{\&} z\approx y).
\]
Using the fact that $\xi$ is quantifier-free, the existence of a model completion for the theory of $\cls{HA^c}$ follows directly from the existence of a model completion for the theory of $\cls{DL^c}$.
\end{example}

We now prove the `only if' part of Theorem~\ref{t:charact-model-completion}. Note first that if $\cls{K}$ is a universal class of algebras whose theory has a model completion, then $\cls{K}$ has the amalgamation property by Proposition~\ref{p:modcomp}.(c). Next, we consider the variable projection property.

\begin{proposition}\label{p:almost-coh-nec}
Let $\cls{K}$ be a universal class of algebras. If the theory of $\cls{K}$ has a model completion, then $\cls{K}$ has the variable projection property.
\end{proposition}
\begin{proof}
Let $T\coloneqq \mathrm{Th}(\cls{K})$ be the theory of $\cls{K}$, and let $T^*$ be a model completion of $T$. Fix a finite set $\overline{x},y$ and conjunction of equations $\ensuremath{\varphi}(\overline{x},y)$. Since $T^*$ has quantifier elimination, there exists a quantifier-free formula $\xi(\overline{x})$ such that
\begin{equation}\label{eq:quant-free-xi-y}
T^*\vdash \forall \overline{x} \, [(\exists y.\ensuremath{\varphi})\leftrightarrow \xi].
\end{equation}
It follows from~\eqref{eq:quant-free-xi-y} that $T^*\vdash \forall \overline{x},y \, (\ensuremath{\varphi}\to\xi)$ and, since $T$ and $T^*$ have the same universal consequences, $T\vdash \forall \overline{x},y \, (\ensuremath{\varphi}\to\xi)$. That is, $\cls{K}\models\ensuremath{\varphi}\to\xi$. It remains to show that for any equation $\varepsilon(\overline{x})$ satisfying $\cls{K}\models\ensuremath{\varphi}\to\varepsilon$, also $\cls{K}\models\xi\to\varepsilon$.\footnote{As pointed out by the referee, this implication is satisfied in fact for any quantifier-free formula $\varepsilon(\overline{x})$.}

Suppose that $\cls{K}\not\models\xi\to\varepsilon$. Then there is an algebra $\m A$ in $\cls{K}$ and a tuple $\overline{a}\in A^{\overline{x}}$ such that $\m A\models \xi(\overline{a})$ and $\m A\not\models \varepsilon(\overline{a})$. Since $T$ and $T^*$ are co-theories and $T$ is universal, there exists a model $\m B$ of $T^*$ extending $\m A$ such that $\m B\in\cls{K}$. Moreover,  $\m A\models \xi(\overline{a})$ implies $\m B\models \xi(\overline{a})$, and hence $\m B\models \exists y. \ensuremath{\varphi}(\overline{a},y)$ by~\eqref{eq:quant-free-xi-y}. Pick $b\in B$ such that $\m B\models \ensuremath{\varphi}(\overline{a},b)$. Since $\m A\not\models \varepsilon(\overline{a})$, we get $\m B\not\models \varepsilon(\overline{a})$. Hence $\cls{K}\not\models\ensuremath{\varphi}\to\varepsilon$ as required.
\end{proof}

To complete the proof of Theorem~\ref{t:charact-model-completion}, it remains to prove that whenever the theory of a universal class of algebras has a model completion, this class has the conservative model extension property. In fact, we will show below that the existence of a model completion is equivalent to a stronger property that directly implies the conservative model extension property. This stronger property is difficult to check in concrete cases, but will be useful in Section~\ref{s:pdpc} for establishing consequences of the existence of a model completion for the definability of principal congruences.

\begin{proposition}\label{p:strong-CMEP-iff}
Let $\cls{K}$ be a universal class of algebras. The theory of $\cls{K}$ has a model completion if, and only if, for any finite sets $\overline{x},\overline{y}$ and conjunction of literals $\ensuremath{\psi}(\overline{x},\overline{y})$, there is a quantifier-free formula $\chi(\overline{x})$ satisfying the following conditions:
 \begin{enumerate}
 \item [(i)] $\cls{K}\models \ensuremath{\psi}\to\chi$
  \item [(ii)] for any $\m A\in\cls{K}$ and tuple $\overline{a}\in A^{\overline{x}}$ satisfying $\m A\models\chi(\overline{a})$, there exist $\m B\in\cls{K}$ extending $\m A$ and $\overline{b} \in B^{\overline{y}}$ such that $\m B\models \ensuremath{\psi}(\overline{a},\overline{b})$.
 \end{enumerate}
In particular, if the theory of $\cls{K}$ has a model completion, then $\cls{K}$ has the conservative model extension property.
\end{proposition}

\begin{proof}
Let $T\coloneqq \mathrm{Th}(\cls{K})$ be the theory of $\cls{K}$, and suppose that $T^*$ is a model completion of~$T$. Fix finite sets $\overline{x},\overline{y}$ and a conjunction of literals $\ensuremath{\psi}(\overline{x},\overline{y})$. Since $T^*$ admits quantifier elimination, there exists a quantifier-free formula $\chi(\overline{x})$ such that
\begin{equation}\label{eq:quant-free-chi-y}
T^*\vdash \forall \overline{x} \, [(\exists \overline{y}.\ensuremath{\psi})\leftrightarrow \chi].
\end{equation}
It follows that $T^*\vdash \forall \overline{x},\overline{y} \, (\ensuremath{\psi}\to \chi)$, and since $T$ and $T^*$ are co-theories,
\begin{equation}\label{eq:univ-consequence}
T\vdash \forall \overline{x},\overline{y} \, (\ensuremath{\psi}\to \chi).
\end{equation}
We show now that $\chi$ satisfies (i) and (ii).

Condition (i) is an immediate consequence of~\eqref{eq:univ-consequence}. For (ii), fix an algebra $\m A\in\cls{K}$ and a tuple $\overline{a}\in A^{\overline{x}}$ such that $\m A\models\chi(\overline{a})$. Since $T$ and $T^*$ are co-theories and $T$ is universal, there exists a model $\m B \in\cls{K}$ of $T^*$ that extends $\m A$. Since $\m B\models \chi(\overline{a})$, it follows by~\eqref{eq:quant-free-chi-y} that there is a tuple $\overline{b}\in B^{\overline{y}}$ such that $\m B\models \ensuremath{\psi}(\overline{a},\overline{b})$. This settles (ii).

For the converse direction, we only sketch the proof, as it is an easy modification of the proof of Proposition~\ref{p:model-completion-univ}. As before, we consider the theory $T^* \coloneqq T \cup \{\tau_j \mid j \in J\}$, but in this case $\tau_j$ is defined as $\forall\overline{x} \, (\chi_j \to \exists y.\ensuremath{\psi})$, where the quantifier-free formula $\chi_j$ satisfies (i) and (ii). To show that $T^*$ has quantifier elimination, it suffices to show that  $T \vdash \forall \overline{x} \, (\exists y.\ensuremath{\psi} \to \chi_j)$ for all $j=(\ensuremath{\psi},y) \in J$, which follows by (i) (cf.~the proof of Proposition~\ref{p:model-completion-univ}). On the other hand, (ii) yields the following property similar to~\eqref{eq:cotheory-univ}: if $\m A, g \models \chi_j$, then there exist $\m B\in \cls{K}$ and $\iota \colon \m A \hookrightarrow \m B$ such that $\m B, \iota g \models \exists y. \ensuremath{\psi}$. Reasoning as in the last part of the proof of Proposition~\ref{p:model-completion-univ}, we conclude that $T$ and $T^*$ are co-theories. It follows then by Proposition~\ref{p:modcomp}.(d) that $T^*$ is a model completion of $T$.
\end{proof}

\begin{remark}
The first part of Proposition~\ref{p:strong-CMEP-iff} admits the following reformulation. Let $\cls{K}$ be a universal class of algebras and let $T\coloneqq \mathrm{Th}(\cls{K})$ be its first-order theory. Then the following statements are equivalent:
\begin{enumerate}
\item[(1)] $T$ has a model completion.
\item[(2)] For any finite sets $\overline{x},\overline{y}$ and conjunction of literals $\ensuremath{\psi}(\overline{x},\overline{y})$, there is a quantifier-free formula $\chi(\overline{x})$ with the same universal consequences, with respect to $T$, as $\exists\overline{y}.\psi$.
\end{enumerate}
This equivalence was established (for arbitrary first-order languages) by Millar in~\cite[Theorem~3.1]{Millar1995} (see also~\cite[Theorem~3.5.20]{CK90} for a related result) and has recently been considered in the context of the verification of data-aware processes~\cite[Theorem~3.2]{GhilardiEtAl2021}.
\end{remark}

\section{Compact congruences}\label{s:model-completion-edpc}

In this section, we show that for varieties of algebras satisfying certain congruence lattice conditions, the rather complicated conservative model extension property appearing in Theorem~\ref{t:charact-model-completion} can be replaced by a more amenable equational variable restriction property. The resulting characterization is a slightly more general version of a theorem proved by Ghilardi and Zawadowski in~\cite[Theorem~4]{GZ97}.

Recall that the compact (equivalently, finitely generated) congruences of an algebra $\m{A}$ ordered by set-theoretic inclusion always form a join-semilattice. A class of algebras $\cls{K}$ is said to have the \emph{compact intersection property} if the join-semilattice of compact congruences of each $\m{A}\in\cls{K}$ forms a lattice, i.e., the intersection of any two compact congruences of $\m{A}$ is compact. Recall also that $\cls{K}$ is said to be \emph{congruence distributive} if the congruence lattice of each $\m A\in\cls{K}$ is distributive. The following lemma describes a useful syntactic consequence of these two properties.

\begin{lemma}\label{l:consequence-of-CIP}
Let $\cls{V}$ be a congruence distributive variety that has the compact intersection property. For any finite set $\overline{x}$ and conjunctions of equations $\ensuremath{\varphi}_1(\overline{x}),\ensuremath{\varphi}_2(\overline{x})$, there exists a conjunction of equations $\pi(\overline{x})$ such that for any equation $\varepsilon(\overline{x},\overline{y})$,
\[
\cls{V}\models (\ensuremath{\varphi}_1\curlyvee \ensuremath{\varphi}_2)\to\varepsilon\iff\cls{V}\models \pi\to \varepsilon.
\]
\end{lemma}
\begin{proof}
Let $\overline{x}$ be any finite set and let $\ensuremath{\varphi}_1(\overline{x}),\ensuremath{\varphi}_2(\overline{x})$ be conjunctions of equations. We fix $\overline{z}$ to be any countably infinite set with $\overline{x}\cap\overline{z}=\emptyset$ and define $\theta_i\coloneqq \cg{\m{F}_\cls{V}(\overline{x},\overline{z})}(\{\hat{\ensuremath{\sigma}}\mid \ensuremath{\sigma} \text{ is an equation of } \ensuremath{\varphi}_i\})$ for $i\in\{1,2\}$. Since $\theta_1$ and $\theta_2$ are compact, so, by assumption, is their intersection; that is, there exist a finite set $\overline{w}\subseteq\overline{z}$ and equations $\ensuremath{\sigma}_1(\overline{x},\overline{w}),\dots,\ensuremath{\sigma}_n(\overline{x},\overline{w})$ such that $\{\hat{\ensuremath{\sigma}}_1,\dots,\hat{\ensuremath{\sigma}}_n\}$ generates $\theta_1\cap \theta_2$. Let $f\colon\overline{x},\overline{z}\to\mathrm{F}_\cls{V}(\overline{x},\overline{z})$ be a map sending each $x\in\overline{x}$ to $x$ and each $w\in\overline{w}$ to some $u\in\mathrm{F}_\cls{V}(\overline{x})$, such that the image of $f$ contains $\overline{x},\overline{z}$. Clearly, the unique homomorphism $g\colon\m{F}_\cls{V}(\overline{x},\overline{z})\to\m{F}_\cls{V}(\overline{x},\overline{z})$ extending $f$ is surjective. Define $g^*\colon\Con{\m{F}_\cls{V}(\overline{x},\overline{z})}\to\Con{\m{F}_\cls{V}(\overline{x},\overline{z})}$ by $g^*(\theta)\coloneqq\cg{\m{F}_\cls{V}(\overline{x},\overline{z})}(\{(g(a),g(b)) \mid (a,b)\in\theta\})$. Since $\cls{V}$ is congruence distributive and $g$ is surjective, $g^*$ is a lattice homomorphism (cf.~\cite[Lemma~1.11]{Bak74}) and, in particular, $g^*(\theta_1\cap\theta_2)=g^*(\theta_1)\cap g^*(\theta_2)=\theta_1\cap\theta_2$. Hence also $\{g(\hat{\ensuremath{\sigma}}_1),\dots,g(\hat{\ensuremath{\sigma}}_n)\}$ generates $\theta_1\cap \theta_2$, where $g(\hat{\ensuremath{\sigma}}_j)\coloneqq (g(s),g(t))$ for each $\hat{\ensuremath{\sigma}}_j=(s,t)$, and we let $\pi(\overline{x})$ be the conjunction of the equations $\ensuremath{\sigma}_1(\overline{x},u,\dots,u),\dots,\ensuremath{\sigma}_n(\overline{x},u,\dots,u)$.

For any equation $\varepsilon(\overline{x},\overline{y})$, we may assume without loss of generality that $\overline{y}\subseteq\overline{z}$ and use  Lemma~\ref{l:compact-congr-and-consequence-rel} to obtain
\begin{align*}
\cls{V}\models (\ensuremath{\varphi}_1\curlyvee \ensuremath{\varphi}_2)\to \varepsilon
&\iff\cls{V}\models \ensuremath{\varphi}_1\to\varepsilon\:\text{ and }\:\cls{V}\models \ensuremath{\varphi}_2\to \varepsilon\\
&\iff\hat{\varepsilon}\in\theta_1\:\text{ and }\:\hat{\varepsilon}\in\theta_2\\
&\iff\hat{\varepsilon}\in\theta_1\cap \theta_2\\
&\iff\cls{V}\models\pi\to\varepsilon. & \qed\proofend
\end{align*}
\end{proof}

\begin{remark}
The previous lemma can also be deduced from the fact that a variety is congruence distributive and has the compact intersection property if, and only if, it has equationally definable principal meets (cf.~\cite[Theorem~1.5]{BP86}).
\end{remark}

Recall next that a class of algebras $\cls{K}$ has \emph{first-order definable principal congruences} if there exists a formula $\alpha(x_1,x_2,y_1,y_2)$ satisfying for all  $\m A\in\cls{K}$ and $a_1,a_2,b_1,b_2\in A$,
\[
(a_1,a_2)\in\cg{\m{A}}(b_1,b_2) \iff \m A\models \alpha(a_1,a_2,b_1,b_2),
\]
where $\cg{\m{A}}(b_1,b_2)\coloneqq\cg{\m{A}}(\{(b_1,b_2)\})$ is the smallest congruence of $\m A$ containing the pair $(b_1,b_2)$. If $\alpha$ can be chosen to be a quantifier-free formula or conjunction of equations, then $\cls{K}$ is said to have, respectively, \emph{quantifier-free definable principal congruences} or \emph{equationally definable principal congruences}. For a variety $\cls{V}$, it is known that having equationally definable principal congruences corresponds to a property of the associated consequence relation of $\cls{V}$ (often referred to as a deduction theorem) and a property of the join-semilattices of compact congruences of members of $\cls{V}$.

\begin{proposition}[{\cite[Theorems~5,~8]{KP1980} and~\cite[Theorem~1.7]{BKP84}}]\label{p:EDPC-reform}
The following statements are equivalent for any variety $\cls{V}$:
\begin{enumerate}
\item [(1)] $\cls{V}$ has equationally definable principal congruences.
\item [(2)] There exists a conjunction of equations $\ensuremath{\varphi}(x_1,x_2,y_1,y_2)$ such that for any terms $s_1,s_2,t_1,t_2$ and conjunction of equations $\pi$,
\[
\cls{V} \models (\pi \mathbin{\&} (s_1\approx s_2)) \to (t_1 \approx t_2) \iff
\cls{V} \models \pi \to \ensuremath{\varphi}(s_1,s_2,t_1,t_2).
\]
\item [(3)] The join-semilattice of compact congruences of each $\m{A}\in\cls{V}$ is dually Brouwerian, i.e., for any compact congruences $\theta_1,\theta_2$ of $\m{A}$, there exists a compact congruence $\theta_1-\theta_2$ of $\m{A}$ such that for every compact congruence $\theta_3$ of $\m{A}$,
\[
\theta_1-\theta_2 \subseteq \theta_3\iff\theta_1 \subseteq \theta_1\vee\theta_2.
\]
\end{enumerate}
\end{proposition}

Equationally definable principal congruences imply two further useful properties.

\begin{proposition}[{\cite[Corollary~2]{Day1971} and~\cite[Corollary~6]{KP1980}}]\label{p:EDPC-implies}
If a variety has equationally definable principal congruences, then it has the congruence extension property and is congruence distributive.
\end{proposition}

We say next that a class of algebras $\cls{K}$ has the {\em equational variable restriction property} if for any finite set $\overline{x},y$ and conjunction of equations $\ensuremath{\gamma}(\overline{x},y)$, there exists a formula $\pi(\overline{x})$ that is either $\bot$ or a conjunction of equations such that $\cls{K}\models \pi\to \ensuremath{\gamma}$ and for any conjunction of equations $\ensuremath{\varphi}(\overline{x})$,
\[
\cls{K}\models\ensuremath{\varphi}\to\ensuremath{\gamma} \:\Longrightarrow\: \cls{K}\models \ensuremath{\varphi}\to \pi.
\]
The main result of this section is the following characterization theorem.

\begin{theorem}\label{t:GZ-charact}
Let $\cls{V}$ be a variety that has the compact intersection property and equationally definable principal congruences. The theory of $\cls{V}$ has a model completion if, and only if, $\cls{V}$ is coherent and has the amalgamation property and equational variable restriction property.
\end{theorem}

\begin{remark}
Theorem~\ref{t:GZ-charact} provides a slightly more general algebraic reformulation of~\cite[Theorem~4]{GZ97}, which requires that the join-semilattice of compact congruences of each algebra $\m{A}\in\cls{V}$ has a bottom element, or, equivalently, that there is a variable-free conjunction of equations $\pi$ such that $\cls{V}\models\pi\to\varepsilon$ for every equation $\varepsilon$. This condition is not satisfied by all the varieties of interest in this paper, in particular, the variety of lattice-ordered abelian groups.
\end{remark}

We show first that the right-to-left direction of Theorem~\ref{t:GZ-charact} holds even in the absence of the  compact intersection property.

\begin{proposition}\label{p:suffconditionsedpc}
Let $\cls{V}$ be a variety that has equationally definable principal congruences. If $\cls{V}$ is coherent and has the amalgamation property and the equational variable restriction property, then the theory of $\cls{V}$ has a model completion.
\end{proposition}
\begin{proof}
Using Theorem~\ref{t:charact-model-completion}, it suffices to prove that $\cls{V}$ has the conservative model extension property. Consider a finite set $\overline{x},y$ and conjunction of literals $\ensuremath{\psi}(\overline{x},y)$, assuming without loss of generality that $\ensuremath{\psi}$ is satisfiable in $\cls{V}$ (cf.~Remark~\ref{r:satisfiable-and-non-empty}). By coherence, there exists a conjunction of equations $\ensuremath{\varphi}(\overline{x})$ such that $\cls{V}\models \ensuremath{\psi}^+ \to \ensuremath{\varphi}$ and for any equation $\varepsilon(\overline{x})$,
\[
\cls{V}\models \ensuremath{\psi}^+\to \varepsilon \:\Longrightarrow\: \cls{V}\models \ensuremath{\varphi}\to \varepsilon.
\]
Let $\ensuremath{\sigma}_1,\dots,\ensuremath{\sigma}_m$ be the equations of $\ensuremath{\psi}^-$. Since $\cls{V}$ has equationally definable principal congruences, it follows by Proposition~\ref{p:EDPC-reform} that for each $i\in\{1,\dots,m\}$, there exists a conjunction of equations $\pi_i(\overline{x},y)$ such that for any conjunction of equations $\ensuremath{\gamma}(\overline{x},y)$,
\begin{equation}\label{eq:pi-i}
\cls{V}\models (\ensuremath{\gamma} \mathbin{\&} \ensuremath{\psi}^+)\to \ensuremath{\sigma}_i \iff \cls{V}\models \ensuremath{\gamma}\to \pi_i.
\end{equation}
The equational variable restriction property yields a formula $\pi'_i(\overline{x})$ for each $i\in\{1,\dots,m\}$ that is either $\bot$ or a conjunction of equations such that $\cls{V}\models \pi'_i\to \pi_i$ and for any conjunction of equations $\ensuremath{\varphi}'(\overline{x})$,
\begin{equation}\label{eq:pi-i-primes}
\cls{V}\models \ensuremath{\varphi}'\to \pi_i  \:\Longrightarrow\: \cls{V}\models \ensuremath{\varphi}'\to \pi'_i.
\end{equation}
We claim that the quantifier-free formula $\chi\coloneqq \ensuremath{\varphi} \mathbin{\&}\neg \pi'_1\mathbin{\&}\cdots\mathbin{\&}\neg \pi'_m$ satisfies the conditions in the definition of conservative model extension property.

Note first that, since $\cls{V}\models \ensuremath{\psi}\to\ensuremath{\psi}^+$ and $\cls{V}\models \ensuremath{\psi}^+\to \ensuremath{\varphi}$,  also $\cls{V}\models \ensuremath{\psi}\to \ensuremath{\varphi}$. To conclude that $\cls{V}\models \ensuremath{\psi}\to \chi$, it remains to show that $\cls{V}\models \ensuremath{\psi}\to \neg \pi'_i$ for each $i\in\{1,\dots,m\}$. Let $i\in\{1,\dots,m\}$. Since $\cls{V}\models \pi'_i\to \pi_i $ and $\cls{V}\models (\pi_i \mathbin{\&} \ensuremath{\psi}^+)\to \ensuremath{\sigma}_i$, also $\cls{V}\models (\pi'_i \mathbin{\&} \ensuremath{\psi}^+)\to \ensuremath{\sigma}_i$. But then $\cls{V}\models (\neg\ensuremath{\sigma}_i\mathbin{\&} \ensuremath{\psi}^+)\to\neg\pi'_i$ and hence $\cls{V}\models \ensuremath{\psi}\to \neg \pi'_i$ as required.

Now, consider an algebra $\m A\in\cls{V}$ generated by $\overline{a}\in A^{\overline{x}}$ such that $\m A\models \chi(\overline{a})$ and for any equation $\varepsilon(\overline{x})$,
\begin{equation}\label{eq:cmep-assumption}
\cls{V}\models \ensuremath{\psi}^+ \to \varepsilon \:\Longrightarrow\: \m A\models \varepsilon(\overline{a}).
\end{equation}
Let $f\colon \m{F}_{\cls{V}}(\overline{x})\twoheadrightarrow \m A$ be the surjective homomorphism mapping the generators of $\m{F}_{\cls{V}}(\overline{x})$ to the elements of $\overline{a}$. Considering $\m{F}_{\cls{V}}(\overline{x})$ as a subalgebra of $\m{F}_{\cls{V}}(\overline{x},y)$, we define
\[
\theta'\coloneqq\cg{\m{F}_{\cls{V}}(\overline{x},y)}(\{\hat{\ensuremath{\sigma}}\mid \ensuremath{\sigma} \text{ is an equation of } \ensuremath{\psi}^+\})
\enspace\text{and}\enspace
\theta\coloneqq\theta'\vee\cg{\m{F}_{\cls{V}}(\overline{x},y)}(\ker{f}).
\]
Let $\m B\coloneqq \m{F}_{\cls{V}}(\overline{x},y)/\theta$ and let $g$ be the natural homomorphism from $\m{F}_{\cls{V}}(\overline{x},y)$ onto $\m B$. Since $\ker{f}\subseteq \theta \cap\mathrm{F}_{\cls{V}}(\overline{x})^2$, the inclusion $\m{F}_{\cls{V}}(\overline{x})\hookrightarrow\m{F}_{\cls{V}}(\overline{x},y)$ yields a homomorphism $\m A\to \m B$ mapping $f(x)$ to $g(x)$ for each $x\in\overline{x}$, as illustrated by the following diagram:
\[\begin{tikzcd}
\m{F}_{\cls{V}}(\overline{x}) \arrow[hookrightarrow]{r} \arrow[twoheadrightarrow]{d}[swap]{f} & \m{F}_{\cls{V}}(\overline{x},y) \arrow[twoheadrightarrow]{d}{g} \\
{\m A} \arrow[dashed]{r} & {\m B}
\end{tikzcd}\]
To prove that this homomorphism is an embedding, it suffices to show that $\theta \cap \mathrm{F}_\cls{V}(\overline{x})^2\subseteq \ker{f}$. Since $\cls{V}$ has equationally definable principal congruences, by Proposition~\ref{p:EDPC-implies}, it has the congruence extension property. Hence, by Lemma~\ref{l:cepequiv},
\[
\theta \cap \mathrm{F}_\cls{V}(\overline{x})^2
=(\theta'\vee\cg{\m{F}_{\cls{V}}(\overline{x},y)}(\ker{f}))\cap \mathrm{F}_\cls{V}(\overline{x})^2
=(\theta' \cap \mathrm{F}_\cls{V}(\overline{x})^2)\vee\ker{f}.
\]
It therefore suffices to prove that $\theta' \cap \mathrm{F}_\cls{V}(\overline{x})^2\subseteq \ker{f}$. Consider any equation $\varepsilon(\overline{x})$ such that $\hat{\varepsilon}\in\theta' \cap \mathrm{F}_\cls{V}(\overline{x})^2$. An application of Lemma~\ref{l:compact-congr-and-consequence-rel} yields $\cls{V}\models\ensuremath{\psi}^+\to\varepsilon$ and, by~\eqref{eq:cmep-assumption}, we obtain $\m A\models \varepsilon(\overline{a})$. Hence  $\hat{\varepsilon}\in \ker{f}$ as required.

To conclude the proof, we show that $\m B\models \ensuremath{\psi}(\overline{a},b)$, where $b$ is the image under $g$ of the equivalence class of $y$. Since $\theta' \subseteq \theta=\ker{g}$, we have $\m B\models \ensuremath{\psi}^+(\overline{a},b)$. Suppose towards a contradiction that $\m B\models \ensuremath{\sigma}_i(\overline{a},b)$ for some $i\in\{1,\dots,m\}$. Then $\hat{\ensuremath{\sigma}}_i\in \theta$, and so $\cls{V}\models (\ensuremath{\psi}^+\mathbin{\&} \ensuremath{\gamma})\to \ensuremath{\sigma}_i$ for some conjunction $\ensuremath{\gamma}(\overline{x})$ of equations  in $\ker{f}$. By~\eqref{eq:pi-i}, we have $\cls{V}\models \ensuremath{\gamma}\to \pi_i$ and hence, by~\eqref{eq:pi-i-primes}, also $\cls{V}\models \ensuremath{\gamma}\to \pi'_i$. Together with $\m A\models \ensuremath{\gamma}(\overline{a})$, this entails $\m A\models \pi'_i(\overline{a})$, contradicting the fact that $\m A\models \chi(\overline{a})$.
\end{proof}

We now complete the proof of Theorem~\ref{t:GZ-charact} by establishing the necessity of the stated conditions, recalling that a variety that has equationally definable principal congruences is congruence distributive (Proposition~\ref{p:EDPC-implies}).

\begin{proposition}
Let $\cls{V}$ be a congruence distributive variety that has the compact intersection property. If the theory of $\cls{V}$ has a model completion, then $\cls{V}$ is coherent and has the amalgamation property and equational variable restriction property.
\end{proposition}
\begin{proof}
If the theory of $\cls{V}$ has a model completion, then $\cls{V}$ is coherent and has the amalgamation property by Theorem~\ref{t:charact-model-completion}. Hence, it remains to settle the equational variable restriction property. To this end, consider a finite set $\overline{x},y$ and conjunction of equations $\ensuremath{\gamma}(\overline{x},y)$. We must find a formula $\pi(\overline{x})$ that is either $\bot$ or a conjunction of equations such that $\cls{V}\models \pi\to \ensuremath{\gamma}$ and for any conjunction of equations $\ensuremath{\varphi}(\overline{x})$,
\[
\cls{V}\models\ensuremath{\varphi}\to\ensuremath{\gamma} \:\Longrightarrow\: \cls{V}\models \ensuremath{\varphi}\to \pi.
\]
Let $T\coloneqq \mathrm{Th}(\cls{V})$ be the theory of $\cls{V}$, and let $T^*$  be a model completion of $T$. Since $T^*$ has quantifier elimination, there exists a quantifier-free formula $\xi(\overline{x})$ satisfying
\[
T^*\vdash \forall \overline{x} \, [(\forall y. \ensuremath{\gamma})\leftrightarrow \xi].
\]
So $T^*\vdash \forall \overline{x},y \, (\xi\to\ensuremath{\gamma})$ and, since $T$ and $T^*$ are co-theories, $T\vdash \forall \overline{x},y \, (\xi\to\ensuremath{\gamma})$. Assume without loss of generality that $\xi=\xi_1\curlyvee \cdots \curlyvee \xi_m$ where each $\xi_i$ is a conjunction of literals. For each $i\in\{1,\dots,m\}$, we have $\cls{V}\models \xi_i\to \ensuremath{\gamma}$ and so, by the disjunction property for varieties, either $\cls{V}\models \xi_i^+\to \ensuremath{\gamma}$ or $\cls{V}\models\neg\xi_i$.

Now let $J\coloneqq \{i\in\{1,\dots,m\}\mid \xi_i\text{ is satisfiable in $\cls{V}$}\}$.  Then $\cls{V}\models\bigOR_{i\in J} \xi^+_i\to\ensuremath{\gamma}$, noting that $\bigOR_{i\in J}\xi^+_i=\bot$ for $J=\emptyset$. By Lemma~\ref{l:consequence-of-CIP}, or taking  $\bot$ if $J=\emptyset$, there exists a formula $\pi(\overline{x})$ that is either $\bot$ or a conjunction of equations such that for any equation $\varepsilon(\overline{x},\overline{z})$,
\[
\cls{V}\models\bigOR_{i\in J} \xi^+_i \to\varepsilon\iff\cls{V}\models \pi\to \varepsilon.
\]
In particular, $\cls{V}\models \pi\to \ensuremath{\gamma}$. Now let  $\ensuremath{\varphi}(\overline{x})$ be any conjunction of equations such that $\cls{V}\models \ensuremath{\varphi}\to \ensuremath{\gamma}$. Then $T\vdash \forall \overline{x} \, [\ensuremath{\varphi} \to(\forall y.\ensuremath{\gamma})]$ and, since $T$ and $T^*$ are co-theories, $T^*\vdash \forall \overline{x} \, [\ensuremath{\varphi} \to(\forall y.\ensuremath{\gamma})]$. Hence $T^*\vdash \forall \overline{x} \, (\ensuremath{\varphi} \to \xi)$ and, again using the fact that  $T$ and $T^*$ are co-theories, $T\vdash \forall \overline{x} \, (\ensuremath{\varphi} \to \xi)$, yielding $\cls{V}\models\ensuremath{\varphi} \to \xi$. But then $\cls{V}\models\ensuremath{\varphi} \to \bigOR_{i\in J} \xi^+_i$ and, since $\cls{V}\models\bigOR_{i\in J} \xi^+_i \to\pi$, by the above equivalence, $\cls{V}\models \ensuremath{\varphi}\to\pi$ as required.
\end{proof}

Finally, in this section, we show that for varieties that have the congruence extension property, a small generalization of the equational variable restriction property implies the amalgamation property. Let us first recall the following well-known relationship between amalgamation and deductive interpolation.

\begin{proposition}[{cf.~\cite[Theorem~22]{MMT14}}]\label{p:amalg:dep}
Let $\cls{V}$ be a variety that has the congruence extension property. $\cls{V}$ has the amalgamation property if, and only if, it has the {\em deductive interpolation property}; that is, for any finite sets $\overline{x},\overline{y},\overline{z}$ and conjunctions of equations $\ensuremath{\varphi}(\overline{x},\overline{y})$, $\ensuremath{\gamma}(\overline{x},\overline{z})$ satisfying $\cls{V}\models\ensuremath{\varphi}\to\ensuremath{\gamma}$, there exists a conjunction of equations $\pi(\overline{x})$ such that $\cls{V}\models\ensuremath{\varphi}\to\pi$ and $\cls{V}\models\pi\to\ensuremath{\gamma}$.
\end{proposition}

It follows easily that the amalgamation property and equational variable restriction property can be combined into a single ``uniform interpolation'' property.

\begin{corollary}\label{c:amalg+leftvar}
Let $\cls{V}$ be a variety that has the congruence extension property. Then the following statements are equivalent:
\begin{enumerate}
\item[\rm (1)] $\cls{V}$ has the amalgamation property and the equational variable restriction property.
\item[\rm (2)] For any finite set $\overline{x},y$ and conjunction of equations $\ensuremath{\gamma}(\overline{x},y)$, there exists a formula $\pi(\overline{x})$ that is either $\bot$ or a conjunction of equations such that $\cls{V}\models \pi\to \ensuremath{\gamma}$ and for any conjunction of equations $\ensuremath{\varphi}(\overline{x},\overline{z})$,
\[
\cls{V}\models\ensuremath{\varphi}\to\ensuremath{\gamma} \:\Longrightarrow\: \cls{V}\models \ensuremath{\varphi}\to \pi.
\]
\end{enumerate}
\end{corollary}
\begin{proof}
$(1)\Rightarrow(2)$ Suppose that $\cls{V}$ has the amalgamation property and the equational variable restriction property, and consider a finite set $\overline{x},y$ and conjunction of equations $\ensuremath{\gamma}(\overline{x},y)$. By the equational variable restriction property,  there exists a formula $\pi(\overline{x})$ that is either $\bot$ or a conjunction of equations such that $\cls{V}\models \pi\to \ensuremath{\gamma}$ and for any conjunction of equations $\ensuremath{\varphi}(\overline{x})$,
\[
\cls{V}\models\ensuremath{\varphi}\to\ensuremath{\gamma} \:\Longrightarrow\: \cls{V}\models \ensuremath{\varphi}\to \pi.
\]
Now consider a conjunction of equations $\ensuremath{\varphi}(\overline{x},\overline{z})$ satisfying $\cls{V}\models\ensuremath{\varphi}\to\ensuremath{\gamma}$. Since $\cls{V}$ has the congruence extension property and the amalgamation property, by Proposition~\ref{p:amalg:dep}, there exists a conjunction of equations $\pi'(\overline{x})$ such that $\cls{V}\models\ensuremath{\varphi}\to\pi'$ and $\cls{V}\models\pi'\to\ensuremath{\gamma}$. By the above implication, $\cls{V}\models\pi'\to\pi$ and hence also $\cls{V}\models\ensuremath{\varphi}\to\pi$ as required.

$(2)\Rightarrow(1)$ The amalgamation property and the equational variable restriction property both follow directly from condition (2) and Proposition~\ref{p:amalg:dep}.
\end{proof}

Relationships between uniform interpolation and the existence of model completions have been investigated in some depth by Ghilardi and Zawadowski in the setting of intermediate and modal logics~\cite{GZ97,GZ02}. In particular, Pitts' uniform interpolation theorem for intuitionistic propositional logic~\cite{Pit92} is used to deduce that the variety $\cls{HA}$ of Heyting algebras satisfies certain categorical conditions and therefore has a model completion. In the terminology of this section: it follows from Pitts'  theorem that $\cls{HA}$ is coherent and satisfies condition (2) of Corollary~\ref{c:amalg+leftvar} and hence has the amalgamation property and the equational variable restriction property; the result then follows by Theorem~\ref{t:GZ-charact} (a slight generalization of~\cite[Theorem~4]{GZ97}), since $\cls{HA}$ has the compact intersection property and equationally definable principal congruences. More generally, the theories of precisely eight varieties of Heyting algebras (those that have the amalgamation property) have a model completion~\cite{GZ02}; finite axiomatizations of these model completions for the six locally finite cases are provided in~\cite{DJ2018}.

\section{Parametrically definable principal congruences}\label{s:pdpc}

In this section, we show that if a variety satisfies certain congruence lattice conditions and has a model completion, then it must have equationally definable principal congruences. Our main technical tool is a weaker condition for defining principal congruences that is inspired by work of Glass and Pierce on existentially complete lattice-ordered abelian groups~\cite{GP80}.

We say that a class of algebras $\cls{K}$ has \emph{parametrically definable principal congruences} if there exists a quantifier-free formula $\xi(x_1,x_2,y_1,y_2,\overline{z})$ such that for each $\m A\in\cls{K}$ and all $a_1,a_2,b_1,b_2\in A$,
\[
(a_1,a_2)\in \cg{\m{A}}(b_1,b_2) \iff \text{any } \m B\in\cls{K} \text{ extending } \m A \text{ satisfies }  \m B\models \forall \overline{z}. \xi(a_1,a_2,b_1,b_2,\overline{z}).
\]
Clearly, if a class of algebras has equationally definable principal congruences, it has parametrically definable principal congruences. However, there are classes of algebras that have parametrically definable principal congruences but do not even have first-order definable principal congruences (see Example~\ref{ex:ablggroupsnomodelcompletion}). The following proposition shows that this cannot be the case for a universal class of algebras whose theory has a model completion.

\begin{proposition}\label{p:splitting-lemma-fo}
Let $\cls{K}$ be a universal class of algebras with parametrically definable principal congruences. If the theory of $\cls{K}$ has a model completion, then $\cls{K}$ has quantifier-free definable principal congruences.
\end{proposition}
\begin{proof}
Suppose that $\cls{K}$ has parametrically definable principal congruences, witnessed by a quantifier-free formula $\xi(x_1,x_2,y_1,y_2,\overline{z})$, and that the theory of $\cls{K}$ has a model completion. We can assume that $\neg\xi=\ensuremath{\psi}_1\curlyvee\cdots\curlyvee \ensuremath{\psi}_n$, where each $\ensuremath{\psi}_i$ is a conjunction of literals. By Proposition~\ref{p:strong-CMEP-iff}, for each $i\in\{1,\dots,n\}$, there exists a quantifier-free formula $\chi_i(x_1,x_2,y_1,y_2)$ such that
  \begin{enumerate}
  \item[\rm (i)] $\cls{K}\models \ensuremath{\psi}_i\to\chi_i$
  \item[\rm (ii)] for any $\m A\in\cls{K}$, and $a_1,a_2,b_1,b_2\in A$ satisfying $\m A\models\chi_i(a_1,a_2,b_1,b_2)$, there exists an extension $\m B\in\cls{K}$ of $\m A$ such that $\m B\models \exists\overline{z}.\ensuremath{\psi}_i(a_1,a_2,b_1,b_2,\overline{z})$.
 \end{enumerate}
We claim that for each $\m A\in\cls{K}$ and all $a_1,a_2,b_1,b_2\in A$,
\begin{equation*}
(a_1,a_2)\in\cg{\m A}(b_1,b_2) \iff \m A\models \bigAND_{1\leq i\leq n}\neg\chi_i(a_1,a_2,b_1,b_2),
\end{equation*}
and hence that $\cls{K}$ has quantifier-free definable principal congruences. Suppose first that $(a_1,a_2)\in\cg{\m A}(b_1,b_2)$. By assumption, any $\m B\in\cls{K}$ extending $\m A$ satisfies $\m{B}\models\forall \overline{z}. \xi(a_1,a_2,b_1,b_2,\overline{z})$ and hence $\m B\not\models \exists \overline{z}. \ensuremath{\psi}_i(a_1,a_2,b_1,b_2,\overline{z})$ for each $i\in\{1,\dots,n\}$. But then, by~(ii), also $\m A\models \neg\chi_i(a_1,a_2,b_1,b_2)$ for each $i\in\{1,\dots,n\}$. Now suppose that $(a_1,a_2)\notin \cg{\m A}(b_1,b_2)$. By assumption, there exists an extension $\m B\in\cls{K}$ of $\m A$ such that $\m B\not\models\forall \overline{z}. \xi(a_1,a_2,b_1,b_2,\overline{z})$, and hence $\m B\models \exists \overline{z}. \ensuremath{\psi}_i(a_1,a_2,b_1,b_2,\overline{z})$ for some $i\in\{1,\dots,n\}$. But then, since $\cls{K}\models \ensuremath{\psi}_i\to\chi_i$, by (i), also $\m B\models \chi_i(a_1,a_2,b_1,b_2)$. Finally, as $\chi_i$ is quantifier-free, it follows that $\m A\models \chi_i(a_1,a_2,b_1,b_2)$.
\end{proof}

\begin{example}
It is easy to see that the variety of abelian groups does not have first-order definable principal congruences. If this were the case, there would be a first-order formula $\alpha(x,y)$ such that for any abelian group $\m G$, an element $a\in G$ belongs to the  subgroup of $\m G$ generated by an element $b\in G$ if, and only if, $\m G\models \alpha(a,b)$. But then the sentence $\exists y \forall x. \alpha(x,y)$ would define the class of cyclic groups, contradicting the fact that this class is not elementary. On the other hand, the theory of abelian groups does have a model completion (cf.~\cite{ES70}). Proposition~\ref{p:splitting-lemma-fo} therefore tells us that the variety of abelian groups does not have parametrically definable principal congruences.
\end{example}

We strengthen Proposition~\ref{p:splitting-lemma-fo} by exploiting the following fact, due to Fried, Gr{\"a}tzer, and Quackenbush~\cite{FGQ80}.

\begin{proposition}[{\cite[Theorems~4.5 and~6.9]{FGQ80}}]\label{p:fo-edpc}
Let $\cls{V}$ be a congruence distributive variety that has the congruence extension property. $\cls{V}$ has first-order definable principal congruences if, and only if, it has equationally definable principal congruences.
\end{proposition}

Combining this fact with Proposition~\ref{p:splitting-lemma-fo} yields the following result.

\begin{proposition}\label{p:splitting-lemma-edpc}
Let $\cls{V}$ be a congruence distributive variety that has the congruence extension property and parametrically definable principal congruences. If the theory of $\cls{V}$ has a model completion, then $\cls{V}$ has equationally definable principal congruences.
\end{proposition}

We now provide a sufficient syntactic condition for a variety with the congruence extension property to have parametrically definable principal congruences that is easier to establish in certain cases. We say that a variety $\cls{V}$ has a \emph{guarded deduction theorem} if there exist conjunctions of equations $\ensuremath{\gamma}(x_1,x_2,y_1,y_2,\overline{z})$ and $\ensuremath{\varphi}(x_1,x_2,y_1,y_2,\overline{z})$ such that for any finite set $\overline{w}$ with $\overline{w}\cap \overline{z}=\emptyset$, terms $s_1(\overline{w}),s_2(\overline{w}),t_1(\overline{w}),t_2(\overline{w})$, and conjunction of equations $\pi(\overline{w})$,
\begin{enumerate}
\item[\rm (i)] $\cls{V} \models (\pi \mathbin{\&} (t_1\approx t_2)) \to (s_1 \approx s_2) \iff \cls{V} \models \pi \to \forall\overline{z}.(\ensuremath{\gamma}\to \ensuremath{\varphi})(s_1,s_2,t_1,t_2,\overline{z})$
\item[\rm (ii)] $\cls{V} \models (\pi \mathbin{\&} \ensuremath{\gamma}(s_1,s_2,t_1,t_2,\overline{z})) \to \ensuremath{\sigma} \iff \cls{V}\models \pi \to \ensuremath{\sigma}$ \,for any equation $\ensuremath{\sigma}(\overline{w})$.
\end{enumerate}
This property has the following algebraic characterization:

\begin{proposition}\label{p:guarded-algebraically}
The following statements are equivalent for any variety $\cls{V}$:
\begin{enumerate}
\item[(1)] $\cls{V}$ has a guarded deduction theorem.
\item[(2)] There exist conjunctions of equations $\ensuremath{\gamma}(x_1,x_2,y_1,y_2,\overline{z})$ and $\ensuremath{\varphi}(x_1,x_2,y_1,y_2,\overline{z})$ such that for any finitely generated algebra $\m A\in \cls{V}$ and $a_1,a_2,b_1,b_2\in A$, there exists an embedding of $\m A$ into some member of $\cls{V}$ satisfying $\exists\overline{z}.\ensuremath{\gamma}(a_1,a_2,b_1,b_2,\overline{z})$, and
\begin{align*}
(a_1,a_2)\in \cg{\m A}(b_1,b_2) \iff\: & \m B\models \forall \overline{z}. (\ensuremath{\gamma}\to\ensuremath{\varphi})(h(a_1),h(a_2),h(b_1),h(b_2),\overline{z})\\
& \text{for any $\m B\in \cls{V}$ and homomorphism $h\colon \m A\to\m B$.}
\end{align*}
\end{enumerate}
\end{proposition}
\begin{proof}
 $(1)\Rightarrow(2)$ Let $\ensuremath{\gamma}(x_1,x_2,y_1,y_2,\overline{z})$ and $\ensuremath{\varphi}(x_1,x_2,y_1,y_2,\overline{z})$ be conjunctions of equations satisfying the conditions for a guarded deduction theorem, and fix a finitely generated algebra $\m A\in \cls{V}$ and $a_1,a_2,b_1,b_2\in A$. We claim that $\ensuremath{\gamma}$ and $\ensuremath{\varphi}$ satisfy the equivalence given in (2).

Note first that since $\m{A}$ is finitely generated, there exists a surjective homomorphism $f\colon\m{Tm}(\overline{w})\twoheadrightarrow \m A$ for some finite set $\overline{w}$ with $\overline{w}\cap\overline{z}=\emptyset$. Let $s_1,s_2,t_1,t_2$ be terms in the preimages under $f$ of $a_1,a_2,b_1,b_2$, respectively. Now consider $(a_1,a_2)\in \cg{\m A}(b_1,b_2)$. Since $\m A$ is isomorphic to $\m{Tm}(\overline{w})/\ker{f}$, by the correspondence theorem for universal algebra, $(s_1,s_2)\in \ker{f} \vee \cg{\m{Tm}(\overline{w})}(t_1,t_2)$. Moreover, since any congruence is the directed union of the compact congruences below it, there exists a finite subset $S\subseteq \ker{f}$ such that $(s_1,s_2)\in \cg{\m{Tm}(\overline{w})}(S) \vee \cg{\m{Tm}(\overline{w})}(t_1,t_2)$. Let $\pi(\overline{w})$ be the conjunction of the equations in $S$. It follows easily from Lemma~\ref{l:compact-congr-and-consequence-rel} that $\cls{V} \models (\pi \mathbin{\&} (t_1\approx t_2)) \to (s_1 \approx s_2)$. Hence $\cls{V} \models \pi \to \forall\overline{z}.(\ensuremath{\gamma}\to \ensuremath{\varphi})(s_1,s_2,t_1,t_2,\overline{z})$, by condition (i) in the definition of a guarded deduction theorem. But $\m A \models \pi(f(\overline{w}))$, so for any $\m B\in \cls{V}$ and homomorphism $h\colon \m A\to \m B$,
\[
\m B\models \forall \overline{z}. (\ensuremath{\gamma}\to\ensuremath{\varphi})(h(a_1),h(a_2),h(b_1),h(b_2),\overline{z}).
\]
Now suppose that $\m B\models \forall \overline{z}. (\ensuremath{\gamma}\to\ensuremath{\varphi})(h(a_1),h(a_2),h(b_1),h(b_2),\overline{z})$ for any $\m B\in \cls{V}$ and homomorphism $h\colon \m A\to\m B$. Let $\mathfrak{D}^+(\m A)$ be the positive diagram of $\m A$, i.e., the set of all atomic sentences in the language extended with names for the elements of $\m A$ that are satisfied in $\m A$. Then
\[
\mathrm{Th}(\cls{V})\cup\mathfrak{D}^+(\m A)\vdash \forall\overline{z}.(\ensuremath{\gamma}\to \ensuremath{\varphi})(a_1,a_2,b_1,b_2,\overline{z}),
\]
and hence, by the compactness theorem for first-order logic, there exists a finite subset $\Sigma\subseteq \mathfrak{D}^+(\m A)$ such that $\mathrm{Th}(\cls{V})\cup\Sigma\vdash \forall\overline{z}.(\ensuremath{\gamma}\to \ensuremath{\varphi})(a_1,a_2,b_1,b_2,\overline{z})$. For each member of $\Sigma$, consider an equation in its preimage under the surjection $\m{Tm}(\overline{w})^2\twoheadrightarrow \m A^2$. This yields a finite subset of $\ker{f}$, and letting $\pi(\overline{w})$ denote the conjunction of the equations in this set, we obtain $\cls{V} \models \pi \to \forall\overline{z}.(\ensuremath{\gamma}\to \ensuremath{\varphi})(s_1,s_2,t_1,t_2,\overline{z})$. By condition (i) in the definition of a guarded deduction theorem, we obtain $\cls{V} \models (\pi \mathbin{\&} (t_1\approx t_2)) \to (s_1 \approx s_2)$. Now let $q\colon \m A\twoheadrightarrow \m A/\cg{\m A}(b_1,b_2)$ be the natural quotient map. Since $\m A/\cg{\m A}(b_1,b_2), qf\models \pi \mathbin{\&} (t_1\approx t_2)$, we have $\m A/\cg{\m A}(b_1,b_2), q f\models s_1 \approx s_2$, i.e., $(a_1,a_2)\in \cg{\m A}(b_1,b_2)$.

To conclude, it remains to show that $\m A$ embeds into some member of $\cls{V}$ satisfying $\exists \overline{z}.\ensuremath{\gamma}(a_1,a_2,b_1,b_2,\overline{z})$. Let $\m B$ be the quotient of $\m{F}_{\cls{V}}(\overline{w},\overline{z})$ with respect to the congruence $\cg{\m{F}_{\cls{V}}(\overline{w},\overline{z})}(\{\hat{\varepsilon}\mid \varepsilon\in \ker{f}\}\cup\{\hat{\ensuremath{\sigma}}\mid \ensuremath{\sigma} \text{ is an equation of }\ensuremath{\gamma}(s_1,s_2,t_1,t_2,\overline{z})\})$. Then $\m B$ satisfies $\exists \overline{z}.\ensuremath{\gamma}(a_1,a_2,b_1,b_2,\overline{z})$ and it is not difficult to see, using condition (ii) in the definition of a guarded deduction theorem, that $\m B$ extends $\m A$.

$(2)\Rightarrow(1)$ Let $\ensuremath{\gamma}(x_1,x_2,y_1,y_2,\overline{z})$ and $\ensuremath{\varphi}(x_1,x_2,y_1,y_2,\overline{z})$ be conjunctions of equations satisfying the conditions in (2). Let $\overline{w}$ be any finite set satisfying $\overline{w}\cap\overline{z}=\emptyset$ and consider terms $s_1(\overline{w}),s_2(\overline{w}),t_1(\overline{w}),t_2(\overline{w})$ and a conjunction of equations $\pi(\overline{w})$.

Let $\m A$ be the quotient of $\m{F}_{\cls{V}}(\overline{w})$ with respect to $\cg{\m{F}_{\cls{V}}(\overline{w})}(\{\hat{\varepsilon}\mid \varepsilon \text{ is an equation of } \pi\})$, with quotient map $f\colon \m{F}_{\cls{V}}(\overline{w}) \twoheadrightarrow \m A$. Let $q\colon \m{Tm}(\overline{w})\twoheadrightarrow \m{F}_{\cls{V}}(\overline{w})$ denote the natural quotient map and define $a_1\coloneqq f(q(s_1))$, $a_2\coloneqq f(q(s_2))$, $b_1\coloneqq f(q(t_1))$, and $b_2\coloneqq f(q(t_2))$. By Lemma~\ref{l:compact-congr-and-consequence-rel}, $(a_1,a_2)\in \cg{\m A}(b_1,b_2)$ if, and only if, $\cls{V} \models (\pi \mathbin{\&} (t_1\approx t_2)) \to (s_1 \approx s_2)$.  Hence, in order to settle condition (i) in the definition of a guarded deduction theorem, it remains to show that $\cls{V} \models \pi \to \forall\overline{z}.(\ensuremath{\gamma}\to \ensuremath{\varphi})(s_1,s_2,t_1,t_2,\overline{z})$ if, and only if, for any $\m B\in \cls{V}$ and homomorphism $h\colon \m A\to \m B$,
\[
\m B\models \forall \overline{z}. (\ensuremath{\gamma}\to\ensuremath{\varphi})(h(a_1),h(a_2),h(b_1),h(b_2),\overline{z}).
\]
This follows by reasoning as in the proof of $(1)\Rightarrow (2)$.

With respect to condition (ii) in the definition of a guarded deduction theorem, let $\m B$ denote the quotient of $\m{F}_{\cls{V}}(\overline{w},\overline{z})$ with respect to
\[
\cg{\m{F}_{\cls{V}}(\overline{w},\overline{z})}(\{\hat{\varepsilon}\mid \varepsilon \text{ is an equation of }\pi(\overline{w})\}\cup\{\hat{\ensuremath{\sigma}}\mid \ensuremath{\sigma} \text{ is an equation of }\ensuremath{\gamma}(s_1,s_2,t_1,t_2,\overline{z})\}).
\]
Note that there is a canonical homomorphism $k\colon \m A\to \m B$. By assumption, there is an embedding $j\colon \m A \hookrightarrow \m B'$ with $\m B'\in \cls{V}$ and $\m B'\models \exists \overline{z}.\ensuremath{\gamma}(a_1,a_2,b_1,b_2,\overline{z})$. It follows easily that there is a homomorphism $h\colon \m B\to \m B'$ such that $j=h k$. Since $j$ is injective, so is $k$. Hence, by Lemma~\ref{l:compact-congr-and-consequence-rel}, we have that $\cls{V} \models (\pi \mathbin{\&} \ensuremath{\gamma}(s_1,s_2,t_1,t_2,\overline{z})) \to \ensuremath{\sigma}'$ implies $\cls{V}\models \pi \to \ensuremath{\sigma}'$ for any equation $\ensuremath{\sigma}'(\overline{w})$.
\end{proof}

\begin{proposition}\label{p:guarded-entails-parametrically}
Let $\cls{V}$ be a variety that has the congruence extension property and a guarded deduction theorem. Then $\cls{V}$ has parametrically definable principal congruences.
\end{proposition}
\begin{proof}
It suffices to show that $\cls{V}$ has parametrically definable principal congruences whenever the property in condition (2) of Proposition~\ref{p:guarded-algebraically} holds for some $\ensuremath{\gamma}$ and $\ensuremath{\varphi}$. Let $\xi(x_1,x_2,y_1,y_2,\overline{z})\coloneqq \ensuremath{\gamma}\to \ensuremath{\varphi}$. We claim that for all $\m A\in\cls{V}$ and $a_1,a_2,b_1,b_2\in A$,
\[
(a_1,a_2)\in \cg{\m{A}}(b_1,b_2) \iff \text{each } \m B\in\cls{V} \text{ extending } \m A \text{ satisfies }  \m B\models \forall \overline{z}. \xi(a_1,a_2,b_1,b_2,\overline{z}).
\]
Suppose first that $(a_1,a_2)\in \cg{\m{A}}(b_1,b_2)$. By the congruence extension property, $(a_1,a_2)\in \cg{\m A'}(b_1,b_2)$, where $\m A'$ is the subalgebra of $\m A$ generated by $a_1,a_2,b_1,b_2$. Since $\m A'$ is a finitely generated member of $\cls{V}$, it follows from condition (2) of Proposition~\ref{p:guarded-algebraically} that $\m B\models \forall \overline{z}. \xi(a_1,a_2,b_1,b_2,\overline{z})$ for every $\m B\in \cls{V}$ extending $\m A'$, and hence, in particular, for every $\m B\in \cls{V}$ extending $\m A$.

Now suppose that $(a_1,a_2)\notin \cg{\m{A}}(b_1,b_2)$. We assume first that $\m A$ is finitely generated, and then deduce the general case. Let $\overline{w}$ be a finite set such that $\overline{w}\cap\overline{z}=\emptyset$ and there exists a surjective homomorphism $f\colon\m{Tm}(\overline{w})\twoheadrightarrow \m A$. We can assume without loss of generality that $x_1,x_2,y_1,y_2\in \overline{w}$, and also $f(x_1)=b_1, f(x_2)=b_2, f(y_1)=a_1, f(y_2)=a_2$. Let $\m B\coloneqq \m{F}_{\cls{V}}(\overline{w},\overline{z})/\theta$, where
\[
\theta\coloneqq\cg{\m{F}_{\cls{V}}(\overline{w},\overline{z})}(\{\hat{\varepsilon}\mid \varepsilon\in \ker{f}\}\cup\{\hat{\ensuremath{\sigma}}\mid \ensuremath{\sigma} \text{ is an equation of } \ensuremath{\gamma}\}).
\]
We claim that $\m B$ extends $\m A$. Let $j\colon \m A\to \m B$ be the canonical homomorphism  mapping $a_1,a_2,b_1,b_2$ to the equivalence classes of $x_1,x_2,y_1,y_2$, respectively. By assumption, there exist $\m B'\in \cls{V}$ and an embedding $i\colon \m A\to \m B'$ such that $\m B'\models \exists\overline{z}.\ensuremath{\gamma}(a_1,a_2,b_1,b_2,\overline{z})$. It is not difficult to see that $i$ factors through $j$, and since $i$ is injective, so is $j$.

Now, by assumption, there exist $\m C\in \cls{V}$ and a homomorphism $h\colon \m A\to \m C$ satisfying $\m C\models \exists \overline{z}. (\ensuremath{\gamma} \mathbin{\&} \neg \ensuremath{\varphi}_i)(h(a_1),h(a_2),h(b_1),h(b_2),\overline{z})$ for some equation $\ensuremath{\varphi}_i$ of $\ensuremath{\varphi}$. It follows that there exists a homomorphism $k\colon \m{Tm}(\overline{w},\overline{z})\to \m C$ which factors through the composition $g\colon \m{Tm}(\overline{w},\overline{z})\twoheadrightarrow \m{F}_{\cls{V}}(\overline{w},\overline{z})\twoheadrightarrow \m B$ and satisfies $\ensuremath{\varphi}_i\notin \ker{k}$, as depicted in the diagram:
\[
\begin{tikzcd}
\m{Tm}(\overline{w}) \arrow[hookrightarrow]{r} \arrow[twoheadrightarrow]{d}[swap]{f} & \m{Tm}(\overline{w},\overline{z}) \arrow[twoheadrightarrow]{d}{g} \arrow[bend left=20]{ddr}{k} & {} \\
{\m A} \arrow[bend right=20]{drr}{h} \arrow[hookrightarrow]{r}{j} & {\m B} \arrow[dashed]{dr} & {} \\
{} & & {\m C}
\end{tikzcd}
\]
So $\ensuremath{\varphi}_i\notin \ker{g}$, showing that $\m B$ is an extension of $\m A$ satisfying $\m B\not\models \forall \overline{z}. \xi(a_1,a_2,b_1,b_2,\overline{z})$.

To conclude, consider any $\m A\in\cls{V}$ and suppose that $\m B\models \forall \overline{z}. \xi(a_1,a_2,b_1,b_2,\overline{z})$ for all $\m B\in \cls{V}$ extending $\m A$. Then $\mathrm{Th}(\cls{V})\cup\mathfrak{D}(\m A)\vdash \forall \overline{z}. \xi(a_1,a_2,b_1,b_2,\overline{z})$, where $\mathfrak{D}(\m A)$ is the diagram of $\m A$, i.e., the collection of all atomic sentences and negated atomic sentences in the language extended with names for the elements of $\m A$ that are satisfied in $\m A$. By the compactness theorem for first-order logic, there is a finite subset $\Sigma\subseteq \mathfrak{D}(\m A)$ such that $\mathrm{Th}(\cls{V})\cup\Sigma\vdash \forall \overline{z}. \xi(a_1,a_2,b_1,b_2,\overline{z})$. Let $\m A'$ be the subalgebra of $\m A$ generated by $a_1,a_2,b_1,b_2$ and the elements named by $\Sigma$. As the diagram of $\m A'$ contains $\Sigma$, every $\m B'\in \cls{V}$ extending $\m A'$ satisfies $\m B'\models \forall \overline{z}. \xi(a_1,a_2,b_1,b_2,\overline{z})$. Note that $\m A'$ is a finitely generated member of $\cls{V}$ and so, by the argument above, $(a_1,a_2)\in \cg{\m A'}(b_1,b_2)\subseteq \cg{\m A}(b_1,b_2)$.
\end{proof}

Combining Propositions~\ref{p:splitting-lemma-edpc} and~\ref{p:guarded-entails-parametrically} yields the main result of this section.

\begin{theorem}\label{t:mc-implies-EDPC-guarded}
Let $\cls{V}$ be a congruence distributive variety that has the congruence extension property and a guarded deduction theorem. If the theory of $\cls{V}$ has a model completion, then $\cls{V}$ has equationally definable principal congruences.
\end{theorem}

\begin{example}\label{ex:ablggroupsnomodelcompletion}
As first proved by Glass and Pierce in~\cite{GP80}, the theory of the variety $\cls{LA}$ of lattice-ordered abelian groups does not have a model completion. It is well-known that $\cls{LA}$ is congruence distributive and has the congruence extension property, but does not have equationally (or even first-order) definable principal congruences. Hence it suffices, by Theorem~\ref{t:mc-implies-EDPC-guarded}, to observe that the formulas
\[
\ensuremath{\gamma}\coloneqq (x_1 - x_2) \wedge(x_2 - x_1) \wedge 0 \leq z \mathbin{\&} ((y_1-y_2)\wedge (y_2-y_1) \wedge 0)\vee z \approx 0\:\text{ and }\:\ensuremath{\varphi}\coloneqq z\approx 0
\]
satisfy conditions (i) and (ii) in the definition of a guarded deduction theorem for $\cls{LA}$.
\end{example}

\section{Varieties of pointed residuated lattices}\label{s:prls}

In this section, we apply the results of the last two sections to a family of varieties of algebras that provide algebraic semantics for substructural logics, including (up to term-equivalence) lattice-ordered groups, MV-algebras, and Heyting algebras (see,~e.g.,~\cite{BT03,GJKO07,MPT10}).

A {\em pointed residuated lattice} is an algebra $\m{A} = \langle A,\wedge,\vee,\cdot,\backslash,\slash,{\rm e}, {\rm 0}\rangle$ such that $\langle A,\wedge,\vee \rangle$ is a lattice, $\langle A,\cdot,{\rm e} \rangle$ is a monoid, and $\backslash,\slash$ are left and right residuals, respectively, of $\cdot$ in the underlying lattice order, i.e., for all $a,b,c\in A$,
\[
b \le a \backslash c \iff  a \cdot b \le c  \iff a \le c \slash b.
\]
It will be useful to define a further binary operation $x\equiv y\coloneqq (x\backslash y)\wedge (y\backslash x)\wedge {\rm e}$, noting that $(a\equiv b) = {\rm e}$ for $a,b\in A$ if, and only if, $a=b$. We also define for any $a\in A$ inductively $a^0\coloneqq {\rm e}$ and $a^{n+1}\coloneqq a\cdot a^n$  ($n\in\mathbb{N}$).

Pointed residuated lattices form a congruence distributive variety~\cite{BT03}, and include the subvariety $\cls{CPRL}$ of commutative pointed residuated lattices satisfying $x \cdot y \approx y \cdot x$. In particular, a Heyting algebra is term-equivalent to a commutative pointed residuated lattice satisfying $x\cdot y\approx x\wedge y$ and $x\wedge{\rm 0}\approx{\rm 0}$, and a Boolean algebra is  term-equivalent to a Heyting algebra satisfying $(x \backslash {\rm 0})\backslash{\rm 0} \approx x$.

Let $\cls{V}$ be a variety of pointed residuated lattices. We let $\cls{V^c}$ denote the class of linearly ordered members of $\cls{V}$, and call $\cls{V}$ {\em semilinear} if $\cls{V} = \cop{ISP}(\cls{V^c})$. Semilinearity can also be expressed equationally; in particular, a variety of commutative pointed residuated lattices is semilinear if, and only if, it satisfies ${\rm e} \approx ((x \backslash y) \wedge {\rm e}) \vee ((y \backslash x) \wedge {\rm e})$~\cite{BT03}.

\begin{example}
The variety $\cls{LA}$ of lattice-ordered abelian groups is term-equivalent to the variety of commutative pointed residuated lattices satisfying ${\rm e}\approx{\rm 0}$ and $x\cdot(x\backslash{\rm e})\approx~{\rm e}$. More precisely, if $\langle L,\wedge,\vee,+,-,0 \rangle\in\cls{LA}$ and we define $x\cdot y\coloneqq x+y$, $x\backslash y\coloneqq y-x$, and $x\slash y\coloneqq x-y$, then $\langle L,\wedge,\vee,\cdot,\backslash,\slash,0,0\rangle\in\cls{CPRL}$ satisfies ${\rm e}\approx{\rm 0}$ and $x\cdot(x\backslash{\rm e})\approx{\rm e}$. Conversely, if $\m{L}\in\cls{CPRL}$ satisfies ${\rm e}\approx{\rm 0}$ and $x\cdot(x\backslash{\rm e})\approx{\rm e}$ and we define $x+y\coloneqq x\cdot y$ and $-x\coloneqq x\backslash{\rm e}$, then $\langle L,\wedge,\vee,+,-,{\rm 0}\rangle\in\cls{LA}$. Recall also that $\cls{LA} = \cop{ISP}(\cls{LA^c})$, so the corresponding variety of pointed residuated lattices is semilinear.
\end{example}

\begin{example}
The variety $\cls{MV}$ of MV-algebras is term-equivalent to the variety of commutative pointed residuated lattices satisfying $x\vee y\approx(x\backslash y)\backslash y$ and $x\wedge{\rm 0}\approx{\rm 0}$. More precisely, if $\langle M,\oplus,\lnot,0\rangle\in\cls{MV}$ and we define $x \cdot y \coloneqq \lnot(\lnot x\oplus\lnot y)$, $x \backslash y \coloneqq  \lnot x \oplus y$, ${x \slash y} \coloneqq x\oplus\lnot y$, and ${\rm e}\coloneqq \lnot 0$, then $\langle M,\wedge,\vee,\cdot,\backslash,\slash,{\rm e},{\rm 0}\rangle\in\cls{CPRL}$ satisfies $x\vee y\approx(x\backslash y)\backslash y$ and $x\wedge{\rm 0}\approx{\rm 0}$. Conversely, if $\m{M}\in\cls{CPRL}$ satisfies $x\vee y\approx(x\backslash y)\backslash y$ and $x\wedge{\rm 0}\approx{\rm 0}$ and we define $x\oplus y\coloneqq (x\backslash{\rm 0})\backslash y$ and $\lnot x\coloneqq x\backslash{\rm 0}$, then $\langle M,\oplus,\lnot,{\rm 0}\rangle\in\cls{MV}$. Again, since $\cls{MV}=\cop{ISP}(\cls{MV^c})$, the corresponding variety of pointed residuated lattices is semilinear.
\end{example}

Let us call a variety $\cls{V}$ of pointed residuated lattices \emph{Hamiltonian}\footnote{An algebra $\m{A}$ is usually called {\em Hamiltonian} if every non-empty subuniverse of $\m{A}$ is an equivalence class of some congruence of $\m{A}$. In~\cite{BKLT16}, it is shown that a variety of pointed residuated lattices satisfying $x\backslash{\rm e}\approx{\rm e}\slash x$ consists of Hamiltonian algebras in this sense if, and only if, it has the property given in our definition.} if for some $k\in\mathbb{N}^{>0}$,
\[
\cls{V}\models(x\wedge {\rm e})^k \cdot y\approx y\cdot (x\wedge {\rm e})^k.
\]
The following proposition collects some useful facts about such varieties.

\begin{proposition}[{\cite[Lemma~3.14,~Proposition~3.15,~and~Lemma~3.17]{Gal03}}]
\label{p:hamiltonian-properties}
Let $\cls{V}$ be a Hamiltonian variety of pointed residuated lattices.
\begin{enumerate}
\item[\rm (a)] For any $\m{A}\in\cls{V}$ and $a_1,a_2,b_1,b_2\in A$,
\[
(a_1,a_2)\in \cg{\m A}(b_1,b_2) \iff  (b_1\equiv b_2)^n\leq a_1\equiv a_2 \text{ for some }n\in\mathbb{N}.
\]
\item[\rm (b)] $\cls{V}$ has equationally definable principal congruences if, and only if, for some $n\in\mathbb{N}$,
\[
\cls{V}\models(x\wedge{\rm e})^n\approx (x\wedge{\rm e})^{n+1}.
\]
\item[\rm (c)] $\cls{V}$ has the congruence extension property.
\end{enumerate}
\end{proposition}

We show now that every Hamiltonian variety of pointed residuated lattices has both the compact intersection property and a guarded deduction theorem, which, combined with Theorems~\ref{t:GZ-charact} and~\ref{t:mc-implies-EDPC-guarded}, will allow us to determine which of these varieties have a theory that has a model completion.

\begin{lemma}
Let $\cls{V}$ be a Hamiltonian variety of pointed residuated lattices. Then $\cls{V}$ has the compact intersection property.
\end{lemma}
\begin{proof}
Every compact congruence of an algebra $\m{A}\in\cls{V}$ is a finite join of principal congruences of $\m{A}$ and hence, by congruence distributivity, the intersection of any two compact congruences of $\m{A}$ is a finite join of intersections of principal congruences of $\m{A}$. It therefore suffices to show that for all $b_1,b_2,c_1,c_2\in A$,
\[
\cg{\m A}(b_1,b_2)\cap\cg{\m A}(c_1,c_2)=\cg{\m A}({\rm e},(b_1\equiv b_2)\vee (c_1\equiv c_2)).
\]
Suppose first that $(a_1,a_2)\in\cg{\m A}(b_1,b_2)\cap\cg{\m A}(c_1,c_2)$. Then Proposition~\ref{p:hamiltonian-properties}.(a) yields $(b_1\equiv b_2)^{n_1}\leq a_1\equiv a_2$ and $(c_1\equiv c_2)^{n_2}\leq a_1\equiv a_2$ for some $n_1,n_2\in\mathbb{N}$. Let $n\coloneqq \max{(n_1,n_2)}$.  Then $(b_1\equiv b_2)^{n} \vee (c_1\equiv c_2)^{n}\leq a_1\equiv a_2$ and, using some elementary properties of pointed residuated lattices, also $((b_1\equiv b_2)\vee (c_1\equiv c_2))^{2n}\leq {a_1\equiv a_2}$. By Proposition~\ref{p:hamiltonian-properties}.(a) again, $(a_1,a_2)\in \cg{\m A}({\rm e},(b_1\equiv b_2)\vee (c_1\equiv c_2))$. Now suppose that $(a_1,a_2)\in \cg{\m A}({\rm e},(b_1\equiv b_2)\vee (c_1\equiv c_2))$. It follows easily, again using some elementary properties of pointed residuated lattices, that $(a_1,a_2)\in\cg{\m A}(b_1,b_2)\cap\cg{\m A}(c_1,c_2)$.
\end{proof}

\begin{lemma}\label{l:guarded-HRL}
Let $\cls{V}$ be a Hamiltonian variety of pointed residuated lattices. Then $\cls{V}$ has a guarded deduction theorem.
\end{lemma}
\begin{proof}
We show that the formulas
\[
\ensuremath{\gamma}\coloneqq (x_1\equiv x_2) \leq z \mathbin{\&} (y_1\equiv y_2)\vee z \approx {\rm e} \: \text{ and } \: \ensuremath{\varphi}\coloneqq z\approx {\rm e}
\]
satisfy conditions (i) and (ii) in the definition of a guarded deduction theorem for a finite set $\overline{w}$ with $z\notin \overline{w}$,  terms $s_1(\overline{w}),s_2(\overline{w}),t_1(\overline{w}),t_2(\overline{w})$, and conjunction of equations $\pi(\overline{w})$.

For (i), suppose first that $\cls{V} \models (\pi \mathbin{\&} (t_1\approx t_2)) \to (s_1 \approx s_2)$. To show that $\cls{V} \models \pi \to \forall z.(\ensuremath{\gamma}\to \ensuremath{\varphi})(s_1,s_2,t_1,t_2,z)$, consider any $\m A\in \cls{V}$ and assignment $f\colon \overline{w} \to A$ such that $\m A, f\models \pi$, and let $g\colon \overline{w}, z\to A$ be a map extending $f$ such that $\m A, g\models \ensuremath{\gamma}(s_1,s_2,t_1,t_2,z)$. Then $\m A, g\models  (s_1\equiv s_2) \leq z$ and $\m A, g\models (t_1\equiv t_2)\vee z \approx {\rm e}$. It follows that also $\m A, g\models z\leq {\rm e}$ and hence to show that $\m A, g\models \ensuremath{\varphi}(s_1,s_2,t_1,t_2,z)$, it suffices to prove the following:
\begin{claim*}
$\m A, g\models {\rm e} \leq z$.
\end{claim*}
\begin{proof}[Proof of Claim]
Let $\tilde{g}\colon \m{Tm}(\overline{w},z)\to \m A$ be the unique homomorphism extending $g$, and define $a_1\coloneqq \tilde{g}(s_1)$, $a_2\coloneqq \tilde{g}(s_2)$, $b_1\coloneqq \tilde{g}(t_1)$, $b_2\coloneqq \tilde{g}(t_2)$, and $c\coloneqq \tilde{g}(z)$. We prove first that ${\rm e}\le(b_1\equiv b_2)^k \vee c$ for all $k\in\mathbb{N}^{>0}$, proceeding by induction on $k$. The base case follows from the fact that $\m A, g\models (t_1\equiv t_2)\vee z \approx {\rm e}$.  For the inductive step, we obtain
\begin{align*}
{\rm e} & \le (b_1\equiv b_2)^k \vee c && \text{by the induction hypothesis}\\
& \le (((b_1\equiv b_2) \vee c)\cdot (b_1\equiv b_2)^k) \vee c && \text{since  ${\rm e}\le(b_1\equiv b_2) \vee c$}\\
& = ((b_1\equiv b_2)^{k+1} \vee c\cdot (b_1\equiv b_2)^k) \vee c && \text{by the distributivity of $\cdot$ over $\vee$}\\
& \le (b_1\equiv b_2)^{k+1} \vee c  && \text{since  $b_1\equiv b_2\leq {\rm e}$.}
\end{align*}
Now let $q$ denote the natural quotient map from $\m A$ onto $\m A/\cg{\m A}(b_1,b_2)$. By assumption, $\cls{V} \models (\pi \mathbin{\&} (t_1\approx t_2)) \to (s_1 \approx s_2)$, so $\m A/\cg{\m A}(b_1,b_2), q f\models s_1\approx s_2$, i.e., $(a_1, a_2)\in \cg{\m A}(b_1,b_2)$. By Proposition~\ref{p:hamiltonian-properties}.(a), we obtain $(b_1\equiv b_2)^n\leq a_1\equiv a_2$ for some $n\in\mathbb{N}$. But $\m A, g\models  (s_1\equiv s_2) \leq z$, so also $(a_1\equiv a_2)\leq c$ and $(b_1\equiv b_2)^n\leq c$. Hence we get ${\rm e}\le (b_1\equiv b_2)^n \vee c = c$; that is, $\m A, g\models {\rm e} \leq z$.
 \end{proof}

Now suppose that $\cls{V} \models \pi \to \forall\overline{z}.(\ensuremath{\gamma}\to \ensuremath{\varphi})(s_1,s_2,t_1,t_2,\overline{z})$. To show that  $\cls{V} \models (\pi \mathbin{\&} (t_1\approx t_2)) \to (s_1 \approx s_2)$, consider any $\m A\in \cls{V}$ and assignment $f\colon \overline{w}\to A$ such that $\m A, f\models \pi \mathbin{\&} (t_1\approx t_2)$. Since $z\notin \overline{w}$, we can extend $f$ to an assignment $g\colon \overline{w},z\to A$ by setting $g(z)\coloneqq \tilde{f}(s_1\equiv s_2)$, where $\tilde{f}\colon \m{Tm}(\overline{w})\to \m A$ is the unique homomorphism extending $f$. Clearly, $\m A, g\models \pi \mathbin{\&} \ensuremath{\gamma}(s_1,s_2,t_1,t_2,z)$ and hence, by assumption, $\m A, g\models z\approx {\rm e}$. It follows that $\m A, f\models (s_1\equiv s_2)\approx {\rm e}$, and so $\m A, f\models s_1\approx s_2$.

For the non-trivial direction of (ii), suppose that $\cls{V} \models (\pi \mathbin{\&} \ensuremath{\gamma}(s_1,s_2,t_1,t_2,\overline{z})) \to \ensuremath{\sigma}$ for some equation $\ensuremath{\sigma}(\overline{w})$. To show that $\cls{V}\models \pi\to\ensuremath{\sigma}$, consider any algebra $\m A\in \cls{V}$ and assignment $f\colon \overline{w} \to A$ such that $\m A, f\models \pi$. Extend $f$ to an assignment $g\colon \overline{w},z\to A$ by setting $g(z)\coloneqq {\rm e}$. Then $\m A, g\models \pi \mathbin{\&} \ensuremath{\gamma}(s_1,s_2,t_1,t_2,z)$ and hence, by assumption, $\m A, f\models \ensuremath{\sigma}$.
\end{proof}

Theorems~\ref{t:GZ-charact} and~\ref{t:mc-implies-EDPC-guarded} then yield the following description of Hamiltonian varieties of pointed residuated lattices whose theories have a model completion.

\begin{theorem}\label{t:HamRL-charact}
Let $\cls{V}$ be a Hamiltonian variety of pointed residuated lattices. The theory of $\cls{V}$ has a model completion if, and only if, $\cls{V}$ is coherent and has equationally definable principal congruences, the amalgamation property, and the equational variable restriction property.
\end{theorem}

\begin{example}
Since the variety of lattice-ordered abelian groups is Hamiltonian but does not have equationally definable principal congruences, it follows directly from Theorem~\ref{t:HamRL-charact} that, as already mentioned in Example~\ref{ex:ablggroupsnomodelcompletion} and first proved in~\cite{GP80}, its theory does not have a model completion. Similarly, the variety of MV-algebras does not have a model completion, as first proved in~\cite{Lac79}. \end{example}

An analogous result to Theorem~\ref{t:HamRL-charact} was obtained in~\cite{KM18} for Hamiltonian varieties of pointed residuated lattices that are closed under canonical extensions; for this latter notion, we refer to~\cite{GH01,Geh14}.

 \begin{proposition}[{\cite[Theorem~5.11]{KM18}}]\label{p:coherence-edpc}
Let $\cls{V}$ be a Hamiltonian variety of pointed residuated lattices that is closed under canonical extensions. If $\cls{V}$ is coherent, then it has equationally definable principal congruences.
 \end{proposition}

We use Proposition~\ref{p:coherence-edpc} to show that if a Hamiltonian semilinear variety $\cls{V}$ of pointed residuated lattices is closed under canonical extensions and the theory of $\cls{V^c}$ has a model completion, then $\cls{V}$ has equationally definable principal congruences.

\begin{lemma}\label{l:varprojimplieseqvar}
Let $\cls{V}$ be a semilinear variety of pointed residuated lattices. If $\cls{V^c}$ has the variable projection property, then $\cls{V}$ is coherent.
\end{lemma}
\begin{proof}
The claim clearly holds if $\cls{V^c}$ is trivial (contains only trivial algebras), so let us assume that this is not the case. Suppose that $\cls{V^c}$ has the variable projection property and consider a finite set $\overline{x},y$ and conjunction of equations $\ensuremath{\varphi}(\overline{x},y)$. By assumption, there exists a quantifier-free formula $\xi(\overline{x})$ such that $\cls{V^c}\models\ensuremath{\varphi}\to\xi$ and for any equation $\varepsilon(\overline{x})$,
\[
\cls{V^c}\models \ensuremath{\varphi}\to \varepsilon \:\Longrightarrow\: \cls{V^c}\models \xi\to\varepsilon.
\]
We may assume without loss of generality that $\xi$ is a conjunction of formulas of the form $\pi \to \ensuremath{\delta}$ where $\pi$ is a (possibly empty) conjunction of equations and $\ensuremath{\delta}$ is a non-empty disjunction of equations. Using some elementary properties of pointed residuated lattices, we may also assume that $\ensuremath{\delta}$ is of the form ${\rm e}\le s_1 \curlyvee \cdots \curlyvee {\rm e} \le s_n$. But also, using the fact that $\cls{V^c}$ consists of linearly ordered pointed residuated lattices,
\[
\cls{V^c}\models ({\rm e}\le s_1 \curlyvee \cdots \curlyvee {\rm e} \le s_n) \leftrightarrow ({\rm e} \le s_1\vee\cdots\vee s_n).
\]
Hence we may further assume that $\xi$ is a conjunction of quasiequations. But then, since $\cls{V}$ and $\cls{V^c}$ satisfy the same quasiequations, $\cls{V}$ also has the variable projection property and, by Proposition~\ref{p:coherence-eq-conseq}, is coherent.
\end{proof}

\begin{proposition}\label{p:failurelinearlyordered}
Let $\cls{V}$ be a Hamiltonian semilinear variety of pointed residuated lattices that is closed under canonical extensions. If the theory of $\cls{V^c}$ has a model completion, then $\cls{V}$ has equationally definable principal congruences.
\end{proposition}
\begin{proof}
Suppose that the theory of $\cls{V^c}$ has a model completion. By Proposition~\ref{p:almost-coh-nec}, the class $\cls{V^c}$ has the variable projection property. Hence, by Lemma~\ref{l:varprojimplieseqvar}, the variety $\cls{V}$ is coherent and, by Proposition~\ref{p:coherence-edpc}, has equationally definable principal congruences.
\end{proof}

\begin{example}
Consider the class $\cls{CRL^c}$ of linearly ordered commutative pointed residuated lattices. The variety generated by $\cls{CRL^c}$ is closed under canonical extensions (cf.~\cite[Chapter~6]{GJKO07}) and does not have equationally definable principal congruences. So, by Proposition~\ref{p:failurelinearlyordered}, the theory of $\cls{CRL^c}$ does not have a model completion.
\end{example}

Note that the Hamiltonian semilinear varieties $\cls{LA}$ and $\cls{MV}$ are coherent and do not have equationally definable principal congruences, but are not closed under canonical extensions. Moreover, as we have already seen, the theories of $\cls{LA^c}$ and $\cls{MV^c}$ have a model completion, but this is not the case for  $\cls{LA}$ and $\cls{MV}$.

\section{Extending the language}\label{s:extension}

Let $\mathcal{L}$ be the language of pointed residuated lattices and let $\mathcal{L}_\rhd$ be $\mathcal{L}$ extended with an additional binary operation symbol $\rhd$. In this section, we show how to associate with any semilinear variety $\cls{V}$ of pointed residuated lattices, a variety $\cls{V_\rhd}$ of $\mathcal{L}_\rhd$-algebras that has equationally definable principal congruences and satisfies the same universal $\mathcal{L}$-sentences as $\cls{V}$. We then show that if $\cls{V}$ satisfies a certain syntactic property,  the theory of $\cls{V_\rhd}$ has a model completion. In particular, this is the case for the varieties of lattice-ordered abelian groups and MV-algebras.

Given any semilinear variety $\cls{V}$ of pointed residuated lattices, let $\cls{V^c_\rhd}$ denote the class of linearly ordered members of $\cls{V}$ expanded with a binary operation $\rhd$ defined by
\[
x \rhd y \coloneqq
\begin{cases}
y & \text{if }{\rm e} \le x\\
{\rm e} & \text{otherwise.}
\end{cases}
\]
That is, $\cls{V^c_\rhd}$ is the positive universal class consisting of $\mathcal{L}_\rhd$-algebras that satisfy the equational theory of $\cls{V}$ and the universal sentences
\[
\forall x,y \: (x\leq y \curlyvee \, y\leq x)
\enspace\text{and}\enspace
\forall x,y \: [({\rm e}\leq x \, \to \, x \rhd y\approx y) \mathbin{\&} ({\rm e}\not\leq x \, \to \, x \rhd y\approx {\rm e}) ].
\]
Let $\cls{V_\rhd}$ be the variety generated by $\cls{V^c_\rhd}$. Since $\cls{V^c_\rhd}$ is a positive universal class, it follows from J\'{o}nsson's Lemma~\cite{Jon67} that $\cls{V_\rhd}=\cop{ISP}(\cls{V^c_\rhd})$. Moreover, we obtain the following conservative extension result.

\begin{proposition}\label{p:vvt}
Let $\cls{V}$ be any semilinear variety of pointed residuated lattices. Then for any quantifier-free $\mathcal{L}$-formula $\chi$,
\[
\cls{V_\rhd} \models \chi\iff \cls{V} \models \chi.
\]
\end{proposition}
\begin{proof}
Since $\cls{V}$ and $\cls{V_\rhd}$ are both varieties, they satisfy the disjunction property (see Section~\ref{s:algebraic-properties}), and it therefore suffices to establish the equivalence for the case where $\chi$ is an $\mathcal{L}$-quasiequation. Suppose first that $\cls{V_\rhd} \not\models \chi$. Since the $\mathcal{L}$-reduct of any member of $\cls{V_\rhd}$ belongs to $\cls{V}$, also $\cls{V} \not\models \chi$. Now suppose that $\cls{V}\not\models \chi$. Since $\cls{V}$ is semilinear, $\cls{V}=\cop{ISP}(\cls{V^c})$, and hence $\cls{V^c}\not\models \chi$. But every member of $\cls{V^c}$ is the $\mathcal{L}$-reduct of a member of $\cls{V_\rhd}$, and therefore also $\cls{V_\rhd} \not\models \chi$.
\end{proof}

For convenience of notation, let us define for any class $\cls{K}$ of algebras with a pointed residuated lattice reduct and a finite set of $\mathcal{L}$-terms or $\mathcal{L}_\rhd$-terms $\Gamma \cup \{t\}$,
\[
\Gamma \mdl{\cls{K}} t \:\: :\Longleftrightarrow\: \: \cls{K}\models \bigAND\{{\rm e} \le s \mid s \in \Gamma\} \to {\rm e} \le t.
\]
It follows easily that for any conjunction of equations $\pi$ and equation $u\approx v$,
\[
\cls{K}\models\pi\to u\approx v \iff \{s\equiv t \mid s\approx t \text{ is an equation of } \pi\} \mdl{\cls{K}} u\equiv v.
\]
We now use this notation to describe a deduction theorem for $\cls{V_\rhd}$.

\begin{proposition}\label{p:EDPCt}
Let $\cls{V}$ be any semilinear variety of pointed residuated lattices. Then for any finite set $\overline{x}$ and finite $\Gamma \cup \{s,t\}\subseteq\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$,
\[
\Gamma\cup\{s\} \mdl{\cls{V_\rhd}} t \iff \Gamma \mdl{\cls{V_\rhd}} s \rhd t.
\]
\end{proposition}
\begin{proof}
Using the fact that $\cls{V_\rhd}=\cop{ISP}(\cls{V^c_\rhd})$, it suffices to prove that for any finite set $\overline{x}$ and finite $\Gamma \cup \{s,t\}\subseteq\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$,
\[
\Gamma\cup\{s\} \mdl{\cls{V^c_\rhd}} t \iff \Gamma \mdl{\cls{V^c_\rhd}} s \rhd t.
\]
Suppose first that $\Gamma\cup\{s\} \mdl{\cls{V^c_\rhd}} t$ and consider any $\m{A}\in\cls{V^c_\rhd}$ and assignment $f\colon\overline{x}\to A$ satisfying ${\rm e}\le \tilde{f}(u)$ for all $u\in\Gamma$. If $\tilde{f}(s)<{\rm e}$, then ${\rm e} =\tilde{f}(s)\rhd \tilde{f}(t) = \tilde{f}(s\rhd t)$; otherwise ${\rm e}\le \tilde{f}(s)$ and, by assumption, ${\rm e}\le \tilde{f}(t) = \tilde{f}(s)\rhd \tilde{f}(t) = \tilde{f}(s\rhd t)$. Hence $\Gamma \mdl{\cls{V^c_\rhd}} s \rhd t$.

Suppose now that $\Gamma \mdl{\cls{V^c_\rhd}} s \rhd t$ and consider any $\m{A}\in\cls{V^c_\rhd}$ and assignment $f\colon\overline{x}\to A$ satisfying ${\rm e}\le\tilde{f}(s)$ and ${\rm e}\le \tilde{f}(u)$ for all $u\in\Gamma$. Then, by assumption, ${\rm e}\le \tilde{f}(s\rhd t)= \tilde{f}(s)\rhd \tilde{f}(t) = \tilde{f}(t)$. Hence $\Gamma\cup\{s\} \mdl{\cls{V^c_\rhd}} t$.
\end{proof}

The next result is then a direct consequence of Proposition~\ref{p:EDPC-reform}.

\begin{corollary}\label{c:EDPCt}
Let $\cls{V}$ be any semilinear variety of pointed residuated lattices. Then $\cls{V_\rhd}$ has equationally definable principal congruences.
\end{corollary}

We also obtain a uniform method for transforming a disjunct in the conclusion of a consequence into a premise. For a finite set $\overline{x} = \{x_1,\dots,x_n\}$ and $s\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$, let
\[
\nabla s \coloneqq s \rhd (({\rm 0}\equiv{\rm e})\wedge\!\bigwedge_{1 \le j \le n} (x_j\equiv{\rm e})).
\]

\begin{lemma}\label{l:reverse}
Let $\cls{V}$ be any semilinear variety of pointed residuated lattices. Then for any finite set $\overline{x}$ and finite $\Gamma \cup \{s,t\}\subseteq\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$,
\[
\Gamma \mdl{\cls{V_\rhd}} s\vee t \iff \Gamma\cup\{\nabla s\} \mdl{\cls{V_\rhd}} t.
\]
\end{lemma}
\begin{proof}
Using the fact that $\cls{V_\rhd}=\cop{ISP}(\cls{V^c_\rhd})$, it suffices to prove that for any finite set $\overline{x} = \{x_1,\dots,x_n\}$ and finite set $\Gamma \cup \{s,t\}\subseteq\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$,
\[
\Gamma \mdl{\cls{V^c_\rhd}} s\vee t \iff \Gamma\cup\{\nabla s\} \mdl{\cls{V^c_\rhd}} t.
\]
Suppose first that $\Gamma \mdl{\cls{V^c_\rhd}} s\vee t$ and consider any $\m{A}\in\cls{V^c_\rhd}$ and assignment $f\colon\overline{x}\to A$ such that ${\rm e}\le \tilde{f}(\nabla s)$ and ${\rm e}\le \tilde{f}(u)$ for all $u\in\Gamma$. Then, by assumption, ${\rm e} \le \tilde{f}(s\vee t)$. If ${\rm e}\le\tilde{f}(s)$, then ${\rm e}\le\tilde{f}(\nabla s)=\tilde{f}(({\rm 0}\equiv{\rm e})\wedge\bigwedge_{1 \le j \le n} (x_j\equiv {\rm e}))$, yielding ${\rm 0} =\tilde{f}(x_1)=\cdots = \tilde{f}(x_n)={\rm e}$ and, inductively, $\tilde{f}(t)={\rm e}$. Otherwise, ${\rm e} \le \tilde{f}(t)$.  Hence $\Gamma\cup\{\nabla s\} \mdl{\cls{V^c_\rhd}} t$.

Suppose next that $\Gamma\cup\{\nabla s\} \mdl{\cls{V^c_\rhd}} t$ and  consider any $\m{A}\in\cls{V^c_\rhd}$ and assignment $f\colon\overline{x}\to A$ such that ${\rm e}\le \tilde{f}(u)$ for all $u\in\Gamma$. If ${\rm e} \le \tilde{f}(s)$, then ${\rm e}\le \tilde{f}(s\vee t)$. Otherwise, $\tilde{f}(\nabla s)={\rm e}$ and, by assumption, ${\rm e}\le \tilde{f}(t)$, yielding ${\rm e}\le \tilde{f}(s\vee t)$. Hence  $\Gamma \mdl{\cls{V^c_\rhd}} s\vee t$.
\end{proof}

The next lemma provides a uniform method for eliminating occurrences of $\rhd$ from $\mathcal{L}_\rhd$-quasiequations while preserving validity in $\cls{V_\rhd}$. To avoid multiple case distinctions, we introduce a new symbol $\Lambda$, fixing $s\vee\Lambda\coloneqq s$, $\Lambda\vee s\coloneqq s$, $\nabla\Lambda\coloneqq{\rm e}$ for any $\mathcal{L}_\rhd$-term $s$.

\begin{lemma}\label{l:removingdeltageneralt}
Let $\cls{V}$ be any semilinear variety of pointed residuated lattices. For any finite set $\overline{x}$, $s\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$, and $t\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})\cup\{\Lambda\}$, there exist a finite non-empty set $I$ and $s'_i\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$, $t'_i\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})\cup\{\Lambda\}$ for each $i\in I$ such that for any $u,v \in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x},\overline{y})$,
\[
\{u \wedge s\}  \mdl{\cls{V_\rhd}} t \vee v \iff \forall i\in I\colon\{u \wedge s'_i\} \mdl{\cls{V_\rhd}} t'_i \vee v.
\]
\end{lemma}
\begin{proof}
Let $s'[t']$ denote the result of replacing some distinguished occurrence of a variable in a term $s'$ by a term $t'$. For $s = s'[s_1\rhd s_2]$ and any $u,v \in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x},\overline{y})$,
\[
\{u \wedge s\}  \mdl{\cls{V_\rhd}} t \vee v \iff \{u \wedge s'[s_2] \wedge s_1\}  \mdl{\cls{V_\rhd}}  t \vee v  \:\text{ and }\: \{u \wedge s'[{\rm e}]\} \mdl{\cls{V_\rhd}}  t \vee s_1 \vee v.
\]
Similarly, for $t = t'[t_1\rhd t_2]$  and any $u,v \in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x},\overline{y})$,
\[
\{u \wedge s\} \mdl{\cls{V_\rhd}} t \vee v \iff \{u \wedge s \wedge t_1\}  \mdl{\cls{V_\rhd}}  t'[t_2] \vee v \:\text{ and }\:\{u \wedge s\} \mdl{\cls{V_\rhd}}  t'[{\rm e}] \vee t_1 \vee v.
\]
Iterating these steps yields the required finite set $I$ and $s'_i,t'_i\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$ for each $i\in I$.
\end{proof}

We now provide sufficient conditions for a semilinear variety of pointed residuated lattices $\cls{V}$ to ensure that the theory of $\cls{V_\rhd}$ has a model completion.

\begin{theorem}\label{t:two-sided-mc}
Let $\cls{V}$ be any semilinear variety of pointed residuated lattices such that for any finite set $\overline{x},y$ and $s(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},y)$, $t(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},y)\cup\{\Lambda\}$, there exist a finite non-empty set $K$ and $s'_k(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$, $t'_k(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})\cup\{\Lambda\}$ for each $k\in K$ satisfying for any $u(\overline{x},\overline{z}),v(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},\overline{z})$,
\[
\{u(\overline{x},\overline{z})\wedge s(\overline{x},y)\} \mdl{\cls{V}} t(\overline{x},y)\vee v(\overline{x},\overline{z}) \iff \forall k\in K\colon\{u(\overline{x},\overline{z})\wedge s'_k(\overline{x})\} \mdl{\cls{V}} t'_k(\overline{x})\vee v(\overline{x},\overline{z}).
\]
Then the theory of $\cls{V_\rhd}$ has a model completion.
\end{theorem}
\begin{proof}
From Corollary~\ref{c:EDPCt}, we know that $\cls{V_\rhd}$ has equationally definable principal congruences.  Hence, to conclude using Proposition~\ref{p:suffconditionsedpc} that the theory of $\cls{V_\rhd}$ has a model completion, it remains to prove that $\cls{V_\rhd}$ is coherent and has the amalgamation property and equational variable restriction property.

For coherence, it suffices to show that for any finite set $\overline{x},y$ and $s(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x},y)$, there exists an $s^\star(\overline{x})\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$ such that for any $v(\overline{x}) \in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$,
\[
\{s(\overline{x},y)\} \mdl{\cls{V_\rhd}} v(\overline{x}) \iff \{s^\star(\overline{x})\} \mdl{\cls{V_\rhd}} v(\overline{x}).
\]
By Lemma~\ref{l:removingdeltageneralt} (with $t=\Lambda$), there exist a finite non-empty set $I$ and $s'_i(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},y)$, $t'_i(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},y)\cup\{\Lambda\}$ ($i\in I$) such that for any $v(\overline{x}) \in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$,
\begin{align}\label{equivs_for_alpha_and_beta}
\{s(\overline{x},y)\} \mdl{\cls{V_\rhd}} v(\overline{x}) & \iff \forall i\in I\colon\{s'_i(\overline{x},y)\}  \mdl{\cls{V_\rhd}} t'_i(\overline{x},y)\vee v(\overline{x}).
\end{align}
By assumption, there exist for each $i\in I$, a finite non-empty set $K_i$ and $s''_{i,k}(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$, $t''_{i,k}(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})\cup\{\Lambda\}$ ($k\in K_i$) satisfying for any $u'(\overline{x}),v'(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$,
\begin{align}\label{interpolants}
\begin{split}
 \{u'(\overline{x})\wedge s'_i(\overline{x},y)\} & \mdl{\cls{V}} t'_i(\overline{x},y)\vee v'(\overline{x})\\
 & \iff \forall k\in K_i\colon \{u'(\overline{x})\wedge s''_{i,k}(\overline{x})\} \mdl{\cls{V}} t''_{i,k}(\overline{x})\vee v'(\overline{x}).
 \end{split}
\end{align}
We define now
\[
s^\star(\overline{x})\coloneqq \bigvee_{i\in I}\bigvee_{k\in K_i}\left(s''_{i,k}(\overline{x})  \wedge  \nabla t''_{i,k}(\overline{x})\right).
\]
Consider any $v(\overline{x})\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$. By Lemma~\ref{l:removingdeltageneralt} (with $s={\rm e}$), there exist a finite non-empty set $J$ and $u'_j(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$, $v'_j(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})\cup\{\Lambda\}$ ($j\in J$) such that for any $s'(\overline{x},y),t'(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x},y)$,
\[
\{s'(\overline{x},y)\}  \mdl{\cls{V_\rhd}} t'(\overline{x},y)\vee v(\overline{x}) \iff \forall j\in J\colon\{u'_j(\overline{x})\wedge s'(\overline{x},y)\} \mdl{\cls{V_\rhd}}t'(\overline{x},y)\vee v'_j(\overline{x}).
\]
In particular, for each $i \in I$ and $k\in K_i$,
\begin{align}
\label{equiv_one}
\{s'_i(\overline{x},y)\}  \mdl{\cls{V_\rhd}} t'_i(\overline{x},y)\vee v(\overline{x})  & \iff  \forall j\in J\colon\{u'_j(\overline{x})\wedge s'_i(\overline{x},y)\}  \mdl{\cls{V_\rhd}} t'_i(\overline{x},y)\vee v'_j(\overline{x})\\
\label{equiv_two}
\{s''_{i,k}(\overline{x})\}  \mdl{\cls{V_\rhd}} t''_{i,k}(\overline{x})\vee v(\overline{x}) & \iff  \forall j\in J\colon\{u'_j(\overline{x})\wedge s''_{i,k}(\overline{x})\}  \mdl{\cls{V_\rhd}} t''_{i,k}(\overline{x})\vee v'_j(\overline{x}).
\end{align}
Putting these equivalences together, it follows that
\begin{align*}
\{s(\overline{x},y)\} & \mdl{\cls{V_\rhd}} v(\overline{x})\\
& \iff \forall i\in I\colon\{s'_i(\overline{x},y)\}  \mdl{\cls{V_\rhd}} t'_i(\overline{x},y) \vee v(\overline{x})
& \text{by~\eqref{equivs_for_alpha_and_beta}}\\
& \iff \forall i\in I,j\in J\colon\{u'_j(\overline{x})\wedge s'_i(\overline{x},y)\}  \mdl{\cls{V_\rhd}} t'_i(\overline{x},y)\vee v'_j(\overline{x})
& \text{by~\eqref{equiv_one}}\\
& \iff \forall i\in I,j\in J\colon\{u'_j(\overline{x})\wedge s'_i(\overline{x},y)\}  \mdl{\cls{V}} t'_i(\overline{x},y)\vee v'_j(\overline{x})
& \text{Prop.~\ref{p:vvt}}\\
& \iff \forall i\in I,j\in J,k\in K_i\colon\{u'_j(\overline{x})\wedge s''_{i,k}(\overline{x})\} \mdl{\cls{V}} t''_{i,k}(\overline{x})\vee v'_j(\overline{x})
& \text{by~\eqref{interpolants}}\\
& \iff \forall i\in I,j\in J,k\in K_i\colon\{u'_j(\overline{x})\wedge s''_{i,k}(\overline{x})\} \mdl{\cls{V_\rhd}} t''_{i,k}(\overline{x})\vee v'_j(\overline{x})
& \text{Prop.~\ref{p:vvt}}\\
& \iff \forall i\in I,k\in K_i\colon\{s''_{i,k}(\overline{x})\} \mdl{\cls{V_\rhd}} t''_{i,k}(\overline{x})\vee v(\overline{x})
& \text{by~\eqref{equiv_two}}\\
& \iff \forall i\in I,k\in K_i\colon\{s''_{i,k}(\overline{x})\wedge \nabla t''_{i,k}(\overline{x})\} \mdl{\cls{V_\rhd}}  v(\overline{x})
& \text{Lem.~\ref{l:reverse}}\\
& \iff \{s^\star(\overline{x})\} \mdl{\cls{V_\rhd}} v(\overline{x}).
\end{align*}
For the amalgamation property and equational variable restriction property, it suffices by Corollary~\ref{c:amalg+leftvar} to show that for any finite set $\overline{x},y$ and $t(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x},y)$, either $\{w(\overline{x})\}\nmdl{\cls{V_\rhd}} t(\overline{x},y)$ for all $w(\overline{x})\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$ (taking care of the case in Corollary~\ref{c:amalg+leftvar} where $\pi(\overline{x})$ is $\bot$) or there exists a $t^\star(\overline{x})\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$ such that for any $u(\overline{x},\overline{z}) \in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x},\overline{z})$,
\[
\{u(\overline{x},\overline{z})\} \mdl{\cls{V_\rhd}} t(\overline{x},y) \iff \{u(\overline{x},\overline{z})\} \mdl{\cls{V_\rhd}} t^\star(\overline{x}).
\]
Suppose then that $\{w(\overline{x})\} \mdl{\cls{V_\rhd}} t(\overline{x},y)$ for some $w(\overline{x})\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x})$. By iteratively replacing $w'[w_1\rhd w_2]$ with $w'[w_2]\wedge w_1$, we may assume without loss of generality that  $w(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$. Next, by Lemma~\ref{l:removingdeltageneralt} (with $s={\rm e}$), there exist a finite  non-empty set $I$ and $s'_i(\overline{x},y),t'_i(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},y)$ ($i\in I$) such that for any $u(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x},\overline{z})$,
\begin{align}
\{u(\overline{x},\overline{z})\}  \mdl{\cls{V_\rhd}} t(\overline{x},y) & \iff \forall i\in I\colon\{u(\overline{x},\overline{z})\wedge s'_i(\overline{x},y)\} \mdl{\cls{V_\rhd}} t'_i(\overline{x},y). \label{equivs_for_alpha_and_betat}
\end{align}
Let us temporarily fix $i\in I$. By assumption, there exist a finite non-empty set $K_i$ and $s''_{i,k}(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$, $t''_{i,k}(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})\cup\{\Lambda\}$ ($k\in K_i$) such that for any $u'(\overline{x},\overline{z}),v'(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},\overline{z})$,
\begin{align}\label{interpolantst}
\begin{split}
\{u'(\overline{x},\overline{z})\wedge s'_i(\overline{x},y)\} & \mdl{\cls{V}} t'_i(\overline{x},y)\vee v'(\overline{x},\overline{z})\\
 & \iff \forall k\in K_i\colon \{u'(\overline{x},\overline{z})\wedge s''_{i,k}(\overline{x})\} \mdl{\cls{V}} t''_{i,k}(\overline{x})\vee v'(\overline{x},\overline{z}).
 \end{split}
\end{align}
Since $\{w(\overline{x})\} \mdl{\cls{V_\rhd}} t(\overline{x},y)$, by~\eqref{equivs_for_alpha_and_betat} and Proposition~\ref{p:vvt}, also $\{w(\overline{x})\wedge s'_i(\overline{x},y)\} \mdl{\cls{V}} t'_i(\overline{x},y)$. Let $t'''_{i,k}(\overline{x}) \coloneqq  t''_{i,k}(\overline{x}) \vee w(\overline{x})$  for each $k\in K_i$. Then for any $u'(\overline{x},\overline{z}),v'(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},\overline{z})$,
\begin{align}\label{interpolantstnew}
\begin{split}
\{u'(\overline{x},\overline{z})\wedge s'_i(\overline{x},y)\} & \mdl{\cls{V_\rhd}} t'_i(\overline{x},y)\vee v'(\overline{x},\overline{z})\\
 & \iff \forall k\in K_i\colon\{u'(\overline{x},\overline{z})\wedge s''_{i,k}(\overline{x})\} \mdl{\cls{V_\rhd}} t'''_{i,k}(\overline{x})\vee v'(\overline{x},\overline{z}).
 \end{split}
\end{align}
The left-to-right direction of this equivalence is immediate. For the converse direction,
\begin{align*}
& \forall k\in K_i\colon\{u'(\overline{x},\overline{z})\wedge s''_{i,k}(\overline{x})\} \mdl{\cls{V_\rhd}} t'''_{i,k}(\overline{x})\vee v'(\overline{x},\overline{z})\\
&  \Longrightarrow  \forall k\in K_i\colon\{u'(\overline{x},\overline{z})\wedge s''_{i,k}(\overline{x})\} \mdl{\cls{V}} t'''_{i,k}(\overline{x})\vee v'(\overline{x},\overline{z}) & \text{Prop.~\ref{p:vvt}}\\
& \Longrightarrow \{u'(\overline{x},\overline{z})\wedge s'_i(\overline{x},y)\}\mdl{\cls{V}} t'_i(\overline{x},y)\vee w(\overline{x}) \vee v'(\overline{x},\overline{z}) & \text{by~\eqref{interpolantst}}\\
& \Longrightarrow \{u'(\overline{x},\overline{z})\wedge s'_i(\overline{x},y)\}\mdl{\cls{V}} t'_i(\overline{x},y)\vee v'(\overline{x},\overline{z}) & \text{since $\{w(\overline{x})\wedge s'_i(\overline{x},y)\} \mdl{\cls{V}} t'_i(\overline{x},y)$}\\
& \Longrightarrow \{u'(\overline{x},\overline{z})\wedge s'_i(\overline{x},y)\}\mdl{\cls{V_\rhd}} t'_i(\overline{x},y)\vee v'(\overline{x},\overline{z})& \text{Prop.~\ref{p:vvt}}.
\end{align*}
We define now
\[
t^\star(\overline{x})\coloneqq \bigwedge_{i\in I}\bigwedge_{k\in K_i} \left(s''_{i,k}(\overline{x}) \rhd t'''_{i,k}(\overline{x})\right).
\]
Consider any $u(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x},\overline{z})$. By Lemma~\ref{l:removingdeltageneralt} (with $t=\Lambda$), there exist a finite non-empty set $J$ and $u'_j(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},\overline{z})$, $v'_j(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},\overline{z})\cup\{\Lambda\}$ ($j\in J$) such that for any $s'(\overline{x},y),t'(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}_\rhd}(\overline{x},y)$,
\[
\{u(\overline{x},\overline{z})\wedge s'(\overline{x},y)\}  \mdl{\cls{V_\rhd}} t'(\overline{x},y) \iff \forall j\in J\colon\{u'_j(\overline{x},\overline{z})\wedge s'(\overline{x},y)\} \mdl{\cls{V_\rhd}}t'(\overline{x},y)\vee v'_j(\overline{x},\overline{z}).
\]
In particular, for each $i \in I$ and $k\in K_i$,
\begin{align}
\label{equivs_onet}
\begin{split}
\{u(\overline{x},\overline{z}) \wedge s'_i(\overline{x},y)\} & \mdl{\cls{V_\rhd}} t'_i(\overline{x},y)\\
& \iff \forall j\in J\colon\{u'_j(\overline{x},\overline{z}) \wedge s'_i(\overline{x},y)\}  \mdl{\cls{V_\rhd}} t'_i(\overline{x},y)\vee v'_j(\overline{x},\overline{z})
\end{split}
\end{align}
\begin{align}
\label{equivs_twot}
\begin{split}
\{u(\overline{x},\overline{z}) \wedge s''_{i,k}(\overline{x})\} & \mdl{\cls{V_\rhd}} t'''_{i,k}(\overline{x})\\
& \iff \forall j\in J\colon\{u'_j(\overline{x},\overline{z}) \wedge s''_{i,k}(\overline{x})\}  \mdl{\cls{V_\rhd}} t'''_{i,k}(\overline{x})\vee v'_j(\overline{x},\overline{z}).
\end{split}
\end{align}
Putting these equivalences together, it follows that
\begin{align*}
\{u(\overline{x},\overline{z})\} & \mdl{\cls{V_\rhd}} t(\overline{x},y)\\
& \iff \forall i\in I\colon\{u(\overline{x},\overline{z}) \wedge s'_i(\overline{x},y)\}  \mdl{\cls{V_\rhd}} t'_i(\overline{x},y)
& \text{by~\eqref{equivs_for_alpha_and_betat}}\\
& \iff \forall i\in I,j\in J\colon\{u'_j(\overline{x},\overline{z}) \wedge s'_i(\overline{x},y)\}  \mdl{\cls{V_\rhd}} t'_i(\overline{x},y)\vee v'_j(\overline{x},\overline{z})
& \text{by~\eqref{equivs_onet}}\\
& \iff \forall i\in I,j\in J,k\in K_i\colon\{u'_j(\overline{x},\overline{z})  \wedge s''_{i,k}(\overline{x})\}  \mdl{\cls{V_\rhd}} t'''_{i,k}(\overline{x})\vee v'_j(\overline{x},\overline{z})
& \text{by~\eqref{interpolantstnew}}\\
& \iff \forall i\in I,k\in K_i\colon\{u(\overline{x},\overline{z}) \wedge s''_{i,k}(\overline{x})\} \mdl{\cls{V_\rhd}} t'''_{i,k}(\overline{x})
& \text{by~\eqref{equivs_twot}}\\
& \iff \forall i\in I,k\in K_i\colon\{u(\overline{x},\overline{z})\} \mdl{\cls{V_\rhd}}  s''_{i,k}(\overline{x}) \rhd t'''_{i,k}(\overline{x})
& \text{Prop.~\ref{p:EDPCt}}\\
& \iff \{u(\overline{x},\overline{z})\}  \mdl{\cls{V_\rhd}} t^\star(\overline{x}). & \qed\proofend
\end{align*}
\end{proof}

In particular, the conditions of Theorem~\ref{t:two-sided-mc} are satisfied when $\cls{V}$ is the variety $\cls{LA}$ of lattice-ordered abelian groups.

\begin{theorem}\label{t:laext}
The theory of $\cls{LA_\rhd}$ has a model completion.
\end{theorem}\begin{proof}
Recall that $\cls{LA}$ is generated as a quasivariety by the lattice-ordered abelian group $\m{R}=\langle\mathbb{R},\min,\max,+,-,0\rangle$ (see, e.g.,~\cite{AF88}). Hence, to show that $\cls{LA_\rhd}$ has a model completion, it suffices to check the condition of Theorem~\ref{t:two-sided-mc} with $\mdl{\cls{V}}$ replaced by $\mdl{\m{R}}$.

We proceed in two stages. Suppose first that $\overline{x},y$ is a finite set, $s(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},y)$ is a meet of group terms, and $t(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},y)\cup\{\Lambda\}$ is $\Lambda$ or a join of group terms. We prove that there exist $s'(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$, $t'(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})\cup\{\Lambda\}$ satisfying for any $u(\overline{x},\overline{z}),v(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},\overline{z})$,
\[
\{u(\overline{x},\overline{z})\wedge s(\overline{x},y)\} \mdl{\m{R}} t(\overline{x},y)\vee v(\overline{x},\overline{z})\iff \{u(\overline{x},\overline{z})\wedge s'(\overline{x})\} \mdl{\m{R}} t'(\overline{x})\vee v(\overline{x},\overline{z}).
\]
It is easily checked in $\m{R}$ that for any $\mathcal{L}$-terms $u,v,w$ and $k\in\mathbb{N}^{>0}$,
\[
\{u \wedge v\} \mdl{\m{R}} w \iff \{u \wedge kv\} \mdl{\m{R}} w
\enspace\text{and}\enspace
\{u\} \mdl{\m{R}} v \vee w \iff \{u\} \mdl{\m{R}} v \vee kw.
\]
Also, $\m{R}\models x + (y \wedge z) \approx (x+y)\wedge (x+z)$ and  $\m{R}\models x + (y \vee z) \approx (x+y)\vee (x+z)$. Hence, reasoning in $\m{R}$, we may assume that there exist a $k\in\mathbb{N}^{>0}$ and $s_0(\overline{x}),s_1(\overline{x}),s_2(\overline{x}),t_1(\overline{x}),t_2(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$, $t_0(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})\cup\{\Lambda\}$ such that $s(\overline{x},y)$ is the meet of $s_0(\overline{x})$ and some members (possibly none) of $\{s_1(\overline{x}) +ky, s_2(\overline{x})-ky\}$, and $t(\overline{x},y)$ is the join of $t_0(\overline{x})$ and some members (possibly none) of $\{t_1(\overline{x}) + ky,t_2(\overline{x})-ky\}$. We construct $s'(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$, $t'(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})\cup\{\Lambda\}$ as follows. Let  $s'(\overline{x})\coloneqq  s_0(\overline{x}) \wedge (s_1(\overline{x})+s_2(\overline{x}))$ if $s_1(\overline{x}) +ky$ and $s_2(\overline{x})-ky$ occur in $s(\overline{x},y)$; otherwise $s'(\overline{x})\coloneqq s_0(\overline{x})$. The term $t'(\overline{x})$ is the join of $t_0(\overline{x})$ and (i) $t_1(\overline{x})+t_2(\overline{x})$ if $t_1(\overline{x}) + ky$ and $t_2(\overline{x})-ky$ occur in $t(\overline{x},y)$; (ii) $t_1(\overline{x})-s_1(\overline{x})$ if $s_1(\overline{x}) +ky$ occurs in $s(\overline{x},y)$ and $t_1(\overline{x}) + ky$ occurs in $t(\overline{x},y)$; (iii) $t_2(\overline{x})-s_2(\overline{x})$ if $s_2(\overline{x})-ky$ occurs in $s(\overline{x},y)$ and $t_2(\overline{x}) - ky$ occurs in $t(\overline{x},y)$.

We check the case where $s(\overline{x},y)= (s_1(\overline{x}) +ky)\wedge (s_2(\overline{x})-ky)$, $t(\overline{x},y) = (t_1(\overline{x}) + ky)\vee (t_2(\overline{x})-ky)$, $s'(\overline{x}) = s_1(\overline{x})+s_2(\overline{x})$, and $t'(\overline{x}) = (t_1(\overline{x})+t_2(\overline{x}))\vee(t_1(\overline{x})-s_1(\overline{x}))\vee(t_2(\overline{x})-s_2(\overline{x}))$, other cases being very similar. Let $u(\overline{x},\overline{z}),v(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},\overline{z})$ and suppose first that $\{u(\overline{x},\overline{z})\wedge s'(\overline{x})\} \mdl{\m{R}} t'(\overline{x})\vee v(\overline{x},\overline{z})$. Since $\{s(\overline{x},y)\}\mdl{\m{R}}s'(\overline{x})$ and $\{s(\overline{x})\wedge t'(\overline{x})\}\mdl{\m{R}}t(\overline{x},y)$, it follows that $\{u(\overline{x},\overline{z})\wedge s(\overline{x},y)\} \mdl{\m{R}} t(\overline{x},y)\vee v(\overline{x},\overline{z})$. Now suppose that $\{u(\overline{x},\overline{z})\wedge s'(\overline{x})\}\nmdl{\m{R}}t'(\overline{x})\vee v(\overline{x},\overline{z})$; that is, some assignment $f\colon\overline{x},\overline{z}\to \mathbb{R}$ satisfies $0\le \tilde{f}(u(\overline{x},\overline{z}))$,  $0\le \tilde{f}(s_1(\overline{x}))+ \tilde{f}(s_2(\overline{x}))$, $\tilde{f}(t_1(\overline{x}))+\tilde{f}(t_2(\overline{x}))<0$,  $\tilde{f}(t_1(\overline{x}))<\tilde{f}(s_1(\overline{x}))$, $\tilde{f}(t_2(\overline{x}))<\tilde{f}(s_2(\overline{x}))$, and $\tilde{f}(v(\overline{x},\overline{z}))<0$. We extend $f$ to an assignment $g\colon\overline{x},y,\overline{z}\to \mathbb{R}$ by defining
\[
g(y)\coloneqq\frac{\min{(\tilde{f}(s_2),-\tilde{f}(t_1))}+\max{(-\tilde{f}(s_1),\tilde{f}(t_2))}}{2k}.
\]
We obtain $0\le\tilde{g}(u(\overline{x},\overline{z}))$, $0\le \tilde{g}(s_1(\overline{x}))+\tilde{g}(ky)$, $\tilde{g}(ky)\le \tilde{g}(s_2(\overline{x}))$, $\tilde{g}(t_1(\overline{x})) + \tilde{g}(ky) <0$, $\tilde{g}(t_2(\overline{x}))<\tilde{g}(ky)$, and $\tilde{g}(v(\overline{x},\overline{z}))<0$. So $\{u(\overline{x},\overline{z})\wedge s(\overline{x},y)\}\nmdl{\m{R}}t(\overline{x},y)\vee v(\overline{x},\overline{z})$.

We now prove that for any finite set $\overline{x},y$ and $s(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},y)$, $t(\overline{x},y)\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},y)\cup\{\Lambda\}$, there exist a finite non-empty set $K$ and $s'_k(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$, $t'_k(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})\cup\{\Lambda\}$ ($k\in K$) satisfying for any $u(\overline{x},\overline{z}),v(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},\overline{z})$,
\[
\{u(\overline{x},\overline{z})\wedge s(\overline{x},y)\} \mdl{\m{R}} t(\overline{x},y)\vee v(\overline{x},\overline{z}) \iff \forall k\in K\colon\{u(\overline{x},\overline{z})\wedge s'_k(\overline{x})\} \mdl{\m{R}} t'_k(\overline{x})\vee v(\overline{x},\overline{z}).
\]
By the distributivity properties of $\m{R}$, we may assume that $s(\overline{x},y)$ is $s_1(\overline{x},y)\vee\cdots\vee s_n(\overline{x},y)$, where each $s_i(\overline{x},y)$ is a meet of group terms, and that $t(\overline{x},y)$ is $t_1(\overline{x},y)\wedge\cdots\wedge t_m(\overline{x},y)$, where either each $t_j(\overline{x},y)$ is a join of group terms or $m=1$ and $t_1(\overline{x},y)=\Lambda$. Using the first part of this proof, for each $i\in\{1,\dots,n\}$ and $j\in\{1,\dots,m\}$, there exist $s'_{i,j}(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})$ and $t'_{i,j}(\overline{x})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x})\cup\{\Lambda\}$ satisfying for any $u(\overline{x},\overline{z}),v(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},\overline{z})$,
\[
\{u(\overline{x},\overline{z})\wedge s_i(\overline{x},y)\} \mdl{\m{R}} t_j(\overline{x},y)\vee v(\overline{x},\overline{z})\iff \{u(\overline{x},\overline{z})\wedge s'_{i,j}(\overline{x})\} \mdl{\m{R}} t'_{i,j}(\overline{x})\vee v(\overline{x},\overline{z}).
\]
Hence for any $u(\overline{x},\overline{z}),v(\overline{x},\overline{z})\in\mathrm{Tm}_{\mathcal{L}}(\overline{x},\overline{z})$,
\begin{align*}
\{u(\overline{x},\overline{z})\wedge s(\overline{x},y)\} \mdl{\m{R}} t(\overline{x},y)\vee v(\overline{x},\overline{z}) \iff & \forall i\in\{1,\dots,n\},j\in\{1,\dots,m\}\colon\\
&  \{u(\overline{x},\overline{z})\wedge s'_{i,j}(\overline{x})\} \mdl{\m{R}} t'_{i,j}(\overline{x})\vee v(\overline{x},\overline{z}).& \qed\proofend
\end{align*}
\end{proof}

The variety $\cls{MV_\rhd}$ of MV-algebras extended with $\rhd$ is term-equivalent to the variety $\cls{MV}_{\!\Delta}$ of {\em MV$_\Delta$-algebras} (see, e.g.,~\cite{Haj98,MP01}), generated by linearly ordered MV-algebras extended with an additional unary operator $\Delta$ defined by
\[
\Delta x \coloneqq
\begin{cases}
1 & \text{if }x=1\\
0 & \text{otherwise.}
\end{cases}
\]
For any algebra in $\cls{MV_\rhd}$, we let $\Delta x\coloneqq  (x\rhd 0)\rhd 0$, and for any algebra in $\cls{MV}_{\!\Delta}$, we let $x\rhd y\coloneqq  \lnot\Delta x \oplus y$. The following theorem may therefore be proved along the same lines as Theorem~\ref{t:laext}, using the fact that $\cls{MV}$ is generated as a quasivariety by the algebra $\langle [0,1],\oplus,\lnot,0\rangle$, where $x\oplus y\coloneqq \min{(1,x+y)}$ and $\lnot x\coloneqq1-x$ (see,~e.g.,~\cite{COM99}).

\begin{theorem}
The theory of $\cls{MV}_{\!\Delta}$ has a model completion.
\end{theorem}

A different proof of this last result (obtained by giving an explicit axiomatization) was presented by X.~Caicedo at the conference {\em Residuated Structures: Algebra and Logic} in 2008.  Caicedo also presented a proof (again by giving an explicit axiomatization) at the {\em Latin American Algebra Colloquium} in  2019 that the theory of the class of so-called ``pseudo-complemented'' lattice-ordered abelian groups has a model completion, which seems to bear some relation to our Theorem~\ref{t:laext}.

\subsection*{Acknowledgement}
The authors would like to thank the anonymous referee for their careful reading of the paper and valuable comments.

redpajama_set_name: RedPajamaArXiv