Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming of revlex, negrevlex, introduction of deginvlex #3038

Merged
merged 33 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
92c87e2
adds invlex and deginvlex
ederc Nov 15, 2023
77e2976
updates src files: revlex => invles
ederc Nov 15, 2023
ed6e937
updates tests: revles => invles
ederc Nov 15, 2023
bfe48b7
updates docu: revlex => invlex
ederc Nov 15, 2023
1f80926
bumps Singular version
ederc Nov 15, 2023
82bdd23
updates exports: revlex => invlex
ederc Nov 15, 2023
42785a2
adds tests for deginvlex
ederc Nov 15, 2023
15731d9
allow revlex and negrevlex for some time
ederc Nov 20, 2023
59d0bce
fixes singular version
ederc Nov 21, 2023
580282a
needs breaking Singular.jl v0.20.0 release
ederc Nov 21, 2023
ac103a3
add deprecations
ederc Nov 22, 2023
94e2b9e
fixes deprecations
ederc Nov 22, 2023
8d97158
Update src/Rings/orderings.jl
ederc Nov 23, 2023
6dc5ad9
Update src/exports.jl
ederc Nov 23, 2023
36de1b8
Update src/Rings/orderings.jl
ederc Nov 23, 2023
74c2d81
Update src/Rings/orderings.jl
ederc Nov 23, 2023
e6d00f7
Update src/Rings/orderings.jl
ederc Nov 23, 2023
fa8c4fd
Update src/Rings/orderings.jl
ederc Nov 23, 2023
55dab69
Update src/Rings/orderings.jl
ederc Nov 23, 2023
213269f
Update src/exports.jl
ederc Nov 23, 2023
26f722f
Update src/exports.jl
ederc Nov 23, 2023
e9ea2a3
removes useless negrevlex = neginvlex
ederc Nov 23, 2023
417127a
Update src/Rings/orderings.jl
ederc Nov 23, 2023
9a43c5a
Update src/Rings/orderings.jl
ederc Nov 23, 2023
489fbf4
Update src/Rings/orderings.jl
ederc Nov 23, 2023
23580b7
fixes some doctests
ederc Nov 23, 2023
578b22c
fixes docu texts for degree monomial orderings
ederc Nov 23, 2023
54e3055
fixes deginvlex test
ederc Nov 23, 2023
299086a
fixes canonical matrix for deginvlex
ederc Nov 27, 2023
fc1b00b
fixes docu printing of canonical matrix for deginvlex
ederc Nov 27, 2023
a732cd6
fixes monomial comparison for deginvlex
ederc Nov 27, 2023
7f2d025
gixes deginvlex test due to adjusted monomial comparison
ederc Nov 27, 2023
7da3213
fixes test
ederc Nov 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Random = "1.6"
RandomExtensions = "0.4.3"
RecipesBase = "1.2.1"
Serialization = "1.6"
Singular = "0.19.0"
Singular = "0.20.0"
TOPCOM_jll = "0.17.8"
UUIDs = "1.6"
cohomCalg_jll = "0.32.0"
Expand Down
40 changes: 25 additions & 15 deletions docs/src/CommutativeAlgebra/GroebnerBases/orderings.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,27 +153,37 @@ lex(R::MPolyRing)

The *degree lexicographical ordering* `deglex` is defined by setting $\;\deg(x^\alpha) = \alpha_1 + \cdots + \alpha_n\;$ and

$x^\alpha > x^\beta \; \Leftrightarrow \; \deg(x^\alpha) > \deg(x^\beta) \;\text{ or }\; \exists \; 1 \leq i \leq n: \alpha_1 = \beta_1, \dots, \alpha_{i-1} = \beta_{i-1}, \alpha_i > \beta_i.$
$x^\alpha > x^\beta \; \Leftrightarrow \; \deg(x^\alpha) > \deg(x^\beta) \;\text{ or }\; (\deg(x^\alpha) = \deg(x^\beta) \;\text{ and }\; \exists \; 1 \leq i \leq n: \alpha_1 = \beta_1, \dots, \alpha_{i-1} = \beta_{i-1}, \alpha_i > \beta_i).$

```@docs
deglex(R::MPolyRing)
```

#### The Reverse Lexicographical Ordering
#### The Inverse Lexicographical Ordering

The *reverse lexicographical ordering* `revlex` is defined by setting
The *inverse lexicographical ordering* `invlex` is defined by setting

$x^\alpha > x^\beta \; \Leftrightarrow \;\exists \; 1 \leq i \leq n: \alpha_n = \beta_n, \dots, \alpha_{i+1} = \beta_{i+1}, \alpha_i > \beta_i.$

```@docs
revlex(R::MPolyRing)
invlex(R::MPolyRing)
```

#### The Degree Inverse Lexicographical Ordering

The *degree inverse lexicographical ordering* `deginvlex` is defined by setting

$x^\alpha > x^\beta \; \Leftrightarrow \deg(x^\alpha) > \deg(x^\beta) \;\text{ or }\;(\deg(x^\alpha) = \deg(x^\beta) \;\text{ and }\; \;\exists \; 1 \leq i \leq n: \alpha_n = \beta_n, \dots, \alpha_{i+1} = \beta_{i+1}, \alpha_i > \beta_i).$

```@docs
deginvlex(R::MPolyRing)
```

#### The Degree Reverse Lexicographical Ordering

The *degree reverse lexicographical ordering* `degrevlex` is defined by setting $\;\deg(x^\alpha) = \alpha_1 + \cdots + \alpha_n\;$ and

$x^\alpha > x^\beta \; \Leftrightarrow \; \deg(x^\alpha) > \deg(x^\beta) \;\text{ or }\;\exists \; 1 \leq i \leq n: \alpha_n = \beta_n, \dots, \alpha_{i+1} = \beta_{i+1}, \alpha_i < \beta_i.$
$x^\alpha > x^\beta \; \Leftrightarrow \; \deg(x^\alpha) > \deg(x^\beta) \;\text{ or }\;(\deg(x^\alpha) = \deg(x^\beta) \;\text{ and }\; \exists \; 1 \leq i \leq n: \alpha_n = \beta_n, \dots, \alpha_{i+1} = \beta_{i+1}, \alpha_i < \beta_i).$

```@docs
degrevlex(R::MPolyRing)
Expand Down Expand Up @@ -219,27 +229,27 @@ neglex(R::MPolyRing)

The *negative degree lexicographical ordering* `negdeglex` is defined by setting $\;\deg(x^\alpha) = \alpha_1 + \cdots + \alpha_n\;$ and

$x^\alpha > x^\beta \; \Leftrightarrow \; \deg(x^\alpha) < \deg(x^\beta) \;\text{ or }\; \exists \; 1 \leq i \leq n: \alpha_1 = \beta_1, \dots, \alpha_{i-1} = \beta_{i-1}, \alpha_i > \beta_i.$
$x^\alpha > x^\beta \; \Leftrightarrow \; \deg(x^\alpha) < \deg(x^\beta) \;\text{ or }\; (\deg(x^\alpha) = \deg(x^\beta) \;\text{ and }\; \exists \; 1 \leq i \leq n: \alpha_1 = \beta_1, \dots, \alpha_{i-1} = \beta_{i-1}, \alpha_i > \beta_i).$

```@docs
negdeglex(R::MPolyRing)
```

#### The Negative Reverse Lexicographical Ordering
#### The Negative Inverse Lexicographical Ordering

The *negative reverse lexicographical ordering* `negrevlex` is defined by setting
The *negative inverse lexicographical ordering* `neginvlex` is defined by setting

$x^\alpha > x^\beta \; \Leftrightarrow \;\exists \; 1 \leq i \leq n: \alpha_n = \beta_n, \dots, \alpha_{i+1} = \beta_{i+1}, \alpha_i < \beta_i.$

```@docs
negrevlex(R::MPolyRing)
neginvlex(R::MPolyRing)
```

#### The Negative Degree Reverse Lexicographical Ordering

The *negative degree reverse lexicographical ordering* `negdegrevlex` is defined by setting $\;\deg(x^\alpha) = \alpha_1 + \cdots + \alpha_n\;$ and

$x^\alpha > x^\beta \; \Leftrightarrow \; \deg(x^\alpha) < \deg(x^\beta) \;\text{ or }\;\exists \; 1 \leq i \leq n: \alpha_n = \beta_n, \dots, \alpha_{i+1} = \beta_{i+1}, \alpha_i < \beta_i.$
$x^\alpha > x^\beta \; \Leftrightarrow \; \deg(x^\alpha) < \deg(x^\beta) \;\text{ or }\;(\deg(x^\alpha) = \deg(x^\beta) \;\text{ and }\; \exists \; 1 \leq i \leq n: \alpha_n = \beta_n, \dots, \alpha_{i+1} = \beta_{i+1}, \alpha_i < \beta_i).$

```@docs
negdegrevlex(R::MPolyRing)
Expand Down Expand Up @@ -392,7 +402,7 @@ Alternatively, we may wish to use $i < j$ instead of $i > j$ in this definition.

In other words, these orderings are obtained by concatenating a monomial ordering on the monomials of $R$
with a way of ordering the basis vectors of $F$ or vice versa. In OSCAR, we refer to the $i < j$ ordering on the
basis vectors as *lex*, and to the $i > j$ ordering as *revlex*. And, we use the `*` operator for concatenation.
basis vectors as *lex*, and to the $i > j$ ordering as *invlex*. And, we use the `*` operator for concatenation.

##### Examples

Expand All @@ -402,11 +412,11 @@ julia> R, (w, x, y, z) = polynomial_ring(QQ, ["w", "x", "y", "z"]);
julia> F = free_module(R, 3)
Free module of rank 3 over Multivariate polynomial ring in 4 variables over QQ

julia> o1 = degrevlex(R)*revlex(gens(F))
degrevlex([w, x, y, z])*revlex([gen(1), gen(2), gen(3)])
julia> o1 = degrevlex(R)*invlex(gens(F))
degrevlex([w, x, y, z])*invlex([gen(1), gen(2), gen(3)])

julia> o2 = revlex(gens(F))*degrevlex(R)
revlex([gen(1), gen(2), gen(3)])*degrevlex([w, x, y, z])
julia> o2 = invlex(gens(F))*degrevlex(R)
invlex([gen(1), gen(2), gen(3)])*degrevlex([w, x, y, z])

```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ end

@testset "Check dimension" begin
@testset "Monomial order $monomial_ordering" for monomial_ordering in
(:lex, :revlex, :degrevlex)
(:lex, :invlex, :degrevlex)
check_dimension(:A, 3, [1, 1, 1], monomial_ordering)
#check_dimension(:B, 3, [2,1,0], monomial_ordering)
#check_dimension(:C, 3, [1,1,1], monomial_ordering)
Expand Down
4 changes: 2 additions & 2 deletions src/Modules/FreeModElem-orderings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function Orderings.lex(F::ModuleFP)
return Orderings.ModuleOrdering(F, Orderings.ModOrdering(1:ngens(F), :lex))
end

function Orderings.revlex(F::ModuleFP)
return Orderings.ModuleOrdering(F, Orderings.ModOrdering(1:ngens(F), :revlex))
function Orderings.invlex(F::ModuleFP)
return Orderings.ModuleOrdering(F, Orderings.ModOrdering(1:ngens(F), :invlex))
end

@doc raw"""
Expand Down
2 changes: 1 addition & 1 deletion src/Rings/mpoly-graded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ function homogenization(I::MPolyIdeal{T}, W::Union{ZZMatrix, Matrix{<:IntegerUni
N = ngens(Ph)
num_x = ngens(P)
num_h = ngens(Ph) - num_x
# Build ordering matrix: weights matrix followed by identity mat, underneath is a revlex matrix
# Build ordering matrix: weights matrix followed by identity mat, underneath is a invlex matrix
Id = reduce(hcat, [[kronecker_delta(i,j) for i in 1:num_h] for j in 1:num_h])
RevLexMat = reduce(hcat, [[-kronecker_delta(i+j, 1+ngens(Ph)) for i in 1:ngens(Ph)] for j in 1:ngens(Ph)])
M = hcat(W, Id)
Expand Down
2 changes: 1 addition & 1 deletion src/Rings/mpolyquo-localizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2197,7 +2197,7 @@ Note: This is only available for localizations at rational points.
F = free_module(R, length(Jlist))
Imax = ideal(R,gens(R))
M = sub(F,[F(syz_mod[i]) for i=1:Singular.ngens(syz_mod)])[1] + (Imax*F)[1]
oF = negdegrevlex(R)*revlex(F)
oF = negdegrevlex(R)*invlex(F)
res_vec = typeof(gen(I,1))[]

## select by Nakayama
Expand Down
Loading
Loading