chore: generalize {Mul, Add}EquivClass.map_{eq, ne}_one_iff (#18809)
{Mul, Add}EquivClass.map_{eq, ne}_one_iff