Theorem: selfZpow_add
File: Mathlib/RingTheory/Localization/Away/Basic.lean

tactic: cases' le_or_lt 0 n with hn hn <;> cases' le_or_lt 0 m with hm hm
state_before: R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
⊢ selfZpow x B (n + m) = selfZpow x B n * selfZpow x B m

tactic: rw [selfZpow_of_nonneg _ _ hn, selfZpow_of_nonneg _ _ hm,
  selfZpow_of_nonneg _ _ (add_nonneg hn hm), Int.natAbs_add_nonneg hn hm, pow_add]
state_before: case inl.inl
R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : 0 ≤ n
hm : 0 ≤ m
⊢ selfZpow x B (n + m) = selfZpow x B n * selfZpow x B m

tactic: have : n + m = n.natAbs - m.natAbs := by
  rw [Int.natAbs_of_nonneg hn, Int.ofNat_natAbs_of_nonpos hm.le, sub_neg_eq_add]
state_before: case inl.inr
R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : 0 ≤ n
hm : m < 0
⊢ selfZpow x B (n + m) = selfZpow x B n * selfZpow x B m

tactic: rw [selfZpow_of_nonneg _ _ hn, selfZpow_of_neg _ _ hm, this, selfZpow_sub_cast_nat,
  IsLocalization.mk'_eq_mul_mk'_one, map_pow]
state_before: case inl.inr
R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : 0 ≤ n
hm : m < 0
this : n + m = ↑(Int.natAbs n) - ↑(Int.natAbs m)
⊢ selfZpow x B (n + m) = selfZpow x B n * selfZpow x B m

tactic: rw [Int.natAbs_of_nonneg hn, Int.ofNat_natAbs_of_nonpos hm.le, sub_neg_eq_add]
state_before: R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : 0 ≤ n
hm : m < 0
⊢ n + m = ↑(Int.natAbs n) - ↑(Int.natAbs m)

tactic: have : n + m = m.natAbs - n.natAbs := by
  rw [Int.natAbs_of_nonneg hm, Int.ofNat_natAbs_of_nonpos hn.le, sub_neg_eq_add, add_comm]
state_before: case inr.inl
R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : n < 0
hm : 0 ≤ m
⊢ selfZpow x B (n + m) = selfZpow x B n * selfZpow x B m

tactic: rw [selfZpow_of_nonneg _ _ hm, selfZpow_of_neg _ _ hn, this, selfZpow_sub_cast_nat,
  IsLocalization.mk'_eq_mul_mk'_one, map_pow, mul_comm]
state_before: case inr.inl
R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : n < 0
hm : 0 ≤ m
this : n + m = ↑(Int.natAbs m) - ↑(Int.natAbs n)
⊢ selfZpow x B (n + m) = selfZpow x B n * selfZpow x B m

tactic: rw [Int.natAbs_of_nonneg hm, Int.ofNat_natAbs_of_nonpos hn.le, sub_neg_eq_add, add_comm]
state_before: R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : n < 0
hm : 0 ≤ m
⊢ n + m = ↑(Int.natAbs m) - ↑(Int.natAbs n)

tactic: rw [selfZpow_of_neg _ _ hn, selfZpow_of_neg _ _ hm, selfZpow_of_neg _ _ (add_neg hn hm),
  Int.natAbs_add_neg hn hm, ← mk'_mul, one_mul]
state_before: case inr.inr
R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : n < 0
hm : m < 0
⊢ selfZpow x B (n + m) = selfZpow x B n * selfZpow x B m

tactic: congr
state_before: case inr.inr
R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : n < 0
hm : m < 0
⊢ mk' B 1 (Submonoid.pow x (Int.natAbs n + Int.natAbs m)) =
    mk' B 1 (Submonoid.pow x (Int.natAbs n) * Submonoid.pow x (Int.natAbs m))

tactic: ext
state_before: case inr.inr.e_y
R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : n < 0
hm : m < 0
⊢ Submonoid.pow x (Int.natAbs n + Int.natAbs m) = Submonoid.pow x (Int.natAbs n) * Submonoid.pow x (Int.natAbs m)

tactic: simp [pow_add]
state_before: case inr.inr.e_y.a
R : Type u_2
inst✝³ : CommRing R
x : R
B : Type u_1
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : n < 0
hm : m < 0
⊢ ↑(Submonoid.pow x (Int.natAbs n + Int.natAbs m)) = ↑(Submonoid.pow x (Int.natAbs n) * Submonoid.pow x (Int.natAbs m))