deMorganIntersection<T> static method
Verifies De Morgan's Law for Intersection.
Law: (A ∩ B)' = A' ∪ B'
The complement of an intersection equals the union of the complements.
Implementation
static bool deMorganIntersection<T>(
CustomSet<T> a,
CustomSet<T> b,
CustomSet<T> universal,
) {
final intersection = SetOperations.intersection(a, b);
final complementIntersection = SetOperations.complement(
intersection,
universal,
);
final complementA = SetOperations.complement(a, universal);
final complementB = SetOperations.complement(b, universal);
final unionComplements = SetOperations.union(complementA, complementB);
return complementIntersection.equals(unionComplements);
}