## `Dom::MonomOrdering` -- monomial orderings

#### Introduction

`Dom::MonomOrdering` represents the set of all possible monomial orderings. A monomial ordering is a well-ordering of the set of all k-tuples of nonnegative integers for some k.

#### Domain

`Dom::MonomOrdering()`

#### Details

- In MuPAD, a monomial ordering is implemented as a function that, when applied to two lists of nonnegative integers, returns `-1`, `0`, or `1` if the first list is respectively smaller than, equal to, or greater than the second list. Each ordering can only compare lists of one fixed length, called its its order length. Since the lists under consideration will be exponent vectors in most cases, their length is also referred to as the number of indeterminates.
- Monomial orderings are used in algebraic geometry for comparing terms i=1n Xiαi and i=1n Xiβi in a polynomial ring. Since `Dom::MonomOrdering` works on the exponent vectors [α1, ..., αn] and [β1, ..., βn], `degreevec` must be applied to the terms to be compared before applying `Dom::MonomOrdering`.
- Elements of `Dom::MonomOrdering` can be used as arguments for `lcoeff`, `lmonomial`, `lterm`, and `tcoeff` as well as for the functions of the `groebner` package in order to specify the monomial ordering to be considered.

#### Introduction

Monomial orderings are created by calling `Dom::MonomOrdering``(someIdentifier(parameters))`, where `someIdentifier` is one of a certain set of predefined identifiers, as stated below. Converting `someIdentifier` into a string gives the order type of the monomial ordering.

#### Creating Elements

``Dom::MonomOrdering`(Lex(n))`
``Dom::MonomOrdering`(RevLex(n))`
``Dom::MonomOrdering`(DegLex(n))`
``Dom::MonomOrdering`(DegRevLex(n))`
``Dom::MonomOrdering`(DegInvLex(n))`
``Dom::MonomOrdering`(WeightedLex(w1, ...,wn))`
``Dom::MonomOrdering`(WeightedRevLex(w1, ...,wn))`
``Dom::MonomOrdering`(WeightedDegLex(w1, ..,wn))`
``Dom::MonomOrdering`(WeightedDegRevLex(w1, ..,wn))`
``Dom::MonomOrdering`(Block(o1...))`
``Dom::MonomOrdering`(Matrix(params))`

#### Parameters

`n` | - | positive integer
`w1...` | - | numerical expressions
`o1,..` | - | valid arguments to `Dom::MonomOrdering`
`params` | - | a sequence valid as the sequence of arguments to `Dom::Matrix``()`.

#### Categories

`Cat::BaseCategory`

#### Details

- `Dom::MonomOrdering``(Lex(n))` creates the lexicographical order on n indeterminates.
- `Dom::MonomOrdering``(RevLex(n))` creates the reverse lexicographical order on n indeterminates, i.e., ``Dom::MonomOrdering`(RevLex(n))([a1,...,an])`
  `=` Dom::MonomOrdering(Lex(n))([an,...,a1]).
- `Dom::MonomOrdering``(DegLex(n))` creates the degree order on n indeterminates with the lexicographical order used for tie-break.
- `Dom::MonomOrdering``(DegRevLex(n))` creates the degree order on n indeterminates with the reverse lexicographical order used for tie-break .
- `Dom::MonomOrdering``(DegInvLex(n))` creates the degree order on n indeterminates, with the tie break being the opposite to the lexicographical order.
- `Dom::MonomOrdering``(Weighted...(w1,...,wn))` returns a weighted degree order with weights w1 through wn. The word following the word `Weighted` specifies the tie-break used. Note that MuPAD uses the ordinary degree order as the first tie-break.
- `Dom::MonomOrdering``(Matrix(params))` creates a matrix order, with the order matrix defined by `Dom::Matrix``()(params)`.
- `Dom::MonomOrdering``(Block(o1, ..., on))` or, equivalently, `Dom::MonomOrdering``([o1, ..., on])`, creates a block order such that `Dom::MonomOrdering``(o1)` is used on the first indeterminates, then `Dom::MonomOrdering``(o2)` is used as a tie-break on the following indeterminates etc.

  Block orders may be nested, i.e., the blocks may be block orders, too.

- Weight vectors with negative entries and order matrices do not define well-orderings in general. You may enter such orderings, but it may cause trouble, e.g., to use them with the `groebner` package.

#### Method func_call: compare two lists of integers

- `func_call(dom o, list l1, list l2)`
- - This method is called by entering `o(l1, l2)`. It returns `-1` if l1 < l2, `1` if l1>l2, and `0` if l1=l2.
  - The lengths of `l1` and `l2` must not exceed the order length of `o`. If `l1` or `l2` is too short, the necessary number of zeroes is appended.

#### Method ordertype: return the type of an order

- `ordertype(dom o)`
- - This method returns the order type of `o`.
  - If `o` equals `Dom::MonomOrdering``(someIdentifier(params))`, then converting `someIdentifier` into a string gives the order type of `o`.

#### Method orderlength: return the length of an order

- `orderlength(dom o)`
- - This method returns length of `o`; this is the largest integer k for which `o` works on lists of length k.

#### Method nops: number of blocks

- `nops(dom o)`
- - A block order `Dom::MonomOrdering``(Block(o1,...,on))` is said to have n blocks. An order of any other type is said to have one block.

#### Method block: get a particular block

- `block(dom o, positive integer i)`
- - This method returns the i-th block of `o`, or `FAIL` if the order `o` does not have that many blocks.

#### Method blocktype: get the order type of a particular block

- `blocktype(dom o, positive integer i)`
- - This method returns the order type of the i-th block of `o`.

#### Method blocklength: get the order length of a particular block

- `blocklength(dom o, positive integer i)`
- - This method returns the order length of the i-th block of `o`.

#### Method expr: return an expression from which the order can be restored

- `expr(dom o)`
- - This method returns an expression `someIdentifier(parameters)` such that applying `Dom::MonomOrdering` to it would give back `o`.

#### Example 1

We define `ORD` by prescribing that lists [a,b,c] are ordered according to their weighted degrees 5a + 2b + πc. For lists with equal weighted degree, the non-weighted degree a+b+c is used as a tie-break. Finally, the lexicographical order decides (in fact, this last step is not necessary because π is irrational).

    >> ORD:=Dom::MonomOrdering(WeightedDegLex(5, 2, PI))

                             WeightedDegLex(5, 2, PI)

With respect to `ORD`, `[1, 6, 1]` is smaller than `[2, 1, 3]`:

    >> ORD([1,6,1], [2,1,3])

                                        -1

#### Super-Domain

`Dom::BaseDomain`

#### Changes

- new function

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000