Proof - Projection distribution over set union

2k Views Asked by At

I've just started databases and have exercise to proof that projection$(\pi)$ is distributive over set union$(\bigcup)$. But I suck in proofs and don't really know how to proof that:

$\pi_\alpha( R \bigcup S) = \pi_\alpha(R) \bigcup \pi_\alpha(S) $

It's just to obvious and I don't know how to proof it.

References:

Definition of $\bigcup: A \bigcup B = \{ x : x \in A \vee x \in B \}$

Property of $\pi \ \ $ $\pi_\alpha(\pi_\beta (R)) = \pi_\alpha(R) \\where \ \ \alpha \subseteq \beta $

1

There are 1 best solutions below

0
On

I'm not sure about the notation, but I'll make an effort...

Say, tuples of $R$ have properties $R_1\times\cdots\times R_n$ and tuples of $S$ have properties $S_1\times\cdots\times S_m$. Without loss of generality, we assume $n\leq m$.

Let $x\in\pi_a(R\cup S)$, where $a\subseteq\{1,\ldots,n\}$. Then $$\forall i\in a, x_i\in\pi_i(R\cup S)\text{, where $x=\prod_{i\in a}x_i$}\Leftrightarrow\\ \forall i\in a, x_i\in R_i\cup S_i\Leftrightarrow\\ \forall i\in a, x_i\in R_i\text{ or } x_i\in S_i\Leftrightarrow\\ \forall i\in a, x_i\in R_i\text{ or } \forall i\in a, x_i\in S_i\Leftrightarrow\\ x\in\pi_a(R)\text{ or }x\in\pi_a(S)\Leftrightarrow\\ x\in\pi_a(R)\cup\pi_a(S)$$

Hence $\pi_a(R\cup S)=\pi_a(R)\cup\pi_a(S)$.