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

tactic: rcases le_or_lt 0 n with hn | hn <;> rcases le_or_lt 0 m with hm | hm
state_before: R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
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
state_after: case inl.inl
R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
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

case inl.inr
R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
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

case inr.inl
R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
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

case inr.inr
R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
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: rw [selfZPow_of_nonneg _ _ hn, selfZPow_of_nonneg _ _ hm,
  selfZPow_of_nonneg _ _ (add_nonneg hn hm), Int.natAbs_add_of_nonneg hn hm, pow_add]
state_before: case inl.inl
R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
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
state_after: no goals

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_1
inst✝³ : CommRing R
x : R
B : Type u_2
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
state_after: case inl.inr
R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : 0 ≤ n
hm : m < 0
this : n + m = ↑n.natAbs - ↑m.natAbs
⊢ 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_natCast,
  IsLocalization.mk'_eq_mul_mk'_one, map_pow]
state_before: case inl.inr
R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : 0 ≤ n
hm : m < 0
this : n + m = ↑n.natAbs - ↑m.natAbs
⊢ selfZPow x B (n + m) = selfZPow x B n * selfZPow x B m
state_after: no goals

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

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_1
inst✝³ : CommRing R
x : R
B : Type u_2
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
state_after: case inr.inl
R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : n < 0
hm : 0 ≤ m
this : n + m = ↑m.natAbs - ↑n.natAbs
⊢ 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_natCast,
  IsLocalization.mk'_eq_mul_mk'_one, map_pow, mul_comm]
state_before: case inr.inl
R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : n < 0
hm : 0 ≤ m
this : n + m = ↑m.natAbs - ↑n.natAbs
⊢ selfZPow x B (n + m) = selfZPow x B n * selfZPow x B m
state_after: no goals

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_1
inst✝³ : CommRing R
x : R
B : Type u_2
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsLocalization.Away x B
n m : ℤ
hn : n < 0
hm : 0 ≤ m
⊢ n + m = ↑m.natAbs - ↑n.natAbs
state_after: no goals

tactic: rw [selfZPow_of_neg _ _ hn, selfZPow_of_neg _ _ hm, selfZPow_of_neg _ _ (add_neg hn hm),
  Int.natAbs_add_of_nonpos hn.le hm.le, ← mk'_mul, one_mul]
state_before: case inr.inr
R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
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
state_after: case inr.inr
R : Type u_1
inst✝³ : CommRing R
x : R
B : Type u_2
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 (n.natAbs + m.natAbs)) = mk' B 1 (Submonoid.pow x n.natAbs * Submonoid.pow x m.natAbs)

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

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

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