diff --git a/src/Init/Data/Int/Pow.lean b/src/Init/Data/Int/Pow.lean index f7eff62ce4..e900aac527 100644 --- a/src/Init/Data/Int/Pow.lean +++ b/src/Init/Data/Int/Pow.lean @@ -62,6 +62,8 @@ protected theorem pow_ne_zero {n : Int} {m : Nat} : n ≠ 0 → n ^ m ≠ 0 := b instance {n : Int} {m : Nat} [NeZero n] : NeZero (n ^ m) := ⟨Int.pow_ne_zero (NeZero.ne _)⟩ +instance {n : Int} : NeZero (n^0) := ⟨Int.one_ne_zero⟩ + @[simp, norm_cast] protected theorem natCast_pow (b n : Nat) : ((b^n : Nat) : Int) = (b : Int) ^ n := by match n with diff --git a/src/Init/Data/Nat/Basic.lean b/src/Init/Data/Nat/Basic.lean index e25128a7a1..ea9f2853a1 100644 --- a/src/Init/Data/Nat/Basic.lean +++ b/src/Init/Data/Nat/Basic.lean @@ -817,6 +817,8 @@ protected theorem two_pow_pos (w : Nat) : 0 < 2^w := Nat.pow_pos (by decide) instance {n m : Nat} [NeZero n] : NeZero (n^m) := ⟨Nat.ne_zero_iff_zero_lt.mpr (Nat.pow_pos (pos_of_neZero _))⟩ +instance {n : Nat} : NeZero (n^0) := ⟨Nat.one_ne_zero⟩ + protected theorem mul_pow (a b n : Nat) : (a * b) ^ n = a ^ n * b ^ n := by induction n with | zero => simp [Nat.pow_zero]