Element
Generated from the engine's own definition: compute-engine's symbol, which we neither extend nor document by hand.
Test whether a value is an element of a collection. Optional third argument is a boolean expression (condition) for filtered iteration in Sum/Product. Element supports two modes of operation: 1. Set membership: Element(3, [List, 1, 2, 3]) checks if 3 is in the list 2. Type-style membership: Element(x, integer) checks if x has type integer Type-style membership works with: - Mathematical sets: Integers, RealNumbers, ComplexNumbers, etc. - Type names: integer, rational, real, number, positive_integer, etc. - Invalid type names remain unevaluated (e.g., Element(2, "Booleans"))
ElementWolfram LanguageElement!Element(any, any, boolean?) -> booleanTest whether a value is an element of a collection. Optional third argument is a boolean expression (condition) for filtered iteration in Sum/Product.
Element supports two modes of operation:
1. Set membership: Element(3, [List, 1, 2, 3]) checks if 3 is in the list
2. Type-style membership: Element(x, integer) checks if x has type integer
Type-style membership works with:
- Mathematical sets: Integers, RealNumbers, ComplexNumbers, etc.
- Type names: integer, rational, real, number, positive_integer, etc.
- Invalid type names remain unevaluated (e.g., Element(2, "Booleans"))Typed signatures
| Type | Package | Applies |
|---|---|---|
(any, any, boolean?) -> boolean | combinatoricsreplaces number-theory | always |
(any, any, boolean?) -> boolean | compute-engine | always |
(any, any, boolean?) -> boolean | frontendreplaces combinatorics | always |
(any, any, boolean?) -> boolean | hypercomplexreplaces structures | always |
(any, any, boolean?) -> boolean | number-theoryreplaces numerals | always |
(any, any, boolean?) -> boolean | numeralsreplaces residues | always |
(any, any, boolean?) -> boolean | residuesreplaces hypercomplex | always |
(any, any, boolean?) -> boolean | structuresreplaces compute-engine | always |
Examples
About
| Examples | 7 |
|---|---|
| Checked against | Wolfram Language 6 agree1 differ |
| Crosswalk | FungrimWolfram LanguageSageMath |
Implementation
wolframpackages/oracle/src/mappings.tsOnly a real match for a Wolfram domain symbol as the second operand (Element[7, Primes], kernel-verified True); against a literal list or one of our own collections (a diagram algebra's basis, PolygonalNumbers(k), …) real Element stays unevaluated instead of erroring, so the scan will record those as disagreements rather than a wrong-but-silent answer.
sagepackages/oracle/src/mappings.ts