# Given a list A returns true if one of the possibilities of sums of
SumSqRtsIsZero:=proc(A) local gu,i,j,mu,lu:
gu:={0}:
end:
# square roots of the members of A sums to 0
# If the list A has n entries, the set gu consists of all the
2^n possibilities of
# +-A[1]+-A[2]+- ... +-A[n] . Then Maple takes the square of each,
# simplifies, and returns true if any of them is zero. Otherwise it
# returns false.
for i from 1 to nops(A) do
mu:={}: lu:=simplify(sqrt(A[i])):
for j from 1 to nops(gu) do
mu:=mu union {gu[j]+lu,gu[j]-lu}:
od:
gu:=mu:
od:
for i from 1 to nops(gu) do
if expand(simplify(expand(gu[i]^2),symbolic))=0 then RETURN(true):fi:
od:
false: