Formalization and Execution of Linear Algebra: From Theorems to Algorithms
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.
KeywordsLinear Algebra Verification Code generation
Unable to display preview. Download preview PDF.
- 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
- 6.Formath Project: Formalisation of Mathematics. http://wiki.portal.chalmers.se/cse/pmwiki.php/ForMath
- 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. 26Google Scholar
- 15.Hölzl, J., et al.: HOL Multivariate Analysis (2013). http://isabelle.in.tum.de/dist/library/HOL/HOL-Multivariate_Analysis/index.html
- 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/