 assume - Maple Help

The Assume Facility Calling Sequence assume(proposition_1, proposition_2, ...) additionally(proposition_1, proposition_2, ...) is(proposition_1) coulditbe(proposition_1) about(x1) hasassumptions(x1) getassumptions(x1) getassumptions(x1, relation=relationtype) addproperty(prop1, parents, children) Parameters

 proposition_i - proposition describing the properties of variables or expressions xi - expression on which assumptions can be placed prop1 - property parents, children - sets of properties Description

 • The assume routine sets variable properties and relationships between variables. Similar functionality is provided by the assuming command.
 • The call assume(proposition_1, proposition_2, ...) is an assertion that each of the propositions proposition_i is true, for all possible values of the parameters therein. Subsequent computations will therefore proceed assuming that these propositions are true.
 • The parameters proposition_i can take multiple forms:
 – A relation x=y, xy.
 – x::p where x is any expression and p is a property as described below
 – x in y where x is any expression and y is a set, a property, or SetOf(p) where p is a property
 – A function of propositions of this or any of the above forms using the boolean operators And, Or, or Not
 – Either true or false
 – A sequence of two elements x, p where x is any expression (that's not a valid proposition as described above) and p is a property. Note that a proposition in this form cannot be combined using And, Or, or Not as described above, though you can submit multiple such sequences in one call to assume, as in assume(x1, p1, x2, p2).
 • A common use of the assume function is assume(a>0). This states that the symbol a is assumed to be a positive real constant.  Having made such an assumption, Maple routines are able to use this information to simplify expressions, for example, sqrt(a^2*b) to a*sqrt(b), and evaluate inequalities, for example, is(a+1>0) returns true. Note: Both sides of an inequality assumption are implicitly assumed real (and finite), unless they are identical to infinity or -infinity.
 • When you make assumptions about a variable, thereafter it prints with an appended tilde (~) to indicate that the variable carries assumptions.  This behavior can be changed, if desired, by updating the showassumed interface setting (see interface).
 • To define the ordering a
 • When the assume function is used to make an assumption about an expression x, all previous assumptions on x are removed. For example, if you enter assume(x>0) then assume(x<0), there is no contradiction.  Similarly, assume(0
 • The additionally function adds additional assumptions without removing previous assumptions. It has the same syntax as assume.  Its functionality differs from assume only in that additionally adds the given properties to the set of preexisting properties of the object(s) included. If you want to assume various properties in several steps, the first call should be to assume and further calls to additionally.  For example, to assume $0, the user can use assume(x>0) then additionally(x<1).
 • Assumptions made on names can be removed by unassigning names. For example, having made assumption(s) on x, x := 'x' clears them.
 • The is routine determines whether the given proposition is satisfied. It returns true, false, or FAIL. The is routine returns true if the proposition is satisfied for all possible values of the variables in the proposition. The is routine returns false if there are any possible values for the parameters in the proposition such that the proposition is not satisfied. The is function returns FAIL if it cannot determine whether the proposition is always satisfied. This is a result of insufficient information or an inability to compute the logical derivation.
 Important: If the is command is used with a Maple type typename, it returns true if the corresponding type(..., typename) command returns true. This may lead to unexpected results.
 • There are convenient tests that can be used when programming with variables that carry assumptions. To test if the expression is real, use is(Im(x)=0). To test whether x is real and positive, use is(signum(x)=1). To test whether x is an integer, use is(Im(x)=0) and is(frac(x)=0).
 • The coulditbe routine determines whether there is a set of values for the parameters in the proposition such that the proposition is satisfied. It returns true, false, or FAIL. The coulditbe routine returns true if there is a set of such parameter values for which the proposition is true. The coulditbe routine returns false if there is no such set of parameter values making the proposition true. The coulditbe routine returns FAIL if it cannot determine whether there is any such set of parameter values making the property true.  This is a result of insufficient information or an ability to compute the logical derivation.
 • The environment variable _EnvTry can be used to specify the intensity of the testing by the is and coulditbe routines. Currently _EnvTry can be set to normal (the default) or hard. If _EnvTry is set to hard, is and coulditbe calls can take exponential time.
 • The about(x1) function returns assumption and property information for x1.
 • The hasassumptions(x1) function returns true if something has been assumed about x1 and false otherwise.
 • The getassumptions(x1) function returns the set of all relevant assumptions in the form expression::property.
 • If the extra option relation=relationtype is provided, getassumptions will decide which assumptions are considered relevant based on the value of relationtype, according to the following table. A name v is assumable if type(v, assumable_name) returns true. Almost all names are assumable; the main exceptions are constants, names of type last_name_eval, and names reserved for internal use by the Maple system. The default value of relationtype is default.

 relationtype exclusive the set of assumptions on objects containing names in x1 but no other assumable names. direct the set of assumptions on objects containing names in x1 (and possibly other names). indirect the set of assumptions linked to a name in x1 via a chain of assumptions connected by assumable names e.g. assume(x>y, y>z); getassumptions(x, relation=indirect) returns both assumptions because they are connected through the name y. default the union of the exclusive set corresponding to non-assumable names in x1, and the indirect set corresponding to assumable names in x1.

 • The addproperty(prop1, parents, children) function installs a new property in the property tables.  The function must be called with the new property name and a set of the parent properties and children properties that must already be defined in the property lattice.  The empty set can be given to specify no parent or children properties. For example, suppose you have defined properties complex and integer and wish to define the new property real. Use addproperty(real, {complex}, {integer}) to specify that all reals are complex and all integers are real.
 • A property can be a:

 property name for example, continuous, unary most type names for example, integer, float numerical range for example, RealRange( a, b ), RealRange( -infinity, b ), RealRange( a, infinity ) where a and b can be either numeric values or Open(a) where a is a numeric value.  Ranges are not placed in the lattice unless explicitly requested because assume knows how to compute their inclusions directly.  The addproperty routine inserts a RealRange in the lattice;  this is only needed when another property in the lattice relates (as parent or child) to a RealRange. AndProp(a,b,...) the conjunction of properties a, b, ... That is, a and b and .. where a, b, etc. are properties as defined above.  This property describes objects that satisfy all of the properties a,  b, ...  An AndProp is not placed in the lattice. OrProp(a,b,...) the disjunction of properties a, b, ... That is, a or b or .. where a, b, etc. are properties as defined above.  This property describes objects that satisfy at least one of the properties a,  b, ...  An OrProp is not placed in the lattice. Non(a) the negation of property a. That is, not a where a is a property as defined above.  This property describes objects that do not satisfy the property a.  A Non is not placed in the lattice. property range prop1 .. prop2 where prop1 and prop2 are properties such that prop1 is included in prop2.  This property means that the object satisfies at least prop2 but not more than prop1.  For example, integer .. rational is satisfied by integers/2. A property range is not placed in the lattice.

 • For more information on properties for the assume facility, see property.
 • For more information on parametric properties for the assume facility, see assume/parametric. Examples Using the same assumptions on multiple computations

 When performing various computations using the same assumptions use assume
 > $\mathrm{assume}\left(0
 > $\mathrm{signum}\left(a\right)$
 ${1}$ (1)
 > $\mathrm{ℜ}\left(a+1\right)$
 ${\mathrm{a~}}{+}{1}$ (2)
 > $\mathrm{ℑ}\left(a+1\right)$
 ${0}$ (3)
 > $\sqrt{{a}^{2}}$
 ${\mathrm{a~}}$ (4)
 > $\mathrm{ln}\left({ⅇ}^{a}\right)$
 ${\mathrm{a~}}$ (5)
 > $\mathrm{about}\left(a\right)$
 Originally a, renamed a~:   is assumed to be: RealRange(Open(0),infinity)
 Similar functionality is provided by the assuming command, but the assumptions are valid only during the computation of one input statement, and no assumptions are placed on the variables. Placing assumptions on expressions

 Assumptions can be placed on expressions
 > $\mathrm{assume}\left(a+b,'\mathrm{real}',0
 > $\mathrm{hasassumptions}\left(a\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{getassumptions}\left(a\right)$
 $\left\{\left({\mathrm{a~}}{+}{\mathrm{b~}}\right){::}{\mathrm{real}}\right\}$ (7)
 > $\mathrm{getassumptions}\left(a+c\right)$
 $\left\{{\mathrm{c~}}{::}\left({0}{,}{\mathrm{\infty }}\right){,}\left({\mathrm{a~}}{+}{\mathrm{b~}}\right){::}{\mathrm{real}}\right\}$ (8)
 > $a≔'a';$$b≔'b';$$c≔'c'$
 ${a}{≔}{a}$
 ${b}{≔}{b}$
 ${c}{≔}{c}$ (9)
 > $\mathrm{signum}\left(a\right)$
 ${\mathrm{signum}}{}\left({a}\right)$ (10) Making multiple assumptions on an expression

 When the assume function is used to make an assumption about an expression x, all previous assumptions on x are removed unless the assume function is used with multiple arguments.
 > $\mathrm{assume}\left(-5
 > $\mathrm{assume}\left(x<0\right)$
 > $\mathrm{about}\left(x\right)$
 Originally x, renamed x~:   is assumed to be: RealRange(-infinity,Open(0))
 > $\mathrm{assume}\left(-5
 > $\mathrm{about}\left(x\right)$
 Originally x, renamed x~:   is assumed to be: RealRange(Open(-5),Open(0)) Adding new assumptions without removing previous assumptions

 > $\mathrm{assume}\left(-1
 > $\mathrm{is}\left(x::\mathrm{positive}\right)$
 ${\mathrm{false}}$ (11)
 > $\mathrm{coulditbe}\left(x::\mathrm{positive}\right)$
 ${\mathrm{true}}$ (12)
 > $\mathrm{additionally}\left(x<1\right)$
 > $\mathrm{is}\left(1-{x}^{2},'\mathrm{positive}'\right)$
 ${\mathrm{true}}$ (13)
 > $\mathrm{coulditbe}\left(1-{x}^{2}=1.0\right)$
 ${\mathrm{true}}$ (14)
 Many assumptions can be input simultaneously:
 > $\mathrm{assume}\left(5
 > $\mathrm{is}\left(xy<50\right)$
 ${\mathrm{true}}$ (15)
 > $\mathrm{coulditbe}\left(xy<-200\right)$
 ${\mathrm{true}}$ (16) Finding values for an expression that do not satisfy a property

 The is command returns false if there are possible values of an expression that do not satisfy a property. The following example returns false because there are possible values, such as -1, for which 2*x is not positive.
 > $\mathrm{assume}\left(x::\mathrm{integer}\right)$
 > $\mathrm{is}\left(0<2x\right)$
 ${\mathrm{false}}$ (17)
 Even without assumptions, is has knowledge about the properties of some mathematical functions:
 > $\mathrm{about}\left(z\right)$
 > $\mathrm{is}\left(\mathrm{ℜ}\left(z\right),'\mathrm{real}'\right)$
 ${\mathrm{true}}$ (18) Specifying a Maple type with the is command

 The is command may return unexpected results if specified with a Maple type. Although there are assumptions on x that specify it is not a name, the is command returns true because the corresponding type command returns true.
 > $\mathrm{about}\left(x\right)$
 Originally x, renamed x~:   is assumed to be: integer
 > $\mathrm{is}\left(x,'\mathrm{name}'\right)$
 ${\mathrm{true}}$ (19)
 > $\mathrm{type}\left(x,'\mathrm{name}'\right)$
 ${\mathrm{true}}$ (20) Imposing integer assumptions on an expression

 Impose integer assumptions.
 > $\mathrm{assume}\left(n::\mathrm{integer}\right)$
 > $\mathrm{frac}\left(n\right)$
 ${0}$ (21)
 > $\mathrm{sin}\left(n\mathrm{Pi}\right)$
 ${0}$ (22)
 > $\mathrm{cos}\left(n\mathrm{Pi}\right)$
 ${\left({-1}\right)}^{{\mathrm{n~}}}$ (23)
 > $\mathrm{assume}\left(\frac{i}{2},'\mathrm{integer}'\right)$
 > $\mathrm{is}\left(\frac{i}{2}+1,'\mathrm{integer}'\right)$
 ${\mathrm{true}}$ (24)
 > $\mathrm{coulditbe}\left(\frac{i}{3},'\mathrm{integer}'\right)$
 ${\mathrm{true}}$ (25) Imposing real assumptions on an expression

 Impose real assumptions.
 > $\mathrm{ln}\left({ⅇ}^{z}\right)$
 ${\mathrm{ln}}{}\left({{ⅇ}}^{{z}}\right)$ (26)
 > $\mathrm{assume}\left(z,'\mathrm{real}'\right)$
 > $\mathrm{is}\left(0\le {z}^{2}\right)$
 ${\mathrm{true}}$ (27)
 > $\mathrm{coulditbe}\left({z}^{2}\le 0\right)$
 ${\mathrm{true}}$ (28)
 > $\mathrm{ln}\left({ⅇ}^{z}\right)$
 ${\mathrm{z~}}$ (29) Using about or getassumptions on a solution returned by Maple

 • Sometimes the solution to a system of equations (and/or inequalities) includes variables with the prefix _Z, _NN, or _B. If there are assumptions on such a variable, indicated with ~, you can use about or getassumptions to find out more.
 > $\mathrm{solve}\left(\left\{\mathrm{tan}\left(x\right)=1\right\},\mathrm{allsolutions}\right)$
 $\left\{{\mathrm{x~}}{=}\frac{{1}}{{4}}{}{\mathrm{\pi }}{+}{\mathrm{\pi }}{}{\mathrm{_Z1~}}\right\}$ (30)
 > $\mathrm{about}\left(\mathrm{_Z1}\right)$
 Originally _Z1, renamed _Z1~:   is assumed to be: integer
 > $\mathrm{getassumptions}\left(\mathrm{_Z1}\right)$
 $\left\{{\mathrm{_Z1~}}{::}{\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{integer}}\right]\right)\right\}$ (31) Other applications of assume

 > $\sqrt{{u}^{2}c}$
 $\sqrt{{{u}}^{{2}}{}{c}}$ (32)
 > ${∫}_{0}^{\mathrm{∞}}{ⅇ}^{-ux}{x}^{\frac{1}{3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 ${{\int }}_{{0}}^{{\mathrm{\infty }}}{{ⅇ}}^{{-}{u}{}{\mathrm{x~}}}{}{{\mathrm{x~}}}^{{1}}{{3}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{\mathrm{x~}}$ (33)
 > $\mathrm{assume}\left(0
 > $\sqrt{{u}^{2}c}$
 ${\mathrm{u~}}{}\sqrt{{c}}$ (34)
 > ${∫}_{0}^{\mathrm{∞}}{ⅇ}^{-ux}{x}^{\frac{1}{3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 $\frac{{2}{}{\mathrm{\pi }}{}\sqrt{{3}}}{{9}{}{\mathrm{\Gamma }}{}\left(\frac{{2}}{{3}}\right){}{{\mathrm{u~}}}^{{4}}{{3}}}}$ (35)
 > $\mathrm{assume}\left(u<0\right)$
 > $\sqrt{{u}^{2}c}$
 ${-}{\mathrm{u~}}{}\sqrt{{c}}$ (36)
 > ${∫}_{0}^{\mathrm{∞}}{ⅇ}^{-ux}{x}^{\frac{1}{3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 ${\mathrm{\infty }}$ (37)
 The assume function accepts ranges.
 > $\mathrm{is}\left(5,\mathrm{RealRange}\left(5,\mathrm{∞}\right)\right)$
 ${\mathrm{true}}$ (38)
 > $\mathrm{is}\left(5,\mathrm{RealRange}\left(\mathrm{Open}\left(5\right),\mathrm{∞}\right)\right)$
 ${\mathrm{false}}$ (39)
 The assume function accepts matrices.
 > $\mathrm{assume}\left(a,'\mathrm{SquareMatrix}'\right)$
 > $\mathrm{assume}\left(n,'\mathrm{integer}'\right)$
 > $\mathrm{is}\left({a}^{n},'\mathrm{SquareMatrix}'\right)$
 ${\mathrm{true}}$ (40)
 > $\mathrm{coulditbe}\left({a}^{n},'\mathrm{tridiagonal}'\right)$
 ${\mathrm{true}}$ (41)
 > $\mathrm{about}\left('\mathrm{SquareMatrix}'\right)$
 SquareMatrix:   a known property having {matrix} as immediate parents   and {NonSingular, NonSymmetric, antisymmetric, idempotent, nilpotent, singular, symmetric, triangular, tridiagonal, ElementaryMatrix, PositiveSemidefinite} as immediate children.   mutually exclusive with {0, 1, Catalan, Pi, complex, integer, list, prime, real, set, table, GaussianInteger, GaussianPrime, NumeralNonZero, composite, constant, fraction, irrational, rational, RectangularMatrix, RealRange(0,infinity), RealRange(1,infinity), RealRange(2,infinity), RealRange(-infinity,Open(0)), RealRange(Open(0),infinity)}
 Define a new property 'orthonormal' for vectors.
 > $\mathrm{addproperty}\left('\mathrm{orthonormal}',\left\{'\mathrm{vector}'\right\},\left\{\right\}\right)$
 This specifies a new property 'orthonormal' .  It also specifies that objects with this property also have the property vector.
 > $\mathrm{assume}\left(u,'\mathrm{orthonormal}'\right)$
 > $\mathrm{is}\left(u,'\mathrm{orthonormal}'\right)$
 ${\mathrm{true}}$ (42)
 > $\mathrm{is}\left(u,'\mathrm{vector}'\right)$
 ${\mathrm{true}}$ (43)
 This specifies a new property 'orthogonal'.  It also specifies that objects with this property also have the property vector, and that objects with the property orthonormal also have this property.
 > $\mathrm{addproperty}\left('\mathrm{orthogonal}',\left\{'\mathrm{vector}'\right\},\left\{'\mathrm{orthonormal}'\right\}\right)$
 > $\mathrm{assume}\left(v,'\mathrm{orthogonal}'\right)$
 > $\mathrm{is}\left(v,'\mathrm{orthonormal}'\right)$
 ${\mathrm{false}}$ (44)
 > $\mathrm{coulditbe}\left(v,'\mathrm{orthonormal}'\right)$
 ${\mathrm{true}}$ (45)
 > $\mathrm{assume}\left(a,'\mathrm{integer}'\right)$
 > $\mathrm{is}\left(a\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}'\mathrm{SetOf}'\left('\mathrm{real}'\right)\right)$
 ${\mathrm{true}}$ (46)
 > $\mathrm{is}\left(a\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}'\mathrm{SetOf}'\left('\mathrm{integer}'\right)\right)$
 ${\mathrm{true}}$ (47)
 > $\mathrm{coulditbe}\left(a\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}'\mathrm{SetOf}'\left('\mathrm{integer}'\right)\right)$
 ${\mathrm{true}}$ (48)
 > $\mathrm{assume}\left(a\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}'\mathrm{SetOf}'\left('\mathrm{prime}'\right)∖\left\{2\right\}\right)$
 > $\mathrm{is}\left(a\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}'\mathrm{SetOf}'\left('\mathrm{integer}'\right)\right)$
 ${\mathrm{true}}$ (49)
 Note: If invalid or contradictory assumptions are detected, an error may be thrown:
 > $\mathrm{assume}\left(x References

 The assume facility for Maple is based on the algorithms described in the following references:
 Weibel, Trudy, and Gonnet, Gaston. "An Algebra of Properties." Proceedings of the ISSAC-91 Conference, pp. 352-359. Bonn, July 1991.
 Weibel, Trudy and Gonnet, Gaston. "An assume facility for CAS with a sample implementation for Maple." Conference Presentation at DISCO '92, Bath, England, April 14, 1992.
 A general discussion of how to use the assume facility, its design and limitations is given in:
 Corless, Robert, and Monagan, Michael. "Simplification and the Assume Facility." Maple Technical Newsletter, Vol. 1 No. 1. Birkhauser, 1994.