Problem
As we were reminded of in oscar-system/Oscar.jl#5960, // can lead to nonsense:
julia> RR,_ = residue_ring(ZZ, 100)
(Integers modulo 100, Map: ZZ -> ZZ/(100))
julia> a = RR(9)
9
julia> parent(a)
Integers modulo 100
julia> W = parent(a//a)
Fraction field
of integers modulo 100
julia> new_j = 10*W(1)
10
julia> inv_new_j = 1/new_j
1//10
julia> inv_new_j^2
Error showing value of type AbstractAlgebra.Generic.FracFieldElem{zzModRingElem}:
ERROR: Impossible inverse in Integers modulo 100
julia> weird = (inv_new_j)^2;
julia> is_zero(1//weird)
true
A possible solution
When we introduced the fraction fields, we did not have the total field of fractions. Nowadays, for a ring R we could do the following:
- if
is_domain_type(R), do what we do now,
- if
!is_domain_type(R), construct total_field_of_fractions.
Problem
As we were reminded of in oscar-system/Oscar.jl#5960,
//can lead to nonsense:A possible solution
When we introduced the fraction fields, we did not have the total field of fractions. Nowadays, for a ring
Rwe could do the following:is_domain_type(R), do what we do now,!is_domain_type(R), constructtotal_field_of_fractions.