4. Let $a, b, c$ be real numbers, $A=\left\{(a, b, c) \mid a^{2}-b c-8 a+7=0\right\}, B=$ $\left\{(a, b, c) \mid b^{2}+c^{2}+b c-b a+b=0\right\}$, and $A \cap B \neq \varnothing$.
(1) Find the range of values for $a$;
(2) Let $y=a b+b c+a c$, try to find the extremum (maximum or minimum) of $y$.
4. (1) From $A \cap B \neq \varnothing$, we know $b-c= \pm(a-1)$, so $b$ and $c$ are the two real roots of the quadratic equation $x^{2} \pm(a-1) x+a^{2}-8 a+7=0$. Therefore, $(a-1)^{2}-4\left(a^{2}-8 a+7\right) \geqslant 0$, solving this gives $1 \leqslant a \leqslant 9$.
(2) $y=a b+b c+c a=a(b+c)+b c= \pm a(a-1)+a^{2}-8 a+7$
$1^{\circ}$ For $y=2 a^{2}-9 a+7=2\left(a-\frac{9}{4}\right)^{2}-\frac{25}{8}$, when $a=\frac{9}{4}$, $y_{\text {min }}=-\frac{25}{8}$; when $a=9$, $y_{\text {max }}=88$.
$2^{\circ}$ For $y=-7 a+7$, when $a=1$, $y_{\text {max }}=0$; when $a=9$, $y_{\text {min }}=-56$.
Combining $1^{\circ}$ and $2^{\circ}$, we get $y_{\text {max }}=88, y_{\text {min }}=-56$.