Every discriminator variety has equationally definable principal congruences A variety $V$ has equationally definable principal congruences (EDPC) if there
is a conjunction $\Phi(x, y, z, w$) of finitely many equations on four variables such
that for all A $\in V$ and all $a, b, c, d \in$ A,$ (c, d) \in \theta(a, b)$ iff A $\models \Phi(a, b, c, d)$.
(a) Show that every discriminator variety has EDPC.
(b) Show that if a variety has EDPC then it also has the congruence extension property (CEP).
Where an algebra A has the CEP if for every B$\leq$ A and $\vartheta \in $ ConB  there is a $\varphi \in$ Con A such that $\vartheta = \varphi \cap B^2$. After some thought I'm still not sure how to get started on either of these, any help is appreciated.
 A: Hints:
(a) A discriminator variety has a discriminator term ${\def\d{{\bf d}}}\d$, and is generated by algebras in which $\d(a,a,c)=c$ and $\d(a,b,c)=a$ if $a\ne b$. 
 Such an algebra is necessarily simple, and thus $(c,d)\in\theta(a,b)$ iff $c=d$ or $a\ne b$. Express this as an equation using $\bf d$. Then verify that the statement remains valid after taking products and subalgebras (and quotients). 
(b) Let $B\le A$ and $\vartheta\in\mathrm{Con\,}B$. Define $\varphi\in\mathrm{Con\,}A$ as the congruence generated by the pairs $(b_1, b_2)\in\vartheta$, i.e. it is the union (generatum) of $\theta_A(b_1,b_2)$'s. We have to prove that no new pairs are added within $B$.
Use the condition to show $\theta_B(b_1,b_2)=\theta_A(b_1,b_2)\cap B^2$.

(a) In more details
For preliminaries, in a discriminator variety the following equations hold: 
$$\d(a,a,c)=c\ \text{ and } \ \d(a,b,a)=\d(a,b,b)\,,$$
and every quasiequation $\bigwedge_i(\tau_i=\sigma_i) \to(\tau=\sigma)$ can be translated into an equation
$$\d(\tau_1,\sigma_1,\, \d(\tau_2,\sigma_2,\,\dots \d(\tau_n, \sigma_n,\tau))) \ =\ \d(\tau_1,\sigma_1,\, \d(\tau_2,\sigma_2,\,\dots \d(\tau_n, \sigma_n,\sigma)))\,.\\ $$
As you found out, we can choose
$$\Phi(a,b,x,y):=\ \d(a,b,x)=\d(a,b,y)\,.$$
For a given algebra $A$ in the variety with fixed elements $a,b$, set $H:=H(a,b)=\{(x,y) : \d(a,b,x)=\d(a,b,y)\}$. 
We have to prove that $H(a,b)=\theta(a,b)$ holds.


*

*$H$ is an equivalence relation.

*$(a,b)\in H$.

*$H\subseteq \theta(a,b)$.

*$H$ is a congruence relation, i.e. for any basic operation $f$, the following quasiequation holds (in the generating algebras, and therefore throughout the variety):
$$\bigwedge_i\big(\d(a,b,x_i)=\d(a,b,y_i)\big) \to\ \, \d(a,b, f(..x_i..))=\d(a,b,f(..y_i..))$$
