In Macaulay2, each free module *F = R*^{s} over a ring *R* has a basis of unit column vectors *F*_{0}, F_{1}, ..., F_{(}s-1). The monomials of *F* are the elements *m F*_{i}, where *m* is a monomial of the ring *R*. In Macaulay2, orders on the monomials of *F* are used for computing GrÃ¶bner bases and syzygies, and also to determine the initial, or lead term of elements of *F*.

This is the same as giving the monomial order as:

Giving Position=>Down instead switches the test above to i < j. In this case the monomial order on F is: m*F_i > n*F_j if m>n or m==n and i<j.

If one gives Position=>Up or Position=>Down earlier, then the position will be taken into account earlier. For example

If one wants Position over Term (POT), place the Position element first

The ring *R* comes equipped with a total order on the monomials of *R*. A total order on the monomials of *F* is called **compatible** (with the order on *R*), if *m F _{i} > n F_{i}* (in

term over position up: *m F _{i} > n F_{j}* iff

term over position down: *m F _{i} > n F_{j}* iff

position up over term: *m F _{i} > n F_{j}* iff

position down over term: *m F _{i} > n F_{j}* iff

Induced monomial orders are another class of important orders on `F`, see Schreyer orders for their definition and use in Macaulay2.

In Macaulay2, free modules come equipped with a compatible order. The default order is: term over position up. This is called Position=>Up. In the following example, the lead term is *a F _{1}*, since

i1 : R = ZZ[a..d]; |

i2 : F = R^3 3 o2 = R o2 : R-module, free |

i3 : f = b*F_0 + a*F_1 o3 = | b | | a | | 0 | 3 o3 : R |

i4 : leadTerm f o4 = | 0 | | a | | 0 | 3 o4 : R |

i5 : R = ZZ[a..d, MonomialOrder => {GRevLex => 4, Position => Up}]; |

i6 : F = R^3 3 o6 = R o6 : R-module, free |

i7 : leadTerm(a*F_0 + a*F_1) o7 = | 0 | | a | | 0 | 3 o7 : R |

i8 : R = ZZ[a..d, MonomialOrder => {GRevLex => 4, Position => Down}]; |

i9 : F = R^3 3 o9 = R o9 : R-module, free |

i10 : leadTerm(a*F_0 + a*F_1) o10 = | a | | 0 | | 0 | 3 o10 : R |

i11 : R = ZZ[a..d, MonomialOrder => {GRevLex => 2, Position => Down, GRevLex => 2}]; |

i12 : F = R^3 3 o12 = R o12 : R-module, free |

i13 : leadTerm(a*F_0 + a*F_1) o13 = | a | | 0 | | 0 | 3 o13 : R |

i14 : leadTerm(b*F_0 + c^4*F_1) o14 = | b | | 0 | | 0 | 3 o14 : R |

i15 : leadTerm(c*F_0 + d^2*F_1) o15 = | c | | 0 | | 0 | 3 o15 : R |

i16 : R = ZZ[a..d, MonomialOrder => {Position => Down}]; |

i17 : F = R^3 3 o17 = R o17 : R-module, free |

i18 : leadTerm(a*F_0 + a*F_1) o18 = | a | | 0 | | 0 | 3 o18 : R |

i19 : leadTerm(b*F_0 + c^4*F_1) o19 = | b | | 0 | | 0 | 3 o19 : R |

i20 : leadTerm(c*F_0 + d^2*F_1) o20 = | c | | 0 | | 0 | 3 o20 : R |

- Schreyer orders -- induced monomial order on a free module