Wiki has set theoretic definitions of relational algebra used in databases. The typical set operations are missing and I'm trying to piece them together. Does anyone know how to define the $\cup, \cap, -, X^C$ set operations over the relation?
For example, the relation $R$ or table is defined as a set of $t_n$ tuples, where each tuple has $z$ attributes and $p$ values, where a single attribute can have many values. $$ R = \{t_0,...,t_n\}, t_x = ((a_1,v_{1}), ...,(a_z,v_{p})) $$ All the attributes for a tuple. $$ A(t) = \{a : (a,h) \in t\} $$ The attributes for each tuple in the relation must be the same. $$ TT = R \times R $$ $$ \forall x,y \in TT (A(x) = A(y)) $$
Projection over attributes is defined: $$ \Pi_{a_1, ...,a_n}( R ) = \{ \ t[a_1,...,a_n] : \ t \in R \ \} $$ $$ t[a_1,...,a_n] = \{ \ ( a', v ) \ | \ ( a', v ) \in t, \ a' \in \{a_1,...,a_n \} \} $$
Selection: $$ \sigma_\varphi(R) = \{ \ t : t \in R, \ \varphi(t) \ \} $$
I'm assuming the set operations can all be defined with union and complement. I think the attributes need to be in correspondence with integers, so the relational table $R$ can be converted into a Cartesian product $A_1 \times ... \times A_n$, then converted back to it's relational representation $R$. I'm interested in what folks with more experience define these as.
These operations are in their standard set theoretic form. $R_1 x R_2$, where the operation are $x \{\cap, \cup, C\}$.