Type::Residue
-- a property
representing a residue classType::Residue(
rem, class)
represents the
integers n for which n-rem is divisible by
class.
assume(x,
Type::Residue(rem, class <,
subset>)
)
is(ex,
Type::Residue(rem, class <,
subset>)
)
testtype(obj,
Type::Residue(rem, class <,
subset>)
)
x |
- | an identifier or one of the expressions Re(u) or Im(u) with an identifier
u |
rem |
- | remainder as integer number between 0 and
class - 1 ; an integer larger than class - 1
will be divided by class and rem gets the
remainder of this division |
class |
- | the divider as positive integer |
subset |
- | a subset of the integers (e.g., Type::PosInt ); otherwise Type::Integer is used |
ex |
- | an arithmetical expression |
obj |
- | any MuPAD object |
assume
, is
, testtype
, Type::Even
, Type::Integer
, Type::Odd
assume(x,
Type::Residue(rem, class)
) marks the identifier
x
as an integer divisible by class
with
remainder rem
.
The call is(ex,
Type::Residue(rem, class)
) derives, whether the expression
ex
is an integer divisible by class
with
remainder rem
(or this property can be derived).
rem
,
class
, <subset>.assume
and is
.Type::Even
and Type::Odd
are objects created by
Type::Residue
.testtype(obj,
Type::Residue(rem,
class)
) checks, whether obj
is an integer and is divisible by class
with
remainder rem
. If the optional argument
subset
is given, testtype
checks additionally
testtype(obj,
subset)
.Type::Residue
can be used in testtype
:
>> testtype(6, Type::Residue(2, 4)), testtype(13, Type::Residue(1, 20))
TRUE, FALSE
x
is assumed to be divisible by
3
with remainder 1
:
>> assume(x, Type::Residue(1, 3))
3 Type::Integer + 1
Which properties has x + 2
got?
>> getprop(x + 2)
3 Type::Integer
x
is an integer, but it may be odd or not:
>> is(x, Type::Integer), is(x, Type::Odd)
TRUE, UNKNOWN
The optional subset of the integers restricts the
possible values of x
:
>> assume(x, Type::Residue(2, 4, Type::PosInt)): is(x > 0), is(x^2 >= 4)
TRUE, TRUE