Opened 5 years ago

Closed 5 years ago

#20184 closed defect (fixed)

Comparison of number field elements embedded into RIF fails

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-7.2
Component: number fields Keywords:
Cc: tmonteil, jj, sstarosta, gagern, mkoeppe, vdelecroix Merged in:
Authors: Matthias Koeppe Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: 259afd9 (Commits) Commit: 259afd9503782367bfd611584f1ca675e4839717
Dependencies: Stopgaps:


This is a follow-up on #17830, which made this possible:

sage: x = polygen(ZZ)
sage: K.<cbrt2> = NumberField(x^3 - 2, embedding=AA.polynomial_root(x^3-2, RIF(0,3)))
sage: 6064/4813 < cbrt2 < 90325/71691

However, if I embed into a RIF instead, the same test fails.

sage: x = polygen(ZZ)
sage: K.<cbrt2> = NumberField(x^3 - 2, embedding=RIF(AA.polynomial_root(x^3-2, RIF(0,3))))
sage: 6064/4813 < cbrt2 < 90325/71691

Change History (6)

comment:1 Changed 5 years ago by vdelecroix

I do not think this is a bug.

The (respective to the embedding) comparison code is used only if there is a coercion embedding for which the codomain allows to have arbitrary precision real intervals (right now, only AA/QQbar but could be extend to RLF/CLF). I do not mean that it is not feasible to find the corresponding exact embedding from a one into RIF one. But I would be against using it.

What is the problem with the behavior in the ticket description?

comment:2 Changed 5 years ago by mmezzarobba

  • Milestone changed from sage-7.1 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

I tend to agree with Vincent.

comment:3 Changed 5 years ago by mkoeppe

  • Branch set to u/mkoeppe/comparison_of_number_field_elements_embedded_into_rif_fails

comment:4 Changed 5 years ago by mkoeppe

  • Commit set to 259afd9503782367bfd611584f1ca675e4839717
  • Milestone changed from sage-duplicate/invalid/wontfix to sage-7.2

Thanks for the discussion; I agree that it's a plausible restriction.

I have added a patch that adds this detail to the documentation of NumberField.

New commits:

259afd9Document implementation restriction of comparison of real number field elements

comment:5 Changed 5 years ago by dimpase

  • Authors set to Matthias Koeppe
  • Reviewers set to Dima Pasechnik
  • Status changed from needs_review to positive_review

a bit of extra doc never hurts.

comment:6 Changed 5 years ago by vbraun

  • Branch changed from u/mkoeppe/comparison_of_number_field_elements_embedded_into_rif_fails to 259afd9503782367bfd611584f1ca675e4839717
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.