overview
play

Overview Motivation Real Algebraic Numbers Well-Definedness - PowerPoint PPT Presentation

Algebraic Numbers in Isabelle/HOL 1 Ren e Thiemann and Akihisa Yamada Institute of Computer Science University of Innsbruck ITP 2016, August 23, 2016 1 Supported by the Austrian Science Fund (FWF) project Y757 Overview Motivation Real


  1. Algebraic Numbers in Isabelle/HOL 1 Ren´ e Thiemann and Akihisa Yamada Institute of Computer Science University of Innsbruck ITP 2016, August 23, 2016 1 Supported by the Austrian Science Fund (FWF) project Y757

  2. Overview Motivation Real Algebraic Numbers Well-Definedness Calculating Real Roots of Rational Polynomial Factorizing Rational Polynomial Arithmetic on Real Algebraic Numbers Complex Algebraic Numbers Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 2/22

  3. Motivation Certify Complexity of Matrix Interpretations • given: automatically generated complexity proof for program χ A = ( x − 1) · ( − 39 + 360 x − 832 x 2 + 512 x 3 ) • criterions • polynomial complexity if norms of all complex roots of χ A � 1 • degree d in O ( n d ): more calculations with complex roots of χ A Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 3/22

  4. Motivation Certify Complexity of Matrix Interpretations • given: automatically generated complexity proof for program χ A = ( x − 1) · ( − 39 + 360 x − 832 x 2 + 512 x 3 ) • criterions • polynomial complexity if norms of all complex roots of χ A � 1 • degree d in O ( n d ): more calculations with complex roots of χ A • problem: certifier crashed as numbers got too complicated Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 3/22

  5. Motivation Closed Form for Cubic Polynomials • − 39 + 360 x − 832 x 2 + 512 x 3 = 0 iff √ � � � 1 34 3 √ • x = 13 + 383 + 91 + 9 i 383 , 24 3 √ 91+9 i √ √ √ 17 ( 1+ i 3 ) � • x = 13 383 − 1 3 √ � � 24 − 1 − i 3) 91 + 9 i 383, or 3 48 √ 24 91+9 i √ √ √ 17 ( 1 − i 3 ) � • x = 13 383 − 1 3 √ � � 24 − 1 + i 3) 91 + 9 i 383 48 3 √ 24 91+9 i Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 4/22

  6. Motivation Closed Form for Cubic Polynomials • − 39 + 360 x − 832 x 2 + 512 x 3 = 0 iff √ � � � 1 34 3 √ • x 1 = 13 + 383 + 91 + 9 i 383 , 24 3 √ 91+9 i √ √ √ 17 ( 1+ i 3 ) � • x 2 = 13 383 − 1 3 √ � � 24 − 1 − i 3) 91 + 9 i 383, or 3 48 √ 24 91+9 i √ √ √ 17 ( 1 − i 3 ) � • x 3 = 13 383 − 1 3 √ � � 24 − 1 + i 3) 91 + 9 i 383 48 3 √ 24 91+9 i • problem: calculate and decide � Re ( x j ) 2 + Im ( x j ) 2 � 1 norm ( x j ) = for all j ∈ { 1 , 2 , 3 } Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 4/22

  7. Motivation Closed Form for Cubic Polynomials • − 39 + 360 x − 832 x 2 + 512 x 3 = 0 iff √ � � � 1 34 3 √ • x 1 = 13 + 383 + 91 + 9 i 383 , 24 3 √ 91+9 i √ √ √ 17 ( 1+ i 3 ) � • x 2 = 13 383 − 1 3 √ � � 24 − 1 − i 3) 91 + 9 i 383, or 3 48 √ 24 91+9 i √ √ √ 17 ( 1 − i 3 ) � • x 3 = 13 383 − 1 3 √ � � 24 − 1 + i 3) 91 + 9 i 383 48 3 √ 24 91+9 i • problem: calculate and decide � Re ( x j ) 2 + Im ( x j ) 2 � 1 norm ( x j ) = for all j ∈ { 1 , 2 , 3 } • problem: no closed form for roots of polynomials of degree 5 and higher Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 4/22

  8. Motivation Algebraic Numbers • number x ∈ R ∪ C is algebraic iff it is root of non-zero rational polynomial • x 1 = “root #1 of − 39 + 360 x − 832 x 2 + 512 x 3 ” • x 2 = “root #2 of − 39 + 360 x − 832 x 2 + 512 x 3 ” • x 3 = “root #3 of − 39 + 360 x − 832 x 2 + 512 x 3 ” Figure: − 39 + 360 x − 832 x 2 + 512 x 3 Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 5/22

  9. Motivation Problems with Algebraic Numbers • well-definedness is there a “root #3 of − 23 + x − 5 x 2 + x 3 ” Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 6/22

  10. Motivation Problems with Algebraic Numbers • well-definedness is there a “root #3 of − 23 + x − 5 x 2 + x 3 ” • representation is there a simpler representation of “root #3 of − 108 − 72 x + 108 x 2 + 84 x 3 − 27 x 4 − 32 x 5 − 2 x 6 + 4 x 7 + x 8 ” Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 6/22

  11. Motivation Problems with Algebraic Numbers • well-definedness is there a “root #3 of − 23 + x − 5 x 2 + x 3 ” • representation is there a simpler representation of “root #3 of − 108 − 72 x + 108 x 2 + 84 x 3 − 27 x 4 − 32 x 5 − 2 x 6 + 4 x 7 + x 8 ” • comparisons is “root #3 of − 39 + 360 x − 832 x 2 + 512 x 3 ” smaller than 1 Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 6/22

  12. Motivation Problems with Algebraic Numbers • well-definedness is there a “root #3 of − 23 + x − 5 x 2 + x 3 ” • representation is there a simpler representation of “root #3 of − 108 − 72 x + 108 x 2 + 84 x 3 − 27 x 4 − 32 x 5 − 2 x 6 + 4 x 7 + x 8 ” • comparisons is “root #3 of − 39 + 360 x − 832 x 2 + 512 x 3 ” smaller than 1 • arithmetic calculate a polynomial representing “root #2 of − 2 + x 2 ” + “root #1 of − 3 + x 2 ” Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 6/22

  13. Motivation Problems with Algebraic Numbers • well-definedness Sturm’s method is there a “root #3 of − 23 + x − 5 x 2 + x 3 ” • representation factorization of rational polynomials is there a simpler representation of “root #3 of − 108 − 72 x + 108 x 2 + 84 x 3 − 27 x 4 − 32 x 5 − 2 x 6 + 4 x 7 + x 8 ” • comparisons Sturm’s method is “root #3 of − 39 + 360 x − 832 x 2 + 512 x 3 ” smaller than 1 • arithmetic matrices, determinants, resultants, . . . calculate a polynomial representing “root #2 of − 2 + x 2 ” + “root #1 of − 3 + x 2 ” Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 6/22

  14. Motivation Main Result: Formalization of Algebraic Numbers • common properties on algebraic numbers ( R and C ) • executable real algebraic numbers • executable complex algebraic numbers indirectly • easy to use via data-refinement for R and C √ evaluate � 3 ⌊ norm ( 2 + 3 + 2 i ) · 100 ⌋ ֒ → 216 • applicable inside (eval) and outside Isabelle (export-code) Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 7/22

  15. Motivation Related work • Cyril Cohen (ITP 2012) • Coq • similar, but partly based on different paper proofs • our work: more focus on efficient execution Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 8/22

  16. Motivation Related work • Cyril Cohen (ITP 2012) • Coq • similar, but partly based on different paper proofs • our work: more focus on efficient execution • Wenda Li and Larry Paulson (CPP 2016) • independant Isabelle/HOL formalization, different approach • oracle (MetiTarski) performs computations • certified code validates results Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 8/22

  17. Motivation Related work • Cyril Cohen (ITP 2012) • Coq • similar, but partly based on different paper proofs • our work: more focus on efficient execution • Wenda Li and Larry Paulson (CPP 2016) • independant Isabelle/HOL formalization, different approach • oracle (MetiTarski) performs computations • certified code validates results • experimental comparison (examples of Li and Paulson) MetiTarski 1.83 seconds (@ 2.66 Ghz) + validation of Li and Paulson 4.16 seconds (@ 2.66 Ghz) Our generated Haskell code 0.03 seconds (@ 3.5 Ghz) Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 8/22

  18. Real Algebraic Numbers Well-Definedness Well-Definedness • “root #3 of − 23 + x − 5 x 2 + x 3 ” • “root #3 of − 25 + 155 x − 304 x 2 + 192 x 3 ” Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 9/22

  19. Real Algebraic Numbers Well-Definedness Sturm’s Method • input • polynomial over R • interval ( [2 , 5], ( − π, 7], ( −∞ , 3), or ( −∞ , + ∞ ) ) • output: count-roots p itval • number of distinct real roots of p in interval itval Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 10/22

  20. Real Algebraic Numbers Well-Definedness Sturm’s Method • input • polynomial over R • interval ( [2 , 5], ( − π, 7], ( −∞ , 3), or ( −∞ , + ∞ ) ) • output: count-roots p itval • number of distinct real roots of p in interval itval • formalized in Isabelle by Manuel Eberl • nearly used as black-box Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 10/22

  21. Real Algebraic Numbers Well-Definedness Sturm’s Method • input • polynomial over R • interval ( [2 , 5], ( − π, 7], ( −∞ , 3), or ( −∞ , + ∞ ) ) • output: count-roots p itval • number of distinct real roots of p in interval itval • formalized in Isabelle by Manuel Eberl • nearly used as black-box • adapted functions to work over Q number of distinct real roots of polynomial over Q in interval over Q reason: apply Sturm’s method to implement R formalization: locale for homomorphisms Thiemann and Yamada (Univ. Innsbruck) Algebraic Numbers in Isabelle/HOL 10/22

Recommend


More recommend