Overview
In mathematics, equality is the basic binary relation that asserts two expressions represent the same mathematical object or value. When we write an expression of the form x = y we claim that x and y are interchangeable in every context where equality is meaningful. The notion is central to arithmetic, algebra, logic, set theory and many branches of applied mathematics. For a concise entry point, see mathematical equality, and for a general description of what it means for two things to be 'the same' in mathematics see identity. The symbol '=' is the most common notation; its origin and conventional use are discussed below, and the glyph itself is treated as a topic of historical interest here.
Formal properties
Equality is not arbitrary: it is commonly taken to satisfy a small set of structural properties that make it an equivalence relation and a tool for substitution. The three standard algebraic properties are:
- Reflexivity: every object equals itself (for all x, x = x).
- Symmetry: if x = y then y = x.
- Transitivity: if x = y and y = z then x = z; this property is often highlighted in elementary logical expositions here.
Beyond these, equality satisfies the substitution property (sometimes called Leibniz's law): if x = y, then any property or formula that holds of x also holds of y. In formal logic and axiomatic systems, identity is usually introduced by axioms that encode these behaviors so that equality can be used to replace equals by equals in proofs and calculations.
Notation, equations and inequalities
The expression that two quantities are equal is called an equation or an equality; equations are solved, manipulated and used to define relationships among variables (equations). By contrast, relations that compare sizes or orderings—such as <, >, ≤ or ≥—are inequalities and express non-equality relationships. Other notations convey related ideas: a double bar or triple bar (≡) can denote congruence of residue classes or definitional identity, while the tilde (~) is commonly used for asymptotic or equivalence relations that are not strict identity.
Variants: equivalence relations and geometric congruence
When two objects are considered the same only up to some prescribed transformation, mathematicians use the more general concept of an equivalence relation. An equivalence relation is any relation that is reflexive, symmetric and transitive; it partitions a collection of objects into classes of mutually equivalent items. Standard examples include congruence classes in modular arithmetic and similarity classes of geometric figures. For definitions and examples see equivalence relations. In geometry, the term congruence describes when two figures match under rigid motions (translations, rotations, reflections) while similarity allows uniform scaling; these ideas are discussed in elementary geometry sources (geometry), with congruence usually symbolized by ≅ (congruence) and similarity by ~ (similarity).
Equality in logic, set theory and mathematics of structure
In formal systems, equality is handled carefully. In first-order logic with identity, special axioms govern how identity interacts with predicates and functions, and in set theory equality is tied to extensionality: two sets are equal exactly when they have the same elements. Structural or abstract equality can mean different things depending on context — for example two functions may be considered equal if they have the same domain and assign the same value to each input, while two algebraic structures might be equal only if there is an identity-preserving bijection between them. These distinctions underlie much of modern algebra and category theory, where 'sameness' is often relaxed to isomorphism or equivalence rather than strict elementwise identity.
Equality in computation and programming
Computer science applies the mathematical idea but must also distinguish between value equality and reference or identity. Many programming languages provide an operator for comparing values and a separate notion for checking whether two variables refer to the same object in memory. Languages influenced by object-oriented design address this distinction explicitly; for a general overview see equality in computing and a discussion specific to object-oriented contexts here. Practical issues arise with numeric approximations (for example floating-point comparisons), immutable versus mutable objects, and operator overloading. Some languages introduce separate operators (e.g. ==, === or an equals method) to make the semantic difference explicit.
Uses, examples and notable distinctions
Equality is used everywhere in mathematics: to state identities like trigonometric equalities, to define functions and relations, to specify axioms, and to reduce expressions during computation. Concrete examples include the identity 2 + 2 = 4, the algebraic equality (x+1)^2 = x^2 + 2x + 1, and the set-theoretic equality {a,b} = {b,a}. Important distinctions to bear in mind are:
- Strict equality versus equivalence up to a relation (isomorphism, congruence, similarity).
- Mathematical identity versus computational identity (value vs reference).
- Exact equality versus approximate equality used in numerical analysis.
For historical notes about the adoption of the equals sign and for further reading see notation, and for social or metaphorical uses of equality outside mathematics consult treatments in the social sciences here (for example how people identify peers peer).
Further reading
To explore related terms and applications consult introductory texts on algebra and logic, entries about equations, the study of equivalence relations, practical programming guides on equality semantics (computing), and elementary geometry references on congruence and similarity.