The PowerSet constructor returns a structure comprising the subsets of a given structure R; it is mainly useful as a parent for other set and sequence constructors. The only operations that are allowed on power sets are printing, testing element membership, and coercion into the power set (see the examples below).
The structure comprising all enumerated subsets of structure R.
The structure comprising all indexed subsets of structure R.
The structure consisting of all submultisets of the structure R.
The structure comprising all formal subsets of structure R.
Returns true if enumerated set S is in the power set P, that is, if all elements of the set S are contained in or coercible into R, where P is the power set of R; false otherwise.
Returns true if indexed set S is in the power set P, that is, if all elements of the set S are contained in or coercible into R, where P is the power set of R; false otherwise.
Returns true if multiset S is in the power set P, that is, if all elements of the set S are contained in or coercible into R, where P is the power set of R; false otherwise.
Return a set with universe R consisting of the elements of the set S, where P is the power set of R. An error results if not all elements of S can be coerced into R.
Return an indexed set with universe R consisting of the elements of the set S, where P is the power indexed set of R. An error results if not all elements of S can be coerced into R.
Return a multiset with universe R consisting of the elements of the set S, where P is the power multiset of R. An error results if not all elements of S can be coerced into R.
> S := { 1 .. 10 }; > P := PowerSet(S); > P; Set of subsets of { 1 .. 10 } > F := { 6/3, 12/4 }; > F in P; true > G := P ! F; > Parent(F); Set of subsets of Rational Field > Parent(G); Set of subsets of { 1 .. 10 }
Using car< > and CartesianProduct( ), it is possible to create the Cartesian product of sets (or, in fact, of any combination of structures), but the result will be of type `Cartesian product' rather than set, and the elements are tuples --- we refer the reader to Chapter TUPLES AND CARTESIAN PRODUCTS for details.