\chapter{Residually Small Varieties}\label{RS_chap}

A variety is {\bf residually large} 
\index{residually large (small)}
if it has
a proper class of subdirectly irreducible
members up to isomorphism, otherwise it is 
{\bf residually small}. 
%\index{residually small}
Our primary goal in this chapter is to prove
that a residually small variety satisfies 
a congruence identity if and only if
it is congruence modular.
(David Hobby and Ralph McKenzie proved
essentially the same result 
for locally finite varieties 
in Chapter~10 of \cite{hobby-mckenzie}.)
\index{Hobby, D.}
\index{McKenzie, R.}
Our result nearly completes the classification
of congruence varieties associated to residually
small varieties.
In Section~\ref{ACD}, we apply the result
to show that almost congruence distributive
varieties cannot have a Taylor term.

\section{Residual Smallness and Congruence Modularity}


\begin{lm}\label{RS_hypotheses_lm}
Let $\vr V$ be a variety that satisfies a nontrivial
congruence identity. If $\m a\in {\vr V}$ has congruences
$\alpha, \beta$ and $\gamma$ that generate a sublattice
isomorphic to $\m n_5$ in $\Con(\m a)$, as depicted in
Figure~\ref{fig40},
\begin{figure}[ht]
\begin{center}
\setlength{\unitlength}{1mm}
\begin{picture}(20,30)
\put(0,15){\circle*{1.2}}
\put(10,0){\circle*{1.2}}
\put(10,30){\circle*{1.2}}
\put(20,10){\circle*{1.2}}
\put(20,20){\circle*{1.2}}

\put(10,0){\line(-2,3){10}}
\put(10,0){\line(1,1){10}}
\put(10,30){\line(-2,-3){10}}
\put(10,30){\line(1,-1){10}}
\put(20,20){\line(0,-1){10}}

\put(-4.5,13){$\beta$}
\put(22,9){$\delta$}
\put(22,19){$\alpha$}
\end{picture}
\end{center}
\caption{ \ }\label{fig40}
\end{figure}
then
\begin{enumerate}
\item[(1)] $\C C(\alpha,\beta;\delta)$ holds, and
\item[(2)] $\C C(\beta, \alpha;\delta)$ fails in the
following strong way: For some $(\beta,\beta;0)$-pair
$(a,b)$ (cf.\ Definition~\ref{triples&pairs})
there is a polynomial $f(x,\wec{y})$ and
tuples $\wec{c}\wrel{\alpha}\wec{d}$ such that 
\[
f(b,\wec{c}) \equiv_{\delta} f(b,\wec{d})\,,
\]
but
\[
f(a,\wec{c}) \not\equiv_{\delta} f(a,\wec{d})\,.
\]
\end{enumerate}
\end{lm}

\begin{proof}
Item (1) follows from 
Theorem~\ref{basic_centrality}~(8), since 
\[\beta\wedge(\alpha\vee(\beta\wedge\delta))\leq\delta\,.\]

For (2), assume instead that 
\[
f(b,\wec{c}) \equiv_{\delta} f(b,\wec{d})
\wrel{\mimplies}
f(a,\wec{c}) \equiv_{\delta} f(a,\wec{d})
\]
holds for every $(\beta,\beta;0)$-pair
$(a,b)$. Then by transitivity 
this implication holds whenever $a\ge_{\beta} b$.
But since $\vr V$ has no algebra with
a rectangular tolerance, 
Theorem~\ref{rect_Malt_cond1}~(1)$\miff$(4)
guarantees that the set of pairs $(a,b)$ satisfying
$a\ge_{\beta} b$ contains $\beta$.
Thus, if this implication holds for every $f$ and every 
choice of tuples $\wec{c}\wrel{\alpha}\wec{d}$
whenever $(a,b)\in\beta$,
then $\C C(\beta,\alpha;\delta)$ holds.
But $\C C(\beta,\alpha;\delta)$ does not hold, as we proved in
Theorem~\ref{taylor_forbidden}~(2).
Therefore $f$, $\wec{c}$ and $\wec{d}$ exist.
\end{proof}

As it happens, the properties described
in conditions (1) and (2) of Lemma~\ref{RS_hypotheses_lm}
are all that are needed to establish
the existence of a proper class of
subdirectly irreducibles in $\vr V$.
(We no longer need the assumption
that $\vr V$ satisfies a nontrivial
congruence identity.)

\begin{thm}\label{kkvm-germ}
Let $\vr V$ be a variety.
Assume that $\m a\in {\vr V}$ has congruences
$\delta < \alpha$ and a tolerance $T$ such that 
\begin{enumerate}
\item[(1)] $\C C(\alpha,T;\delta)$ holds, and
\item[(2)] For some $(T,T;0)$-pair
$(a,b)$ there is a polynomial $f(x,\wec{y})$ and
tuples $\wec{c}\wrel{\alpha}\wec{d}$ such that 
\[
v := f(b,\wec{c}) \equiv_{\delta} f(b,\wec{d}) =: v'\,,
\]
but
\[
u := f(a,\wec{c}) \not\equiv_{\delta} f(a,\wec{d}) =: u'\,.
\]
\end{enumerate}
Then $\vr V$ is residually large.
\end{thm}

\begin{proof}
Both (1) and (2) continue to hold if we factor
by $\delta$, so there is no loss in
generality in assuming that $\delta = 0$.
(Under this assumption $v=v'$.)
We now explain how to construct a subdirectly irreducible 
algebra in $\vr V$ of cardinality $\geq \kappa$
for any infinite cardinal $\kappa$.

Let $\m b$ be the subalgebra of $\m a^{\kappa}$
consisting of those $\kappa$-tuples 
$\wec{a}$ where $(a_i, a_j)\in T$
for all coordinates $i < j < \kappa$.
For any $a\in A$ let $\widehat{a}$
denote the constant $\kappa$-tuple
satisfying $(\widehat{a})_i = a$ for all $i$.
Clearly $\widehat{a}\in B$ for all $a\in A$.
Let $N=\{u,v\}$ and let $N'=\{u',v'\}$. 
Since $(a,b)\in T$ it follows that
$(u,v) = (f(a,\wec{c}),f(b,\wec{c}))\in T$
and $(u',v')\in T$, so 
$N^{\kappa}\cup (N')^{\kappa}\subseteq B$.
For an element~$\wec{z}$ of~$N^\kappa$ denote
by~$\wec{z}'$ the element of~$(N')^\kappa$ obtained
from~$\wec{z}$ by priming the entry in each 
coordinate. Furthermore, let
\[
G = \set{(\wec{z},\wec{z}')\in B^2}%
{$\wec{z}\in N^{\kappa}\setminus\{\widehat{u}\}$}\,,
\]
and let $\psi = \Cg b(G)$.

\begin{clm}
The pair $(\hat{u},\hat{u}')$ is not contained in $\psi$.
\end{clm}

As $u\ne u'$, it is sufficient to prove that $\{\widehat{u}\}$ is
a singleton $\psi$-class. For this we must show that
if $(\wec{z},\wec{z}')\in G$ and $p$
%(x) = g(x,\overline{\wec{e}})$ 
is a unary polynomial of $\m B$, then 
\[
p(\wec{z}) = \widehat{u} \wrel{\miff} p(\wec{z}') = \widehat{u}\,.
\]
Since $\wec{z}\in N^{\kappa}\setminus \{\widehat{u}\}$,
at least one coordinate of $\wec{z}$ is $v$.
If $z_i = v$, then $z'_i = v' = v$, so 
$\wec{z}$ and $\wec{z}'$ agree in the $i$-th
coordinate. This implies that 
$p(\wec{z})$  and $p(\wec{z}')$ agree in
the $i$-th coordinate. 
We now argue that these tuples also agree in the
$j$-th coordinate for every other $j<\kappa$.
There is nothing to prove for those coordinates
where $z_j = v = v' = z'_j$, by the above
argument,
so we consider only those $j$ where
$z_j = u$ and $z'_j = u'$.

The polynomial $p$ of~$\m B$ comes from a term~$g(x,\wec{y})$,
where appropriate parameters from $\m b$ are substituted in place
of~$\wec{y}$ in every coordinate. Denote by~$\wec{r}$
and~$\wec{s}$ the parameters occurring at the~$i$-th and the
$j$-th coordinate, respectively. Then $\wec{r}\wrel{T}\wec{s}$
holds by the definition of~$\m B$. We have to prove that
$g(u,\wec{s})=g(u',\wec{s})$, and we have either
\begin{equation}\label{first}
g(u,\wec{s})=u=g(v,\wec{r})
\end{equation}
(in case $p(\wec{z})=\widehat{u}$), or 
\begin{equation}\label{second}
g(u',\wec{s})=u=g(v',\wec{r})
\end{equation}
(in case $p(\wec{z}')=\widehat{v}$). However 
$C(\alpha,T;0)$ holds and $\wec{c}\wrel{\alpha}\wec{d}$, so 
\[
(g(u,\wec{s}) = )\quad g(f(a,\underline{\wec{c}}),\wec{s})=
g(f(b,\underline{\wec{c}}),\wec{r})\quad ( = g(v,\wec{r}))
\]
is equivalent to
\[
(g(u',\wec{s}) = )\quad g(f(a,\underline{\wec{d}}),\wec{s}) =
g(f(b,\underline{\wec{d}}),\wec{r})\quad ( = g(v',\wec{r}))\,.
\]
Since at least one of (\ref{first}) or (\ref{second}) holds,
this implies that 
$g(u,\wec{s})=g(v,\wec{r})$ and
$g(u',\wec{s})=g(v',\wec{r})$ both hold.
Moreover, $v=v'$ implies that $g(v,\wec{r})=g(v',\wec{r})$,
so in fact
\[
g(u,\wec{s}) = g(v,\wec{r})=g(v',\wec{r})=g(u',\wec{s})\,.
\]
Thus $g(u,\wec{s})=g(u',\wec{s})$ indeed holds, completing
the argument that 
$p(\wec{z}) = \widehat{u} \wrel{\miff} p(\wec{z}') = \widehat{u}$
holds. This proves the claim.

\medskip


Since $(\widehat{u}, \widehat{u}')\notin\psi$
we may extend $\psi$ to a congruence 
$\psi_0\geq \psi$ that is maximal with respect to
$(\widehat{u}, \widehat{u}')\notin\psi_0$.
Then~$\m B/\psi_0$ is a subdirectly
irreducible algebra in $\vr V$. 
We claim that $|B/\psi_0|\geq\kappa$.

In order to prove that $\m b/\psi_0$ is
as large as this, we need only to
exhibit $\kappa$ elements of $\m b$
that are pairwise incongruent modulo $\psi_0$.
We introduce the following
notation for certain elements of $A^{\kappa}$: 
for $i<j<\kappa$, and for arbitrary elements 
$a,b,c\in A$ let $[a,b,c]^{i,j}$ denote the tuple
whose $k$-th coordinate is $a$ for $0\le k<i$, is $b$ for
$i\le k<j$, and is $c$ for $j\le k<\kappa$. 
(Note that $[a,b,c]^{i,j}\in B$ if 
$a, b$ and $c$ are pairwise $T$-related.)
Similarly, if
$\wec{a}, \wec{b}, \wec{c}\in A^n$, then
let $[\wec{a}, \wec{b}, \wec{c}]^{i,j}$
denote the member of $B^n$ whose 
$\ell$-th coordinate is 
$[a_\ell,b_\ell,c_\ell]^{i,j}$ 
for  $1\le \ell\le n$. 
We shall omit the
superscripts ${i,j}$ if we think 
it is clear from the context what they are.

As $(a,b)$ is a $(T,T;0)$-pair, there exists a $T,T$-matrix
\[
\left[
\begin{array}{cc}
f(\wec{p},\wec{r})&f(\wec{p},\wec{s})\\
f(\wec{q},\wec{r})&f(\wec{q},\wec{s})
\end{array}
\right] = 
\left[
\begin{array}{cc}
* & a\\
a & b
\end{array}
\right]\,.
\]

\begin{clm}\label{tuples_are_different}
For each~$0< i < j<\kappa$ the tuples
$[\wec{q},\wec{p},\wec{p}]$ and $[\wec{q},\wec{q},\wec{p}]$
are not $\psi_0$-congruent in every coordinate.
\end{clm}

Suppose that they are. Then in the algebra~$\m B$ we have that
\[
f([\wec{q},\wec{p},\wec{p}],[\wec{r},\wec{s},\wec{s}])
\wrel{\psi_0}
f([\wec{q},\wec{q},\wec{p}],[\wec{r},\wec{s},\wec{s}])\,,
\]
that is,
\[
[a,a,a]\wrel{\psi_0}[a,b,a]\,.
\]
Therefore
\[
[u,u,u]=f([a,a,a],[\wec{c},\wec{c},\wec{c}])
\wrel{\psi_0}
f([a,b,a],[\wec{c},\wec{c},\wec{c}])=[u,v,u]\,,
\]
and
\[
[u',u',u']=f([a,a,a],[\wec{d},\wec{d},\wec{d}])
\wrel{\psi_0}
f([a,b,a],[\wec{d},\wec{d},\wec{d}])=[u',v',u']\,.
\]
But then
\[
\widehat{u} = [u,u,u]
\wrel{\psi_0} [u,v,u]
\wrel{\psi} [u',v',u']
\wrel{\psi_0} [u',u',u'] = \widehat{u}'
\]
By transitivity and the fact that $\psi_0\ge \psi$,
this yields $(\widehat{u},\widehat{u}')\in \psi_0$,
contradicting the choice of~$\psi_0$. So the claim is proved.

\medskip

To finish the proof, let~$m$ be the length of the
tuples~$\wec{p}$ and~$\wec{q}$, and define a mapping
$h\colon \kappa\to (B/\psi_0)^m$ in the following way. Let
$i<k<\kappa$, and
\[
h(i)=[\wec{q},\wec{p},\wec{p}]^{i,k}/\psi_0^m\,.
\]
The value of $h(i)$ does not depend on~$k$ because
the last two blocks of coordinates of the tuple
$[\wec{q},\wec{p},\wec{p}]$ are both $\wec{p}$.
We claim that $h$ is
injective. Indeed, suppose that $i<j<\kappa$. Then
\[
h(i)=[\wec{q},\wec{p},\wec{p}]^{i,j}/\psi_0^m
\]
and
\[
h(j)=[\wec{q},\wec{q},\wec{p}]^{i,j}/\psi_0^m\,,
\]
and these tuples are different by Claim~\ref{tuples_are_different}. 
Therefore $h$
is indeed injective, so $\kappa\le|B/\psi_0|^m = |B/\psi_0|$, 
proving the theorem.
\end{proof}

We obtain the main theorem of this chapter
by combining Lemma~\ref{RS_hypotheses_lm} with
Theorem~\ref{kkvm-germ}.

\begin{thm} \label{RS_congid}
A residually small variety satisfies a congruence
identity if and only if it is congruence modular.
\end{thm}

This theorem generalizes Theorem 10.4 of \cite{hobby-mckenzie}
from locally finite varieties to arbitrary varieties.

\begin{rem}
We describe a three-step plan for classifying
all congruence varieties associated to 
residually small varieties.
\begin{enumerate}
\item[(1)] Prove that if $\vr V$ is residually small 
and satisfies a nontrivial congruence identity, then
$\vr V$ is congruence modular.
\smallskip

\item[(2)] Prove that if $\vr V$ is residually small 
and congruence modular, then $\vr V$
is congruence distributive or $\CON(\vr V)=\CON(\vr M)$
for some variety $\vr M$ of modules.
\smallskip

\item[(3)] Classify the congruence varieties
of varieties of modules.
\end{enumerate}
Theorem~\ref{RS_congid} accomplishes Step~(1).
Step~(3) was accomplished by 
G\'{a}bor Cz\'{e}dli\index{Cz\'{e}dli, G.}
and
George Hutchinson\index{Hutchinson, G.} 
in \cite{hutchinson-czedli}.
Partial results on Step~(2) were obtained by 
Alan Day\index{Day, A.} 
and Emil~W.~Kiss in \cite{day-kiss}.
Namely, Day and Kiss accomplished Step~(2)
under the further assumption that $\vr V$
is either locally finite or locally solvable.
Their ideas extend a little further than these two cases,
but fall short of fully accomplishing Step~(2).
Therefore, we pose the problem of accomplishing
Step~(2) in full generality.

\begin{prb}\label{day-kiss_prb}
Show that if $\vr V$ is residually small 
and congruence modular, then $\vr V$
is congruence distributive or $\CON(\vr V)=\CON(\vr M)$
for some variety $\vr M$ of modules.
\end{prb}

If this is proved, then we will know that the 
congruence varieties $\CON(\vr V)$
of residually small varieties $\vr V$ are precisely
\begin{itemize}
\item the variety of all lattices --- e.g. when $\vr V$
is the (residually small) variety of sets, 
\smallskip

\item $\CON(\vr M)$ where $\vr M$ is a variety of modules, 
\smallskip

\item the variety of distributive lattices --- e.g. when $\vr V$
is the (residually small) variety of distributive lattices, and
\smallskip

\item the variety of trivial lattices (e.g. when $\vr V$
is a trivial variety).
\end{itemize}
\end{rem}

\section{Almost Congruence Distributive Varieties}\label{ACD}

A variety is {\bf affine complete}
\index{affine complete variety}
if every congruence preserving function on every member
is a polynomial.
In \cite{kaarli-pixley}, 
Kalle Kaarli\index{Kaarli, K.}
 and 
Alden Pixley\index{Pixley, A.}
announced
that any affine complete variety
is residually finite and has the property
that every finitely
generated subvariety is congruence distributive.
At the time it was
not known whether the entire variety
had to be congruence distributive. 
Pixley then introduced the following concept.

\begin{df}\label{acd_df}
A variety 
$\vr V$ is {\bf almost congruence distributive},
\index{almost congruence distributive (ACD)}
or {\bf ACD},
if it is residually finite, every finitely generated
subvariety is congruence distributive, 
but $\vr V$ itself is not congruence distributive.
\end{df}

\noindent
Pixley asked if there exists an ACD variety.
A negative answer would, of course, 
show that every affine complete variety 
is congruence distributive.

Kaarli and Ralph McKenzie\index{McKenzie, R.} 
proved in \cite{kaarli-mckenzie} that 
every affine complete variety is congruence distributive,
but it remains open whether there is an ACD variety.
%(This is Problem~2 of \cite{kaarli-mckenzie}.)
This is still an interesting question, since
we know very little about how local properties
of a variety, like the structure 
of the subdirectly irreducible algebras, 
imply global properties, such as the satisfaction
of a Maltsev condition.

In this section we prove that an ACD variety 
satisfies no nontrivial 
idempotent Maltsev condition.
This implies that if an ACD variety exists,
then some member has a nontrivial strongly abelian congruence,
but for some reason such congruences do not show
up in any subdirectly irreducible algebra
or even in any subvariety generated by
a finite set of subdirectly irreducible algebras.

\begin{thm} \label{acd_thm}
Let $\vr V$ be a variety satisfying a nontrivial
idempotent Maltsev condition.
\begin{enumerate}
\item[(1)] If every subdirectly irreducible algebra in
$\vr V$ generates a subvariety satisfying a nontrivial
congruence identity, then $\vr V$ satisfies a nontrivial
congruence identity.
\item[(2)] If every subdirectly irreducible algebra in
$\vr V$ generates a congruence join semidistributive
subvariety, then $\vr V$ is
congruence join semidistributive.
\end{enumerate}

Now assume also that $\vr V$ is residually small.
\begin{enumerate}
\item[$(1)^{\prime}$] If every subdirectly irreducible algebra in
$\vr V$ generates a subvariety satisfying a nontrivial
congruence identity, then $\vr V$ is congruence modular.
\item[$(2)^{\prime}$] If every subdirectly irreducible algebra in
$\vr V$ generates a congruence join semidistributive
subvariety, then $\vr V$ is
congruence distributive.
\end{enumerate}
\end{thm}

\begin{proof}
If each subdirectly irreducible algebra
in $\vr V$ generates a subvariety satisfying 
a nontrivial congruence identity, then 
by Theorem~\ref{main1} each subdirectly
irreducible algebra in $\vr V$
has a Hobby--McKenzie
term. By Theorem~\ref{rect_Malt_cond2}
the rectangular tolerances on
subdirectly irreducible members of $\vr V$ are trivial.
Corollary~\ref{ACD_cor}
guarantees that no algebra in $\vr V$ has a rectangular
tolerance. Reusing Theorems~\ref{rect_Malt_cond2}
and \ref{main1}, we get that $\vr V$
satisfies a nontrivial
congruence identity. This proves (1).

For (2), if every subdirectly irreducible in $\vr V$
generates a congruence join semidistributive
subvariety, then no subdirectly irreducible algebra has
a nontrivial rectangular or abelian tolerance. By part (1),
this implies that $\vr V$ satisfies a nontrivial
congruence identity, hence 
$\vr V$ has a weak difference term
according to Corollary~\ref{justify_weak_cor}.
This shows that the hypotheses of Corollary~\ref{ACD_cor2}
are met, so from the fact that no subdirectly irreducible algebra
has an abelian tolerance we may derive that no
algebra in $\vr V$ has an abelian tolerance.
By Theorem~\ref{sdj-thm}~(5)$\mimplies$(1)
it follows that $\vr V$ is congruence join semidistributive.

Items $(1)^{\prime}$ and $(2)^{\prime}$ follow from items (1) and (2)
using Theorem~\ref{RS_congid}.
\end{proof}


\begin{cor}
An ACD
%almost congruence distributive 
variety satisfies no nontrivial idempotent Maltsev condition.
\end{cor}

\begin{proof}
This follows from Theorem~\ref{acd_thm}~$(2)^{\prime}$
and the definition of an ACD variety.
%Suppose that $\vr V$ 
%satisfies a nontrivial idempotent Maltsev condition.
%If $\vr V$ is residually finite and 
%every subdirectly irreducible algebra in
%$\vr V$ generates a congruence distributive
%subvariety, it follows from Theorem~\ref{acd_thm}~(2)'
%that $\vr V$ is
%congruence distributive. Therefore $\vr V$ is not ACD.
\end{proof}

Theorem~\ref{acd_thm} suggests the following problem.

\begin{prb}\label{SI_mod}
Suppose that $\vr V$ satisfies a nontrivial
idempotent Maltsev condition, and every 
subdirectly irreducible member of $\vr V$
generates a congruence modular subvariety.
Must $\vr V$ be congruence modular?
(We are interested in the case where
$\vr V$ is residually large.)
\end{prb}

The answer to Problem~\ref{SI_mod} is affirmative
if $\vr V$ is locally finite.
Indeed, it follows from
tame congruence theory that the following conditions
are equivalent for a locally finite variety:
\begin{enumerate}
\item[(1)] $\vr V$ is congruence modular.
\item[(2)] The minimal sets of the finite algebras
are of type $\atyp, \btyp$ or $\ltyp$ and have
empty tails.
\item[(3)] The minimal sets of the finite 
subdirectly irreducible algebras
are of type $\atyp, \btyp$ or $\ltyp$ and have
empty tails.
\item[(4)] Each finite subdirectly irreducible 
algebra generates a congruence modular subvariety.
\end{enumerate}

\noindent
However, the modular law is special in this regard,
because of its link with the empty
tails condition. We expect that for identities weaker than
modularity the problem analogous to Problem~\ref{SI_mod}
will have a negative answer.

Another problem is suggested by the proof
of Theorem~\ref{acd_thm}.

\begin{prb}\label{9.12}
Suppose that $\vr V$ has a Taylor term.
If some algebra in $\vr V$ has a nontrivial
abelian tolerance,
must some subdirectly irreducible algebra in
$\vr V$ have a nontrivial abelian tolerance?
\end{prb}

