Re: operators for relations in sets
- To: mathgroup at smc.vnet.net
- Subject: [mg60346] Re: [mg60338] operators for relations in sets
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Wed, 14 Sep 2005 03:27:14 -0400 (EDT)
- References: <200509131007.GAA09833@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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
- References:
- operators for relations in sets
- From: "hawkmoon269" <rson@new.rr.com>
- operators for relations in sets