My obsession with set theory continues. I believe that most programming languages have neither sets as possible structures nor set theory operations such as Union and Intersection. If I am wrong then this question becomes trivial and I learn something new.
It would be fun to ask for the code golf construction of a full set structure where a set could contain any possible structures within the language and operators such as is a member of, is a subset of, union and intersection etc. However that is much too broad. So I will simplify the puzzle.
An Alphaset has only lower case letters as elements.
The structure for an Alphaset can be defined as you wish and the method used should be explained. It could be just a list of letters read from a file.
As an example I will use an array as a structure for an Alphaset.
An Alphaset can contain a letter once only and order does not matter.
['a','b','c'], ['b','c','a'] and ['c','a','b'] are equivalent Alphasets.
The operation Union forms an Alphaset from two Alphasets.
['a','b','c'] Union ['d','a', 'g', 'b'] is ['a', 'b', 'c', 'd', 'g'] or an equivalent.
A Big Alphaset has the same structure as an Alphaset but can contain repeated letters, eg ['a', 'b', 'a', 'c', 'b'] is a Big Alphaset.
If A and B are any combination of Alphasets and Big Alphasets then A Union B must return an Alphaset.
This gives a way of producing an Alphaset from a Big Alphaset should it ever be necessary for when A is a Big Alphaset the A Union A will be an Alphaset.
A an Alphaset or Big Alphaset
B an Alphaset or Big Alphaset
An Alphaset that is the Union of A and B.
Testing should demonstrate that order of elements within the Alphaset does not matter.
ie the following should all produce equivalent results.
['a','b','c'] Union ['a', 'c', 'd']
['b','c','a'] Union ['c', 'd', 'a']
['c','b','a'] Union ['d', 'a', 'c']
Shortest code wins