Sets, Lists, some basics.
A set is denoted by {} and a list by []. Both may be empty.
> S1:= {}; S2 := {1, 23}; S3 := {23,4,5};
Union, intersection and minus (set difference) can be accomplished two ways. Notice the back quote. The second form is more compact for more than two sets.
> T1 := S2 union S3; T2 := `intersect`(S2, S3,T1);
You can test for membership and the result is of type boolean.
> b := member(1, S1); c := member(1, S2);
>
> type(b,boolean);
> b and c;
Lists
> L1 := [2,3,5,2,3,6,2,3]; L2 := [3,4,8,9];
> nops(L1); op(3,L1); [op(1..6,L1)]; {op(1..6,L1)};
> convert(L1,set);
> L3 := [op(L1),op(L2)];
> L3 := map(x -> x^2, L2);