MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: operators for relations in sets


On 13 Sep 2005, at 19:07, hawkmoon269 wrote:

> I'm having some difficulty understanding the behaviour of the  
> operators
> for relations in sets in Mathematica.  For instance,
>
> TrueQ[{1}\[SubsetEqual]{1}]
>
> returns
>
> False
>
> I'm not getting what's going on here...
>
> h
>
>

First of all, \[SubsetEqual] is not defined in Mathematica. You can  
define your own function SubsetEqual as:

SubsetEqual[A_List, B_List] := Intersection[A, B] == A

so that


SubsetEqual[{1},{1,2}]

True

etc. If you really want with the help of the Notation package you can  
make the infix form A\[SubsetEqual]B equivalent to Subsetequal[A,B]  
(although i would not bother).

As for TrueQ, it serves a completely different purpose. Note that  
TrueQ always gives False whenever something is not explicitly true,  
for example


TrueQ[Sin[x]^2+Cos[x]^2==1]

False

although


TrueQ[Simplify[Sin[x]^2+Cos[x]^2==1]]

True

TrueQ has its uses but your example is not one  of them!.

Andrzej Kozlowski


  • Prev by Date: Re: High precision NIntegrate problem. Please help!
  • Next by Date: Re: operators for relations in sets
  • Previous by thread: operators for relations in sets
  • Next by thread: Batch