src/HOL/Decision_Procs/ex/Commutative_Ring_Ex.thy
author wenzelm
Sun Nov 02 18:21:45 2014 +0100 (2014-11-02)
changeset 58889 5b7a9633cfa8
parent 49070 f00fee6d21d4
child 60533 1e7ccd864b62
permissions -rw-r--r--
modernized header uniformly as section;
     1 (*  Author:     Bernhard Haeupler *)
     2 
     3 section {* Some examples demonstrating the comm-ring method *}
     4 
     5 theory Commutative_Ring_Ex
     6 imports "../Commutative_Ring"
     7 begin
     8 
     9 lemma "4*(x::int)^5*y^3*x^2*3 + x*z + 3^5 = 12*x^7*y^3 + z*x + 243"
    10   by comm_ring
    11 
    12 lemma "((x::int) + y)^2  = x^2 + y^2 + 2*x*y"
    13   by comm_ring
    14 
    15 lemma "((x::int) + y)^3  = x^3 + y^3 + 3*x^2*y + 3*y^2*x"
    16   by comm_ring
    17 
    18 lemma "((x::int) - y)^3  = x^3 + 3*x*y^2 + (-3)*y*x^2 - y^3"
    19   by comm_ring
    20 
    21 lemma "((x::int) - y)^2  = x^2 + y^2 - 2*x*y"
    22   by comm_ring
    23 
    24 lemma " ((a::int) + b + c)^2 = a^2 + b^2 + c^2 + 2*a*b + 2*b*c + 2*a*c"
    25   by comm_ring
    26 
    27 lemma "((a::int) - b - c)^2 = a^2 + b^2 + c^2 - 2*a*b + 2*b*c - 2*a*c"
    28   by comm_ring
    29 
    30 lemma "(a::int)*b + a*c = a*(b+c)"
    31   by comm_ring
    32 
    33 lemma "(a::int)^2 - b^2 = (a - b) * (a + b)"
    34   by comm_ring
    35 
    36 lemma "(a::int)^3 - b^3 = (a - b) * (a^2 + a*b + b^2)"
    37   by comm_ring
    38 
    39 lemma "(a::int)^3 + b^3 = (a + b) * (a^2 - a*b + b^2)"
    40   by comm_ring
    41 
    42 lemma "(a::int)^4 - b^4 = (a - b) * (a + b)*(a^2 + b^2)"
    43   by comm_ring
    44 
    45 lemma "(a::int)^10 - b^10 =
    46   (a - b) * (a^9 + a^8*b + a^7*b^2 + a^6*b^3 + a^5*b^4 + a^4*b^5 + a^3*b^6 + a^2*b^7 + a*b^8 + b^9)"
    47   by comm_ring
    48 
    49 end