src/HOL/Integ/IntPower.ML
author wenzelm
Fri, 05 Oct 2001 21:52:39 +0200
changeset 11701 3d51fbf81c17
parent 9509 0f3ee1f89ca8
child 11868 56db9f3a6b3e
permissions -rw-r--r--
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat, "num" syntax (still with "#"), Numeral0, Numeral1;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9509
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
     1
(*  Title:	IntPower.thy
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
     2
    ID:         $Id$
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
     3
    Author:	Thomas M. Rasmussen
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
     4
    Copyright	2000  University of Cambridge
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
     5
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
     6
Integer powers 
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
     7
*)
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
     8
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
     9
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    10
Goal "((x::int) mod m)^y mod m = x^y mod m";
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    11
by (induct_tac "y" 1);
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    12
by Auto_tac;
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    13
by (rtac (zmod_zmult1_eq RS trans) 1);
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    14
by (Asm_simp_tac 1);
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    15
by (rtac (zmod_zmult_distrib RS sym) 1);
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    16
qed "zpower_zmod";
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    17
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 9509
diff changeset
    18
Goal "Numeral1^y = (Numeral1::int)";
9509
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    19
by (induct_tac "y" 1);
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    20
by Auto_tac;
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    21
qed "zpower_1";
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    22
Addsimps [zpower_1];
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    23
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    24
Goal "(x*z)^y = ((x^y)*(z^y)::int)";
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    25
by (induct_tac "y" 1);
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    26
by Auto_tac;
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    27
qed "zpower_zmult_distrib";
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    28
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    29
Goal "x^(y+z) = ((x^y)*(x^z)::int)";
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    30
by (induct_tac "y" 1);
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    31
by Auto_tac;
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    32
qed "zpower_zadd_distrib";
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    33
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    34
Goal "(x^y)^z = (x^(y*z)::int)";
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    35
by (induct_tac "y" 1);
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    36
by Auto_tac;
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    37
by (stac zpower_zmult_distrib 1);
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    38
by (stac zpower_zadd_distrib 1);
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    39
by (Asm_simp_tac 1);
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    40
qed "zpower_zpower";
0f3ee1f89ca8 introduction of integer exponentiation
paulson
parents:
diff changeset
    41