l3lab/ntp-mathlib huggingface dataset:
protected theorem div_pow {a b c : ℕ} (h : a ∣ b) : (b / a) ^ c = b ^ c / a ^ c := by
  rcases c.eq_zero_or_pos with rfl | hc
  · simp
  rcases a.eq_zero_or_pos with rfl | ha
  · simp [Nat.zero_pow hc]
  refine (Nat.div_eq_of_eq_mul_right (pos_pow_of_pos c ha) ?_).symm
  

Proof state:
case inr.inr
m n k a b c : ℕ
h : a ∣ b
hc : c > 0
ha : a > 0
⊢ b ^ c = a ^ c * (b / a) ^ c

Next tactic:
rw [← Nat.mul_pow, Nat.mul_div_cancel_left' h]
theorem mod_eq_iff_lt {a b : ℕ} (h : b ≠ 0) : a % b = a ↔ a < b := by
  

Proof state:
m n k a b : ℕ
h : b ≠ 0
⊢ a % b = a ↔ a < b

Next tactic:
cases b
theorem mod_eq_iff_lt {a b : ℕ} (h : b ≠ 0) : a % b = a ↔ a < b := by
  cases b
  

Proof state:
case zero
m n k a : ℕ
h : zero ≠ 0
⊢ a % zero = a ↔ a < zero
case succ m n k a n✝ : ℕ h : succ n✝ ≠ 0 ⊢ a % succ n✝ = a ↔ a < succ n✝

Next tactic:
contradiction
theorem mod_eq_iff_lt {a b : ℕ} (h : b ≠ 0) : a % b = a ↔ a < b := by
  cases b
  contradiction
  

Proof state:
case succ
m n k a n✝ : ℕ
h : succ n✝ ≠ 0
⊢ a % succ n✝ = a ↔ a < succ n✝

Next tactic:
exact ⟨fun h => h.ge.trans_lt (mod_lt _ (succ_pos _)), mod_eq_of_lt⟩
theorem mod_add_div' (m k : ℕ) : m % k + m / k * k = m := by
  

Proof state:
m✝ n k✝ m k : ℕ
⊢ m % k + m / k * k = m

Next tactic:
rw [mul_comm]
theorem mod_add_div' (m k : ℕ) : m % k + m / k * k = m := by
  rw [mul_comm]
  

Proof state:
m✝ n k✝ m k : ℕ
⊢ m % k + k * (m / k) = m

Next tactic:
exact mod_add_div _ _
theorem div_add_mod' (m k : ℕ) : m / k * k + m % k = m := by
  

Proof state:
m✝ n k✝ m k : ℕ
⊢ m / k * k + m % k = m

Next tactic:
rw [mul_comm]
theorem div_add_mod' (m k : ℕ) : m / k * k + m % k = m := by
  rw [mul_comm]
  

Proof state:
m✝ n k✝ m k : ℕ
⊢ k * (m / k) + m % k = m

Next tactic:
exact div_add_mod _ _
/-- See also `Nat.divModEquiv` for a similar statement as an `Equiv`. -/
protected theorem div_mod_unique {n k m d : ℕ} (h : 0 < k) :
    n / k = d ∧ n % k = m ↔ m + k * d = n ∧ m < k :=
  ⟨fun ⟨e₁, e₂⟩ => e₁ ▸ e₂ ▸ ⟨mod_add_div _ _, mod_lt _ h⟩, fun ⟨h₁, h₂⟩ =>
    h₁ ▸ by
      

Proof state:
m✝ n✝ k✝ n k m d : ℕ
h : 0 < k
x✝ : m + k * d = n ∧ m < k
h₁ : m + k * d = n
h₂ : m < k
⊢ (m + k * d) / k = d ∧ (m + k * d) % k = m

Next tactic:
rw [add_mul_div_left _ _ h, add_mul_mod_self_left]
/-- See also `Nat.divModEquiv` for a similar statement as an `Equiv`. -/
protected theorem div_mod_unique {n k m d : ℕ} (h : 0 < k) :
    n / k = d ∧ n % k = m ↔ m + k * d = n ∧ m < k :=
  ⟨fun ⟨e₁, e₂⟩ => e₁ ▸ e₂ ▸ ⟨mod_add_div _ _, mod_lt _ h⟩, fun ⟨h₁, h₂⟩ =>
    h₁ ▸ by
      rw [add_mul_div_left _ _ h, add_mul_mod_self_left]
      

Proof state:
m✝ n✝ k✝ n k m d : ℕ
h : 0 < k
x✝ : m + k * d = n ∧ m < k
h₁ : m + k * d = n
h₂ : m < k
⊢ m / k + d = d ∧ m % k = m

Next tactic:
simp [div_eq_of_lt, mod_eq_of_lt, h₂]
protected theorem mul_dvd_mul_iff_left {a b c : ℕ} (ha : 0 < a) : a * b ∣ a * c ↔ b ∣ c :=
  exists_congr fun d => by 

Proof state:
m n k a b c : ℕ
ha : 0 < a
d : ℕ
⊢ a * c = a * b * d ↔ c = b * d

Next tactic:
rw [mul_assoc, mul_right_inj' ha.ne']
protected theorem mul_dvd_mul_iff_right {a b c : ℕ} (hc : 0 < c) : a * c ∣ b * c ↔ a ∣ b :=
  exists_congr fun d => by 

Proof state:
m n k a b c : ℕ
hc : 0 < c
d : ℕ
⊢ b * c = a * c * d ↔ b = a * d

Next tactic:
rw [Nat.mul_right_comm, mul_left_inj' hc.ne']
@[simp]
theorem mod_mod_of_dvd (n : Nat) {m k : Nat} (h : m ∣ k) : n % k % m = n % m := by
  

Proof state:
m✝ n✝ k✝ n m k : ℕ
h : m ∣ k
⊢ n % k % m = n % m

Next tactic:
conv_rhs => rw [← mod_add_div n k]
@[simp]
theorem mod_mod_of_dvd (n : Nat) {m k : Nat} (h : m ∣ k) : n % k % m = n % m := by
  conv_rhs => 

Proof state:
m✝ n✝ k✝ n m k : ℕ
h : m ∣ k
| n % m

Next tactic:
rw [← mod_add_div n k]
@[simp]
theorem mod_mod_of_dvd (n : Nat) {m k : Nat} (h : m ∣ k) : n % k % m = n % m := by
  conv_rhs => rw [← mod_add_div n k]
  

Proof state:
m✝ n✝ k✝ n m k : ℕ
h : m ∣ k
⊢ n % k % m = (n % k + k * (n / k)) % m

Next tactic:
rcases h with ⟨t, rfl⟩
@[simp]
theorem mod_mod_of_dvd (n : Nat) {m k : Nat} (h : m ∣ k) : n % k % m = n % m := by
  conv_rhs => rw [← mod_add_div n k]
  rcases h with ⟨t, rfl⟩
  

Proof state:
case intro
m✝ n✝ k n m t : ℕ
⊢ n % (m * t) % m = (n % (m * t) + m * t * (n / (m * t))) % m

Next tactic:
rw [mul_assoc, add_mul_mod_self_left]
theorem add_mod_eq_add_mod_right {m n k : ℕ} (i : ℕ) (H : m % n = k % n) :
    (m + i) % n = (k + i) % n := by
  

Proof state:
m✝ n✝ k✝ m n k i : ℕ
H : m % n = k % n
⊢ (m + i) % n = (k + i) % n

Next tactic:
rw [← mod_add_mod, ← mod_add_mod k, H]
theorem add_mod_eq_add_mod_left {m n k : ℕ} (i : ℕ) (H : m % n = k % n) :
    (i + m) % n = (i + k) % n := by
  

Proof state:
m✝ n✝ k✝ m n k i : ℕ
H : m % n = k % n
⊢ (i + m) % n = (i + k) % n

Next tactic:
rw [add_comm, add_mod_eq_add_mod_right _ H, add_comm]
theorem mul_dvd_of_dvd_div {a b c : ℕ} (hab : c ∣ b) (h : a ∣ b / c) : c * a ∣ b :=
  have h1 : ∃ d, b / c = a * d := h
  let ⟨d, hd⟩ := h1
  have h3 : b = a * d * c := Nat.eq_mul_of_div_eq_left hab hd
  -- Porting note: was `cc`
  show ∃ d, b = c * a * d from ⟨d, by 

Proof state:
m n k a b c : ℕ
hab : c ∣ b
h : a ∣ b / c
h1 : ∃ d, b / c = a * d
d : ℕ
hd : b / c = a * d
h3 : b = a * d * c
⊢ b = c * a * d

Next tactic:
rwa [mul_comm, ← mul_assoc] at h3
theorem eq_of_dvd_of_div_eq_one {a b : ℕ} (w : a ∣ b) (h : b / a = 1) : a = b := by
  

Proof state:
m n k a b : ℕ
w : a ∣ b
h : b / a = 1
⊢ a = b

Next tactic:
rw [← Nat.div_mul_cancel w, h, one_mul]
theorem eq_zero_of_dvd_of_div_eq_zero {a b : ℕ} (w : a ∣ b) (h : b / a = 0) : b = 0 := by
  

Proof state:
m n k a b : ℕ
w : a ∣ b
h : b / a = 0
⊢ b = 0

Next tactic:
rw [← Nat.div_mul_cancel w, h, zero_mul]
theorem lt_mul_div_succ (m : ℕ) {n : ℕ} (n0 : 0 < n) : m < n * (m / n + 1) := by
  

Proof state:
m✝ n✝ k m n : ℕ
n0 : 0 < n
⊢ m < n * (m / n + 1)

Next tactic:
rw [mul_comm, ← Nat.div_lt_iff_lt_mul' n0]
theorem lt_mul_div_succ (m : ℕ) {n : ℕ} (n0 : 0 < n) : m < n * (m / n + 1) := by
  rw [mul_comm, ← Nat.div_lt_iff_lt_mul' n0]
  

Proof state:
m✝ n✝ k m n : ℕ
n0 : 0 < n
⊢ m / n < m / n + 1

Next tactic:
exact lt_succ_self _
theorem mul_add_mod' (a b c : ℕ) : (a * b + c) % b = c % b := by 

Proof state:
m n k a b c : ℕ
⊢ (a * b + c) % b = c % b

Next tactic:
rw [mul_comm, Nat.mul_add_mod]
theorem mul_add_mod_of_lt {a b c : ℕ} (h : c < b) : (a * b + c) % b = c := by
  

Proof state:
m n k a b c : ℕ
h : c < b
⊢ (a * b + c) % b = c

Next tactic:
rw [Nat.mul_add_mod', Nat.mod_eq_of_lt h]
theorem pred_eq_self_iff {n : ℕ} : n.pred = n ↔ n = 0 := by
  

Proof state:
m n✝ k n : ℕ
⊢ pred n = n ↔ n = 0

Next tactic:
cases n
theorem pred_eq_self_iff {n : ℕ} : n.pred = n ↔ n = 0 := by
  cases n <;> 

Proof state:
case zero
m n k : ℕ
⊢ pred zero = zero ↔ zero = 0

Next tactic:
simp [(Nat.succ_ne_self _).symm]
theorem pred_eq_self_iff {n : ℕ} : n.pred = n ↔ n = 0 := by
  cases n <;> 

Proof state:
case succ
m n k n✝ : ℕ
⊢ pred (succ n✝) = succ n✝ ↔ succ n✝ = 0

Next tactic:
simp [(Nat.succ_ne_self _).symm]
theorem find_eq_iff (h : ∃ n : ℕ, p n) : Nat.find h = m ↔ p m ∧ ∀ n < m, ¬p n := by
  

Proof state:
m n k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h : ∃ n, p n
⊢ Nat.find h = m ↔ p m ∧ ∀ (n : ℕ), n < m → ¬p n

Next tactic:
constructor
theorem find_eq_iff (h : ∃ n : ℕ, p n) : Nat.find h = m ↔ p m ∧ ∀ n < m, ¬p n := by
  constructor
  · 

Proof state:
case mp
m n k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h : ∃ n, p n
⊢ Nat.find h = m → p m ∧ ∀ (n : ℕ), n < m → ¬p n

Next tactic:
rintro rfl
theorem find_eq_iff (h : ∃ n : ℕ, p n) : Nat.find h = m ↔ p m ∧ ∀ n < m, ¬p n := by
  constructor
  · rintro rfl
    

Proof state:
case mp
n k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h : ∃ n, p n
⊢ p (Nat.find h) ∧ ∀ (n : ℕ), n < Nat.find h → ¬p n

Next tactic:
exact ⟨Nat.find_spec h, fun _ => Nat.find_min h⟩
theorem find_eq_iff (h : ∃ n : ℕ, p n) : Nat.find h = m ↔ p m ∧ ∀ n < m, ¬p n := by
  constructor
  · rintro rfl
    exact ⟨Nat.find_spec h, fun _ => Nat.find_min h⟩
  · 

Proof state:
case mpr
m n k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h : ∃ n, p n
⊢ (p m ∧ ∀ (n : ℕ), n < m → ¬p n) → Nat.find h = m

Next tactic:
rintro ⟨hm, hlt⟩
theorem find_eq_iff (h : ∃ n : ℕ, p n) : Nat.find h = m ↔ p m ∧ ∀ n < m, ¬p n := by
  constructor
  · rintro rfl
    exact ⟨Nat.find_spec h, fun _ => Nat.find_min h⟩
  · rintro ⟨hm, hlt⟩
    

Proof state:
case mpr.intro
m n k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h : ∃ n, p n
hm : p m
hlt : ∀ (n : ℕ), n < m → ¬p n
⊢ Nat.find h = m

Next tactic:
exact le_antisymm (Nat.find_min' h hm) (not_lt.1 <| imp_not_comm.1 (hlt _) <| Nat.find_spec h)
@[simp]
theorem find_le_iff (h : ∃ n : ℕ, p n) (n : ℕ) : Nat.find h ≤ n ↔ ∃ m ≤ n, p m := by
  

Proof state:
m n✝ k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h : ∃ n, p n
n : ℕ
⊢ Nat.find h ≤ n ↔ ∃ m, m ≤ n ∧ p m

Next tactic:
simp only [exists_prop, ← lt_succ_iff, find_lt_iff]
@[simp]
theorem le_find_iff (h : ∃ n : ℕ, p n) (n : ℕ) : n ≤ Nat.find h ↔ ∀ m < n, ¬p m := by
  

Proof state:
m n✝ k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h : ∃ n, p n
n : ℕ
⊢ n ≤ Nat.find h ↔ ∀ (m : ℕ), m < n → ¬p m

Next tactic:
simp_rw [← not_lt, find_lt_iff, not_exists, not_and]
@[simp]
theorem lt_find_iff (h : ∃ n : ℕ, p n) (n : ℕ) : n < Nat.find h ↔ ∀ m ≤ n, ¬p m := by
  

Proof state:
m n✝ k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h : ∃ n, p n
n : ℕ
⊢ n < Nat.find h ↔ ∀ (m : ℕ), m ≤ n → ¬p m

Next tactic:
simp only [← succ_le_iff, le_find_iff, succ_le_succ_iff]
@[simp]
theorem find_eq_zero (h : ∃ n : ℕ, p n) : Nat.find h = 0 ↔ p 0 := by 

Proof state:
m n k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h : ∃ n, p n
⊢ Nat.find h = 0 ↔ p 0

Next tactic:
simp [find_eq_iff]
theorem find_comp_succ (h₁ : ∃ n, p n) (h₂ : ∃ n, p (n + 1)) (h0 : ¬p 0) :
    Nat.find h₁ = Nat.find h₂ + 1 := by
  

Proof state:
m n k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h₁ : ∃ n, p n
h₂ : ∃ n, p (n + 1)
h0 : ¬p 0
⊢ Nat.find h₁ = Nat.find h₂ + 1

Next tactic:
refine' (find_eq_iff _).2 ⟨Nat.find_spec h₂, fun n hn => _⟩
theorem find_comp_succ (h₁ : ∃ n, p n) (h₂ : ∃ n, p (n + 1)) (h0 : ¬p 0) :
    Nat.find h₁ = Nat.find h₂ + 1 := by
  refine' (find_eq_iff _).2 ⟨Nat.find_spec h₂, fun n hn => _⟩
  

Proof state:
m n✝ k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h₁ : ∃ n, p n
h₂ : ∃ n, p (n + 1)
h0 : ¬p 0
n : ℕ
hn : n < Nat.find h₂ + 1
⊢ ¬p n

Next tactic:
cases' n with n
theorem find_comp_succ (h₁ : ∃ n, p n) (h₂ : ∃ n, p (n + 1)) (h0 : ¬p 0) :
    Nat.find h₁ = Nat.find h₂ + 1 := by
  refine' (find_eq_iff _).2 ⟨Nat.find_spec h₂, fun n hn => _⟩
  cases' n with n
  

Proof state:
case zero
m n k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h₁ : ∃ n, p n
h₂ : ∃ n, p (n + 1)
h0 : ¬p 0
hn : zero < Nat.find h₂ + 1
⊢ ¬p zero
case succ
m n✝ k : ℕ
p q : ℕ → Prop
inst✝¹ : DecidablePred p
inst✝ : DecidablePred q
h₁ : ∃ n, p n
h₂ : ∃ n, p (n + 1)
h0 : ¬p 0
n : ℕ
hn : succ n < Nat.find h₂ + 1
⊢ ¬p (succ n)

Next tactic:
exacts [h0, @Nat.find_min (fun n => p (n + 1)) _ h₂ _ (succ_lt_succ_iff.1 hn)]
@[simp]
theorem findGreatest_eq : ∀ {b}, P b → Nat.findGreatest P b = b
  | 0, _ => rfl
  | n + 1, h => by 

Proof state:
m n✝ k : ℕ
P Q : ℕ → Prop
inst✝ : DecidablePred P
b n : ℕ
h : P (n + 1)
⊢ Nat.findGreatest P (n + 1) = n + 1

Next tactic:
simp [Nat.findGreatest, h]
@[simp]
theorem findGreatest_of_not (h : ¬P (b + 1)) :
    Nat.findGreatest P (b + 1) = Nat.findGreatest P b := by
  

Proof state:
m n k : ℕ
P Q : ℕ → Prop
inst✝ : DecidablePred P
b : ℕ
h : ¬P (b + 1)
⊢ Nat.findGreatest P (b + 1) = Nat.findGreatest P b

Next tactic:
simp [Nat.findGreatest, h]
example : ∀ a, a < 25 → ∀ b, b < 25 → ∀ c, c < 25 → a ^ 2 + b ^ 2 + c ^ 2 ≠ 7 := by 

Proof state:
m n k : ℕ
⊢ ∀ (a : ℕ), a < 25 → ∀ (b : ℕ), b < 25 → ∀ (c : ℕ), c < 25 → a ^ 2 + b ^ 2 + c ^ 2 ≠ 7

Next tactic:
decide
instance decidableExistsLT {P : ℕ → Prop} [h : DecidablePred P] :
    DecidablePred fun n => ∃ m : ℕ, m < n ∧ P m
  | 0 => isFalse (by 

Proof state:
m n k : ℕ
P : ℕ → Prop
h : DecidablePred P
⊢ ¬(fun n => ∃ m, m < n ∧ P m) 0

Next tactic:
simp
instance decidableExistsLT {P : ℕ → Prop} [h : DecidablePred P] :
    DecidablePred fun n => ∃ m : ℕ, m < n ∧ P m
  | 0 => isFalse (by simp)
  | n + 1 =>
    @decidable_of_decidable_of_iff _ _ (@instDecidableOr _ _ (decidableExistsLT n) (h n))
      (by 

Proof state:
m n✝ k : ℕ
P : ℕ → Prop
h : DecidablePred P
n : ℕ
⊢ (fun n_1 => ∃ m, m < n_1 ∧ ?m.249074 n m) n ∨ P n ↔ (fun n => ∃ m, m < n ∧ P m) (n + 1)

Next tactic:
simp only [lt_succ_iff_lt_or_eq, or_and_right, exists_or, exists_eq_left]
instance decidableExistsLT {P : ℕ → Prop} [h : DecidablePred P] :
    DecidablePred fun n => ∃ m : ℕ, m < n ∧ P m
  | 0 => isFalse (by simp)
  | n + 1 =>
    @decidable_of_decidable_of_iff _ _ (@instDecidableOr _ _ (decidableExistsLT n) (h n))
      (by simp only [lt_succ_iff_lt_or_eq, or_and_right, exists_or, exists_eq_left]; 

Proof state:
m n✝ k : ℕ
P : ℕ → Prop
h : DecidablePred P
n : ℕ
⊢ (∃ m, m < n ∧ ?m.249074 n m) ∨ P n ↔ (∃ x, x < n ∧ P x) ∨ P n

Next tactic:
apply Iff.refl
theorem liftFun_vecCons {n : ℕ} (r : α → α → Prop) [IsTrans α r] {f : Fin (n + 1) → α} {a : α} :
    ((· < ·) ⇒ r) (vecCons a f) (vecCons a f) ↔ r a (f 0) ∧ ((· < ·) ⇒ r) f f := by
  

Proof state:
α : Type u_1
n : ℕ
r : α → α → Prop
inst✝ : IsTrans α r
f : Fin (n + 1) → α
a : α
⊢ ((fun x x_1 => x < x_1) ⇒ r) (vecCons a f) (vecCons a f) ↔ r a (f 0) ∧ ((fun x x_1 => x < x_1) ⇒ r) f f

Next tactic:
simp only [liftFun_iff_succ r, forall_fin_succ, cons_val_succ, cons_val_zero, ← succ_castSucc,
    castSucc_zero]
@[simp]
theorem monotone_vecCons : Monotone (vecCons a f) ↔ a ≤ f 0 ∧ Monotone f := by
  

Proof state:
α : Type u_1
inst✝ : Preorder α
n : ℕ
f : Fin (n + 1) → α
a : α
⊢ Monotone (vecCons a f) ↔ a ≤ f 0 ∧ Monotone f

Next tactic:
simpa only [monotone_iff_forall_lt] using @liftFun_vecCons α n (· ≤ ·) _ f a
example : Monotone ![1, 2, 2, 3] := by 

Proof state:
α : Type u_1
inst✝ : Preorder α
n : ℕ
f : Fin (n + 1) → α
a : α
⊢ Monotone ![1, 2, 2, 3]

Next tactic:
decide
theorem HasSum.mul_left (a₂) (h : HasSum f a₁) : HasSum (fun i => a₂ * f i) (a₂ * a₁) := by
  

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝² : NonUnitalNonAssocSemiring α
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSemiring α
f g : ι → α
a a₁ a₂✝ a₂ : α
h : HasSum f a₁
⊢ HasSum (fun i => a₂ * f i) (a₂ * a₁)

Next tactic:
simpa only using h.map (AddMonoidHom.mulLeft a₂) (continuous_const.mul continuous_id)
theorem HasSum.mul_right (a₂) (hf : HasSum f a₁) : HasSum (fun i => f i * a₂) (a₁ * a₂) := by
  

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝² : NonUnitalNonAssocSemiring α
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSemiring α
f g : ι → α
a a₁ a₂✝ a₂ : α
hf : HasSum f a₁
⊢ HasSum (fun i => f i * a₂) (a₁ * a₂)

Next tactic:
simpa only using hf.map (AddMonoidHom.mulRight a₂) (continuous_id.mul continuous_const)
theorem HasSum.div_const (h : HasSum f a) (b : α) : HasSum (fun i => f i / b) (a / b) := by
  

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝² : DivisionSemiring α
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
h : HasSum f a
b : α
⊢ HasSum (fun i => f i / b) (a / b)

Next tactic:
simp only [div_eq_mul_inv, h.mul_right b⁻¹]
theorem hasSum_mul_left_iff (h : a₂ ≠ 0) : HasSum (fun i => a₂ * f i) (a₂ * a₁) ↔ HasSum f a₁ :=
  ⟨fun H => by 

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝² : DivisionSemiring α
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
h : a₂ ≠ 0
H : HasSum (fun i => a₂ * f i) (a₂ * a₁)
⊢ HasSum f a₁

Next tactic:
simpa only [inv_mul_cancel_left₀ h] using H.mul_left a₂⁻¹
theorem hasSum_mul_right_iff (h : a₂ ≠ 0) : HasSum (fun i => f i * a₂) (a₁ * a₂) ↔ HasSum f a₁ :=
  ⟨fun H => by 

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝² : DivisionSemiring α
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
h : a₂ ≠ 0
H : HasSum (fun i => f i * a₂) (a₁ * a₂)
⊢ HasSum f a₁

Next tactic:
simpa only [mul_inv_cancel_right₀ h] using H.mul_right a₂⁻¹
theorem hasSum_div_const_iff (h : a₂ ≠ 0) : HasSum (fun i => f i / a₂) (a₁ / a₂) ↔ HasSum f a₁ := by
  

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝² : DivisionSemiring α
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
h : a₂ ≠ 0
⊢ HasSum (fun i => f i / a₂) (a₁ / a₂) ↔ HasSum f a₁

Next tactic:
simpa only [div_eq_mul_inv] using hasSum_mul_right_iff (inv_ne_zero h)
theorem summable_mul_left_iff (h : a ≠ 0) : (Summable fun i => a * f i) ↔ Summable f :=
  ⟨fun H => by 

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝² : DivisionSemiring α
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
h : a ≠ 0
H : Summable fun i => a * f i
⊢ Summable f

Next tactic:
simpa only [inv_mul_cancel_left₀ h] using H.mul_left a⁻¹
theorem summable_mul_right_iff (h : a ≠ 0) : (Summable fun i => f i * a) ↔ Summable f :=
  ⟨fun H => by 

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝² : DivisionSemiring α
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
h : a ≠ 0
H : Summable fun i => f i * a
⊢ Summable f

Next tactic:
simpa only [mul_inv_cancel_right₀ h] using H.mul_right a⁻¹
theorem summable_div_const_iff (h : a ≠ 0) : (Summable fun i => f i / a) ↔ Summable f := by
  

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝² : DivisionSemiring α
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
h : a ≠ 0
⊢ (Summable fun i => f i / a) ↔ Summable f

Next tactic:
simpa only [div_eq_mul_inv] using summable_mul_right_iff (inv_ne_zero h)
theorem tsum_mul_left [T2Space α] : ∑' x, a * f x = a * ∑' x, f x :=
  if hf : Summable f then hf.tsum_mul_left a
  else if ha : a = 0 then by 

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝³ : DivisionSemiring α
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
inst✝ : T2Space α
hf : ¬Summable f
ha : a = 0
⊢ ∑' (x : ι), a * f x = a * ∑' (x : ι), f x

Next tactic:
simp [ha]
theorem tsum_mul_left [T2Space α] : ∑' x, a * f x = a * ∑' x, f x :=
  if hf : Summable f then hf.tsum_mul_left a
  else if ha : a = 0 then by simp [ha]
  else by 

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝³ : DivisionSemiring α
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
inst✝ : T2Space α
hf : ¬Summable f
ha : ¬a = 0
⊢ ∑' (x : ι), a * f x = a * ∑' (x : ι), f x

Next tactic:
rw [tsum_eq_zero_of_not_summable hf,
              tsum_eq_zero_of_not_summable (mt (summable_mul_left_iff ha).mp hf), mul_zero]
theorem tsum_mul_right [T2Space α] : ∑' x, f x * a = (∑' x, f x) * a :=
  if hf : Summable f then hf.tsum_mul_right a
  else if ha : a = 0 then by 

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝³ : DivisionSemiring α
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
inst✝ : T2Space α
hf : ¬Summable f
ha : a = 0
⊢ ∑' (x : ι), f x * a = (∑' (x : ι), f x) * a

Next tactic:
simp [ha]
theorem tsum_mul_right [T2Space α] : ∑' x, f x * a = (∑' x, f x) * a :=
  if hf : Summable f then hf.tsum_mul_right a
  else if ha : a = 0 then by simp [ha]
  else by 

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝³ : DivisionSemiring α
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
inst✝ : T2Space α
hf : ¬Summable f
ha : ¬a = 0
⊢ ∑' (x : ι), f x * a = (∑' (x : ι), f x) * a

Next tactic:
rw [tsum_eq_zero_of_not_summable hf,
              tsum_eq_zero_of_not_summable (mt (summable_mul_right_iff ha).mp hf), zero_mul]
theorem tsum_div_const [T2Space α] : ∑' x, f x / a = (∑' x, f x) / a := by
  

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
inst✝³ : DivisionSemiring α
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSemiring α
f g : ι → α
a a₁ a₂ : α
inst✝ : T2Space α
⊢ ∑' (x : ι), f x / a = (∑' (x : ι), f x) / a

Next tactic:
simpa only [div_eq_mul_inv] using tsum_mul_right
theorem summable_sum_mul_antidiagonal_of_summable_mul
    (h : Summable fun x : A × A => f x.1 * g x.2) :
    Summable fun n => ∑ kl in antidiagonal n, f kl.1 * g kl.2 := by
  

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
A : Type u_5
inst✝⁵ : AddCommMonoid A
inst✝⁴ : HasAntidiagonal A
inst✝³ : TopologicalSpace α
inst✝² : NonUnitalNonAssocSemiring α
f g : A → α
inst✝¹ : T3Space α
inst✝ : TopologicalSemiring α
h : Summable fun x => f x.1 * g x.2
⊢ Summable fun n => ∑ kl in antidiagonal n, f kl.1 * g kl.2

Next tactic:
rw [summable_mul_prod_iff_summable_mul_sigma_antidiagonal] at h
theorem summable_sum_mul_antidiagonal_of_summable_mul
    (h : Summable fun x : A × A => f x.1 * g x.2) :
    Summable fun n => ∑ kl in antidiagonal n, f kl.1 * g kl.2 := by
  rw [summable_mul_prod_iff_summable_mul_sigma_antidiagonal] at h
  

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
A : Type u_5
inst✝⁵ : AddCommMonoid A
inst✝⁴ : HasAntidiagonal A
inst✝³ : TopologicalSpace α
inst✝² : NonUnitalNonAssocSemiring α
f g : A → α
inst✝¹ : T3Space α
inst✝ : TopologicalSemiring α
h : Summable fun x => f (↑x.snd).1 * g (↑x.snd).2
⊢ Summable fun n => ∑ kl in antidiagonal n, f kl.1 * g kl.2

Next tactic:
conv => congr; ext; rw [← Finset.sum_finset_coe, ← tsum_fintype]
theorem summable_sum_mul_antidiagonal_of_summable_mul
    (h : Summable fun x : A × A => f x.1 * g x.2) :
    Summable fun n => ∑ kl in antidiagonal n, f kl.1 * g kl.2 := by
  rw [summable_mul_prod_iff_summable_mul_sigma_antidiagonal] at h
  conv => 

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
A : Type u_5
inst✝⁵ : AddCommMonoid A
inst✝⁴ : HasAntidiagonal A
inst✝³ : TopologicalSpace α
inst✝² : NonUnitalNonAssocSemiring α
f g : A → α
inst✝¹ : T3Space α
inst✝ : TopologicalSemiring α
h : Summable fun x => f (↑x.snd).1 * g (↑x.snd).2
| Summable fun n => ∑ kl in antidiagonal n, f kl.1 * g kl.2

Next tactic:
congr; ext; rw [← Finset.sum_finset_coe, ← tsum_fintype]
theorem summable_sum_mul_antidiagonal_of_summable_mul
    (h : Summable fun x : A × A => f x.1 * g x.2) :
    Summable fun n => ∑ kl in antidiagonal n, f kl.1 * g kl.2 := by
  rw [summable_mul_prod_iff_summable_mul_sigma_antidiagonal] at h
  conv => 

Proof state:
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
A : Type u_5
inst✝⁵ : AddCommMonoid A
inst✝⁴ : HasAntidiagonal A
inst✝³ : TopologicalSpace α
inst✝² : NonUnitalNonAssocSemiring α
f g : A → α
inst✝¹ : T3Space α
inst✝ : TopologicalSemiring α
h : Summable fun x => f (↑x.snd).1 * g (↑x.snd).2
| Summable fun n => ∑ kl in antidiagonal n, f kl.1 * g kl.2

Next tactic:
congr
theorem summable_sum_mul_antidiagonal_of_summable_mul
    (h : Summable fun x : A × A => f x.1 * g x.2) :
    Summable fun n => ∑ kl in antidiagonal n, f kl.1 * g kl.2 := by
  rw [summable_mul_prod_iff_summable_mul_sigma_antidiagonal] at h
  conv => congr; 

Proof state:
case f
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
A : Type u_5
inst✝⁵ : AddCommMonoid A
inst✝⁴ : HasAntidiagonal A
inst✝³ : TopologicalSpace α
inst✝² : NonUnitalNonAssocSemiring α
f g : A → α
inst✝¹ : T3Space α
inst✝ : TopologicalSemiring α
h : Summable fun x => f (↑x.snd).1 * g (↑x.snd).2
| fun n => ∑ kl in antidiagonal n, f kl.1 * g kl.2

Next tactic:
ext
theorem summable_sum_mul_antidiagonal_of_summable_mul
    (h : Summable fun x : A × A => f x.1 * g x.2) :
    Summable fun n => ∑ kl in antidiagonal n, f kl.1 * g kl.2 := by
  rw [summable_mul_prod_iff_summable_mul_sigma_antidiagonal] at h
  conv => congr; ext; 

Proof state:
case f.h
ι : Type u_1
κ : Type u_2
R : Type u_3
α : Type u_4
A : Type u_5
inst✝⁵ : AddCommMonoid A
inst✝⁴ : HasAntidiagonal A
inst✝³ : TopologicalSpace α
inst✝² : NonUnitalNonAssocSemiring α
f g : A → α
inst✝¹ : T3Space α
inst✝ : TopologicalSemiring α
h : Summable fun x => f (↑x.snd).1 * g (↑x.snd).2
x✝ : A
| ∑ kl in antidiagonal x✝, f kl.1 * g kl.2

Next tactic:
rw [← Finset.sum_finset_coe, ← tsum_fintype]