Understanding First-order Logic 141 Example 114 The equality is often an indispensable relation to express important mathematical properties as shown in the following examples The sentences in Example 113 are easily relativized for every formula A(x, z¯) containing, among others, the free variable x, to the subset of the domain consisting of the elements satisfying A For instance, we can combine these to say things like “of all the students in the class, at most two scored distinctions in at least five exams each.” In particular, for any formula A(x, z¯), the formula ∃!xA(x, z¯) = (A(x, z¯) ∧ ∀y (A(y, z¯) → x = y )) states that there is a unique element in the domain of discourse satisfying A, for the current values of the parameters z¯ The sentence ∀x∃!y (R(x, y ) in the language with = and a binary relational symbol R therefore states that the relation R is functional, that is, every element of the domain is R-related to a unique element The sentence ∀x∀y (f (x) = f (y ) → x = y )) in the language with = and a unary functional symbol f states that the function f is injective, that is (by contraposition), assigns different values to different arguments Sometimes the equality is implicit or even hidden in natural language expressions such as “Everyone, except possibly John, understood the joke.” It becomes explicit and readily translatable (exercise) to first-order logic when rephrased as “Everyone, who is not (equal to) John, understood the joke.” Likewise, “No-one, but John and Mary, enjoyed the party” can be rephrased as “Everyone, who is not (equal to) John and not (equal to) Mary, enjoyed the party.” The following proposition captures the characteristic properties of the equality expressible in a first-order language Proposition 115 The following sentences in an arbitrary first-order language L are logically valid: (Eq1) x = x; (Eq2) x = y → y = x; (Eq3) x = y ∧ y = z → x = z ; (Eq f ) x1 = y1 ∧ ∧ xn = yn → f (x1 , , xn ) = f (y1 , , yn ) for n-ary functional symbol f in L; (Eq r ) x1 = y1 ∧ ∧ xn = yn → (p(x1 , , xn ) → p(y1 , , yn )) for n-ary predicate symbol p in L However, these axioms cannot guarantee that the interpretation of any binary relational symbol = satisfying them is equality, but only that it is a congruence (see Section 4.6.3) in the given structure Lastly, the following theorem states an important generalization of the equality axioms listed above stating that equal terms can be equivalently replaced for each other in any formula