The map() command is useful for distributing a function/procedure over a single, specified data container, with the other arguments fixed. For instance, for function phi(x,y,z):
map( phi, a, [b,c], d ); # [ phi(a,b,d), phi(a,c,d) ]
with the index telling Maple which argument to distribute over. Note map=map and map2=map.
The operator ~, though, operates element-wise. For phi(x,y,z) again:
phi~( [a,b], c, [d,e] ); # [ phi(a,c,d), phi(b,c,e) ]
Here, the distribution occurs in unison over the two lists (which need to be of the same size).
Of course, the results of map() and ~ may coincide:
phi~( [a,b], c, d );
map( phi, [a,b], c, d );
For your worksheet, using map~() applies map() element-wise, so (see below) X is computed as Y, and Y is computed as Z, and P treats each Ai and Bi (i=1..4) as lists (hence the subscripts):
X := map~( P, [A1, A2, A3, A4], [B1, B2, B3, B4] );
Y := [ map(P,A1,B1), map(P,A2,B2), map(P,A3,B3), map(P,A4,B4) ];
Z := [ P(A1,B1), P(A2,B2), P(A3,B3), P(A4,B4) ];
is( X = Y and Y = Z ); # true