Formalisation in higher-order logic and code generation to functional languages of the Gauss-Jordan algorithm

In this paper, we present a formalisation in a proof assistant, Isabelle/HOL, of a naive version of the Gauss-Jordan algorithm, with explicit proofs of some of its applications; and, additionally, a process to obtain versions of this algorithm in two different functional languages (SML and Haskell) by means of code generation techniques from the verified algorithm. The aim of this research is not to compete with specialised numerical implementations of Gausslike algorithms, but to show that formal proofs in this area can be used to generate usable functional programs. The obtained programs show compelling performance in comparison to some other verified and functional versions, and accomplish some challenging tasks, such as the computation of determinants of matrices of big integers and the computation of the homology of matrices representing digital images.

[1]  Jose Divasón,et al.  Formalization and Execution of Linear Algebra: From Theorems to Algorithms , 2013, LOPSTR.

[2]  Cyril Cohen,et al.  Refinements for Free! , 2013, CPP.

[3]  T. Hales The Kepler conjecture , 1998, math/9811078.

[4]  Tobias Nipkow,et al.  Data Refinement in Isabelle/HOL , 2013, ITP.

[5]  Maxime Dénès,et al.  Étude formelle d'algorithmes efficaces en algèbre linéaire. (Formal study of efficient algorithms in linear algebra) , 2013 .

[6]  Tobias Nipkow,et al.  Code Generation via Higher-Order Rewrite Systems , 2010, FLOPS.

[7]  Jose Divasón,et al.  Generalizing a Mathematical Analysis Library in Isabelle/HOL , 2015, NFM.

[8]  Antonio José Durán Guardeño,et al.  The Misfortunes of a Trio of Mathematicians Using Computer Algebra Systems. Can We Trust in Them , 2014 .

[9]  John Harrison,et al.  The HOL Light Theory of Euclidean Space , 2012, Journal of Automated Reasoning.

[10]  Tobias Nipkow,et al.  Gauss-Jordan Elimination for Matrices Represented as Functions , 2011, Arch. Formal Proofs.

[11]  Antonio J. Durán Guardeño,et al.  Misfortunes of a mathematicians' trio using Computer Algebra Systems: Can we trust? , 2013, ArXiv.

[12]  Johannes Hölzl,et al.  A Formally Verified Proof of the Central Limit Theorem , 2014, Journal of Automated Reasoning.

[13]  John Harrison,et al.  A HOL Theory of Euclidean Space , 2005, TPHOLs.

[14]  Christian Sternagel Proof Pearl—A Mechanized Proof of GHC’s Mergesort , 2012, Journal of Automated Reasoning.

[15]  Tobias Nipkow,et al.  A Proof Assistant for Higher-Order Logic , 2002 .

[16]  Jeremy Avigad,et al.  Formally verified mathematics , 2014, Commun. ACM.

[17]  David B. MacQueen,et al.  The Definition of Standard ML (Revised) , 1997 .

[18]  Vincent Siles,et al.  A Refinement-Based Approach to Computational Algebra in Coq , 2012, ITP.

[19]  Jónathan Heras,et al.  Towards a Certified Computation of Homology Groups for Digital Images , 2012, CTIC.

[20]  Tobias Nipkow,et al.  A Fully Verified Executable LTL Model Checker , 2013, CAV.

[21]  M. Gockenbach Finite-Dimensional Linear Algebra , 2010 .

[22]  Jose Divasón,et al.  Gauss-Jordan Algorithm and Its Applications , 2014, Arch. Formal Proofs.

[23]  G. Strang Introduction to Linear Algebra , 1993 .