4. In $\triangle A B C$, among the following conditions: (1) two medians are equal, (2) two altitudes are equal; (3) $\cos A=\cos B$; (4) $\operatorname{tg} A=\operatorname{tg} B$. The number of conditions that can lead to $\triangle A B C$ being an isosceles triangle is ( ).
(A) 1
(B) 2
(C) 3
(D) 4
4. D.
(1) If $A D, C E$

are two medians intersecting at $M$, and
$A D=C E$, then $A M$
$$
\begin{array}{l}
=\frac{2}{3} A D=\frac{2}{3} C E \\
=C M, M D=\frac{1}{3} A D \\
=\frac{1}{3} C E=M E, \angle A M E=\angle C M D,
\end{array}
$$

thus $\triangle A M E \cong \triangle C M D \Rightarrow A E=C D \Rightarrow A B=C B$
(2) If $A F, C G$ are two altitudes and are equal, then
$S_{\triangle A B C}=\frac{1}{2} A F \cdot C B=\frac{1}{2} C G \cdot A B \Rightarrow A B=C B$.
(3) $\cos A=\cos B \Rightarrow A=B \Rightarrow A C=B C$.
(4) $\operatorname{tg} A=\operatorname{tg} B \Rightarrow A=B \Rightarrow A C=B C$.