Theoremcore
Heath's theorem
Also called lossless decomposition by a functional dependency.
If X -> Y holds in a relation over the attributes XYZ, the relation is the join of its projections on XY and XZ. Fagin showed that the exact condition is the MVD X ->> Y.
Heath's theorem says that a functional dependency lets you split a relation into its projections on and on with the other attributes, and get it back with a natural join. Fagin (1977) found the exact condition for this, the multivalued dependency . Both are statements about one relation. The lossless join page is about a schema and a set of FDs, and proves that a split in two parts is lossless under FDs exactly when the common attributes fix one part. The tableau test handles any number of parts.
Statement
Let be a finite set of attributes, let , and let , where means . We use set semantics: a relation over is a finite set of tuples, and projection and join remove duplicates. Write .
Theorem (Heath 1971). If satisfies , then .
Theorem (Fagin 1977). if and only if satisfies , that is: for any two tuples with , there is a tuple with and .
In plain words
Suppose each value in some columns fixes the value in some other columns, for example each department has one manager. Then you can cut the table into two narrower tables that share the deciding columns: one with the deciding columns and the fixed columns, one with the deciding columns and everything else. Joining the two narrow tables on the shared columns gives back exactly the rows you started with, no more and no fewer.
Fagin found the precise rule. The split works exactly when, for each value of the shared columns, the two halves combine freely: every left half that goes with that value pairs with every right half that goes with it. A fixed value is one special case of free combination, because there is only one left half to pair.
Proof
Lemma. . A tuple over is in if and only if there are with and .
Proof. The natural join of and is joined on the common attributes , since . A tuple over is in it exactly when and , which is the condition with and . For , take .
Proof of Heath's theorem. By the lemma it is enough to show . Let , with as in the lemma. Then . Since satisfies , . So agrees with on , on and on , that is on , and .
Proof of Fagin's theorem. If. Let satisfy and let , with as in the lemma. Then , so there is with and . So , and . With the lemma, .
Only if. Let , and let with . Define over by and . This is well defined, because and are disjoint and cover . Then , so . By the lemma, , and is the tuple that asks for.
Heath's theorem also follows from Fagin's: if holds and , then works, since .
Consequences
- Every FD is an MVD. If satisfies , then by Heath , and by Fagin satisfies . This is the replication rule of the axioms for FDs and MVDs.
- Complementation. does not change when and swap roles, so holds exactly when holds. In particular is also enough for the split.
- BCNF decomposition is lossless. Each step of BCNF decomposition splits a schema on a violating FD into and . Heath's theorem shows that each step loses nothing, and a lossless split of a part of a lossless split is still lossless.
- 4NF decomposition is lossless. The 4NF decomposition splits on a violating MVD into and . Fagin's theorem is exactly what makes this step lossless.
- Splits for 2NF and 3NF. with and splits on into and with no loss, which removes the transitive dependency.
- The schema version. Under a set of FDs only, the split into and is lossless for every relation that satisfies exactly when or . The if part is Heath's theorem. The only if part needs a two-tuple counterexample and is proved on the lossless join page.
Tightness
- The converse of Heath's theorem is false. Over take , and
Then , but neither nor holds. The MVD holds, as Fagin's theorem says it must.
- Bag semantics breaks the theorem. Take the bag over , where holds. As bags, holds twice, and the bag join with gives each of the two tuples twice, four tuples in all. In SQL, the projections must use DISTINCT, or a key must be kept in each part.
- The common attributes must be the left side. With over , the FD holds, but the split into and joins on and gives four tuples, two of them spurious. The theorem needs the part that holds and the part that holds to share exactly .
- Three or more parts. The theorem is about two parts. A relation over can be the join of its projections on , and and satisfy no nontrivial MVD at all, so no split in two parts explains it. The right condition is a join dependency, and under FDs the tableau test decides it.
History
Heath (1971) proved the FD case in a paper on file operations that are not acceptable in a relational database, at a time when Codd's normal forms were new. Fagin (1977) introduced multivalued dependencies and fourth normal form, and proved that the MVD is the exact condition for a lossless split in two parts. Aho, Beeri and Ullman (1979) and Maier, Mendelzon and Sagiv (1979) then treated splits into many parts with tableaux and the chase.
References
- Ian J. Heath, Unacceptable file operations in a relational data base, Proceedings of the 1971 ACM SIGFIDET Workshop on Data Description, Access and Control, 19 to 33 (1971), a relation that satisfies a functional dependency is the join of two of its projections
- Ronald Fagin, Multivalued dependencies and a new normal form for relational databases, ACM Transactions on Database Systems 2(3), 262 to 278 (1977), the definition of multivalued dependencies and the theorem that a relation is the join of its projections on XY and XZ exactly when X ->> Y holds
- Serge Abiteboul, Richard Hull and Victor Vianu, Foundations of Databases, Addison-Wesley (1995), Chapter 8 (functional and join dependency), multivalued dependencies and lossless joins
- Jeffrey D. Ullman, Principles of Database and Knowledge-Base Systems, Volume I, Computer Science Press (1988), Chapter 7 (design theory for relational databases), lossless-join decompositions and multivalued dependencies
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag CHJRS4 Edit this page History Report an error Markdown