Loading learning content...
Functional dependencies, like mathematical statements, have an inner logic that allows us to derive new dependencies from existing ones. This derivation process is not arbitrary—it follows precise inference rules that are guaranteed to produce only valid conclusions.
The ability to derive FDs is essential for:
In this page, we master the inference machinery that powers all FD analysis—Armstrong's axioms and their derived rules.
By the end of this page, you will be able to apply Armstrong's axioms to derive new FDs, use derived rules (union, decomposition, pseudotransitivity) for efficient derivation, construct formal derivation proofs, understand the soundness and completeness of the inference system, and recognize common derivation patterns in practice.
Armstrong's axioms are the three fundamental inference rules from which all FD derivation flows. Though introduced in an earlier module, we review them here with a focus on their application in derivation.
The Three Axioms
Soundness and Completeness
Armstrong's axioms have two crucial properties:
Soundness: Every FD derivable using the axioms is logically valid—it holds in every relation that satisfies the original FDs.
Completeness: Every FD that logically follows from a set F can be derived using the axioms—nothing valid is missed.
Together, these properties mean the axioms give us exactly the right set of derivable FDs, no more and no less.
$$\text{F} \vdash (X \to Y) \iff \text{F} \vDash (X \to Y)$$
where ⊢ means "can derive" (syntactic) and ⊨ means "logically implies" (semantic).
Soundness ensures we never derive a false dependency—everything we prove is actually enforced by the original constraints. Completeness ensures we can discover all hidden dependencies—nothing is beyond our derivation power. Together, they make FD analysis reliable and complete.
While Armstrong's three axioms are sufficient to derive any valid FD, they can be cumbersome to apply step-by-step. Several derived rules provide convenient shortcuts. Each derived rule can be proven from the axioms.
Rule 4: Union (Additive) Rule
If X → Y and X → Z, then X → YZ.
Proof from axioms:
Rule 5: Decomposition (Projective) Rule
If X → YZ, then X → Y and X → Z.
Proof from axioms:
Rule 6: Pseudotransitivity Rule
If X → Y and WY → Z, then WX → Z.
Proof from axioms:
Rule 7: Composition Rule
If X → Y and Z → W, then XZ → YW.
Proof from axioms:
| Rule | If We Have... | We Can Derive... |
|---|---|---|
| Reflexivity | Y ⊆ X | X → Y |
| Augmentation | X → Y | XZ → YZ |
| Transitivity | X → Y, Y → Z | X → Z |
| Union | X → Y, X → Z | X → YZ |
| Decomposition | X → YZ | X → Y, X → Z |
| Pseudotransitivity | X → Y, WY → Z | WX → Z |
| Composition | X → Y, Z → W | XZ → YW |
Deriving FDs requires a systematic approach. While intuition helps identify likely derivable FDs, a formal process ensures correctness.
The Derivation Question
Given an FD set F and a potential FD X → Y, we want to determine: Can X → Y be derived from F?
Method 1: Direct Proof
Construct a sequence of FDs, each either in F or derived from previous ones using inference rules, ending with X → Y.
Method 2: Attribute Closure
Compute X⁺_F (the attribute closure of X under F). If Y ⊆ X⁺_F, then X → Y is derivable.
This method is faster and less error-prone for verification. It works because:
$$X \to Y \in F^+ \iff Y \subseteq X^+_F$$
Use attribute closure for quick verification of specific FDs. Use direct proof when you need to demonstrate the derivation chain explicitly, such as in exams, proofs, or when explaining to others why an FD follows from given constraints.
Example: Complete Derivation
Given F = {A → B, B → C, CD → E} over U = {A, B, C, D, E}.
Claim: AD → E is derivable from F.
Direct Proof:
| Step | FD | Justification |
|---|---|---|
| 1 | A → B | Given in F |
| 2 | B → C | Given in F |
| 3 | A → C | Transitivity (1, 2) |
| 4 | AD → CD | Augmentation of (3) with D |
| 5 | CD → E | Given in F |
| 6 | AD → E | Transitivity (4, 5) |
Verification via Attribute Closure:
Compute {A, D}⁺_F:
Is E ⊆ {A, B, C, D, E}? Yes. ✓
Both methods confirm AD → E is derivable.
Experienced database designers recognize recurring patterns in FD derivation. Internalizing these patterns accelerates analysis.
Pattern 1: Transitive Chains
If A → B, B → C, C → D, ..., then A → X for any X in the chain.
This is repeated application of transitivity. The attribute closure of A includes everything reachable via the chain.
Pattern 2: Parallel Determination
If A → B and A → C, then A → BC (union rule).
This shows that if A determines multiple attributes independently, it determines all of them together.
Pattern 3: Key Extension
If X is a superkey (X → U where U is all attributes) and W is any subset, then XW → U as well.
Augmenting a superkey with additional attributes still yields a superkey. This is why candidate keys are minimal superkeys—we can't remove any attribute without losing the superkey property.
Pattern 4: Composite LHS Building
To derive X → Z where the path goes through an FD with composite LHS, use augmentation:
If A → B and BC → D, then AC → D.
Derivation:
This is actually pseudotransitivity: from A → B and BC → D, derive AC → D.
Pattern 5: Decomposition for Targeted Derivation
To check if X → A (a single attribute), use closure:
Rather than deriving X → AB...C and then decomposing, just compute X⁺ and check if A ∈ X⁺.
This leverages the fact that X → A iff A ∈ X⁺, avoiding unnecessary derivation of compound FDs.
Complex derivations can be visualized as derivation trees, where each node represents an FD and edges connect premises to conclusions.
Example: Derivation Tree
Given F = {A → B, B → C, A → D, CD → E}, derive A → E.
textual derivation:
Reading the Tree:
Benefits of Derivation Trees:
One of the most important applications of FD derivation is finding candidate keys. A candidate key K is a minimal set of attributes such that K → U (K determines all attributes).
The Key-Finding Strategy
To find candidate keys:
Example: Finding Candidate Keys
Let U = {A, B, C, D, E} with F = {A → B, BC → D, D → E}.
Step 1: Classify attributes
| Attribute | Appears on LHS | Appears on RHS | Classification |
|---|---|---|---|
| A | Yes (A → B) | No | Must be in key |
| B | Yes (BC → D) | Yes (A → B) | Maybe in key |
| C | Yes (BC → D) | No | Must be in key |
| D | Yes (D → E) | Yes (BC → D) | Maybe in key |
| E | No | Yes (D → E) | Never in key |
Step 2: Start with must-have attributes
Candidate must include A and C. Try {A, C}:
{A, C}⁺ = ?
{A, C}⁺ = U, so AC is a superkey.
Step 3: Check minimality
Neither A nor C alone is a superkey, so AC is minimal.
Conclusion: AC is a candidate key.
A relation can have multiple candidate keys. After finding one, systematically explore other combinations of must-have attributes with maybe-in-key attributes that weren't part of the first key. if an attribute appears on both LHS and RHS, it might be in some candidate keys but not others.
Not all FDs can be derived, and not all attributes are reachable from arbitrary starting points. Understanding what cannot be derived is as important as knowing what can.
Definition: Undetermined Attribute
An attribute A is undetermined by a set X under F if A ∉ X⁺_F. This means no sequence of derivations from F can establish X → A.
Why Attributes Remain Undetermined
An attribute A is unreachable from X if:
A never appears on RHS of any FD — No FD determines A; it can only be determined by itself or superkeys containing it.
Path to A is blocked — The FD(s) that determine A have LHS attributes not in X⁺.
Example: Unreachable Attributes
Let U = {A, B, C, D} with F = {A → B, C → D}.
Compute {A}⁺:
Attributes C and D are undetermined from A. There's no chain of FDs connecting A to C or D.
This tells us:
If attribute A never appears on the RHS of any FD, then A must be part of every candidate key. Since no other attribute can determine A, A must be given explicitly in any key that determines all attributes.
Proof of Non-derivability
To prove X → A is NOT derivable from F:
By completeness of Armstrong's axioms, if X → A is not in F⁺, it cannot be derived—period. There's no hidden proof we might be missing.
The ability to derive FDs is a core competency in database theory. With Armstrong's axioms and their derived rules, we have a complete and sound inference system for functional dependencies.
What's Next:
Now that we can derive FDs fluently, we're ready to address a practical question: Given two FD sets, how do we systematically test if they're equivalent? The next page covers Testing Equivalence—efficient algorithms for determining whether two FD sets impose identical constraints.
You now have comprehensive knowledge of FD derivation techniques. From basic axioms to complex derivation trees, you can construct proofs, verify conclusions, and understand the logical structure of functional dependencies. Next, we formalize the process of testing FD set equivalence.