By a theorem of Hagemann and Mitschke, a condition (A) that a variety $\mathcal{V}$ is congruence $n$-permutable, is equivalent to a condition (B) that there exist ternary terms $p\_1,\dots,p\_{n-1}$ such that $\mathcal{V}$ satisfies identities
$$x = p\_1(x,y,y),\ \ p\_i(x,x,y) = p\_{i+1}(x,y,y),\ \ p\_{n-1}(x,x,y) = y.$$
I know how to show that (B) implies (A), however I was not able to show the converse implication. I searched the literature, but it turns out that much of it is in German. I found no full proof in English of the implication (A) $\Rightarrow$ (B). The best I could find is the information that there is a third equivalent condition (C) that for every $A \in \mathcal{V}$ and every reflexive subalgebra $R$ of $A^2$, one has $R^{-1} \subseteq R^{n-1}$, where $R^{-1}$ is the converse relation and $R^{n-1}$ is the $(n-1)$-fold composition of $R$ with itself. I know how to show the equivalence of (C) and (B).


I would like to ask for a reference in English for the proof of the implication (A) $\Rightarrow$ (B) (or alternatively for sketching such a proof). In fact I am mostly interested in congruence $3$-permutability, so it would be enough for me if someone could provide a proof for the case $n = 3$. Note that a proof of the implication (A) $\Rightarrow$ (C) that does not make use of the equivalence of (A) and (B) would fulfill my request.



Reference request for a proof of the Mal'cev condition for congruence $n$-permutability
The original paper is in English:
Hagemann, Joachim; Mitschke, A.  

On $n$-permutable congruences.  

Algebra Universalis 3 (1973), 8-12.



The proof given there is only a partial proof which depends
on an earlier paper (in German) by Hagemann.


I did not find the argument in any of the standard textbooks by Burris and Sankpannavar (1981), McKenzie-McNulty-Taylor (1987), or the one by Cliff Bergman (2012).
I did find a complete proof in English of $(A)\Rightarrow(B)$ in Algebras, Lattices, Varieties
Volume II by
Ralph S. Freese,
Ralph N. McKenzie,
George F. McNulty.
Walter F. Taylor. It is their Theorem 6.11.
I will state Theorem 6.11 here and make a few comments on the proof.



**Theorem 6.11.**  

For a variety $V$ and an integer $k \geq 2$ the following conditions are equivalent:  

(i) $V$ has $k$-permutable congruences.  

(ii) $F\_V(k + 1)$ has $k$-permutable congruences.  

(ii') There exist terms $r\_i(x\_0 , x\_1 , \ldots, x\_k )$,
$i = 0, \ldots, k$ for $V$ such that the following are
identities of $V$:
$x\_0 \approx r(x\_0 , x\_1 , \ldots, x\_k)$,
$r\_k (x\_0 , x\_1 , \ldots, x\_k ) \approx x\_k$, and
$r\_{i−1}(x\_0 , x\_0 , x\_2 , x\_2 , \ldots) \approx r\_i (x\_0 , x\_0 , x\_2 , x\_2 ,\ldots )$ for $i$ even,
$r\_{i−1} (x\_0 , x\_1 , x\_1 , x\_3 , x\_3,\ldots) \approx r\_i (x\_0 , x\_1 , x\_1 , x\_3 , x\_3 \ldots)$ for $i$ odd.  

(iii) There exist terms $p\_1 , \ldots, p\_{k−1}$ for $V$ such that the following are identities of $V$:  

$x \approx p\_1 (x, z, z)$,  

$p\_1 (x, x, z) \approx p\_2 (x, z, z)$  

$\vdots$  

$p\_{k−2} (x, x, z) \approx p\_{k−1} (x, z, z)$  

$p\_{k−1} (x, x, z) \approx z$.   

(iv) The subalgebra of $F\_V^2(x, y) $
generated by $\langle x, x\rangle$, $\langle x, y\rangle$
and $\langle y, y\rangle$ contains elements
$\langle a\_i , b\_i\rangle$, $i = 0, \ldots,k$, with $\langle y, y\rangle = \langle a\_0 , b\_0\rangle$, $\langle x, x\rangle = \langle a\_k , b\_k\rangle$, and $b\_i = a\_{i+1}$.



The steps you are interested in are (ii) $\Rightarrow$ (ii') $\Rightarrow$ (iii).
For (ii) $\Rightarrow$ (ii'), use the fact that the congruences
$\theta\_0 = \textrm{Cg}(\langle x\_0,x\_1\rangle, \langle x\_2,x\_3\rangle,\ldots)$ and $\theta\_1 = \textrm{Cg}(\langle x\_1,x\_2\rangle, \langle x\_3,x\_4\rangle,\ldots)$ $k$-permute and have join containing $\langle x\_0,x\_k\rangle$. The argument to get the $r\_i$'s follows a standard pattern.



For the implication (ii') $\Rightarrow$ (iii), define   

$p\_i (x\_0 , x\_1 , x\_2 ) = r\_i (x\_0 , \ldots , x\_0 , x\_1 , x\_2 , \ldots , x\_2 )$  

where there are $i$ instances of $x\_0$ followed by one instance of $x\_1$ followed by $k-i$ instances of $x\_2$.
















