You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow TropicalSemiringMap to not have a valued field (#5514)
* chg: TropicalSemiringMap, allow valuedField to be unspeficied
intended for future use-cases where valued field is unimportant, e.g., when
working with Puiseux polynomials.
* TropicalGeometry: groebner_basis, added TropicalSemiringMap checks
* TropicalGeometry: added / changed comments
* TropicalGeometry: added domain, codomain for TropicalSemiringMap
* TropicalGeometry: relaxed assertions for initial
* TropicalGeometry: tropical_semiring_map, field renaming
- `uniformizer_field` -> `uniformizer_in_field`
- `uniformizer_ring` -> `uniformizer_in_ring`
* TropicalGeometry: adding linebreaks to overlong docstring line
* TropicalGeometry: hypersurface, simplified optional parameter specification
* TropicalGeometry: hypersurface, added check for valued field
The notion of a tropical hypersurface over a general ring is ambigious,
so it makes sense to disallow it for now.
* TropicalGeometry: replace `valued_field` calls by `domain` calls
* TropicalGeometry: replace if bracket with ternary if
* TropicalGeometry: fixed forgotten `uniformizer_field` in namechange
# special function for trivial valuation to ensure reusing original ring
32
36
functionget_polynomial_ring_for_groebner_simulation(R::MPolyRing, nu::TropicalSemiringMap{K,Nothing,minOrMax}) where {K<:Field, minOrMax<:Union{typeof(min),typeof(max)}}
33
-
@reqcoefficient_ring(R)==valued_field(nu) "coefficient ring is not valued field"
37
+
@reqcoefficient_ring(R)==domain(nu) "coefficient ring is not valued field"
@reqcoefficient_ring(R)==valued_field(nu) "coefficient ring is not valued field"
16
+
@reqcoefficient_ring(R)==domain(nu) "coefficient ring of polynomials is not domain of tropical semiring map"
17
17
18
18
polynomialRingsForInitial =get_attribute!(R, :tropical_geometry_polynomial_rings_for_initial) do
19
19
returnDict{TropicalSemiringMap,MPolyRing}()
@@ -23,7 +23,7 @@ end
23
23
24
24
# special function for trivial valuation to ensure reusing original ring
25
25
functionget_polynomial_ring_for_initial(R::MPolyRing, nu::TropicalSemiringMap{K,Nothing,minOrMax}) where {K<:Field, minOrMax<:Union{typeof(min),typeof(max)}}
26
-
@reqcoefficient_ring(R)==valued_field(nu) "coefficient ring is not valued field"
26
+
@reqcoefficient_ring(R)==domain(nu) "coefficient ring of polynomials is not domain of tropical semiring map"
functionTropicalSemiringMap{typeofValuedField,typeofUniformizer,minOrMax}(valuedField::typeofValuedField,uniformizerField::Union{Nothing,FieldElem},valuedRing::Ring,uniformizerRing::typeofUniformizer,residueField::Field,tropicalSemiring::TropicalSemiring{minOrMax}) where {typeofValuedField<:Field,typeofUniformizer<:Union{Nothing,RingElem},minOrMax<:Union{typeof(min),typeof(max)}}
Return a map `nu` from `K` to the min (default) or max tropical semiring `T` such that `nu(0)=zero(T)` and `nu(c)=one(T)` for `c` non-zero. In other words, `nu` extends the trivial valuation on `K`.
108
+
Return a map `nu` from `K` to the min (default) or max tropical semiring `T`
109
+
such that `nu(0)=zero(T)` and `nu(c)=one(T)` for `c` non-zero. In other words,
110
+
`nu` represents the trivial valuation on `K`.
61
111
62
112
# Examples
63
113
```jldoctest
@@ -93,14 +143,14 @@ end
93
143
94
144
# Print string
95
145
function Base.show(io::IO, nu::TropicalSemiringMap{K,Nothing,minOrMax}where {K<:Ring, minOrMax<:Union{typeof(min),typeof(max)}})
96
-
print(io, "Map into $(tropical_semiring(nu)) encoding the trivial valuation on $(valued_field(nu))")
146
+
print(io, "Map into $(tropical_semiring(nu)) encoding the trivial valuation on $(domain(nu))")
97
147
end
98
148
99
149
# Mapping an element of the valued field or ring to the tropical semiring
100
150
function (nu::TropicalSemiringMap{K,Nothing,minOrMax})(c::Union{RingElem,Integer,Rational}) where {K<:Field, minOrMax<:Union{typeof(min),typeof(max)}}
# Mapping an element of the valued field or ring to the residue field
@@ -155,12 +205,12 @@ end
155
205
156
206
# Print string
157
207
function Base.show(io::IO, nu::TropicalSemiringMap{QQField,ZZRingElem,minOrMax}) where {minOrMax<:Union{typeof(min),typeof(max)}}
158
-
print(io, "Map into $(tropical_semiring(nu)) encoding the $(uniformizer(nu))-adic valuation on $(valued_field(nu))")
208
+
print(io, "Map into $(tropical_semiring(nu)) encoding the $(uniformizer(nu))-adic valuation on $(domain(nu))")
159
209
end
160
210
161
211
# Mapping an element of the valued field or ring to the tropical semiring
162
212
function (nu::TropicalSemiringMap{QQField,ZZRingElem,minOrMax})(c::Union{RingElem,Integer,Rational}) where minOrMax<:Union{typeof(min),typeof(max)}
163
-
c =valued_field(nu)(c)
213
+
c =domain(nu)(c)
164
214
# return tropical zero if c is zero
165
215
# and p-adic valuation otherwise
166
216
# preserve_ordering ensures that valuation is negated if convention(nu)==max
@@ -170,11 +220,11 @@ end
170
220
171
221
# Mapping an element of the valued field or ring to the residue field
172
222
functioninitial(c::Union{RingElem,Integer,Rational}, nu::TropicalSemiringMap{QQField,ZZRingElem,minOrMax}) where minOrMax<:Union{typeof(min),typeof(max)}
173
-
c =valued_field(nu)(c)
223
+
c =domain(nu)(c)
174
224
# return residue field zero if c is zero
175
225
# and the correct non-zero residue otherwise
176
226
iszero(c) &&returnzero(residue_field(nu)) # if c is zero, return 0
177
-
c *=uniformizer_field(nu)^(-valuation(c,uniformizer(nu)))
227
+
c *=uniformizer_in_field(nu)^(-valuation(c,uniformizer(nu)))
178
228
returnresidue_field(nu)(c)
179
229
end
180
230
@@ -230,7 +280,7 @@ end
230
280
231
281
# Print String
232
282
function Base.show(io::IO, nu::TropicalSemiringMap{Kt,t,minOrMax}) where {Kt<:Generic.RationalFunctionField, t<:PolyRingElem, minOrMax<:Union{typeof(min),typeof(max)}}
233
-
print(io, "Map into $(tropical_semiring(nu)) encoding the $(uniformizer(nu))-adic valuation on $(valued_field(nu))")
283
+
print(io, "Map into $(tropical_semiring(nu)) encoding the $(uniformizer(nu))-adic valuation on $(domain(nu))")
234
284
end
235
285
236
286
# Mapping an element of the valued field or ring to the tropical semiring
@@ -239,7 +289,7 @@ function t_adic_valuation(c::Generic.RationalFunctionFieldElem, t::PolyRingElem)
239
289
end
240
290
241
291
function (nu::TropicalSemiringMap{Kt,t,minOrMax})(c::Union{RingElem,Integer,Rational}) where {Kt<:Generic.RationalFunctionField, t<:PolyRingElem, minOrMax<:Union{typeof(min),typeof(max)}}
242
-
c =valued_field(nu)(c)
292
+
c =domain(nu)(c)
243
293
# return tropical zero if c is zero
244
294
# and p-adic valuation otherwise
245
295
# preserve_ordering ensures that valuation is negated if convention(nu)==max
@@ -249,10 +299,10 @@ end
249
299
250
300
# Mapping an element of the valued field or ring to the residue field
251
301
functioninitial(c::Union{RingElem,Integer,Rational}, nu::TropicalSemiringMap{Kt,t,minOrMax}) where {Kt<:Generic.RationalFunctionField, t<:PolyRingElem, minOrMax<:Union{typeof(min),typeof(max)}}
252
-
c =valued_field(nu)(c)
302
+
c =domain(nu)(c)
253
303
# return residue field zero if c is zero
254
304
# and the correct non-zero residue otherwise
255
305
iszero(c) &&returnzero(residue_field(nu)) # if c is zero, return 0
256
-
c *=uniformizer_field(nu)^(-t_adic_valuation(c,uniformizer(nu)))
306
+
c *=uniformizer_in_field(nu)^(-t_adic_valuation(c,uniformizer(nu)))
0 commit comments