Module docstring
{"# pow "}
{"# pow "}
Int.pow_zero
theorem
(b : Int) : b ^ 0 = 1
Int.pow_succ
theorem
(b : Int) (e : Nat) : b ^ (e + 1) = (b ^ e) * b
Int.pow_succ'
theorem
(b : Int) (e : Nat) : b ^ (e + 1) = b * (b ^ e)
protected theorem pow_succ' (b : Int) (e : Nat) : b ^ (e+1) = b * (b ^ e) := by
rw [Int.mul_comm, Int.pow_succ]
Int.pow_pos
theorem
{n : Int} {m : Nat} : 0 < n → 0 < n ^ m
protected theorem pow_pos {n : Int} {m : Nat} : 0 < n → 0 < n ^ m := by
induction m with
| zero => simp
| succ m ih => exact fun h => Int.mul_pos (ih h) h
Int.pow_nonneg
theorem
{n : Int} {m : Nat} : 0 ≤ n → 0 ≤ n ^ m
protected theorem pow_nonneg {n : Int} {m : Nat} : 0 ≤ n → 0 ≤ n ^ m := by
induction m with
| zero => simp
| succ m ih => exact fun h => Int.mul_nonneg (ih h) h
Int.pow_le_pow_of_le_left
abbrev
@[deprecated Nat.pow_le_pow_left (since := "2025-02-17")]
abbrev pow_le_pow_of_le_left := @Nat.pow_le_pow_left
Int.pow_le_pow_of_le_right
abbrev
@[deprecated Nat.pow_le_pow_right (since := "2025-02-17")]
abbrev pow_le_pow_of_le_right := @Nat.pow_le_pow_right
Int.pos_pow_of_pos
abbrev
@[deprecated Nat.pow_pos (since := "2025-02-17")]
abbrev pos_pow_of_pos := @Nat.pow_pos
Int.natCast_pow
theorem
(b n : Nat) : ((b ^ n : Nat) : Int) = (b : Int) ^ n
@[norm_cast]
protected theorem natCast_pow (b n : Nat) : ((b^n : Nat) : Int) = (b : Int) ^ n := by
match n with
| 0 => rfl
| n + 1 =>
simp only [Nat.pow_succ, Int.pow_succ, Int.natCast_mul, Int.natCast_pow _ n]
Int.two_pow_pred_sub_two_pow
theorem
{w : Nat} (h : 0 < w) : ((2 ^ (w - 1) : Nat) - (2 ^ w : Nat) : Int) = -((2 ^ (w - 1) : Nat) : Int)
@[simp]
protected theorem two_pow_pred_sub_two_pow {w : Nat} (h : 0 < w) :
((2 ^ (w - 1) : Nat) - (2 ^ w : Nat) : Int) = - ((2 ^ (w - 1) : Nat) : Int) := by
rw [← Nat.two_pow_pred_add_two_pow_pred h]
omega
Int.two_pow_pred_sub_two_pow'
theorem
{w : Nat} (h : 0 < w) : (2 : Int) ^ (w - 1) - (2 : Int) ^ w = -(2 : Int) ^ (w - 1)
@[simp]
protected theorem two_pow_pred_sub_two_pow' {w : Nat} (h : 0 < w) :
(2 : Int) ^ (w - 1) - (2 : Int) ^ w = - (2 : Int) ^ (w - 1) := by
norm_cast
rw [← Nat.two_pow_pred_add_two_pow_pred h]
simp [h]