Skip to content

Commit 1a361bf

Browse files
authored
Merge pull request #935 from oscar-system/Wolfram
corrections to docu
2 parents 990c497 + 589e506 commit 1a361bf

File tree

5 files changed

+105
-93
lines changed

5 files changed

+105
-93
lines changed

docs/src/CommutativeAlgebra/affine_algebras.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ functionality for handling such algebras in OSCAR.
3030

3131
## Types
3232

33-
!!! note
34-
All types for quotient rings of multivariate polynomial rings belong to the abstract type `MPolyQuo{T}`,
35-
irrespective of whether they are graded or not.
33+
The OSCAR type for quotient rings of a multivariate polynomial ring -- decorated or not -- is of parametrized form `MPolyQuo{T}`,
34+
where `T` is the element type of the polynomial ring. In turn, the type for elements of quotient rings is of parametrized form `MPolyQuoElem{T}`.
3635

3736
## Constructors
3837

docs/src/CommutativeAlgebra/ideals.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ using Oscar
1010
Pages = ["ideals.md"]
1111
```
1212

13-
# Ideals in Polynomial Rings
14-
15-
In this section, we describe functionality for handling ideals in multivariate polynomial rings.
13+
# Ideals in Multivariate Rings
1614

1715
## Types
1816

19-
!!! note
20-
Irrespective of whether the rings are graded or not, all types for ideals in multivariate polynomial rings
21-
belong to the abstract type `MPolyIdeal{T}` which, in turn, is a subtype of `Ideal{T}`.
22-
17+
The OSCAR type for ideals in multivariate polynomial rings -- decorated or not --
18+
is of parametrized form `MPolyIdeal{T}`, where `T` is the element type of the
19+
polynomial ring.
2320

2421
## Constructors
2522

@@ -30,8 +27,8 @@ ideal(g::Vector{T}) where {T <: MPolyElem}
3027
## Gröbner Bases
3128

3229
Algorithmic means to deal with ideals in multivariate polynomial rings are provided by
33-
the concept of Gröbner bases and its workhorse, Buchberger's algorithm for computing
34-
such bases. For both the concept and the algorithm a convenient way of ordering the monomials
30+
the concept of Gröbner bases and the workhorse of this concept, Buchberger's algorithm for computing
31+
Gröbner bases. For both the concept and the algorithm a convenient way of ordering the monomials
3532
appearing in multivariate polynomials and, thus, to distinguish leading terms of such
3633
polynomials is needed.
3734

@@ -326,7 +323,7 @@ saturation_with_index(I::MPolyIdeal{T}, J::MPolyIdeal{T}) where T
326323
### Elimination
327324

328325
```@docs
329-
eliminate(I::MPolyIdeal{T}, l::Vector{T}) where T <: Union{MPolyElem, MPolyElem_dec}
326+
eliminate(I::MPolyIdeal{T}, l::Vector{T}) where T <: MPolyElem
330327
```
331328

332329
## Tests on Ideals
@@ -353,13 +350,13 @@ issubset(I::MPolyIdeal{T}, J::MPolyIdeal{T}) where T
353350
### Ideal Membership
354351

355352
```@docs
356-
ideal_membership(f::T, I::MPolyIdeal{T}) where T <: Union{MPolyElem, MPolyElem_dec}
353+
ideal_membership(f::T, I::MPolyIdeal{T}) where T
357354
```
358355

359356
### Radical Membership
360357

361358
```@docs
362-
radical_membership(f::T, I::MPolyIdeal{T}) where T <: Union{MPolyElem, MPolyElem_dec}
359+
radical_membership(f::T, I::MPolyIdeal{T}) where T
363360
```
364361

365362
### Primality Test

docs/src/CommutativeAlgebra/rings.md

Lines changed: 61 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,50 @@ using Oscar
1010
Pages = ["rings.md"]
1111
```
1212

13-
# Creating Polynomial Rings
13+
# Creating Multivariate Rings
1414

15-
Referring to the corrresponding section of the ring chapter for details, we recall how to create
16-
multivariate polynomial rings and their elements. We also show how to assign gradings to these rings.
17-
Homomorphisms of multivariate polynomial rings are described in a more general context in the section on affine algebras.
15+
Referring to the rings and fields chapters for more details, our focus in this section is on examples
16+
which illustrate how to create multivariate polynomial rings and their elements. Of particular
17+
interest to us is the introduction of decorated ring types which allow one to implement multivariate
18+
polynomial rings with gradings and/or filtrations.
1819

1920
## Types
2021

21-
!!! note
22-
All types for multivariate polynomial rings belong to the abstract type
23-
`MPolyRing{T}`, irrespective of whether they are graded or not. In contrast, the types for univariate polynomial rings belong to `PolyRing{T}`.
24-
The elements of these rings are stored in a sparse and dense format, respectively.
22+
OSCAR provides types for dense univariate and sparse multivariate polynomials. The univariate
23+
ring types belong to the abstract type `PolyRing{T}`, their elements have abstract type
24+
`PolyRingElem{T}`. The multivariate ring types belong to the abstract type `MPolyRing{T}`,
25+
their elements have abstract type `MPolyRingElem{T}`. Here, `T` is the element type
26+
of the coefficient ring of the polynomial ring.
27+
28+
Multivariate rings with gradings and/or filtrations are modelled by objects of type
29+
`MPolyRing_dec{T, S} :< MPolyRing{T}`, with elements of type
30+
`MPolyRingElem_dec{T, S} :< MPolyRingElem{T}`. Here, `S` is the element type of the
31+
multivariate ring, and `T` is the element type of its coefficient ring as above.
2532

2633
## Constructors
2734

28-
The standard constructor below allows one to build multivariate polynomial rings:
35+
The basic constructor below allows one to build multivariate polynomial rings:
2936

3037
```@julia
31-
PolynomialRing(C::Ring, v::Vector{String}; ordering=:lex)
38+
PolynomialRing(C::Ring, v::Vector{String}; ordering=:lex, cached = true)
3239
```
3340

3441
Its return value is a tuple, say `R, vars`, consisting of a polynomial ring `R` with coefficient ring `C` and a vector `vars` of generators (variables) which print according to the strings in the vector `v` .
3542
The input `ordering=:lex` refers to the lexicograpical monomial ordering which specifies the default way of storing and displaying polynomials in OSCAR (terms are sorted in descending
3643
order). The other possible choices are `:deglex` and `:degrevlex`. Gröbner bases, however, can be computed with respect to any monomial ordering. See the section on Gröbner bases.
3744

38-
39-
45+
!!! note
46+
Caching is used to ensure that a given ring constructed from given parameters is unique in the system. For example, there is only one ring of multivariate polynomials over $\mathbb{Z}$ in the variables x, y, z with `ordering=:lex`.
4047

4148
###### Examples
4249

50+
```@repl oscar
51+
R, (x, y, z) = PolynomialRing(ZZ, ["x", "y", "z"])
52+
typeof(R)
53+
typeof(x)
54+
S, (x, y, z) = PolynomialRing(ZZ, ["x", "y", "z"])
55+
R === S
56+
```
4357

4458
```@repl oscar
4559
R1, x = PolynomialRing(QQ, ["x"])
@@ -50,12 +64,6 @@ R3, x = PolynomialRing(QQ, "x")
5064
typeof(x)
5165
```
5266

53-
```@repl oscar
54-
R, (x, y, z) = PolynomialRing(ZZ, ["x", "y", "z"])
55-
typeof(R)
56-
typeof(x)
57-
```
58-
5967
```@repl oscar
6068
V = ["x[1]", "x[2]"]
6169
T, x = PolynomialRing(GF(3), V)
@@ -120,14 +128,29 @@ QT = FractionField(T)
120128
ZZ
121129
```
122130

123-
## Data Associated to Polynomial Rings
131+
## Gradings and Filtrations
132+
133+
The following functions implement multivariate polynomial rings decorated with $\mathbb Z$-gradings by (weighted) degree:
134+
135+
```@docs
136+
grade(R::MPolyRing, W::Vector{Int})
137+
```
138+
139+
```@docs
140+
GradedPolynomialRing(C::Ring, V::Vector{String}, W::Vector{Int}; ordering=:lex)
141+
```
142+
143+
!!! note
144+
OSCAR functionality for working with gradings by arbitrary abelian groups and for working with filtrations is currently under development.
145+
146+
## Data Associated to Multivariate Rings
124147

125-
If `R` is a multivariate polynomial ring `R` with coefficient ring `C`, then
148+
If `R` is a multivariate polynomial ring with coefficient ring `C`, then
126149

127150
- `base_ring(R)` refers to `C`,
128151
- `gens(R)` to the generators (variables) of `R`,
129152
- `ngens(R)` to the number of these generators, and
130-
- `gen(R, i)` as well as `R[i]` to the `i`th generator.
153+
- `gen(R, i)` as well as `R[i]` to the `i`-th generator.
131154

132155
###### Examples
133156

@@ -140,12 +163,9 @@ R[3]
140163
ngens(R)
141164
```
142165

143-
## Elements of Polynomial Rings
144-
145-
!!! note
146-
The types for multivariate polynomials belong to the abstract type `MPolyElem{T}`.
166+
## Elements of Multivariate Rings
147167

148-
One way to construct elements of a multivariate polynomial ring `R` is
168+
One way to create elements of a multivariate polynomial ring, `R`, is
149169
to build up polynomials from the generators (variables) of `R` using
150170
basic arithmetic as shown below:
151171

@@ -157,6 +177,12 @@ f = 3*x^2+y*z
157177
typeof(f)
158178
```
159179

180+
```@repl oscar
181+
R, (x, y, z) = GradedPolynomialRing(QQ, ["x", "y", "z"])
182+
f = 3*x^2+y*z
183+
typeof(f)
184+
```
185+
160186
Alternatively, there is the following constructor:
161187

162188
```@julia
@@ -170,11 +196,15 @@ with exponent vectors given by the elements of `e`.
170196

171197
```@repl oscar
172198
R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
173-
f = R(QQ.([3, 1]), [[2, 0, 0], [0, 1, 1]])
174-
QQ.([3, 1]) == map(QQ, [3, 1])
199+
f = 3*x^2+y*z
200+
g = R(QQ.([3, 1]), [[2, 0, 0], [0, 1, 1]])
201+
f == g
175202
```
176203

177-
If an element `f` of `R` has been constructed, then
204+
!!! note
205+
An often more effective way to create polynomials is to use the `MPoly` build context, see the chapter on rings.
206+
207+
Given an element `f` of a multivariate polynomial ring `R`,
178208
- `parent(f)` refers to `R`,
179209
- `monomial(f, i)` to the `i`-th monomial of `f`,
180210
- `term(f, i)` to the `i`-th term of `f`,
@@ -196,28 +226,7 @@ monomial(f, 2)
196226
term(f, 2)
197227
```
198228

199-
!!! note
200-
An often more effective way to construct polynomials is to use the `MPoly` build context as explained in the chapter on rings.
201-
202-
203-
## Gradings
204-
205-
The following functions allow one to assign gradings to multivariate polynomial rings:
206-
207-
```@docs
208-
grade(R::MPolyRing, W::Vector{Int})
209-
```
210-
211-
More directly, graded polynomial rings can be constructed as follows:
212-
213-
```@docs
214-
GradedPolynomialRing(C::Ring, V::Vector{String}, W::Vector{Int}; ordering=:lex)
215-
```
216-
217-
!!! note
218-
OSCAR functionality for working with gradings by arbitrary abelian groups is currently under development.
219-
220-
## Homomorphisms of Polynomial Rings
229+
## Homomorphisms of Multivariate Rings
221230

222-
How to handle homomorphisms of multivariate polynomial rings is described in
231+
How to handle homomorphisms of multivariate polynomial rings and their decorated types is described in
223232
a more general context in the section on affine algebras.

src/Rings/mpoly-graded.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ julia> R, (x, y, z) = GradedPolynomialRing(QQ, ["x", "y", "z"], [1, 2, 3])
133133
x -> [1]
134134
y -> [2]
135135
z -> [3], MPolyElem_dec{fmpq, fmpq_mpoly}[x, y, z])
136+
137+
julia> S, (x, y, z) = GradedPolynomialRing(QQ, ["x", "y", "z"])
138+
(Multivariate Polynomial Ring in x, y, z over Rational Field graded by
139+
x -> [1]
140+
y -> [1]
141+
z -> [1], MPolyElem_dec{fmpq, fmpq_mpoly}[x, y, z])
136142
```
137143
"""
138144
function GradedPolynomialRing(C::Ring, V::Vector{String}, W::Vector{Int}; ordering=:lex)
@@ -411,8 +417,6 @@ end
411417
ishomogeneous(F::MPolyElem_dec)
412418
413419
Return `true` if `F` is homogeneous, `false` otherwise.
414-
415-
Return the homogenization of `f`, `V`, or `I` in a graded ring with additional variable `var` at position `pos`.
416420
"""
417421
function ishomogeneous(F::MPolyElem_dec)
418422
D = parent(F).D
@@ -758,7 +762,8 @@ end
758762
759763
homogenization(I::MPolyIdeal{T}, var::String, pos::Int = 1; ordering::Symbol = :degrevlex) where {T <: MPolyElem}
760764
761-
Return the homogenization of `f`, `V`, or `I` in a graded ring with additional variable `var` at position `pos`.
765+
Homogenize `f`, `V`, or `I` using an additional variable printing as `var`.
766+
Return the result as an element of a graded polynomial ring with an additional variable at position `pos` printing as `var`.
762767
763768
!!! warning
764769
Homogenizing an ideal requires a Gröbner basis computation. This may take some time.
@@ -809,7 +814,8 @@ end
809814
810815
dehomogenization(I::MPolyIdeal{T}, pos::Int) where {T <: MPolyElem_dec}
811816
812-
Return the dehomogenization of `F`, `V`, or `I` in a ring not depending on the variable at position `pos`.
817+
Dehomogenize `F`, `V`, or `I` using the variable at position `pos`.
818+
Return the result as an element of a polynomial ring not depending on the variable at position `pos`.
813819
"""
814820
function dehomogenization(F::MPolyElem_dec, pos::Int)
815821
S = parent(F)

0 commit comments

Comments
 (0)