l3lab/ntp-mathlib huggingface dataset:
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case pos
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∈ some i
h✝² : i✝ = x✝
h✝¹ : x✝ ∉ none
h✝ : x✝ ∈ some j
⊢ 1 = 1 - 0 - 1 + 0 + 1

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case neg
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∈ some i
h✝² : i✝ = x✝
h✝¹ : x✝ ∉ none
h✝ : x✝ ∉ some j
⊢ 1 = 1 - 0 - 0 + 0 + 1

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case pos
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∈ some i
h✝² : ¬i✝ = x✝
h✝¹ : x✝ ∈ none
h✝ : x✝ ∈ some j
⊢ 1 = 0 - 1 - 1 + 1 + 1

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case neg
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∈ some i
h✝² : ¬i✝ = x✝
h✝¹ : x✝ ∈ none
h✝ : x✝ ∉ some j
⊢ 1 = 0 - 1 - 0 + 1 + 1

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case pos
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∈ some i
h✝² : ¬i✝ = x✝
h✝¹ : x✝ ∉ none
h✝ : x✝ ∈ some j
⊢ 1 = 0 - 0 - 1 + 0 + 1

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case neg
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∈ some i
h✝² : ¬i✝ = x✝
h✝¹ : x✝ ∉ none
h✝ : x✝ ∉ some j
⊢ 1 = 0 - 0 - 0 + 0 + 1

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case pos
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∉ some i
h✝² : i✝ = x✝
h✝¹ : x✝ ∈ none
h✝ : x✝ ∈ some j
⊢ 0 = 1 - 1 - 1 + 1 + 0

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case neg
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∉ some i
h✝² : i✝ = x✝
h✝¹ : x✝ ∈ none
h✝ : x✝ ∉ some j
⊢ 0 = 1 - 1 - 0 + 1 + 0

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case pos
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∉ some i
h✝² : i✝ = x✝
h✝¹ : x✝ ∉ none
h✝ : x✝ ∈ some j
⊢ 0 = 1 - 0 - 1 + 0 + 0

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case neg
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∉ some i
h✝² : i✝ = x✝
h✝¹ : x✝ ∉ none
h✝ : x✝ ∉ some j
⊢ 0 = 1 - 0 - 0 + 0 + 0

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case pos
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∉ some i
h✝² : ¬i✝ = x✝
h✝¹ : x✝ ∈ none
h✝ : x✝ ∈ some j
⊢ 0 = 0 - 1 - 1 + 1 + 0

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case neg
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∉ some i
h✝² : ¬i✝ = x✝
h✝¹ : x✝ ∈ none
h✝ : x✝ ∉ some j
⊢ 0 = 0 - 1 - 0 + 1 + 0

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case pos
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∉ some i
h✝² : ¬i✝ = x✝
h✝¹ : x✝ ∉ none
h✝ : x✝ ∈ some j
⊢ 0 = 0 - 0 - 1 + 0 + 0

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case neg
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁵ : ¬i✝ = i
h✝⁴ : i✝ = j
h✝³ : x✝ ∉ some i
h✝² : ¬i✝ = x✝
h✝¹ : x✝ ∉ none
h✝ : x✝ ∉ some j
⊢ 0 = 0 - 0 - 0 + 0 + 0

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case pos
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁴ : ¬i✝ = i
h✝³ : ¬i✝ = j
h✝² : x✝ ∈ some i✝
h✝¹ : i✝ = x✝
h✝ : x✝ ∈ none
⊢ 1 = 1 - 1 - 1 + 1 + 1

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case neg
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁴ : ¬i✝ = i
h✝³ : ¬i✝ = j
h✝² : x✝ ∈ some i✝
h✝¹ : i✝ = x✝
h✝ : x✝ ∉ none
⊢ 1 = 1 - 0 - 0 + 0 + 0

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case pos
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁴ : ¬i✝ = i
h✝³ : ¬i✝ = j
h✝² : x✝ ∈ some i✝
h✝¹ : ¬i✝ = x✝
h✝ : x✝ ∈ none
⊢ 1 = 0 - 1 - 1 + 1 + 1

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case neg
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁴ : ¬i✝ = i
h✝³ : ¬i✝ = j
h✝² : x✝ ∈ some i✝
h✝¹ : ¬i✝ = x✝
h✝ : x✝ ∉ none
⊢ 1 = 0 - 0 - 0 + 0 + 0

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case pos
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁴ : ¬i✝ = i
h✝³ : ¬i✝ = j
h✝² : x✝ ∉ some i✝
h✝¹ : i✝ = x✝
h✝ : x✝ ∈ none
⊢ 0 = 1 - 1 - 1 + 1 + 1

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case neg
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁴ : ¬i✝ = i
h✝³ : ¬i✝ = j
h✝² : x✝ ∉ some i✝
h✝¹ : i✝ = x✝
h✝ : x✝ ∉ none
⊢ 0 = 1 - 0 - 0 + 0 + 0

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case pos
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁴ : ¬i✝ = i
h✝³ : ¬i✝ = j
h✝² : x✝ ∉ some i✝
h✝¹ : ¬i✝ = x✝
h✝ : x✝ ∈ none
⊢ 0 = 0 - 1 - 1 + 1 + 1

Next tactic:
simp_all
theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix := by
  ext
  dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply]
  split_ifs <;> 

Proof state:
case neg
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝¹ : DecidableEq n
inst✝ : Ring α
i j i✝ x✝ : n
h✝⁴ : ¬i✝ = i
h✝³ : ¬i✝ = j
h✝² : x✝ ∉ some i✝
h✝¹ : ¬i✝ = x✝
h✝ : x✝ ∉ none
⊢ 0 = 0 - 0 - 0 + 0 + 0

Next tactic:
simp_all
@[simp]
theorem single_mul_single [Fintype n] [DecidableEq k] [DecidableEq m] [DecidableEq n] [Semiring α]
    (a : m) (b : n) (c : k) :
    ((single a b).toMatrix : Matrix _ _ α) * (single b c).toMatrix = (single a c).toMatrix := by
  

Proof state:
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝⁴ : Fintype n
inst✝³ : DecidableEq k
inst✝² : DecidableEq m
inst✝¹ : DecidableEq n
inst✝ : Semiring α
a : m
b : n
c : k
⊢ toMatrix (single a b) * toMatrix (single b c) = toMatrix (single a c)

Next tactic:
rw [← toMatrix_trans, single_trans_single]
theorem single_mul_single_of_ne [Fintype n] [DecidableEq n] [DecidableEq k] [DecidableEq m]
    [Semiring α] {b₁ b₂ : n} (hb : b₁ ≠ b₂) (a : m) (c : k) :
    (single a b₁).toMatrix * (single b₂ c).toMatrix = (0 : Matrix _ _ α) := by
  

Proof state:
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝⁴ : Fintype n
inst✝³ : DecidableEq n
inst✝² : DecidableEq k
inst✝¹ : DecidableEq m
inst✝ : Semiring α
b₁ b₂ : n
hb : b₁ ≠ b₂
a : m
c : k
⊢ toMatrix (single a b₁) * toMatrix (single b₂ c) = 0

Next tactic:
rw [← toMatrix_trans, single_trans_single_of_ne hb, toMatrix_bot]
/-- Restatement of `single_mul_single`, which will simplify expressions in `simp` normal form,
  when associativity may otherwise need to be carefully applied. -/
@[simp]
theorem single_mul_single_right [Fintype n] [Fintype k] [DecidableEq n] [DecidableEq k]
    [DecidableEq m] [Semiring α] (a : m) (b : n) (c : k) (M : Matrix k l α) :
    (single a b).toMatrix * ((single b c).toMatrix * M) = (single a c).toMatrix * M := by
  

Proof state:
k : Type u_1
l : Type u_2
m : Type u_3
n : Type u_4
α : Type v
inst✝⁵ : Fintype n
inst✝⁴ : Fintype k
inst✝³ : DecidableEq n
inst✝² : DecidableEq k
inst✝¹ : DecidableEq m
inst✝ : Semiring α
a : m
b : n
c : k
M : Matrix k l α
⊢ toMatrix (single a b) * (toMatrix (single b c) * M) = toMatrix (single a c) * M

Next tactic:
rw [← Matrix.mul_assoc, single_mul_single]
/-- The canonical morphism from a seminormed group `V` to its completion. -/
@[simps]
def completion.incl {V : SemiNormedGroupCat} : V ⟶ completion.obj V where
  toFun v := (v : Completion V)
  map_add' := Completion.coe_add
  bound' := ⟨1, fun v => by 

Proof state:
V : SemiNormedGroupCat
v : ↑V
⊢ ‖(fun v => ↑↑V v) v‖ ≤ 1 * ‖v‖

Next tactic:
simp
instance : Preadditive SemiNormedGroupCat.{u} where
  homGroup P Q := inferInstanceAs <| AddCommGroup <| NormedAddGroupHom P Q
  add_comp _ Q _ f f' g := by
    

Proof state:
V : SemiNormedGroupCat
W : SemiNormedGroupCat
x✝¹ Q x✝ : SemiNormedGroupCat
f f' : x✝¹ ⟶ Q
g : Q ⟶ x✝
⊢ (f + f') ≫ g = f ≫ g + f' ≫ g

Next tactic:
ext x
instance : Preadditive SemiNormedGroupCat.{u} where
  homGroup P Q := inferInstanceAs <| AddCommGroup <| NormedAddGroupHom P Q
  add_comp _ Q _ f f' g := by
    ext x
    -- Porting note: failing simps probably due to instance synthesis issues with concrete
    -- cats; see the gymnastics below for what used to be
    -- simp only [add_apply, comp_apply. map_add]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    

Proof state:
case h
V : SemiNormedGroupCat
W : SemiNormedGroupCat
x✝¹ Q x✝ : SemiNormedGroupCat
f f' : x✝¹ ⟶ Q
g : Q ⟶ x✝
x : ↑x✝¹
⊢ ((f + f') ≫ g) x = (f ≫ g + f' ≫ g) x

Next tactic:
rw [NormedAddGroupHom.add_apply]
instance : Preadditive SemiNormedGroupCat.{u} where
  homGroup P Q := inferInstanceAs <| AddCommGroup <| NormedAddGroupHom P Q
  add_comp _ Q _ f f' g := by
    ext x
    -- Porting note: failing simps probably due to instance synthesis issues with concrete
    -- cats; see the gymnastics below for what used to be
    -- simp only [add_apply, comp_apply. map_add]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    rw [NormedAddGroupHom.add_apply]; 

Proof state:
case h
V : SemiNormedGroupCat
W : SemiNormedGroupCat
x✝¹ Q x✝ : SemiNormedGroupCat
f f' : x✝¹ ⟶ Q
g : Q ⟶ x✝
x : ↑x✝¹
⊢ ((f + f') ≫ g) x = (f ≫ g) x + (f' ≫ g) x

Next tactic:
erw [CategoryTheory.comp_apply, CategoryTheory.comp_apply,
      CategoryTheory.comp_apply, @NormedAddGroupHom.add_apply _ _ (_) (_)]
instance : Preadditive SemiNormedGroupCat.{u} where
  homGroup P Q := inferInstanceAs <| AddCommGroup <| NormedAddGroupHom P Q
  add_comp _ Q _ f f' g := by
    ext x
    -- Porting note: failing simps probably due to instance synthesis issues with concrete
    -- cats; see the gymnastics below for what used to be
    -- simp only [add_apply, comp_apply. map_add]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    rw [NormedAddGroupHom.add_apply]; erw [CategoryTheory.comp_apply, CategoryTheory.comp_apply,
      CategoryTheory.comp_apply, @NormedAddGroupHom.add_apply _ _ (_) (_)]
    

Proof state:
case h
V : SemiNormedGroupCat
W : SemiNormedGroupCat
x✝¹ Q x✝ : SemiNormedGroupCat
f f' : x✝¹ ⟶ Q
g : Q ⟶ x✝
x : ↑x✝¹
⊢ g (f x + f' x) = g (f x) + g (f' x)

Next tactic:
convert map_add g (f x) (f' x)
instance : Preadditive SemiNormedGroupCat.{u} where
  homGroup P Q := inferInstanceAs <| AddCommGroup <| NormedAddGroupHom P Q
  add_comp _ Q _ f f' g := by
    ext x
    -- Porting note: failing simps probably due to instance synthesis issues with concrete
    -- cats; see the gymnastics below for what used to be
    -- simp only [add_apply, comp_apply. map_add]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    rw [NormedAddGroupHom.add_apply]; erw [CategoryTheory.comp_apply, CategoryTheory.comp_apply,
      CategoryTheory.comp_apply, @NormedAddGroupHom.add_apply _ _ (_) (_)]
    convert map_add g (f x) (f' x)
  comp_add _ _ _ _ _ _ := by
    

Proof state:
V : SemiNormedGroupCat
W : SemiNormedGroupCat
x✝⁵ x✝⁴ x✝³ : SemiNormedGroupCat
x✝² : x✝⁵ ⟶ x✝⁴
x✝¹ x✝ : x✝⁴ ⟶ x✝³
⊢ x✝² ≫ (x✝¹ + x✝) = x✝² ≫ x✝¹ + x✝² ≫ x✝

Next tactic:
ext
instance : Preadditive SemiNormedGroupCat.{u} where
  homGroup P Q := inferInstanceAs <| AddCommGroup <| NormedAddGroupHom P Q
  add_comp _ Q _ f f' g := by
    ext x
    -- Porting note: failing simps probably due to instance synthesis issues with concrete
    -- cats; see the gymnastics below for what used to be
    -- simp only [add_apply, comp_apply. map_add]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    rw [NormedAddGroupHom.add_apply]; erw [CategoryTheory.comp_apply, CategoryTheory.comp_apply,
      CategoryTheory.comp_apply, @NormedAddGroupHom.add_apply _ _ (_) (_)]
    convert map_add g (f x) (f' x)
  comp_add _ _ _ _ _ _ := by
    ext
    -- Porting note: failing simps probably due to instance synthesis issues with concrete
    -- cats; see the gymnastics below for what used to be
    -- simp only [add_apply, comp_apply. map_add]
    

Proof state:
case h
V : SemiNormedGroupCat
W : SemiNormedGroupCat
x✝⁶ x✝⁵ x✝⁴ : SemiNormedGroupCat
x✝³ : x✝⁶ ⟶ x✝⁵
x✝² x✝¹ : x✝⁵ ⟶ x✝⁴
x✝ : ↑x✝⁶
⊢ (x✝³ ≫ (x✝² + x✝¹)) x✝ = (x✝³ ≫ x✝² + x✝³ ≫ x✝¹) x✝

Next tactic:
rw [NormedAddGroupHom.add_apply]
instance : Preadditive SemiNormedGroupCat.{u} where
  homGroup P Q := inferInstanceAs <| AddCommGroup <| NormedAddGroupHom P Q
  add_comp _ Q _ f f' g := by
    ext x
    -- Porting note: failing simps probably due to instance synthesis issues with concrete
    -- cats; see the gymnastics below for what used to be
    -- simp only [add_apply, comp_apply. map_add]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    rw [NormedAddGroupHom.add_apply]; erw [CategoryTheory.comp_apply, CategoryTheory.comp_apply,
      CategoryTheory.comp_apply, @NormedAddGroupHom.add_apply _ _ (_) (_)]
    convert map_add g (f x) (f' x)
  comp_add _ _ _ _ _ _ := by
    ext
    -- Porting note: failing simps probably due to instance synthesis issues with concrete
    -- cats; see the gymnastics below for what used to be
    -- simp only [add_apply, comp_apply. map_add]
    rw [NormedAddGroupHom.add_apply]
    -- This used to be a single `rw`, but we need `erw` after leanprover/lean4#2644
    

Proof state:
case h
V : SemiNormedGroupCat
W : SemiNormedGroupCat
x✝⁶ x✝⁵ x✝⁴ : SemiNormedGroupCat
x✝³ : x✝⁶ ⟶ x✝⁵
x✝² x✝¹ : x✝⁵ ⟶ x✝⁴
x✝ : ↑x✝⁶
⊢ (x✝³ ≫ (x✝² + x✝¹)) x✝ = (x✝³ ≫ x✝²) x✝ + (x✝³ ≫ x✝¹) x✝

Next tactic:
erw [CategoryTheory.comp_apply, CategoryTheory.comp_apply,
      CategoryTheory.comp_apply, @NormedAddGroupHom.add_apply _ _ (_) (_)]
instance : Preadditive SemiNormedGroupCat.{u} where
  homGroup P Q := inferInstanceAs <| AddCommGroup <| NormedAddGroupHom P Q
  add_comp _ Q _ f f' g := by
    ext x
    -- Porting note: failing simps probably due to instance synthesis issues with concrete
    -- cats; see the gymnastics below for what used to be
    -- simp only [add_apply, comp_apply. map_add]
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    rw [NormedAddGroupHom.add_apply]; erw [CategoryTheory.comp_apply, CategoryTheory.comp_apply,
      CategoryTheory.comp_apply, @NormedAddGroupHom.add_apply _ _ (_) (_)]
    convert map_add g (f x) (f' x)
  comp_add _ _ _ _ _ _ := by
    ext
    -- Porting note: failing simps probably due to instance synthesis issues with concrete
    -- cats; see the gymnastics below for what used to be
    -- simp only [add_apply, comp_apply. map_add]
    rw [NormedAddGroupHom.add_apply]
    -- This used to be a single `rw`, but we need `erw` after leanprover/lean4#2644
    erw [CategoryTheory.comp_apply, CategoryTheory.comp_apply,
      CategoryTheory.comp_apply, @NormedAddGroupHom.add_apply _ _ (_) (_)]
    

Proof state:
case h
V : SemiNormedGroupCat
W : SemiNormedGroupCat
x✝⁶ x✝⁵ x✝⁴ : SemiNormedGroupCat
x✝³ : x✝⁶ ⟶ x✝⁵
x✝² x✝¹ : x✝⁵ ⟶ x✝⁴
x✝ : ↑x✝⁶
⊢ x✝² (x✝³ x✝) + x✝¹ (x✝³ x✝) = x✝² (x✝³ x✝) + x✝¹ (x✝³ x✝)

Next tactic:
rfl
/-- Every topological group in which there exists a compact set with nonempty interior
is weakly locally compact. -/
@[to_additive
  "Every separated topological additive group
  in which there exists a compact set with nonempty interior is weakly locally compact."]
theorem TopologicalSpace.PositiveCompacts.weaklyLocallyCompactSpace_of_group
    (K : PositiveCompacts G) : WeaklyLocallyCompactSpace G where
  exists_compact_mem_nhds x := by
    

Proof state:
α : Type u
β : Type v
G : Type w
H : Type x
inst✝² : TopologicalSpace G
inst✝¹ : Group G
inst✝ : TopologicalGroup G
K : PositiveCompacts G
x : G
⊢ ∃ s, IsCompact s ∧ s ∈ 𝓝 x

Next tactic:
obtain ⟨y, hy⟩ := K.interior_nonempty
/-- Every topological group in which there exists a compact set with nonempty interior
is weakly locally compact. -/
@[to_additive
  "Every separated topological additive group
  in which there exists a compact set with nonempty interior is weakly locally compact."]
theorem TopologicalSpace.PositiveCompacts.weaklyLocallyCompactSpace_of_group
    (K : PositiveCompacts G) : WeaklyLocallyCompactSpace G where
  exists_compact_mem_nhds x := by
    obtain ⟨y, hy⟩ := K.interior_nonempty
    

Proof state:
case intro
α : Type u
β : Type v
G : Type w
H : Type x
inst✝² : TopologicalSpace G
inst✝¹ : Group G
inst✝ : TopologicalGroup G
K : PositiveCompacts G
x y : G
hy : y ∈ interior ↑K
⊢ ∃ s, IsCompact s ∧ s ∈ 𝓝 x

Next tactic:
refine ⟨(x * y⁻¹) • (K : Set G), K.isCompact.smul _, ?_⟩