l3lab/ntp-mathlib huggingface dataset:
/-- If `I` and `J` are complementary index sets, the product of the kernels of the `J`th projections
of `φ` is linearly equivalent to the product over `I`. -/
def iInfKerProjEquiv {I J : Set ι} [DecidablePred fun i => i ∈ I] (hd : Disjoint I J)
    (hu : Set.univ ⊆ I ∪ J) :
    (⨅ i ∈ J, ker (proj i : (∀ i, φ i) →L[R] φ i) : Submodule R (∀ i, φ i)) ≃L[R] ∀ i : I, φ i
    where
  toLinearEquiv := LinearMap.iInfKerProjEquiv R φ hd hu
  continuous_toFun :=
    continuous_pi fun i => by
      have :=
        @continuous_subtype_val _ _ fun x =>
          x ∈ (⨅ i ∈ J, ker (proj i : (∀ i, φ i) →L[R] φ i) : Submodule R (∀ i, φ i))
      have := Continuous.comp (continuous_apply (π := φ) i) this
      exact this
  continuous_invFun :=
    Continuous.subtype_mk
      (continuous_pi fun i => by
        -- Porting note: Was `dsimp`.
        change
          Continuous (⇑(if h : i ∈ I then LinearMap.proj (R := R) (ι := ↥I)
            (φ := fun i : ↥I => φ i) ⟨i, h⟩ else
            (0 : ((i : I) → φ i) →ₗ[R] φ i)))
        split_ifs <;> [

Proof state:
case pos
R : Type u_1
inst✝¹⁰ : Semiring R
M : Type u_2
inst✝⁹ : TopologicalSpace M
inst✝⁸ : AddCommMonoid M
inst✝⁷ : Module R M
M₂ : Type u_3
inst✝⁶ : TopologicalSpace M₂
inst✝⁵ : AddCommMonoid M₂
inst✝⁴ : Module R M₂
ι : Type u_4
φ : ι → Type u_5
inst✝³ : (i : ι) → TopologicalSpace (φ i)
inst✝² : (i : ι) → AddCommMonoid (φ i)
inst✝¹ : (i : ι) → Module R (φ i)
I J : Set ι
inst✝ : DecidablePred fun i => i ∈ I
hd : Disjoint I J
hu : Set.univ ⊆ I ∪ J
i : ι
h✝ : i ∈ I
⊢ Continuous ⇑(LinearMap.proj { val := i, property := h✝ })

Next tactic:
apply continuous_apply
/-- If `I` and `J` are complementary index sets, the product of the kernels of the `J`th projections
of `φ` is linearly equivalent to the product over `I`. -/
def iInfKerProjEquiv {I J : Set ι} [DecidablePred fun i => i ∈ I] (hd : Disjoint I J)
    (hu : Set.univ ⊆ I ∪ J) :
    (⨅ i ∈ J, ker (proj i : (∀ i, φ i) →L[R] φ i) : Submodule R (∀ i, φ i)) ≃L[R] ∀ i : I, φ i
    where
  toLinearEquiv := LinearMap.iInfKerProjEquiv R φ hd hu
  continuous_toFun :=
    continuous_pi fun i => by
      have :=
        @continuous_subtype_val _ _ fun x =>
          x ∈ (⨅ i ∈ J, ker (proj i : (∀ i, φ i) →L[R] φ i) : Submodule R (∀ i, φ i))
      have := Continuous.comp (continuous_apply (π := φ) i) this
      exact this
  continuous_invFun :=
    Continuous.subtype_mk
      (continuous_pi fun i => by
        -- Porting note: Was `dsimp`.
        change
          Continuous (⇑(if h : i ∈ I then LinearMap.proj (R := R) (ι := ↥I)
            (φ := fun i : ↥I => φ i) ⟨i, h⟩ else
            (0 : ((i : I) → φ i) →ₗ[R] φ i)))
        split_ifs <;> [apply continuous_apply; 

Proof state:
case neg
R : Type u_1
inst✝¹⁰ : Semiring R
M : Type u_2
inst✝⁹ : TopologicalSpace M
inst✝⁸ : AddCommMonoid M
inst✝⁷ : Module R M
M₂ : Type u_3
inst✝⁶ : TopologicalSpace M₂
inst✝⁵ : AddCommMonoid M₂
inst✝⁴ : Module R M₂
ι : Type u_4
φ : ι → Type u_5
inst✝³ : (i : ι) → TopologicalSpace (φ i)
inst✝² : (i : ι) → AddCommMonoid (φ i)
inst✝¹ : (i : ι) → Module R (φ i)
I J : Set ι
inst✝ : DecidablePred fun i => i ∈ I
hd : Disjoint I J
hu : Set.univ ⊆ I ∪ J
i : ι
h✝ : i ∉ I
⊢ Continuous ⇑0

Next tactic:
exact continuous_zero
protected theorem map_neg (f : M →SL[σ₁₂] M₂) (x : M) : f (-x) = -f x := by
  

Proof state:
R : Type u_1
inst✝¹³ : Ring R
R₂ : Type u_2
inst✝¹² : Ring R₂
R₃ : Type u_3
inst✝¹¹ : Ring R₃
M : Type u_4
inst✝¹⁰ : TopologicalSpace M
inst✝⁹ : AddCommGroup M
M₂ : Type u_5
inst✝⁸ : TopologicalSpace M₂
inst✝⁷ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁶ : TopologicalSpace M₃
inst✝⁵ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁴ : TopologicalSpace M₄
inst✝³ : AddCommGroup M₄
inst✝² : Module R M
inst✝¹ : Module R₂ M₂
inst✝ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
f : M →SL[σ₁₂] M₂
x : M
⊢ f (-x) = -f x

Next tactic:
exact map_neg f x
protected theorem map_sub (f : M →SL[σ₁₂] M₂) (x y : M) : f (x - y) = f x - f y := by
  

Proof state:
R : Type u_1
inst✝¹³ : Ring R
R₂ : Type u_2
inst✝¹² : Ring R₂
R₃ : Type u_3
inst✝¹¹ : Ring R₃
M : Type u_4
inst✝¹⁰ : TopologicalSpace M
inst✝⁹ : AddCommGroup M
M₂ : Type u_5
inst✝⁸ : TopologicalSpace M₂
inst✝⁷ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁶ : TopologicalSpace M₃
inst✝⁵ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁴ : TopologicalSpace M₄
inst✝³ : AddCommGroup M₄
inst✝² : Module R M
inst✝¹ : Module R₂ M₂
inst✝ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
f : M →SL[σ₁₂] M₂
x y : M
⊢ f (x - y) = f x - f y

Next tactic:
exact map_sub f x y
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  

Proof state:
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
⊢ AddCommGroup (M →SL[σ₁₂] M₂)

Next tactic:
refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; simp [add_smul, add_comm]
      zsmul_neg' := fun n f => by ext; simp [Nat.succ_eq_add_one, add_smul]
      .. }
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by 

Proof state:
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
f : M →SL[σ₁₂] M₂
⊢ (fun x x_1 => x • x_1) 0 f = 0

Next tactic:
ext
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; 

Proof state:
case h
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
f : M →SL[σ₁₂] M₂
x✝ : M
⊢ ((fun x x_1 => x • x_1) 0 f) x✝ = 0 x✝

Next tactic:
simp
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by 

Proof state:
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
n : ℕ
f : M →SL[σ₁₂] M₂
⊢ (fun x x_1 => x • x_1) (Int.ofNat (Nat.succ n)) f = f + (fun x x_1 => x • x_1) (Int.ofNat n) f

Next tactic:
ext
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; 

Proof state:
case h
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
n : ℕ
f : M →SL[σ₁₂] M₂
x✝ : M
⊢ ((fun x x_1 => x • x_1) (Int.ofNat (Nat.succ n)) f) x✝ = (f + (fun x x_1 => x • x_1) (Int.ofNat n) f) x✝

Next tactic:
simp [add_smul, add_comm]
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; simp [add_smul, add_comm]
      zsmul_neg' := fun n f => by 

Proof state:
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
n : ℕ
f : M →SL[σ₁₂] M₂
⊢ (fun x x_1 => x • x_1) (Int.negSucc n) f = -(fun x x_1 => x • x_1) (↑(Nat.succ n)) f

Next tactic:
ext
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; simp [add_smul, add_comm]
      zsmul_neg' := fun n f => by ext; 

Proof state:
case h
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
n : ℕ
f : M →SL[σ₁₂] M₂
x✝ : M
⊢ ((fun x x_1 => x • x_1) (Int.negSucc n) f) x✝ = (-(fun x x_1 => x • x_1) (↑(Nat.succ n)) f) x✝

Next tactic:
simp [Nat.succ_eq_add_one, add_smul]
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; simp [add_smul, add_comm]
      zsmul_neg' := fun n f => by ext; simp [Nat.succ_eq_add_one, add_smul]
      .. } <;>
    

Proof state:
case refine'_1
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
⊢ ∀ (a b : M →SL[σ₁₂] M₂), a - b = a + -b

Next tactic:
{ intros
      ext
      apply_rules [zero_add, add_assoc, add_zero, add_left_neg, add_comm, sub_eq_add_neg] }
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; simp [add_smul, add_comm]
      zsmul_neg' := fun n f => by ext; simp [Nat.succ_eq_add_one, add_smul]
      .. } <;>
    { 

Proof state:
case refine'_1
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
⊢ ∀ (a b : M →SL[σ₁₂] M₂), a - b = a + -b

Next tactic:
intros
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; simp [add_smul, add_comm]
      zsmul_neg' := fun n f => by ext; simp [Nat.succ_eq_add_one, add_smul]
      .. } <;>
    { intros
      

Proof state:
case refine'_1
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
a✝ b✝ : M →SL[σ₁₂] M₂
⊢ a✝ - b✝ = a✝ + -b✝

Next tactic:
ext
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; simp [add_smul, add_comm]
      zsmul_neg' := fun n f => by ext; simp [Nat.succ_eq_add_one, add_smul]
      .. } <;>
    { intros
      ext
      

Proof state:
case refine'_1.h
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
a✝ b✝ : M →SL[σ₁₂] M₂
x✝ : M
⊢ (a✝ - b✝) x✝ = (a✝ + -b✝) x✝

Next tactic:
apply_rules [zero_add, add_assoc, add_zero, add_left_neg, add_comm, sub_eq_add_neg]
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; simp [add_smul, add_comm]
      zsmul_neg' := fun n f => by ext; simp [Nat.succ_eq_add_one, add_smul]
      .. } <;>
    

Proof state:
case refine'_2
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
⊢ ∀ (a : M →SL[σ₁₂] M₂), -a + a = 0

Next tactic:
{ intros
      ext
      apply_rules [zero_add, add_assoc, add_zero, add_left_neg, add_comm, sub_eq_add_neg] }
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; simp [add_smul, add_comm]
      zsmul_neg' := fun n f => by ext; simp [Nat.succ_eq_add_one, add_smul]
      .. } <;>
    { 

Proof state:
case refine'_2
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
⊢ ∀ (a : M →SL[σ₁₂] M₂), -a + a = 0

Next tactic:
intros
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; simp [add_smul, add_comm]
      zsmul_neg' := fun n f => by ext; simp [Nat.succ_eq_add_one, add_smul]
      .. } <;>
    { intros
      

Proof state:
case refine'_2
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
a✝ : M →SL[σ₁₂] M₂
⊢ -a✝ + a✝ = 0

Next tactic:
ext
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) := by
  refine'
    { ContinuousLinearMap.addCommMonoid with
      neg := (-·)
      sub := (· - ·)
      sub_eq_add_neg := _
      nsmul := (· • ·)
      zsmul := (· • ·)
      zsmul_zero' := fun f => by ext; simp
      zsmul_succ' := fun n f => by ext; simp [add_smul, add_comm]
      zsmul_neg' := fun n f => by ext; simp [Nat.succ_eq_add_one, add_smul]
      .. } <;>
    { intros
      ext
      

Proof state:
case refine'_2.h
R : Type u_1
inst✝¹⁴ : Ring R
R₂ : Type u_2
inst✝¹³ : Ring R₂
R₃ : Type u_3
inst✝¹² : Ring R₃
M : Type u_4
inst✝¹¹ : TopologicalSpace M
inst✝¹⁰ : AddCommGroup M
M₂ : Type u_5
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommGroup M₄
inst✝³ : Module R M
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝ : TopologicalAddGroup M₂
src✝ : AddCommMonoid (M →SL[σ₁₂] M₂) := addCommMonoid
a✝ : M →SL[σ₁₂] M₂
x✝ : M
⊢ (-a✝ + a✝) x✝ = 0 x✝

Next tactic:
apply_rules [zero_add, add_assoc, add_zero, add_left_neg, add_comm, sub_eq_add_neg]
@[simp]
theorem comp_neg [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [TopologicalAddGroup M₂] [TopologicalAddGroup M₃]
    (g : M₂ →SL[σ₂₃] M₃) (f : M →SL[σ₁₂] M₂) : g.comp (-f) = -g.comp f := by
  

Proof state:
R : Type u_1
inst✝¹⁶ : Ring R
R₂ : Type u_2
inst✝¹⁵ : Ring R₂
R₃ : Type u_3
inst✝¹⁴ : Ring R₃
M : Type u_4
inst✝¹³ : TopologicalSpace M
inst✝¹² : AddCommGroup M
M₂ : Type u_5
inst✝¹¹ : TopologicalSpace M₂
inst✝¹⁰ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁹ : TopologicalSpace M₃
inst✝⁸ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁷ : TopologicalSpace M₄
inst✝⁶ : AddCommGroup M₄
inst✝⁵ : Module R M
inst✝⁴ : Module R₂ M₂
inst✝³ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝² : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝¹ : TopologicalAddGroup M₂
inst✝ : TopologicalAddGroup M₃
g : M₂ →SL[σ₂₃] M₃
f : M →SL[σ₁₂] M₂
⊢ comp g (-f) = -comp g f

Next tactic:
ext x
@[simp]
theorem comp_neg [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [TopologicalAddGroup M₂] [TopologicalAddGroup M₃]
    (g : M₂ →SL[σ₂₃] M₃) (f : M →SL[σ₁₂] M₂) : g.comp (-f) = -g.comp f := by
  ext x
  

Proof state:
case h
R : Type u_1
inst✝¹⁶ : Ring R
R₂ : Type u_2
inst✝¹⁵ : Ring R₂
R₃ : Type u_3
inst✝¹⁴ : Ring R₃
M : Type u_4
inst✝¹³ : TopologicalSpace M
inst✝¹² : AddCommGroup M
M₂ : Type u_5
inst✝¹¹ : TopologicalSpace M₂
inst✝¹⁰ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁹ : TopologicalSpace M₃
inst✝⁸ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁷ : TopologicalSpace M₄
inst✝⁶ : AddCommGroup M₄
inst✝⁵ : Module R M
inst✝⁴ : Module R₂ M₂
inst✝³ : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝² : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝¹ : TopologicalAddGroup M₂
inst✝ : TopologicalAddGroup M₃
g : M₂ →SL[σ₂₃] M₃
f : M →SL[σ₁₂] M₂
x : M
⊢ (comp g (-f)) x = (-comp g f) x

Next tactic:
simp
@[simp]
theorem neg_comp [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [TopologicalAddGroup M₃] (g : M₂ →SL[σ₂₃] M₃)
    (f : M →SL[σ₁₂] M₂) : (-g).comp f = -g.comp f := by
  

Proof state:
R : Type u_1
inst✝¹⁵ : Ring R
R₂ : Type u_2
inst✝¹⁴ : Ring R₂
R₃ : Type u_3
inst✝¹³ : Ring R₃
M : Type u_4
inst✝¹² : TopologicalSpace M
inst✝¹¹ : AddCommGroup M
M₂ : Type u_5
inst✝¹⁰ : TopologicalSpace M₂
inst✝⁹ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁸ : TopologicalSpace M₃
inst✝⁷ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁶ : TopologicalSpace M₄
inst✝⁵ : AddCommGroup M₄
inst✝⁴ : Module R M
inst✝³ : Module R₂ M₂
inst✝² : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝¹ : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝ : TopologicalAddGroup M₃
g : M₂ →SL[σ₂₃] M₃
f : M →SL[σ₁₂] M₂
⊢ comp (-g) f = -comp g f

Next tactic:
ext
@[simp]
theorem neg_comp [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [TopologicalAddGroup M₃] (g : M₂ →SL[σ₂₃] M₃)
    (f : M →SL[σ₁₂] M₂) : (-g).comp f = -g.comp f := by
  ext
  

Proof state:
case h
R : Type u_1
inst✝¹⁵ : Ring R
R₂ : Type u_2
inst✝¹⁴ : Ring R₂
R₃ : Type u_3
inst✝¹³ : Ring R₃
M : Type u_4
inst✝¹² : TopologicalSpace M
inst✝¹¹ : AddCommGroup M
M₂ : Type u_5
inst✝¹⁰ : TopologicalSpace M₂
inst✝⁹ : AddCommGroup M₂
M₃ : Type u_6
inst✝⁸ : TopologicalSpace M₃
inst✝⁷ : AddCommGroup M₃
M₄ : Type u_7
inst✝⁶ : TopologicalSpace M₄
inst✝⁵ : AddCommGroup M₄
inst✝⁴ : Module R M
inst✝³ : Module R₂ M₂
inst✝² : Module R₃ M₃
σ₁₂ : R →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R →+* R₃
inst✝¹ : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝ : TopologicalAddGroup M₃
g : M₂ →SL[σ₂₃] M₃
f : M →SL[σ₁₂] M₂
x✝ : M
⊢ (comp (-g) f) x✝ = (-comp g f) x✝

Next tactic:
simp