Skip to main content

Formalization and Execution of Linear Algebra: From Theorems to Algorithms

  • Conference paper
  • First Online:
Logic-Based Program Synthesis and Transformation (LOPSTR 2013)

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

Abstract

In this work we present a formalization of the Rank Nullity theorem of Linear Algebra in Isabelle/HOL. The formalization is of interest because of various reasons. First, it has been carried out based on the representation of mathematical structures proposed in the HOL Multivariate Analysis library of Isabelle/HOL (which is part of the standard distribution of the proof assistant). Hence, our proof shows the adequacy of such an infrastructure for the formalization of Linear Algebra. Moreover, we enrich the proof with an additional formalization of its computational meaning; to this purpose, we choose to implement the Gauss-Jordan elimination algorithm for matrices over fields, prove it correct, and then apply the Isabelle code generation facility that permits to execute the formalized algorithm. For the algorithm to be code generated, we use again the implementation of matrices available in the HOL Multivariate Analysis library, and enrich it with some necessary features. We report on the precise modifications that we introduce to get code execution from the original representation, and on the performance of the code obtained. We present an alternative verified type refinement of vectors that outperforms the original version. This refinement performs well enough as to be applied to the computation of the rank of some biomedical digital images. Our work proves itself as a suitable basis for the formalization of numerical Linear Algebra in HOL provers that can be successfully applied for computations of real case studies.

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 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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aransay, J. Divasón, J.: Rank Nullity Theorem in Linear Algebra, Archive of Formal Proofs (2013). http://afp.sourceforge.net/entries/Rank_Nullity_Theorem.shtml

  2. Aransay, J., Divasón, J.: Gauss-Jordan elimination in Isabelle/HOL (2013). http://www.unirioja.es/cu/jodivaso/Isabelle/Gauss-Jordan/

  3. Aransay, J., Divasón, J.: Performance Analysis of a Verified Linear Algebra program in SML, Taller de Programación Funcional (TPF 2013), pp. 28–35. Lars-Åke Fredlund and Laura M. Castro (eds.) (2013)

    Google Scholar 

  4. Dénès, M., Mörtberg, A., Siles, V.: A Refinement-Based Approach to Computational Algebra in Coq. In: Beringer, L., Felty, A. (eds.) ITP 2012. LNCS, vol. 7406, pp. 83–98. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  5. Esparza, J., Lammich, P., Neumann, R., Nipkow, T., Schimpf, A., Smaus, J.-G.: A Fully Verified Executable LTL Model Checker. In: Sharygina, N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044, pp. 463–478. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  6. Formath Project: Formalisation of Mathematics. http://wiki.portal.chalmers.se/cse/pmwiki.php/ForMath

  7. Haftmann, F., Nipkow, T.: Code Generation via Higher-Order Rewrite Systems. In: Blume, M., Kobayashi, N., Vidal, G. (eds.) FLOPS 2010. LNCS, vol. 6009, pp. 103–117. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  8. 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 

  9. Harrison, J.: A HOL Theory of Euclidean Space. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 114–129. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  10. Harrison, J.: The HOL Light Theory of Euclidean Space. J. Autom. Reasoning 50(2), 173–190 (2013)

    Article  MATH  Google Scholar 

  11. Hales, T.C., Harrison, J., McLaughlin, S., Nipkow, T., Obua, S., Zumkeller, R.: A revision of the Proof of the Kepler Conjecture. Discrete & Computational Geometry 44(1), 1–34 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  12. Heras, J., Coquand, T., Mörtberg, A., Siles, V.: Computing Persistent Homology within Coq/SSReflect. ACM Transactions on Computational Logic, 14(4). Article n. 26

    Google Scholar 

  13. Heras, J., Dénès, M., Mata, G., Mörtberg, A., Poza, M., Siles, V.: Towards a Certified Computation of Homology Groups for Digital Images. In: Ferri, M., Frosini, P., Landi, C., Cerri, A., Di Fabio, B. (eds.) CTIC 2012. LNCS, vol. 7309, pp. 49–57. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  14. Heras, J., Poza, M., Dénès, M., Rideau, L.: Incidence Simplicial Matrices Formalized in Coq/SSReflect. In: Davenport, J.H., Farmer, W.M., Urban, J., Rabe, F. (eds.) MKM 2011 and Calculemus 2011. LNCS, vol. 6824, pp. 30–44. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  15. Hölzl, J., et al.: HOL Multivariate Analysis (2013). http://isabelle.in.tum.de/dist/library/HOL/HOL-Multivariate_Analysis/index.html

  16. Hölzl, J., Immler, F., Huffman, B.: Type Classes and Filters for Mathematical Analysis in Isabelle/HOL. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 279–294. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  17. Lammich, P., Tuerk, T.: Applying Data Refinement for Monadic Programs to Hopcroft’s Algorithm. In: Beringer, L., Felty, A. (eds.) ITP 2012. LNCS, vol. 7406, pp. 166–182. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  18. Lammich, P.: Automatic Data Refinement. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 84–99. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  19. Lochbihler, A.: Light-Weight Containers for Isabelle: Efficient, Extensible, Nestable. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 116–132. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  20. Nipkow, T.: Gauss-Jordan Elimination for Matrices Represented as Functions. Archive of Formal Proofs (2011). http://afp.sourceforge.net/entries/Gauss-Jordan-Elim-Fun.shtml

  21. Nipkow, T., Paulson, L., Wenzel, M.: Isabelle/HOL: A proof assistant for Higher-Order Logic. Springer (2002)

    Google Scholar 

  22. Roman, S.: Advanced Linear Algebra (Third Edition). Springer (2008)

    Google Scholar 

  23. Gasner, E., Reppy, J.H. (eds.): The Standard ML Basis Library. http://www.standardml.org/Basis/

  24. Wiedijk, F.: Formalizing 100 Theorems. http://www.cs.ru.nl/~freek/100/

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jesús Aransay .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Aransay, J., Divasón, J. (2014). Formalization and Execution of Linear Algebra: From Theorems to Algorithms. In: Gupta, G., Peña, R. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2013. Lecture Notes in Computer Science(), vol 8901. Springer, Cham. https://doi.org/10.1007/978-3-319-14125-1_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-14125-1_1

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-14124-4

  • Online ISBN: 978-3-319-14125-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics