# Dom::ImageSet

Domain of images of sets under mappings

## Syntax

### Domain Creation

`Dom::ImageSet()`

### Element Creation

`Dom::ImageSet(`f`, `x`, `S`)`
`Dom::ImageSet(`f`, `[x1, …]`, `[S1, …]`)`

## Description

### Domain Creation

`Dom::ImageSet` is the domain of all sets of complex numbers that can be written as the set of all values taken on by some mapping, i.e., sets of the form for some function f and some sets S1, …, Sn.

Image sets are mainly used by `solve` to express sets like .

`Dom::ImageSet` belongs to the category `Cat::Set`—arithmetical and set-theoretic operations are inherited from there.

### Element Creation

`Dom::ImageSet(f, x, S)` represents the set of all values that can be obtained by substituting some element of `S` for `x` in the expression `f`.

`Dom::ImageSet(f, [x1, ...], [S1, ...])` represents the set of all values that can be obtained by substituting, for each i, the identifier xi by some element of Si in the expression `f`.

`Dom::ImageSet(f, x, S)` represents the set . ```Dom::ImageSet(f, [x1, ..., xn], [S1, ..., Sn])``` represents the set .

`f` need not contain `x`; on the other hand, it may contain other identifiers (free variables).

If a list of several identifiers is given, the identifiers must be distinct.

`S` must be a set; see `solve` for an overview of the different kinds of sets in MuPAD®.

`Dom::ImageSet` carries out some automatical simplifications that may produce a result of a type different from `Dom::ImageSet`.

`Dom::ImageSet` renames the variables ```x1, ..., xn```, in order to avoid naming conflicts as well as producing a nicer output.

## Superdomain

`Dom::BaseDomain`

## Categories

`Cat::Set`

## Examples

### Example 1

We define S to be the set of all integer multiples of π.

`S:= Dom::ImageSet(ugly*PI, ugly, Z_)`

Our ugly variable name has been replaced by a nicer one which suggests that it represents an integer.

We may now apply the usual set-theoretic operations.

`S intersect Dom::Interval(3..7)`

### Example 2

An element of an image set may be obtained by substituting all parameters by some values:

`S:= Dom::ImageSet(a^7 + b^3 + C, [a, b], [Z_, Z_])`

On calling the `evalParam` method, we have to take care that the variable names have been replaced.

`Dom::ImageSet::evalParam(S, k = 3, l = 5)`

The same may be achieved using the index operator:

`S[3, 5]`

Substituting only for one parameter, we obtain an image set in the other parameter:

`Dom::ImageSet::evalParam(S, k = 3)`

A parameter may be substituted by itself, meaning that it becomes a free variable:

`Dom::ImageSet::evalParam(S, k = k)`

The `evalParam` method cannot be used to substitute a free variable:

`Dom::ImageSet::evalParam(S, C = 3)`

`delete S:`

## Parameters

 `f` Arithmetical expression `x` Identifier or indexed identifier `S` Set of any type

expand all

## Mathematical Methods

### `changevar` — Change the name of a variable

`changevar(A, oldvar, newvar)`

The new variable `newvar` must not equal any element of the list of variables; this is not checked!

### `setvar` — Set the name of the variable

`setvar(A, newvar)`

`setvar(A, newvar)`

For an argument `A` that is not an image set, the method `"setvar"` is applied to all image sets contained in the expression `A`. `A` might be, for example, a union, intersection, etc. of image sets and other sets.

### `homogpointwise` — Define an n-ary pointwise operator for image sets

`homogpointwise(Op)`

`Op` must accept arithmetical expressions as arguments.

### `isEmpty` — Test whether a set is empty

`isEmpty(A)`

### `substituteBySet` — Substitute an ImageSet for a variable

`substituteBySet(a, x, A)`

### `freeIndets` — Free parameters of a set

`freeIndets(A)`

If , the xi are called bound and the yi are called free parameters.

Use the slot `"variables"` to obtain the bound parameters.

### `evalParam` — Insert values for bound parameters

`evalParam(A(x = value, …))`

If `x` is not a parameter, but a free variable of `A`, it is not substituted by `value`.

`value` may be an identifier or contain identifiers; in particular, it may contain `x` and/or some of the remaining parameters. This may be used to convert parameters into free variables.

Several parameters may be replaced in a single call.

See Example 2.

### `_index` — Extract element by inserting values for bound parameters

`_index(A, value1, …)`

The number of values passed must match the number of variables of `A`.

It is not checked whether for each i, the value for the ith parameter belongs to the ith set.

See Example 2.

## Access Methods

### `expr` — Defining mapping as an expression

`expr(A)`

This method overloads the function `expr`.

### `variables` — List of variables

`variables(A)`

The free parameters (identifiers appearing in f other than the xi) can be obtained using the `"freeIndets"` slot.

### `nvars` — Number of variables

`nvars(A)`

### `sets` — List of sets

`sets(A)`

## Technical Methods

### `print` — Print image set

`print(A)`