Skip to main content

Algebraic Numbers in Isabelle/HOL

  • Conference paper
  • First Online:
Interactive Theorem Proving (ITP 2016)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9807))

Included in the following conference series:

Abstract

We formalize algebraic numbers in Isabelle/HOL, based on existing libraries for matrices and Sturm’s theorem. Our development serves as a verified implementation for real and complex numbers, and it admits to compute roots and completely factor real and complex polynomials, provided that all coefficients are rational numbers. Moreover, we provide two implementations to display algebraic numbers, an injective and expensive one, and a faster but approximative version.

To this end, we mechanize several results on resultants, which also required us to prove that polynomials over a unique factorization domain form again a unique factorization domain. We moreover formalize algorithms for factorization of integer polynomials: Newton interpolation, factorization over the integers, and Kronecker’s factorization algorithm, as well as a factorization oracle via Berlekamp’s algorithm with the Hensel lifting.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    See http://math-comp.github.io/math-comp.

  2. 2.

    Here one cannot just evaluate the polynomial on the algebraic point and test the result is 0; we are defining the basic arithmetic operations needed for this evaluation.

  3. 3.

    However, we use a faster computer with 3.5 GHz instead of 2.66 GHz.

  4. 4.

    We contributed our formalization to the development version of Isabelle (May 2016). There one will find the general “”.

  5. 5.

    As for the division algorithm, we have not been able to work with Isabelle’s existing type class for GCDs, as the GCD on polynomials is only available for fields.

  6. 6.

    These optimizations became part of the development version of Isabelle (May 2016).

  7. 7.

    We thank one of the anonymous reviewers for pointing us to this equality test.

  8. 8.

    Note that the quotient type can be in principle defined also directly on top of , such that the quotient and invariant construction is done in one step, but then code generator will fail in Isabelle 2016.

References

  1. Brown, W.S.: The subresultant PRS algorithm. ACM Trans. Math. Softw. 4(3), 237–249 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  2. Cohen, C.: Construction of real algebraic numbers in Coq. In: Beringer, L., Felty, A. (eds.) ITP 2012. LNCS, vol. 7406, pp. 67–82. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  3. Cohen, C., Djalal, B.: Formalization of a Newton series representation of polynomials. In: CPP 2016, pp. 100–109. ACM (2016)

    Google Scholar 

  4. Cohen, C., Mahboubi, A.: Formal proofs in real algebraic geometry: from ordered fields to quantifier elimination. Log. Methods Comput. Sci. 8(1:02), 1–40 (2012)

    MathSciNet  MATH  Google Scholar 

  5. Collins, G.E.: Subresultants and reduced polynomial remainder sequences. J. ACM 14, 128–142 (1967)

    Article  MathSciNet  MATH  Google Scholar 

  6. Eberl, M.: A decision procedure for univariate real polynomials in Isabelle/HOL. In: CPP 2015, pp. 75–83. ACM (2015)

    Google Scholar 

  7. Haftmann, F., Krauss, A., Kunčar, O., Nipkow, T.: Data refinement in Isabelle/HOL. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 100–115. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  8. Huffman, B., Kunčar, O.: Lifting and transfer: a modular design for quotients in Isabelle/HOL. In: Gonthier, G., Norrish, M. (eds.) CPP 2013. LNCS, vol. 8307, pp. 131–146. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  9. Knuth, D.E.: The Art of Computer Programming. Seminumerical Algorithms, vol. 2, 2nd edn. Addison-Wesley, Boston (1981)

    MATH  Google Scholar 

  10. Krauss, A.: Recursive definitions of monadic functions. In: PAR 2010. EPTCS, vol. 43, pp. 1–13 (2010)

    Google Scholar 

  11. Li, W., Paulson, L.C.: A modular, efficient formalisation of real algebraic numbers. In: CPP 2016, pp. 66–75. ACM (2016)

    Google Scholar 

  12. Mahboubi, A.: Proving formally the implementation of an efficient gcd algorithm for polynomials. In: Furbach, U., Shankar, N. (eds.) IJCAR 2006. LNCS (LNAI), vol. 4130, pp. 438–452. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  13. Mishra, B.: Algorithmic Algebra. Texts and Monographs in Computer Science. Springer, Heidelberg (1993)

    Google Scholar 

  14. Nipkow, T., Paulson, L.C., Wenzel, M. (eds.): Isabelle/HOL–A Proof Assistant for Higher-Order Logic. LNCS, vol. 2283. Springer, Heidelberg (2002)

    MATH  Google Scholar 

  15. Prasolov, V.V.: Polynomials. Springer, Heidelberg (2004)

    Book  MATH  Google Scholar 

  16. Thiemann, R., Yamada, A.: Formalizing Jordan normal forms in Isabelle/HOL. In: CPP 2016, pp. 88–99. ACM (2016)

    Google Scholar 

Download references

Acknowledgments

We thank the anonymous reviewers for their helpful comments. The early abortion in our divisibility test for integer polynomials is due to Sebastiaan Joosten. This research was supported by the Austrian Science Fund (FWF) project Y757.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to René Thiemann .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Thiemann, R., Yamada, A. (2016). Algebraic Numbers in Isabelle/HOL. In: Blanchette, J., Merz, S. (eds) Interactive Theorem Proving. ITP 2016. Lecture Notes in Computer Science(), vol 9807. Springer, Cham. https://doi.org/10.1007/978-3-319-43144-4_24

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-43144-4_24

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-43143-7

  • Online ISBN: 978-3-319-43144-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics