MathGroup Archive 2000

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

Search the Archive

Re: ReplaceAll in Element[] Q

  • To: mathgroup at
  • Subject: [mg25640] Re: [mg25599] ReplaceAll in Element[] Q
  • From: Andrzej Kozlowski <andrzej at>
  • Date: Mon, 16 Oct 2000 03:04:57 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Indeed, this looks strange but actually are  a victim of an "optical
illusion". Observe:


(a | b) \[Element] Reals
In other words,   Element[List[variables],Domain] is automatically converted
to Element[Alternatives[ variables],Domain]. These two forms are  equivalent
if entered as input, e.g.
a \[Element] Reals
a \[Element] Reals
You can understand why these two approaches, using List and using
Alternatives, are equivalent if you look at the documentation for Element:
Element[x, dom] asserts that x is an element of the domain
   dom. Element[{x1, x2, ... }, dom] asserts that all the xi
   are elements of dom. Element[patt, dom] asserts that any
   expression matching the pattern patt is an element of dom.
Since Alternatives[a,b] is a pattern, the last part of the above applies.
The statement Element[Alternatives[variables],dom] means that any expression
matching Alternatives[variables] is an element of Dom. But every variable in
variables matches Alternatives[variables]. Thus the statement amounts to
saying that all variables are in dom, which is the same as
on 00.10.11 4:50 PM, Arturas Acus at acus at wrote:
> Dear Group,
> Could anybody help me in understanding this
> obviously strange behaviour
> In[22]:=$Version
> Out[22]="4.0 for Linux (April 21, 1999)"
> In[23]:=ReplaceAll[Element[Alternatives[a, b], Reals], Alternatives -> List]
> Out[23]=(a | b) \[Element] Reals
> Why not replaced ??? Compare:
> In[24]:=ReplaceAll[El[Alternatives[a, b], Reals], Alternatives -> List]
> Out[24]=El[{a, b}, Reals]
> As expected
> Dr. Arturas Acus
> Institute of Theoretical
> Physics and Astronomy
> Gostauto 12, 2600,Vilnius
> Lithuania
> E-mail: acus at
> Fax: 370-2-225361
> Tel: 370-2-612906
Andrzej Kozlowski
Toyama International University

  • Prev by Date: Re: limits
  • Next by Date: How do you create a ListContourPlot from a mesh of non-equally spaced real numbers?
  • Previous by thread: Re: ReplaceAll in Element[] Q
  • Next by thread: careers with mathematica?