Relations are just sets of ordered pairs? If the definition of a relation is that it is a set of ordered pairs, how come two relations are not equal if they contain the same elements but aren't on the same sets?
For example, Let $R_1$ be a relation from $A$ to $B$ and $R_2$ be a relation from $C$ to $D$ such that $B \ne D$ but $R_1$ and $R_2$ contain the same elements. If $R_1$ and $R_2$ are just sets shouldn't $R_1=R_2$?
Wouldn't it be more appropriate to define relations as something like an ordered triple? For example $(R,A,B)$ where $R \subseteq A \times B$.
Thanks in advance
 A: You seem to be quoting an ill-stated version of the definition of a relation. A better crafted version will have the domain and range given as part of the definition:


*

*Given sets $A$ and $B$, a relation between $A$ and $B$ is a subset of $A \times B$.

A: If $R_1$ and $R_2$ have the same ordered pairs then they are equal. Period. Because two sets with the same elements are equal. For example the empty relation is the empty set is the same relation whether or not it is a subset of $A\times B$ or $C\times D$.
But we often care about both internal and external properties of a relation. For example a relation is a function from $A$ to $B$ if it satisfies the property that $(x,y),(x,z)\in R$ then $y=z$; and that its domain is equal to $A$. So if $f\colon A\to B$ is a function, and then we take $A'$ to be a set strictly bigger than $A$, then $f\subseteq A'\times B$, but $f$ is not a function from $A'$, but rather a partial function.
Similarly, reflexive relations are reflexive on a set, whereas symmetric relations are just symmetric. This is because reflexive and being a function from $A$ to $B$ are external properties of a relation, whereas being symmetric or have a functional property are internal properties.
Sometimes, if so, we are interested in the domain and codomain of a relation, for example in category theory a function is an ordered triplet consisting of a domain, codomain and a graph. In set theory, we only care about the graph. The same can be done with relations, and either approach has merits and uses for different purposes.
A: Your problem is that you're mixing up a relation with its graph.
A relation doesn't contain elements: the graph of the relation contains elements. And it is possible for relations on different sets (which therefore cannot be equal) to have equal graphs.
Actually, that is only true if you think of the graph of a relation as merely being a set. If you think of it as a subset of the domain of the relation, then the graphs would still be different: "$S \subseteq A \times B$" is different from "$S \subseteq C \times D$", and it is merely their underlying sets that are the same.
In some sense, relations on different domains are different types of objects, and it's not obvious that it should even be meaningful to ask if they are equal.
It's worth noting that your $R_1$ and $R_2$ can be extended to binary relations on $(\mathbf{Set}, \mathbf{Set})$, and they extend to the same relation $R$, as both definitions below give the same relation
$$ xRy \Leftrightarrow (x,y) \in A\times B \wedge xR_1y $$
$$ xRy \Leftrightarrow (x,y) \in C \times D \wedge xR_2y $$
so they really are the same relation if you're really thinking not in terms of of relations on sets but in terms of relations on the entire universe of sets.

Sometimes, it is useful to have a set-theoretic model of the notion of relation. Interpreting a relation as its graph is a reasonable model for a great many purposes.
But if your notion of relation is that it is meaningful to compare relations on different domains and you want a model that faithfully captures equality, then the graph of the relation does not make a good model. The triple consisting of the graph, domain, and codomain that you suggest is indeed a reasonable model.
A: The problem is that a relation IS NOT just a collection of ordered pairs. Just as a function is not defined only by the rule of assignment, a relation isn't either. You must also explicitly specify the "domain" and "range" ($A$ and $B$, in the case of $R_1$). So it really already IS an ordered triple.
