SumSqRtsIsZero Definition

# Given a list A returns true if one of the possibilities of sums of
# 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.

SumSqRtsIsZero:=proc(A) local gu,i,j,mu,lu:

gu:={0}:
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:

end:


Definitions     Theorems