307
307
308
308
# saturation #######################################################
309
309
@doc raw """
310
- saturation(I::MPolyIdeal{T},
311
- J::MPolyIdeal{T} = ideal(base_ring(I), gens(base_ring(I)));
310
+ saturation(I::MPolyIdeal{T},
311
+ J::MPolyIdeal{T} = ideal(base_ring(I), gens(base_ring(I)));
312
312
iteration::Bool=false) where T
313
313
314
314
Return the saturation of `I` with respect to `J`.
@@ -372,7 +372,7 @@ _saturation2(I::MPolyIdeal{T}, J::MPolyIdeal{T} = ideal(base_ring(I), gens(base_
372
372
373
373
# ######################################################
374
374
@doc raw """
375
- saturation_with_index(I::MPolyIdeal{T},
375
+ saturation_with_index(I::MPolyIdeal{T},
376
376
J::MPolyIdeal{T} = ideal(base_ring(I), gens(base_ring(I)))) where T
377
377
378
378
Return $I:J^{\i nfty}$ together with the smallest integer $m$ such that $I:J^m = I:J^{\i nfty}$ (saturation index).
@@ -509,7 +509,7 @@ function eliminate(I::MPolyIdeal, o::MonomialOrdering, l::Int)
509
509
@req is_elimination_ordering (o, R_gens) " Given ordering is not an elimination ordering"
510
510
gb = get (I. gb, o, nothing )
511
511
isnothing (gb) && return eliminate (I, R_gens)
512
-
512
+
513
513
elimination_ideal_gens_indices = findall (x -> cmp (o, R_gens[end ], leading_monomial (x; ordering= o)) > 0 , gens (gb))
514
514
isempty (elimination_ideal_gens_indices) && return ideal (R, [])
515
515
ideal (IdealGens (gens (gb)[elimination_ideal_gens_indices], o; isGB= true ))
@@ -530,7 +530,7 @@ Return the radical of `I`.
530
530
531
531
# Implemented Algorithms
532
532
533
- * If the base ring of `I` is a polynomial ring over a the field of rational numbers or a finite field, a combination of the algorithms of Krick and Logar (with modifications by Laplagne) and Kemper is used.
533
+ * If the base ring of `I` is a polynomial ring over a the field of rational numbers or a finite field, a combination of the algorithms of Krick and Logar (with modifications by Laplagne) and Kemper is used.
534
534
* If the `base_ring` of `I` is a number field, then we first expand the minimal polynomials to reduce to a computation over the rationals.
535
535
* For polynomial rings over the integers, the algorithm proceeds as suggested by Pfister, Sadiq, and Steidel. See [KL91](@cite), [Kem02](@cite), and [PSS11](@cite).
536
536
@@ -639,27 +639,27 @@ Ideal generated by
639
639
```
640
640
"""
641
641
@attr MPolyIdeal{T} function radical (
642
- I:: MPolyIdeal{T} ;
642
+ I:: MPolyIdeal{T} ;
643
643
preprocessing:: Bool = true ,
644
644
eliminate_variables:: Bool = true ,
645
645
factor_generators:: Bool = true
646
646
) where {T <: MPolyRingElem }
647
647
is_known (is_radical, I) && is_radical (I) && return I
648
- # We first check for the squarefree flag.
649
- # Elimination of variables will probably affect how the generators factor.
648
+ # We first check for the squarefree flag.
649
+ # Elimination of variables will probably affect how the generators factor.
650
650
if preprocessing && factor_generators
651
- # Replace every generator by its squarefree part to get closer to the actual radical
651
+ # Replace every generator by its squarefree part to get closer to the actual radical
652
652
# even before passing computations on to Singular.
653
653
return radical (_squarefree_generator_ideal (I); preprocessing, eliminate_variables, factor_generators= false )
654
654
end
655
655
if preprocessing && eliminate_variables
656
656
is_known (is_radical, I) && is_radical (I) && return I
657
- # Call `elimpart` (within `simplify`) in order to substitute variables.
657
+ # Call `elimpart` (within `simplify`) in order to substitute variables.
658
658
# This turns out to significantly speed things up in many cases.
659
659
R = base_ring (I)
660
660
Q, pr = quo (R, I)
661
661
S, iso, iso_inv = simplify (Q)
662
- is_zero (ngens (S)) && return I # This only happens when all variables can be eliminated.
662
+ is_zero (ngens (S)) && return I # This only happens when all variables can be eliminated.
663
663
# Then the ideal defines a reduced point.
664
664
J = modulus (S)
665
665
pre_res = radical (J; preprocessing, eliminate_variables= false , factor_generators)
@@ -704,7 +704,7 @@ function _compute_radical(I::T) where {T <: MPolyIdeal}
704
704
return Irad
705
705
end
706
706
707
- # Go through the generators of I and replace each generator by its squarefree part.
707
+ # Go through the generators of I and replace each generator by its squarefree part.
708
708
# This is a heuristic preprocessing method for radical computations.
709
709
function _squarefree_generator_ideal (I:: MPolyIdeal )
710
710
R = base_ring (I)
@@ -723,18 +723,18 @@ end
723
723
@attr MPolyIdeal{T} function radical (
724
724
I:: MPolyIdeal{T} ;
725
725
preprocessing:: Bool = true ,
726
- factor_generators:: Bool = true ,
726
+ factor_generators:: Bool = true ,
727
727
eliminate_variables:: Bool = true
728
728
) where {U<: Hecke.RelSimpleNumFieldElem , T<: MPolyRingElem{U} }
729
729
is_known (is_radical, I) && is_radical (I) && return I
730
730
R = base_ring (I)
731
731
preprocessing && factor_generators && return radical (_squarefree_generator_ideal (I); preprocessing, eliminate_variables, factor_generators= false )
732
732
R_flat, iso, iso_inv = _expand_coefficient_field_to_QQ (R)
733
733
I_flat = ideal (R_flat, iso_inv .(gens (I)))
734
- I_flat_rad = radical (I_flat;
734
+ I_flat_rad = radical (I_flat;
735
735
preprocessing,
736
- eliminate_variables,
737
- factor_generators= false ) # Taking the squarefree part of generators only pays off on the top level.
736
+ eliminate_variables,
737
+ factor_generators= false ) # Taking the squarefree part of generators only pays off on the top level.
738
738
Irad = iso (I_flat_rad)
739
739
set_attribute! (Irad, :is_radical => true )
740
740
@hassert :IdealSheaves 2 ! is_one (Irad)
875
875
is_known (:: typeof (primary_decomposition), I:: MPolyIdeal ) = has_attribute (I, :primary_decomposition )
876
876
877
877
function primary_decomposition (
878
- I:: MPolyIdeal{T} ;
878
+ I:: MPolyIdeal{T} ;
879
879
algorithm:: Symbol = :GTZ , cache:: Bool = true
880
880
) where {U<: Hecke.RelSimpleNumFieldElem , T<: MPolyRingElem{U} }
881
881
if has_attribute (I, :primary_decomposition )
@@ -887,7 +887,7 @@ function primary_decomposition(
887
887
dec = primary_decomposition (I_flat; algorithm, cache)
888
888
result = Vector {Tuple{typeof(I), typeof(I)}} ()
889
889
for (P, Q) in dec
890
- push! (result, (ideal (R, unique! ([x for x in iso .(gens (P)) if ! iszero (x)])),
890
+ push! (result, (ideal (R, unique! ([x for x in iso .(gens (P)) if ! iszero (x)])),
891
891
ideal (R, unique! ([x for x in iso .(gens (Q)) if ! iszero (x)]))))
892
892
end
893
893
@@ -1010,7 +1010,7 @@ Ideal generated by
1010
1010
x + _a*y
1011
1011
1012
1012
julia> RAP = base_ring(AP)
1013
- Multivariate polynomial ring in 2 variables over number field graded by
1013
+ Multivariate polynomial ring in 2 variables over number field graded by
1014
1014
x -> [1]
1015
1015
y -> [1]
1016
1016
```
@@ -1225,12 +1225,12 @@ end
1225
1225
1226
1226
is_known (:: typeof (minimal_primes), I:: MPolyIdeal ) = has_attribute (I, :minimal_primes )
1227
1227
1228
- # rerouting the procedure for minimal primes this way leads to
1228
+ # rerouting the procedure for minimal primes this way leads to
1229
1229
# much longer computations compared to the flattening of the coefficient
1230
1230
# field implemented above.
1231
1231
function minimal_primes (
1232
- I:: MPolyIdeal{T} ;
1233
- algorithm:: Symbol = :GTZ ,
1232
+ I:: MPolyIdeal{T} ;
1233
+ algorithm:: Symbol = :GTZ ,
1234
1234
eliminate_variables:: Bool = true ,
1235
1235
cache:: Bool = true
1236
1236
) where {U<: Union{AbsSimpleNumFieldElem, <:Hecke.RelSimpleNumFieldElem} , T<: MPolyRingElem{U} }
@@ -1347,7 +1347,7 @@ end
1347
1347
1348
1348
Return a vector of equidimensional radical ideals increasingly ordered by dimension.
1349
1349
For each dimension, the returned radical ideal is the intersection of the associated primes
1350
- of `I` of that dimension.
1350
+ of `I` of that dimension.
1351
1351
1352
1352
# Implemented Algorithms
1353
1353
@@ -1614,7 +1614,8 @@ julia> triangular_decomposition(I; algorithm=:lazard_factorized)
1614
1614
Ideal (x5 - 1, x4^4 + x4^3 + x4^2 + x4 + 1, -x3 + x4^2, -x2 + x4^3, x1 + x4^3 + x4^2 + x4 + 1)
1615
1615
Ideal (x5^2 + 3*x5 + 1, x4 - 1, x3 - 1, x2 - 1, x1 + x5 + 3)
1616
1616
Ideal (x5^2 + 3*x5 + 1, x4 + x5 + 3, x3 - 1, x2 - 1, x1 - 1)
1617
- ⋮
1617
+ Ideal with 5 generators
1618
+ Ideal (x5^4 + x5^3 + x5^2 + x5 + 1, x4 - 1, x3 + x5^3 + x5^2 + x5 + 1, -x2 + x5^3, -x1 + x5^2)
1618
1619
Ideal (x5^4 + x5^3 + x5^2 + x5 + 1, x4 - x5, x3 - x5, x2^2 + 3*x2*x5 + x5^2, x1 + x2 + 3*x5)
1619
1620
Ideal (x5^4 + x5^3 + x5^2 + x5 + 1, x4 - x5, x3^2 + 3*x3*x5 + x5^2, x2 + x3 + 3*x5, x1 - x5)
1620
1621
Ideal with 5 generators
@@ -2072,7 +2073,7 @@ end
2072
2073
2073
2074
# In general this depends on the ring, ...
2074
2075
is_known (:: typeof (is_zero), I:: MPolyIdeal ) = true
2075
- # but for specific rings we can do more.
2076
+ # but for specific rings we can do more.
2076
2077
is_known (:: typeof (is_zero), I:: MPolyIdeal{QQMPolyRingElem} ) = true
2077
2078
2078
2079
@doc raw """
@@ -2109,7 +2110,7 @@ end
2109
2110
function is_known (:: typeof (is_one), I:: MPolyIdeal )
2110
2111
has_attribute (I, :is_one ) && return true
2111
2112
! is_empty (I. gb) && return true # a Groebner basis has already been computed
2112
- if any (is_unit, gens (I))
2113
+ if any (is_unit, gens (I))
2113
2114
set_attribute! (I, :is_one => true )
2114
2115
return true
2115
2116
end
@@ -2260,7 +2261,7 @@ function small_generating_set(
2260
2261
# than the original one!!!
2261
2262
return_value = filter (! iszero, (R). (gens (sing_min)))
2262
2263
2263
- # The following is a common phenomenon which we can not fully explain yet. So far nothing but a
2264
+ # The following is a common phenomenon which we can not fully explain yet. So far nothing but a
2264
2265
# restart really seems to help, unfortunately.
2265
2266
if is_zero (length (return_value))
2266
2267
! is_zero (I) && error (" singular crashed in the background; please restart your session!" )
@@ -2290,7 +2291,7 @@ small_generating_set(I::MPolyIdeal{<:MPolyDecRingElem}; algorithm::Symbol=:simpl
2290
2291
# ###############################################################################
2291
2292
# returns Pluecker ideal in ring with standard grading
2292
2293
function grassmann_pluecker_ideal (subspace_dimension:: Int , ambient_dimension:: Int )
2293
- I = convert (MPolyIdeal{QQMPolyRingElem},
2294
+ I = convert (MPolyIdeal{QQMPolyRingElem},
2294
2295
Polymake. ideal. pluecker_ideal (subspace_dimension, ambient_dimension))
2295
2296
base = base_ring (I)
2296
2297
base2, x = graded_polynomial_ring (coefficient_ring (base), :x => sort (subsets (ambient_dimension, subspace_dimension)))
@@ -2310,8 +2311,8 @@ generated by the Plücker relations. If the input ring is not graded, return the
2310
2311
If the ring is not specified return the ideal in a multivariate polynomial ring over the rationals with variables indexed by
2311
2312
elements of ${[n]\c hoose d}$ with the standard grading.
2312
2313
2313
- The Grassmann-Plücker ideal is the homogeneous ideal generated by the relations defined by
2314
- the Plücker Embedding of the Grassmannian. That is given Gr$(k, n)$ the Moduli
2314
+ The Grassmann-Plücker ideal is the homogeneous ideal generated by the relations defined by
2315
+ the Plücker Embedding of the Grassmannian. That is given Gr$(k, n)$ the Moduli
2315
2316
space of all $k$-dimensional subspaces of an $n$-dimensional vector space, the relations
2316
2317
are given by all $d \t imes d$ minors of a $d \t imes n$ matrix. For the algorithm see
2317
2318
[Stu93](@cite).
@@ -2332,7 +2333,7 @@ Ideal generated by
2332
2333
"""
2333
2334
function grassmann_pluecker_ideal (ring:: MPolyRing ,
2334
2335
subspace_dimension:: Int ,
2335
- ambient_dimension:: Int )
2336
+ ambient_dimension:: Int )
2336
2337
I = grassmann_pluecker_ideal (subspace_dimension, ambient_dimension)
2337
2338
coeff_ring = base_ring (ring)
2338
2339
o = degrevlex (ring)
@@ -2374,7 +2375,7 @@ _pluecker_sgn(a::Vector{Int}, b::Vector{Int}, t::Int)::Int =
2374
2375
@doc raw """
2375
2376
flag_pluecker_ideal(F::Union{Field, MPolyRing}, dimensions::Vector{Int}, n::Int; minimal::Bool=true)
2376
2377
2377
- Return the generators of the defining ideal for the complete flag variety
2378
+ Return the generators of the defining ideal for the complete flag variety
2378
2379
$\t ext{Fl}(\m athbb{F}, (d_1,\d ots,d_k), n)$, where $(d_1,\d ots,d_k)
2379
2380
=$`dimensions`, with $d_j\l eq n-1$, denotes the rank. That is, the vanishing
2380
2381
set of this ideal corresponds to the space of $k$-step flags of linear
@@ -2391,7 +2392,7 @@ Evaluating this function with the parameter `minimal = true` returns the reduced
2391
2392
the flag Plücker ideal with respect to the degree reverse lexicographical order. For more details, see Theorem 14.6 [MS05](@cite)
2392
2393
# Examples
2393
2394
2394
- Complete flag variety $\t ext{Fl}(\m athbb{Q}, (1,2,3), 4)$.
2395
+ Complete flag variety $\t ext{Fl}(\m athbb{Q}, (1,2,3), 4)$.
2395
2396
```jldoctest
2396
2397
julia> flag_pluecker_ideal(QQ,[1,2,3],4)
2397
2398
Ideal generated by
@@ -2435,7 +2436,7 @@ flag_pluecker_ideal(dimensions::Vector{Int}, n::Int; minimal::Bool=true) = flag_
2435
2436
2436
2437
function flag_pluecker_ideal (ring:: MPolyRing{<: FieldElem} , dimensions:: Vector{Int} , n:: Int ; minimal:: Bool = true )
2437
2438
dimensions = unique (dimensions)
2438
-
2439
+
2439
2440
@req maximum (dimensions) <= n- 1 " The dimensions must be at most n-1"
2440
2441
@req sum (binomial (n, d) for d in dimensions) == ngens (ring) " The ring doesn't have the right number of variables"
2441
2442
@req issorted (dimensions) " The dimensions must be increasing"
@@ -2462,7 +2463,7 @@ function flag_pluecker_ideal(ring::MPolyRing{<: FieldElem}, dimensions::Vector{I
2462
2463
gg = unique (x -> divexact (x, canonical_unit (x)), genz)
2463
2464
I = ideal (gg)
2464
2465
2465
- ! minimal && return I
2466
+ ! minimal && return I
2466
2467
2467
2468
o = degrevlex (ring)
2468
2469
converted_generators = collect (groebner_basis (I; ordering = o))
@@ -2473,7 +2474,7 @@ function flag_pluecker_ideal(ring::MPolyRing{<: FieldElem}, dimensions::Vector{I
2473
2474
end
2474
2475
2475
2476
# Since most ideals implement `==`, they have to implement the hash function.
2476
- # See issue #4143 for problems entailed. Interestingly, this does not yet fix
2477
+ # See issue #4143 for problems entailed. Interestingly, this does not yet fix
2477
2478
# the failure of unique! on lists of ideals.
2478
2479
function hash (I:: Ideal , c:: UInt )
2479
2480
return hash (base_ring (I), c)
0 commit comments