Theorem (can be generalized to arbitrary number of attributes):
Suppose r(A,B,C) is a relation.
Let r_AB be the projection of r to AB, and
r_AC be the projection of r to AC.
Then
(1) r is a subset of r_AB join r_AC
(2) if the dependency A -> B holds,
then r_AB join r_AC is a subset of r
(and the join thus lossless)
Proof:
First (1):
let t = (a,b,c) belong to r.
Then (a,b) belongs to r_AB, and (a,c) belongs to r_AC,
so t = (a,b,c) belongs to the join of r_AB and r_AC, as desired.
Next (2):
let t = (a,b,c) belong to the join of r_AB and r_AC,
implying that
(a,b) belongs to r_AB and
(a,c) belongs to r_AC.
We infer that there exists c' and b' such that
(a,b,c') belongs to r and
(a,b',c) belongs to r
Since A -> B holds, we now infer that b = b'.
But then t = (a,b,c) belongs to r, as desired.