lean2/library/data/int/power.lean
2016-02-25 12:26:20 -08:00

29 lines
763 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/-
Copyright (c) 2015 Jeremy Avigad. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Jeremy Avigad
The power function on the integers.
-/
import data.int.basic data.int.order data.int.div algebra.group_power data.nat.power
namespace int
definition int_has_pow_nat [instance] [priority int.prio] : has_pow_nat int :=
has_pow_nat.mk has_pow_nat.pow_nat
/-
definition nmul (n : ) (a : ) : := algebra.nmul n a
infix [priority int.prio] ⬝ := nmul
definition imul (i : ) (a : ) : := algebra.imul i a
-/
open nat
theorem of_nat_pow (a n : ) : of_nat (a^n) = (of_nat a)^n :=
begin
induction n with n ih,
apply eq.refl,
krewrite [pow_succ, pow_succ, of_nat_mul, ih]
end
end int