complementUnion<T> static method

bool complementUnion<T>(
  1. CustomSet<T> a,
  2. CustomSet<T> universal
)

Verifies the Complement Law for Union.

Law: A ∪ A' = U

The union of a set and its complement equals the universal set.

Implementation

static bool complementUnion<T>(CustomSet<T> a, CustomSet<T> universal) {
  final complement = SetOperations.complement(a, universal);
  return SetOperations.union(a, complement).equals(universal);
}