l3lab/ntp-mathlib huggingface dataset:
instance instRing : Ring ℍ[R,c₁,c₂] where
  __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
  left_distrib _ _ _ := by ext <;> simp <;> ring
  right_distrib _ _ _ := by ext <;> simp <;> ring
  zero_mul _ := by ext <;> simp
  mul_zero _ := by ext <;> simp
  mul_assoc _ _ _ := by ext <;> simp <;> 

Proof state:
case imK
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
src✝ : AddCommGroupWithOne ℍ[R,c₁,c₂] := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
x✝² x✝¹ x✝ : ℍ[R,c₁,c₂]
⊢ (x✝².re * x✝¹.re + c₁ * x✝².imI * x✝¹.imI + c₂ * x✝².imJ * x✝¹.imJ - c₁ * c₂ * x✝².imK * x✝¹.imK) * x✝.imK +
          (x✝².re * x✝¹.imI + x✝².imI * x✝¹.re - c₂ * x✝².imJ * x✝¹.imK + c₂ * x✝².imK * x✝¹.imJ) * x✝.imJ -
        (x✝².re * x✝¹.imJ + c₁ * x✝².imI * x✝¹.imK + x✝².imJ * x✝¹.re - c₁ * x✝².imK * x✝¹.imI) * x✝.imI +
      (x✝².re * x✝¹.imK + x✝².imI * x✝¹.imJ - x✝².imJ * x✝¹.imI + x✝².imK * x✝¹.re) * x✝.re =
    x✝².re * (x✝¹.re * x✝.imK + x✝¹.imI * x✝.imJ - x✝¹.imJ * x✝.imI + x✝¹.imK * x✝.re) +
          x✝².imI * (x✝¹.re * x✝.imJ + c₁ * x✝¹.imI * x✝.imK + x✝¹.imJ * x✝.re - c₁ * x✝¹.imK * x✝.imI) -
        x✝².imJ * (x✝¹.re * x✝.imI + x✝¹.imI * x✝.re - c₂ * x✝¹.imJ * x✝.imK + c₂ * x✝¹.imK * x✝.imJ) +
      x✝².imK * (x✝¹.re * x✝.re + c₁ * x✝¹.imI * x✝.imI + c₂ * x✝¹.imJ * x✝.imJ - c₁ * c₂ * x✝¹.imK * x✝.imK)

Next tactic:
ring
instance instRing : Ring ℍ[R,c₁,c₂] where
  __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
  left_distrib _ _ _ := by ext <;> simp <;> ring
  right_distrib _ _ _ := by ext <;> simp <;> ring
  zero_mul _ := by ext <;> simp
  mul_zero _ := by ext <;> simp
  mul_assoc _ _ _ := by ext <;> simp <;> ring
  one_mul _ := by 

Proof state:
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
src✝ : AddCommGroupWithOne ℍ[R,c₁,c₂] := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
x✝ : ℍ[R,c₁,c₂]
⊢ 1 * x✝ = x✝

Next tactic:
ext
instance instRing : Ring ℍ[R,c₁,c₂] where
  __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
  left_distrib _ _ _ := by ext <;> simp <;> ring
  right_distrib _ _ _ := by ext <;> simp <;> ring
  zero_mul _ := by ext <;> simp
  mul_zero _ := by ext <;> simp
  mul_assoc _ _ _ := by ext <;> simp <;> ring
  one_mul _ := by ext <;> 

Proof state:
case re
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
src✝ : AddCommGroupWithOne ℍ[R,c₁,c₂] := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
x✝ : ℍ[R,c₁,c₂]
⊢ (1 * x✝).re = x✝.re

Next tactic:
simp
instance instRing : Ring ℍ[R,c₁,c₂] where
  __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
  left_distrib _ _ _ := by ext <;> simp <;> ring
  right_distrib _ _ _ := by ext <;> simp <;> ring
  zero_mul _ := by ext <;> simp
  mul_zero _ := by ext <;> simp
  mul_assoc _ _ _ := by ext <;> simp <;> ring
  one_mul _ := by ext <;> 

Proof state:
case imI
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
src✝ : AddCommGroupWithOne ℍ[R,c₁,c₂] := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
x✝ : ℍ[R,c₁,c₂]
⊢ (1 * x✝).imI = x✝.imI

Next tactic:
simp
instance instRing : Ring ℍ[R,c₁,c₂] where
  __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
  left_distrib _ _ _ := by ext <;> simp <;> ring
  right_distrib _ _ _ := by ext <;> simp <;> ring
  zero_mul _ := by ext <;> simp
  mul_zero _ := by ext <;> simp
  mul_assoc _ _ _ := by ext <;> simp <;> ring
  one_mul _ := by ext <;> 

Proof state:
case imJ
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
src✝ : AddCommGroupWithOne ℍ[R,c₁,c₂] := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
x✝ : ℍ[R,c₁,c₂]
⊢ (1 * x✝).imJ = x✝.imJ

Next tactic:
simp
instance instRing : Ring ℍ[R,c₁,c₂] where
  __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
  left_distrib _ _ _ := by ext <;> simp <;> ring
  right_distrib _ _ _ := by ext <;> simp <;> ring
  zero_mul _ := by ext <;> simp
  mul_zero _ := by ext <;> simp
  mul_assoc _ _ _ := by ext <;> simp <;> ring
  one_mul _ := by ext <;> 

Proof state:
case imK
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
src✝ : AddCommGroupWithOne ℍ[R,c₁,c₂] := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
x✝ : ℍ[R,c₁,c₂]
⊢ (1 * x✝).imK = x✝.imK

Next tactic:
simp
instance instRing : Ring ℍ[R,c₁,c₂] where
  __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
  left_distrib _ _ _ := by ext <;> simp <;> ring
  right_distrib _ _ _ := by ext <;> simp <;> ring
  zero_mul _ := by ext <;> simp
  mul_zero _ := by ext <;> simp
  mul_assoc _ _ _ := by ext <;> simp <;> ring
  one_mul _ := by ext <;> simp
  mul_one _ := by 

Proof state:
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
src✝ : AddCommGroupWithOne ℍ[R,c₁,c₂] := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
x✝ : ℍ[R,c₁,c₂]
⊢ x✝ * 1 = x✝

Next tactic:
ext
instance instRing : Ring ℍ[R,c₁,c₂] where
  __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
  left_distrib _ _ _ := by ext <;> simp <;> ring
  right_distrib _ _ _ := by ext <;> simp <;> ring
  zero_mul _ := by ext <;> simp
  mul_zero _ := by ext <;> simp
  mul_assoc _ _ _ := by ext <;> simp <;> ring
  one_mul _ := by ext <;> simp
  mul_one _ := by ext <;> 

Proof state:
case re
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
src✝ : AddCommGroupWithOne ℍ[R,c₁,c₂] := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
x✝ : ℍ[R,c₁,c₂]
⊢ (x✝ * 1).re = x✝.re

Next tactic:
simp
instance instRing : Ring ℍ[R,c₁,c₂] where
  __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
  left_distrib _ _ _ := by ext <;> simp <;> ring
  right_distrib _ _ _ := by ext <;> simp <;> ring
  zero_mul _ := by ext <;> simp
  mul_zero _ := by ext <;> simp
  mul_assoc _ _ _ := by ext <;> simp <;> ring
  one_mul _ := by ext <;> simp
  mul_one _ := by ext <;> 

Proof state:
case imI
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
src✝ : AddCommGroupWithOne ℍ[R,c₁,c₂] := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
x✝ : ℍ[R,c₁,c₂]
⊢ (x✝ * 1).imI = x✝.imI

Next tactic:
simp
instance instRing : Ring ℍ[R,c₁,c₂] where
  __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
  left_distrib _ _ _ := by ext <;> simp <;> ring
  right_distrib _ _ _ := by ext <;> simp <;> ring
  zero_mul _ := by ext <;> simp
  mul_zero _ := by ext <;> simp
  mul_assoc _ _ _ := by ext <;> simp <;> ring
  one_mul _ := by ext <;> simp
  mul_one _ := by ext <;> 

Proof state:
case imJ
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
src✝ : AddCommGroupWithOne ℍ[R,c₁,c₂] := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
x✝ : ℍ[R,c₁,c₂]
⊢ (x✝ * 1).imJ = x✝.imJ

Next tactic:
simp
instance instRing : Ring ℍ[R,c₁,c₂] where
  __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
  left_distrib _ _ _ := by ext <;> simp <;> ring
  right_distrib _ _ _ := by ext <;> simp <;> ring
  zero_mul _ := by ext <;> simp
  mul_zero _ := by ext <;> simp
  mul_assoc _ _ _ := by ext <;> simp <;> ring
  one_mul _ := by ext <;> simp
  mul_one _ := by ext <;> 

Proof state:
case imK
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
src✝ : AddCommGroupWithOne ℍ[R,c₁,c₂] := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂])
x✝ : ℍ[R,c₁,c₂]
⊢ (x✝ * 1).imK = x✝.imK

Next tactic:
simp
@[norm_cast, simp]
theorem coe_mul : ((x * y : R) : ℍ[R,c₁,c₂]) = x * y := by 

Proof state:
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
⊢ ↑(x * y) = ↑x * ↑y

Next tactic:
ext
@[norm_cast, simp]
theorem coe_mul : ((x * y : R) : ℍ[R,c₁,c₂]) = x * y := by ext <;> 

Proof state:
case re
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
⊢ (↑(x * y)).re = (↑x * ↑y).re

Next tactic:
simp
@[norm_cast, simp]
theorem coe_mul : ((x * y : R) : ℍ[R,c₁,c₂]) = x * y := by ext <;> 

Proof state:
case imI
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
⊢ (↑(x * y)).imI = (↑x * ↑y).imI

Next tactic:
simp
@[norm_cast, simp]
theorem coe_mul : ((x * y : R) : ℍ[R,c₁,c₂]) = x * y := by ext <;> 

Proof state:
case imJ
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
⊢ (↑(x * y)).imJ = (↑x * ↑y).imJ

Next tactic:
simp
@[norm_cast, simp]
theorem coe_mul : ((x * y : R) : ℍ[R,c₁,c₂]) = x * y := by ext <;> 

Proof state:
case imK
S : Type u_1
T : Type u_2
R : Type u_3
inst✝ : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
⊢ (↑(x * y)).imK = (↑x * ↑y).imK

Next tactic:
simp
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by 

Proof state:
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
⊢ (fun s => ↑((algebraMap S R) s)) 1 = 1

Next tactic:
simp only [map_one, coe_one]
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by simp only [map_zero, coe_zero]
  map_mul' x y := by 

Proof state:
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x✝ y✝ z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
x y : S
⊢ OneHom.toFun { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) } (x * y) =
    OneHom.toFun { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) } x *
      OneHom.toFun { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) } y

Next tactic:
simp only [map_mul, coe_mul]
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by 

Proof state:
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x y z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
          map_mul' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) })
      0 =
    0

Next tactic:
simp only [map_zero, coe_zero]
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by simp only [map_zero, coe_zero]
  map_mul' x y := by simp only [map_mul, coe_mul]
  map_add' x y := by 

Proof state:
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x✝ y✝ z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
x y : S
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
          map_mul' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) })
      (x + y) =
    OneHom.toFun
        (↑{ toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
            map_mul' :=
              (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) })
        x +
      OneHom.toFun
        (↑{ toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
            map_mul' :=
              (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) })
        y

Next tactic:
simp only [map_add, coe_add]
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by simp only [map_zero, coe_zero]
  map_mul' x y := by simp only [map_mul, coe_mul]
  map_add' x y := by simp only [map_add, coe_add]
  smul_def' s x := by ext <;> simp [Algebra.smul_def]
  commutes' s x := by 

Proof state:
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x✝ y z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
x : ℍ[R,c₁,c₂]
⊢ {
          toMonoidHom :=
            { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
              map_mul' :=
                (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
          map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
          map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
        s *
      x =
    x *
      {
          toMonoidHom :=
            { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
              map_mul' :=
                (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
          map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
          map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
        s

Next tactic:
ext
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by simp only [map_zero, coe_zero]
  map_mul' x y := by simp only [map_mul, coe_mul]
  map_add' x y := by simp only [map_add, coe_add]
  smul_def' s x := by ext <;> simp [Algebra.smul_def]
  commutes' s x := by ext <;> 

Proof state:
case re
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x✝ y z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
x : ℍ[R,c₁,c₂]
⊢ ({
            toMonoidHom :=
              { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
                map_mul' :=
                  (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
            map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
            map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
          s *
        x).re =
    (x *
        {
            toMonoidHom :=
              { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
                map_mul' :=
                  (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
            map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
            map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
          s).re

Next tactic:
simp [Algebra.commutes]
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by simp only [map_zero, coe_zero]
  map_mul' x y := by simp only [map_mul, coe_mul]
  map_add' x y := by simp only [map_add, coe_add]
  smul_def' s x := by ext <;> simp [Algebra.smul_def]
  commutes' s x := by ext <;> 

Proof state:
case imI
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x✝ y z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
x : ℍ[R,c₁,c₂]
⊢ ({
            toMonoidHom :=
              { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
                map_mul' :=
                  (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
            map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
            map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
          s *
        x).imI =
    (x *
        {
            toMonoidHom :=
              { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
                map_mul' :=
                  (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
            map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
            map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
          s).imI

Next tactic:
simp [Algebra.commutes]
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by simp only [map_zero, coe_zero]
  map_mul' x y := by simp only [map_mul, coe_mul]
  map_add' x y := by simp only [map_add, coe_add]
  smul_def' s x := by ext <;> simp [Algebra.smul_def]
  commutes' s x := by ext <;> 

Proof state:
case imJ
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x✝ y z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
x : ℍ[R,c₁,c₂]
⊢ ({
            toMonoidHom :=
              { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
                map_mul' :=
                  (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
            map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
            map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
          s *
        x).imJ =
    (x *
        {
            toMonoidHom :=
              { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
                map_mul' :=
                  (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
            map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
            map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
          s).imJ

Next tactic:
simp [Algebra.commutes]
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by simp only [map_zero, coe_zero]
  map_mul' x y := by simp only [map_mul, coe_mul]
  map_add' x y := by simp only [map_add, coe_add]
  smul_def' s x := by ext <;> simp [Algebra.smul_def]
  commutes' s x := by ext <;> 

Proof state:
case imK
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x✝ y z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
x : ℍ[R,c₁,c₂]
⊢ ({
            toMonoidHom :=
              { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
                map_mul' :=
                  (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
            map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
            map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
          s *
        x).imK =
    (x *
        {
            toMonoidHom :=
              { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
                map_mul' :=
                  (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
            map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
            map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
          s).imK

Next tactic:
simp [Algebra.commutes]
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by simp only [map_zero, coe_zero]
  map_mul' x y := by simp only [map_mul, coe_mul]
  map_add' x y := by simp only [map_add, coe_add]
  smul_def' s x := by 

Proof state:
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x✝ y z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
x : ℍ[R,c₁,c₂]
⊢ s • x =
    {
          toMonoidHom :=
            { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
              map_mul' :=
                (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
          map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
          map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
        s *
      x

Next tactic:
ext
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by simp only [map_zero, coe_zero]
  map_mul' x y := by simp only [map_mul, coe_mul]
  map_add' x y := by simp only [map_add, coe_add]
  smul_def' s x := by ext <;> 

Proof state:
case re
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x✝ y z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
x : ℍ[R,c₁,c₂]
⊢ (s • x).re =
    ({
            toMonoidHom :=
              { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
                map_mul' :=
                  (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
            map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
            map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
          s *
        x).re

Next tactic:
simp [Algebra.smul_def]
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by simp only [map_zero, coe_zero]
  map_mul' x y := by simp only [map_mul, coe_mul]
  map_add' x y := by simp only [map_add, coe_add]
  smul_def' s x := by ext <;> 

Proof state:
case imI
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x✝ y z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
x : ℍ[R,c₁,c₂]
⊢ (s • x).imI =
    ({
            toMonoidHom :=
              { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
                map_mul' :=
                  (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
            map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
            map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
          s *
        x).imI

Next tactic:
simp [Algebra.smul_def]
instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂] where
  smul := (· • ·)
  toFun s := coe (algebraMap S R s)
  map_one' := by simp only [map_one, coe_one]
  map_zero' := by simp only [map_zero, coe_zero]
  map_mul' x y := by simp only [map_mul, coe_mul]
  map_add' x y := by simp only [map_add, coe_add]
  smul_def' s x := by ext <;> 

Proof state:
case imJ
S : Type u_1
T : Type u_2
R : Type u_3
inst✝² : CommRing R
c₁ c₂ r x✝ y z : R
a b c : ℍ[R,c₁,c₂]
inst✝¹ : CommSemiring S
inst✝ : Algebra S R
s : S
x : ℍ[R,c₁,c₂]
⊢ (s • x).imJ =
    ({
            toMonoidHom :=
              { toOneHom := { toFun := fun s => ↑((algebraMap S R) s), map_one' := (_ : ↑((algebraMap S R) 1) = 1) },
                map_mul' :=
                  (_ : ∀ (x y : S), ↑((algebraMap S R) (x * y)) = ↑((algebraMap S R) x) * ↑((algebraMap S R) y)) },
            map_zero' := (_ : ↑((algebraMap S R) 0) = 0),
            map_add' := (_ : ∀ (x y : S), ↑((algebraMap S R) (x + y)) = ↑((algebraMap S R) x) + ↑((algebraMap S R) y)) }
          s *
        x).imJ

Next tactic:
simp [Algebra.smul_def]