equal
deleted
inserted
replaced
1457 with False show ?P |
1457 with False show ?P |
1458 by (auto intro: * [of _ "m div n"]) |
1458 by (auto intro: * [of _ "m div n"]) |
1459 qed |
1459 qed |
1460 qed |
1460 qed |
1461 |
1461 |
|
1462 lemma funpow_mod_eq: \<^marker>\<open>contributor \<open>Lars Noschinski\<close>\<close> |
|
1463 \<open>(f ^^ (m mod n)) x = (f ^^ m) x\<close> if \<open>(f ^^ n) x = x\<close> |
|
1464 proof - |
|
1465 have \<open>(f ^^ m) x = (f ^^ (m mod n + m div n * n)) x\<close> |
|
1466 by simp |
|
1467 also have \<open>\<dots> = (f ^^ (m mod n)) (((f ^^ n) ^^ (m div n)) x)\<close> |
|
1468 by (simp only: funpow_add funpow_mult ac_simps) simp |
|
1469 also have \<open>((f ^^ n) ^^ q) x = x\<close> for q |
|
1470 by (induction q) (use \<open>(f ^^ n) x = x\<close> in simp_all) |
|
1471 finally show ?thesis |
|
1472 by simp |
|
1473 qed |
|
1474 |
1462 |
1475 |
1463 subsection \<open>Euclidean division on \<^typ>\<open>int\<close>\<close> |
1476 subsection \<open>Euclidean division on \<^typ>\<open>int\<close>\<close> |
1464 |
1477 |
1465 instantiation int :: normalization_semidom |
1478 instantiation int :: normalization_semidom |
1466 begin |
1479 begin |