Clarify Cartesian Products and Binary Operations Tell me if I'm saying this right.   A Cartesian Product is a function $f:X \times Y \to Z$ , where some unknown structural operation on the sets $X$ and $Y$ produces a set $Z$ as its codomain, and $Z$ is a set of ordered pairs $(x,y)$ where $x \in X$ and $y \in Y$ for all possible values of $x$ and $y$. And codomain, while kind of arbitrarily defined, is generally the set of all possible values output by $f$, the set of ordered pairs $(x,y)$.    Good, so far?    
Now,  tell me if I'm describing binary operations right.   
Now a binary operation, it seems, is a cartesian product $f: Y \times Y \to Y$, where $f$, an unknown structural operation, operates on the sets $Y$ and $Y$ (which are for all purposes identical) and produces a set $Y$ (identical to the first two) as its codomain. Codomain has the same definition has earlier. 
 
Okay, here's where I get really confused regarding binary operations. From the first definition, it seems that a Cartesian Product is always a set of ordered pairs, but a binary operation is not producing ordered pairs of elements, but single elements that are also members of the set from which the two elements being operated on are members.  
Could anyone help me make sense of, help me bridge this—how do I say?—cognitive dissonance?
Thanks.
 A: The cartesian product of two sets : $X,Y$ is a set $Z$ defined as :

$Z = \{ (x,y) \, | \, x \in X \, \text {and} \, y \in Y \}$

where $(x,y)$ is the ordered pair having $x$ as first component and $y$ as second component.
Thus, the cartesian product $X \times Y$ is the set of all ordered pairs with first component in $X$ and second component in $Y$.
A relation $R$ with domain in $X$ and range in $Y$ is a subset of the cartesian product $X \times Y$, i.e. :

$R \subseteq X \times Y$.

Thus, a relation is a set of ordered pairs.
A function $F$ is a relation satisfying the ("functionality") condition :

if $(x_1,y_1) \in F$ and $(x_1,y_2) \in F$, then $y_1=y_2$.

A binary operation $f : Y \times Y \to Y$ is a function from the cartesian product $Y \times Y$ to the set Y, i.e. a subset of $(Y \times Y) \times Y$, because it "maps" an ordered pair $(y_1,y_2)$ into an element $y_3$, with $y_i \in Y$.

You can try to clarify the definitions with some simple examples.
Let $\mathbb N = \{ 0, 1, 2, ... \}$ the set of natural numbers.
Consider the cartesian product $\mathbb N \times \mathbb N$ and :


*

*the relation $<$ ("Less then"), i.e. $(n,m) \in L$ iff $n < m$, 

*the function $s$ ("Successor"), i.e. $(n,m) \in S$ iff $m=s(n)$ 

*the (binary) operation $+$ ("Plus"), i.e. $((x,y),z) \in P$ iff $z=x+y$.
