oscar-system / Oscar.jl

A comprehensive open source computer algebra system for computations in algebra, geometry, and number theory.
https://www.oscar-system.org
Other
338 stars 120 forks source link

Order on RationalFunctionField #3067

Open lenweis opened 10 months ago

lenweis commented 10 months ago

The field of rational functions does not come with an order in Oscar which doesn't let me construct a polyhedron for example.

julia> RR, u = RationalFunctionField(QQ, :u)
(Rational function field over QQ, u)

julia> a = [u, u^2, u^3]
3-element Vector{AbstractAlgebra.Generic.RationalFunctionFieldElem{QQFieldElem, QQPolyRingElem}}:
 u
 u^2
 u^3

julia> P = polyhedron(RR, [a], [u])
ERROR: MethodError: no method matching isless(::AbstractAlgebra.Generic.RationalFunctionFieldElem{QQFieldElem, QQPolyRingElem}, ::AbstractAlgebra.Generic.RationalFunctionFieldElem{QQFieldElem, QQPolyRingElem})

Closest candidates are:
  isless(::Any, ::EmbeddedElem)
   @ Hecke ~/.julia/packages/Hecke/D2kay/src/NumField/Embedded.jl:142
  isless(::EmbeddedElem, ::Any)
   @ Hecke ~/.julia/packages/Hecke/D2kay/src/NumField/Embedded.jl:140
  isless(::Any, ::Missing)
   @ Base missing.jl:88
  ...

As the field comes with a natural order ($\frac{f}{g} > 0$, when $\frac{lc(f)}{lc(g)} > 0$), it would be nice to have to this.

fieker commented 10 months ago

On Tue, Dec 05, 2023 at 01:58:55AM -0800, Lena wrote:

The field of rational functions does not come with an order in Oscar which doesn't let me construct a polyhedron for example.

julia> RR, u = RationalFunctionField(QQ, :u)
(Rational function field over QQ, u)

julia> a = [u, u^2, u^3]
3-element Vector{AbstractAlgebra.Generic.RationalFunctionFieldElem{QQFieldElem, QQPolyRingElem}}:
 u
 u^2
 u^3

julia> P = polyhedron(RR, [a], [u])
ERROR: MethodError: no method matching isless(::AbstractAlgebra.Generic.RationalFunctionFieldElem{QQFieldElem, QQPolyRingElem}, ::AbstractAlgebra.Generic.RationalFunctionFieldElem{QQFieldElem, QQPolyRingElem})

Closest candidates are:
  isless(::Any, ::EmbeddedElem)
   @ Hecke ~/.julia/packages/Hecke/D2kay/src/NumField/Embedded.jl:142
  isless(::EmbeddedElem, ::Any)
   @ Hecke ~/.julia/packages/Hecke/D2kay/src/NumField/Embedded.jl:140
  isless(::Any, ::Missing)
   @ Base missing.jl:88
  ...

As the field comes with a natural order ($\frac{f}{g} > 0$, when $\frac{lc(f)}{lc(g)} > 0$), it would be nice to have to this.

The field comes with many orders, e.g. any irreducible in K[t] defines an exponential valuation, then there is the degree function...

What properties of an order are required here? Maybe we can pass an order into the constructor? Or do s.th. like the Embedded stuff where a new object with an order is created...

-- Reply to this email directly or view it on GitHub: https://github.com/oscar-system/Oscar.jl/issues/3067 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

fingolfin commented 5 months ago

The proposed "natural" order seems extremely unnatural to me. E.g. it would order $2x$ above $x^5$. Not saying this rules it out as a order, just that I'd be very careful with the term "natural".

Also, even if defining such ordering, I don't think you'll be able to do much with the resulting polyhedron. For geometry, you need to eventually fix an embedding into the real numbers.

lgoettgens commented 4 months ago

@benlorenz proposes to put a wrapper with an ordering around fractional function fields, like was done with embedded number fields