Formal Aspects of Computing

, Volume 28, Issue 6, pp 1005–1026 | Cite as

Formalisation of the computation of the echelon form of a matrix in Isabelle/HOL

Original Article


In this contribution we present a formalised algorithm in the Isabelle/HOL proof assistant to compute echelon forms, and, as a consequence, characteristic polynomials of matrices. We have proved its correctness over Bézout domains, but its executability is only guaranteed over Euclidean domains, such as the integer ring and the univariate polynomials over a field. This is possible since the algorithm has been parameterised by a (possibly non-computable) operation that returns the Bézout coefficients of a pair of elements of a ring. The echelon form is also used to compute determinants and inverses of matrices. As a by-product, some algebraic structures have been implemented (principal ideal domains, Bézout domains, etc.). In order to improve performance, the algorithm has been refined to immutable arrays inside of Isabelle and code can be generated to functional languages as well.


Theorem proving Isabelle/HOL Linear algebra Verified code generation 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. AD14.
    Aransay J, Divasón J (2014) Formalization and execution of Linear Algebra: from theorems to algorithms. In: Gupta G, Peña R (ed) Post Proceedings of the international symposium on logic-based program synthesis and transformation: LOPSTR 2013, LNCS, vol 8901. Springer, pp 01–19Google Scholar
  2. AD15a.
    Aransay J, Divasón J (2015) Formalisation in higher-order logic and code generation to functional languages of the Gauss–Jordan algorithm. J Funct Program 25(e9):21. doi: 10.1017/S0956796815000155
  3. AD15b.
    Aransay J, Divasón J (2015) Generalizing a Mathematical Analysis library in Isabelle/HOL. In: Havelund K, Holzmann G, Joshi R (eds) Proceedings of the seventh NASA formal methods symposium: NFM 2015Google Scholar
  4. AHP14.
    Adelsberger S, Hetzl S, Pollak F (2014) The Cayley–Hamilton theorem. Archive of formal proofs. Formal proof development. Accessed 30 Apr 2016
  5. Bat03.
    Bathe KJ (2003) Computational fluid and solid mechanics. Elsevier Science, AmsterdamMATHGoogle Scholar
  6. BvH82.
    Borodin A, von zur Gathen J, Hopcroft JE (1982) Fast parallel matrix and gcd computations. Inf Control 52(3): 241–256MathSciNetCrossRefMATHGoogle Scholar
  7. BW04.
    Beineke LW, Wilson RJ (2004) Topics in algebraic graph theory. Encyclopedia of mathematics and its applications. Cambridge University Press, CambridgeGoogle Scholar
  8. CCD+16.
    Cano G, Cohen C, Dénès M, Mörtberg A, Siles V (2016) Formalized linear algebra over elementary divisor rings in Coq. Logical methods in computer science (Submitted)Google Scholar
  9. CDM13.
    Cohen C, Dénès M, Mörtberg A (2013) Refinements for Free! In: Gonthier G, Norrish M (eds) Certified programs and proofs: CPP 2013, of lecture notes in computer science, vol 8307. Springer, pp 147–162Google Scholar
  10. Chi06.
    Child D (2006) The essentials of factor analysis. Bloomsbury Academic, New YorkGoogle Scholar
  11. DA14.
    Divasón J, Aransay J (2014) Gauss–Jordan algorithm and Its applications. Archive of formal proofs. Formal proof development. Accessed 30 Apr 2016
  12. DA15a.
    Divasón J, Aransay J (2015) Echelon form. Archive of formal proofs., Formal proof development. Updated version available from the AFP repository version: Accessed 30 Apr 2016
  13. DA15b.
    Divasón J, Aransay J (2015) QR Decomposition. Archive of formal proofs. Formal proof development. Accessed 30 Apr 2016
  14. Dén13.
    Dénès M (2013) Formal study of efficient algorithms in linear algebra. Ph.D. thesis, Université Nice Sophia AntipolisGoogle Scholar
  15. DMS12.
    Dénès M, Mörtberg A, Siles V (2012) A refinement-based approach to Computational Algebra in COQ. In: Beringer L, Felty A (eds) Interactive theorem proving: ITP 2012, lecture notes in computer science, vol 7406. Springer, pp 83–98Google Scholar
  16. Ebe15.
    Eberl M (2015) A decision procedure for univariate real polynomials in Isabelle/HOL. In: Proceedings of the 2015 conference on certified programs and proofs, CPP ’15, New York, NY, USA, pp 75–83Google Scholar
  17. FS01.
    Fuchs L, Salce L (2001) Modules over non-Noetherian domains. Mathematical surveys and monographs. American Mathematical Society, ProvidenceGoogle Scholar
  18. Fuk13.
    Fukunaga K (2013) Introduction to statistical pattern recognition. Computer science and scientific computing. Elsevier Science, AmsterdamGoogle Scholar
  19. GCV03.
    Gamboa R, Cowles J, Van Baalen J (2003) Using ACL2 arrays to formalise matrix algebra. In: Fourth international workshop on the ACL2 theorem prover and its applicationsGoogle Scholar
  20. HAB+15.
    Hales T, Adams M, Bauer G, Tat Dang D, Harrison J, Le Hoang T, Kaliszyk C, Magron V, McLaughlin S, Tat Nguyen T, Quang Nguyen T, Nipkow T, Obua S, Pleso J, Rute J, Solovyev A, Hoai Thi Ta A, Tran TN, Thi Trieu D, Urban J, Khac Vu K, Zumkeller R (2015) Formal proof of the Kepler conjecture CoRR. abs/1501.02155. Accessed 30 Apr 2016
  21. Haf16a.
    Haftmann F (2016) Code generation from Isabelle/HOL theories. Tutorial documentation. Accessed 30 Apr 2016
  22. Haf16b.
    Haftmann F (2016) Haskell-style type classes with Isabelle/Isar. Tutorial documentation. Accessed 30 Apr 2016
  23. Har13.
    Harrison J (2013) The HOL light theory of euclidean space. J Autom Reason 50(2): 173–190MathSciNetCrossRefMATHGoogle Scholar
  24. HK13.
    Huffman B, Kunčar O (2013) Lifting and Transfer: A Modular Design for Quotients in Isabelle/HOL. In: Gonthier G, Norrish M (eds) Certified programs and proofs: CPP 2013, lecture notes in computer science, vol 8307. Springer, pp 131–146Google Scholar
  25. Hog06.
    Hogben J (2006) Handbook of linear algebra (discrete mathematics and its applications), 1st edn. Chapman & Hall/CRC, Boca RatónGoogle Scholar
  26. Jac12.
    Jacobson N (2012) Basic algebra I, 2nd edn. Dover Books on Mathematics, Dover Publications, New YorkGoogle Scholar
  27. KEH+09.
    Klein G, Elphinstone K, Heiser G, Andronick J, Cock D, Derrin P, Elkaduwe D, Engelhardt K, Kolanski R, Norrish M, Sewell T, Tuch H, Winwood S (2009) seL4: formal verification of an OS kernel. In: Proceedings of the ACM SIGOPS 22Nd symposium on operating systems principles, SOSP ’09. ACM, New York, pp 207–220Google Scholar
  28. LB11.
    Lochbihler A, Bulwahn L (2011) Animating the formalised semantics of a Java-like Language. In: van Eekelen M, Geuvers H, Schmalz J, Wiedijk F (eds) Interactive theorem proving (ITP 2011), lecture notes in computer science, vol 6898. Springer, pp 216 – 232Google Scholar
  29. Leo14.
    Leon SJ (2014) Linear algebra with applications. Featured titles for linear algebra (introductory) Series. Pearson Education, New JerseyGoogle Scholar
  30. LL00.
    Liu B, Lai HJ (2000) Matrices in combinatorics and graph theory. Network theory and applications. Springer, BerlinGoogle Scholar
  31. LM11.
    Langville AN, Meyer CD (2011) Google’s Pagerank and beyond: the science of search engine rankings. Princeton University Press, PrincetonGoogle Scholar
  32. MLt.
    The MLton website. MLton. a whole program optimizing complier for Standard ML. Accessed 30 Apr 2016
  33. New72.
    Newman M (1972) Integral matrices. Pure and applied mathematics. Elsevier Science, New YorkGoogle Scholar
  34. NMnD15.
    Narkawicz A, Muñoz C, Dutle A (2015) Formally-verified decision procedures for univariate polynomial computation based on Sturm’s and Tarski’s theorems. J Autom Reason 54(4): 285–326CrossRefMATHGoogle Scholar
  35. OB10.
    Ould Biha S (2010) Mathematical components for groups theory. Ph.D. thesis, Université Nice Sophia AntipolisGoogle Scholar
  36. Pan01.
    Pan VY (2001) Computation of approximate polynomial gcds and an extension. Inf Comput 167(2): 71–85MathSciNetCrossRefMATHGoogle Scholar
  37. Pol.
    The Poly/ML website. Accessed 30 Apr 2016
  38. Rom07.
    Roman S (2007) Advanced linear algebra. Graduate texts in mathematics. Springer, BerlinGoogle Scholar
  39. RST01.
    Rudnicki P, Schwarzweller C, Trybulec A (2001) Commutative algebra in the Mizar system. J Symbolic Comput 32(1/2): 143–169MathSciNetCrossRefMATHGoogle Scholar
  40. Sto00.
    Storjohann A (2000) Algorithms for matrix canonical forms. Ph.D. thesis, Swiss Federal Institute of Technology ZurichGoogle Scholar
  41. TAV12.
    Coquand T, Mörtberg A, Siles V (2012) A formal proof of Sasaki–Murao algorithm. J Formaliz Reason 5(1): 27–36MathSciNetGoogle Scholar
  42. TY15.
    Thiemann R, Yamada A (2015) Matrices, Jordan normal forms, and spectral radius theory. Archive of formal proofs, August. Formal proof development. Accessed 30 Apr 2016
  43. VN55.
    Von Neumann J (1955) Mathematical foundations of quantum mechanics. Investigations in physics. Princeton University Press, PrincetonGoogle Scholar
  44. Zil12.
    Zill D (2012) A first course in differential equations with modeling applications. Cengage Learning, BostonMATHGoogle Scholar

Copyright information

© British Computer Society 2016

Authors and Affiliations

  1. 1.Departamento de Matemáticas y Computación, C/ Luis de Ulloa 2, Edificio Juan Luis VivesUniversidad de La RiojaLogroño, La RiojaSpain

Personalised recommendations