I saw some other comments mentioning the need for context, and I think the notion of structure captures this. The context for an equality is the kind of structures we are considering at the moment. As types ℕ and ℤ are equal, but structured as addition semirings in the conventional way they are different.