l3lab/ntp-mathlib huggingface dataset:
instance instSemiring (r : R → R → Prop) : Semiring (RingQuot r) where
  natCast := natCast r
  natCast_zero := by simp [Nat.cast, natCast, ← zero_quot]
  natCast_succ := by simp [Nat.cast, natCast, ← one_quot, add_quot]
  left_distrib := by
    rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩ ⟨⟨⟩⟩
    simp only [mul_quot, add_quot, left_distrib]
  right_distrib := by
    rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩ ⟨⟨⟩⟩
    

Proof state:
case mk.mk.mk.mk.mk.mk
R : Type uR
inst✝³ : Semiring R
S : Type uS
inst✝² : CommSemiring S
T : Type uT
A : Type uA
inst✝¹ : Semiring A
inst✝ : Algebra S A
r✝ r : R → R → Prop
src✝¹ : AddCommMonoid (RingQuot r) := instAddCommMonoid r
src✝ : MonoidWithZero (RingQuot r) := instMonoidWithZero r
toQuot✝² : Quot (Rel r)
a✝² : R
toQuot✝¹ : Quot (Rel r)
a✝¹ : R
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ ({ toQuot := Quot.mk (Rel r) a✝² } + { toQuot := Quot.mk (Rel r) a✝¹ }) * { toQuot := Quot.mk (Rel r) a✝ } =
    { toQuot := Quot.mk (Rel r) a✝² } * { toQuot := Quot.mk (Rel r) a✝ } +
      { toQuot := Quot.mk (Rel r) a✝¹ } * { toQuot := Quot.mk (Rel r) a✝ }

Next tactic:
simp only [mul_quot, add_quot, right_distrib]
instance instSemiring (r : R → R → Prop) : Semiring (RingQuot r) where
  natCast := natCast r
  natCast_zero := by 

Proof state:
R : Type uR
inst✝³ : Semiring R
S : Type uS
inst✝² : CommSemiring S
T : Type uT
A : Type uA
inst✝¹ : Semiring A
inst✝ : Algebra S A
r✝ r : R → R → Prop
src✝¹ : AddCommMonoid (RingQuot r) := instAddCommMonoid r
src✝ : MonoidWithZero (RingQuot r) := instMonoidWithZero r
⊢ NatCast.natCast 0 = 0

Next tactic:
simp [Nat.cast, natCast, ← zero_quot]
instance instSemiring (r : R → R → Prop) : Semiring (RingQuot r) where
  natCast := natCast r
  natCast_zero := by simp [Nat.cast, natCast, ← zero_quot]
  natCast_succ := by 

Proof state:
R : Type uR
inst✝³ : Semiring R
S : Type uS
inst✝² : CommSemiring S
T : Type uT
A : Type uA
inst✝¹ : Semiring A
inst✝ : Algebra S A
r✝ r : R → R → Prop
src✝¹ : AddCommMonoid (RingQuot r) := instAddCommMonoid r
src✝ : MonoidWithZero (RingQuot r) := instMonoidWithZero r
⊢ ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1

Next tactic:
simp [Nat.cast, natCast, ← one_quot, add_quot]
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      simp [neg_quot, add_quot, ← zero_quot]
    sub := Sub.sub
    sub_eq_add_neg := by
      

Proof state:
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
⊢ ∀ (a b : RingQuot r), a - b = a + -b

Next tactic:
rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      simp [neg_quot, add_quot, ← zero_quot]
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
      

Proof state:
case mk.mk.mk.mk
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
toQuot✝¹ : Quot (Rel r)
a✝¹ : R
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ { toQuot := Quot.mk (Rel r) a✝¹ } - { toQuot := Quot.mk (Rel r) a✝ } =
    { toQuot := Quot.mk (Rel r) a✝¹ } + -{ toQuot := Quot.mk (Rel r) a✝ }

Next tactic:
simp [neg_quot, sub_quot, add_quot, sub_eq_add_neg]
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      simp [neg_quot, add_quot, ← zero_quot]
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
      simp [neg_quot, sub_quot, add_quot, sub_eq_add_neg]
    zsmul := (· • ·)
    zsmul_zero' := by
      

Proof state:
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
⊢ ∀ (a : RingQuot r), (fun x x_1 => x • x_1) 0 a = 0

Next tactic:
rintro ⟨⟨⟩⟩
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      simp [neg_quot, add_quot, ← zero_quot]
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
      simp [neg_quot, sub_quot, add_quot, sub_eq_add_neg]
    zsmul := (· • ·)
    zsmul_zero' := by
      rintro ⟨⟨⟩⟩
      

Proof state:
case mk.mk
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ (fun x x_1 => x • x_1) 0 { toQuot := Quot.mk (Rel r) a✝ } = 0

Next tactic:
simp [smul_quot, ← zero_quot]
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      simp [neg_quot, add_quot, ← zero_quot]
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
      simp [neg_quot, sub_quot, add_quot, sub_eq_add_neg]
    zsmul := (· • ·)
    zsmul_zero' := by
      rintro ⟨⟨⟩⟩
      simp [smul_quot, ← zero_quot]
    zsmul_succ' := by
      

Proof state:
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
⊢ ∀ (n : ℕ) (a : RingQuot r),
    (fun x x_1 => x • x_1) (Int.ofNat (Nat.succ n)) a = a + (fun x x_1 => x • x_1) (Int.ofNat n) a

Next tactic:
rintro n ⟨⟨⟩⟩
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      simp [neg_quot, add_quot, ← zero_quot]
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
      simp [neg_quot, sub_quot, add_quot, sub_eq_add_neg]
    zsmul := (· • ·)
    zsmul_zero' := by
      rintro ⟨⟨⟩⟩
      simp [smul_quot, ← zero_quot]
    zsmul_succ' := by
      rintro n ⟨⟨⟩⟩
      

Proof state:
case mk.mk
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
n : ℕ
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ (fun x x_1 => x • x_1) (Int.ofNat (Nat.succ n)) { toQuot := Quot.mk (Rel r) a✝ } =
    { toQuot := Quot.mk (Rel r) a✝ } + (fun x x_1 => x • x_1) (Int.ofNat n) { toQuot := Quot.mk (Rel r) a✝ }

Next tactic:
simp [smul_quot, add_quot, add_mul, add_comm]
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      simp [neg_quot, add_quot, ← zero_quot]
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
      simp [neg_quot, sub_quot, add_quot, sub_eq_add_neg]
    zsmul := (· • ·)
    zsmul_zero' := by
      rintro ⟨⟨⟩⟩
      simp [smul_quot, ← zero_quot]
    zsmul_succ' := by
      rintro n ⟨⟨⟩⟩
      simp [smul_quot, add_quot, add_mul, add_comm]
    zsmul_neg' := by
      

Proof state:
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
⊢ ∀ (n : ℕ) (a : RingQuot r), (fun x x_1 => x • x_1) (Int.negSucc n) a = -(fun x x_1 => x • x_1) (↑(Nat.succ n)) a

Next tactic:
rintro n ⟨⟨⟩⟩
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      simp [neg_quot, add_quot, ← zero_quot]
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
      simp [neg_quot, sub_quot, add_quot, sub_eq_add_neg]
    zsmul := (· • ·)
    zsmul_zero' := by
      rintro ⟨⟨⟩⟩
      simp [smul_quot, ← zero_quot]
    zsmul_succ' := by
      rintro n ⟨⟨⟩⟩
      simp [smul_quot, add_quot, add_mul, add_comm]
    zsmul_neg' := by
      rintro n ⟨⟨⟩⟩
      

Proof state:
case mk.mk
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
n : ℕ
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ (fun x x_1 => x • x_1) (Int.negSucc n) { toQuot := Quot.mk (Rel r) a✝ } =
    -(fun x x_1 => x • x_1) ↑(Nat.succ n) { toQuot := Quot.mk (Rel r) a✝ }

Next tactic:
simp [smul_quot, neg_quot, add_mul]
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      

Proof state:
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
⊢ ∀ (a : RingQuot r), -a + a = 0

Next tactic:
rintro ⟨⟨⟩⟩
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      

Proof state:
case mk.mk
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ -{ toQuot := Quot.mk (Rel r) a✝ } + { toQuot := Quot.mk (Rel r) a✝ } = 0

Next tactic:
simp [neg_quot, add_quot, ← zero_quot]
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      simp [neg_quot, add_quot, ← zero_quot]
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
      simp [neg_quot, sub_quot, add_quot, sub_eq_add_neg]
    zsmul := (· • ·)
    zsmul_zero' := by
      rintro ⟨⟨⟩⟩
      simp [smul_quot, ← zero_quot]
    zsmul_succ' := by
      rintro n ⟨⟨⟩⟩
      simp [smul_quot, add_quot, add_mul, add_comm]
    zsmul_neg' := by
      rintro n ⟨⟨⟩⟩
      simp [smul_quot, neg_quot, add_mul]
    intCast := intCast r
    intCast_ofNat := fun n => congrArg RingQuot.mk <| by
      

Proof state:
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
n : ℕ
⊢ Quot.mk (Rel r) ↑↑n = Quot.mk (Rel r) ↑n

Next tactic:
exact congrArg (Quot.mk _) (Int.cast_ofNat _)
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      simp [neg_quot, add_quot, ← zero_quot]
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
      simp [neg_quot, sub_quot, add_quot, sub_eq_add_neg]
    zsmul := (· • ·)
    zsmul_zero' := by
      rintro ⟨⟨⟩⟩
      simp [smul_quot, ← zero_quot]
    zsmul_succ' := by
      rintro n ⟨⟨⟩⟩
      simp [smul_quot, add_quot, add_mul, add_comm]
    zsmul_neg' := by
      rintro n ⟨⟨⟩⟩
      simp [smul_quot, neg_quot, add_mul]
    intCast := intCast r
    intCast_ofNat := fun n => congrArg RingQuot.mk <| by
      exact congrArg (Quot.mk _) (Int.cast_ofNat _)
    intCast_negSucc := fun n => congrArg RingQuot.mk <| by
      

Proof state:
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
n : ℕ
⊢ Quot.mk (Rel r) ↑(Int.negSucc n) = (RingQuot.neg r ↑(n + 1)).toQuot

Next tactic:
simp_rw [neg_def]
instance instRing {R : Type uR} [Ring R] (r : R → R → Prop) : Ring (RingQuot r) :=
  { RingQuot.instSemiring r with
    neg := Neg.neg
    add_left_neg := by
      rintro ⟨⟨⟩⟩
      simp [neg_quot, add_quot, ← zero_quot]
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
      simp [neg_quot, sub_quot, add_quot, sub_eq_add_neg]
    zsmul := (· • ·)
    zsmul_zero' := by
      rintro ⟨⟨⟩⟩
      simp [smul_quot, ← zero_quot]
    zsmul_succ' := by
      rintro n ⟨⟨⟩⟩
      simp [smul_quot, add_quot, add_mul, add_comm]
    zsmul_neg' := by
      rintro n ⟨⟨⟩⟩
      simp [smul_quot, neg_quot, add_mul]
    intCast := intCast r
    intCast_ofNat := fun n => congrArg RingQuot.mk <| by
      exact congrArg (Quot.mk _) (Int.cast_ofNat _)
    intCast_negSucc := fun n => congrArg RingQuot.mk <| by
      simp_rw [neg_def]
      

Proof state:
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : Ring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
n : ℕ
⊢ Quot.mk (Rel r) ↑(Int.negSucc n) =
    Quot.map (fun a => -a) (_ : ∀ ⦃a b : R⦄, Rel r a b → Rel r (-a) (-b)) (RingQuot.natCast r (n + 1)).toQuot

Next tactic:
exact congrArg (Quot.mk _) (Int.cast_negSucc n)
instance instCommSemiring {R : Type uR} [CommSemiring R] (r : R → R → Prop) :
  CommSemiring (RingQuot r) :=
  { RingQuot.instSemiring r with
    mul_comm := by
      

Proof state:
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : CommSemiring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
⊢ ∀ (a b : RingQuot r), a * b = b * a

Next tactic:
rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
instance instCommSemiring {R : Type uR} [CommSemiring R] (r : R → R → Prop) :
  CommSemiring (RingQuot r) :=
  { RingQuot.instSemiring r with
    mul_comm := by
      rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
      

Proof state:
case mk.mk.mk.mk
R✝ : Type uR
inst✝⁴ : Semiring R✝
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R✝ → R✝ → Prop
R : Type uR
inst✝ : CommSemiring R
r : R → R → Prop
src✝ : Semiring (RingQuot r) := instSemiring r
toQuot✝¹ : Quot (Rel r)
a✝¹ : R
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ { toQuot := Quot.mk (Rel r) a✝¹ } * { toQuot := Quot.mk (Rel r) a✝ } =
    { toQuot := Quot.mk (Rel r) a✝ } * { toQuot := Quot.mk (Rel r) a✝¹ }

Next tactic:
simp [mul_quot, mul_comm]
instance instAlgebra [Algebra S R] (r : R → R → Prop) : Algebra S (RingQuot r) where
  smul := (· • ·)
  toFun r := ⟨Quot.mk _ (algebraMap S R r)⟩
  map_one' := by 

Proof state:
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Algebra S R
r : R → R → Prop
⊢ (fun r_1 => { toQuot := Quot.mk (Rel r) ((algebraMap S R) r_1) }) 1 = 1

Next tactic:
simp [← one_quot]
instance instAlgebra [Algebra S R] (r : R → R → Prop) : Algebra S (RingQuot r) where
  smul := (· • ·)
  toFun r := ⟨Quot.mk _ (algebraMap S R r)⟩
  map_one' := by simp [← one_quot]
  map_mul' := by 

Proof state:
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Algebra S R
r : R → R → Prop
⊢ ∀ (x y : S),
    OneHom.toFun
        { toFun := fun r_1 => { toQuot := Quot.mk (Rel r) ((algebraMap S R) r_1) },
          map_one' := (_ : { toQuot := Quot.mk (Rel r) ((algebraMap S R) 1) } = 1) }
        (x * y) =
      OneHom.toFun
          { toFun := fun r_1 => { toQuot := Quot.mk (Rel r) ((algebraMap S R) r_1) },
            map_one' := (_ : { toQuot := Quot.mk (Rel r) ((algebraMap S R) 1) } = 1) }
          x *
        OneHom.toFun
          { toFun := fun r_1 => { toQuot := Quot.mk (Rel r) ((algebraMap S R) r_1) },
            map_one' := (_ : { toQuot := Quot.mk (Rel r) ((algebraMap S R) 1) } = 1) }
          y

Next tactic:
simp [mul_quot]
instance instAlgebra [Algebra S R] (r : R → R → Prop) : Algebra S (RingQuot r) where
  smul := (· • ·)
  toFun r := ⟨Quot.mk _ (algebraMap S R r)⟩
  map_one' := by simp [← one_quot]
  map_mul' := by simp [mul_quot]
  map_zero' := by 

Proof state:
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Algebra S R
r : R → R → Prop
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun r_1 => { toQuot := Quot.mk (Rel r) ((algebraMap S R) r_1) },
              map_one' := (_ : { toQuot := Quot.mk (Rel r) ((algebraMap S R) 1) } = 1) },
          map_mul' :=
            (_ :
              ∀ (a a_1 : S),
                { toQuot := Quot.mk (Rel r) ((algebraMap S R) (a * a_1)) } =
                  { toQuot := Quot.mk (Rel r) ((algebraMap S R) a) } *
                    { toQuot := Quot.mk (Rel r) ((algebraMap S R) a_1) }) })
      0 =
    0

Next tactic:
simp [← zero_quot]
instance instAlgebra [Algebra S R] (r : R → R → Prop) : Algebra S (RingQuot r) where
  smul := (· • ·)
  toFun r := ⟨Quot.mk _ (algebraMap S R r)⟩
  map_one' := by simp [← one_quot]
  map_mul' := by simp [mul_quot]
  map_zero' := by simp [← zero_quot]
  map_add' := by 

Proof state:
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Algebra S R
r : R → R → Prop
⊢ ∀ (x y : S),
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun r_1 => { toQuot := Quot.mk (Rel r) ((algebraMap S R) r_1) },
                map_one' := (_ : { toQuot := Quot.mk (Rel r) ((algebraMap S R) 1) } = 1) },
            map_mul' :=
              (_ :
                ∀ (a a_1 : S),
                  { toQuot := Quot.mk (Rel r) ((algebraMap S R) (a * a_1)) } =
                    { toQuot := Quot.mk (Rel r) ((algebraMap S R) a) } *
                      { toQuot := Quot.mk (Rel r) ((algebraMap S R) a_1) }) })
        (x + y) =
      OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun r_1 => { toQuot := Quot.mk (Rel r) ((algebraMap S R) r_1) },
                  map_one' := (_ : { toQuot := Quot.mk (Rel r) ((algebraMap S R) 1) } = 1) },
              map_mul' :=
                (_ :
                  ∀ (a a_1 : S),
                    { toQuot := Quot.mk (Rel r) ((algebraMap S R) (a * a_1)) } =
                      { toQuot := Quot.mk (Rel r) ((algebraMap S R) a) } *
                        { toQuot := Quot.mk (Rel r) ((algebraMap S R) a_1) }) })
          x +
        OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun r_1 => { toQuot := Quot.mk (Rel r) ((algebraMap S R) r_1) },
                  map_one' := (_ : { toQuot := Quot.mk (Rel r) ((algebraMap S R) 1) } = 1) },
              map_mul' :=
                (_ :
                  ∀ (a a_1 : S),
                    { toQuot := Quot.mk (Rel r) ((algebraMap S R) (a * a_1)) } =
                      { toQuot := Quot.mk (Rel r) ((algebraMap S R) a) } *
                        { toQuot := Quot.mk (Rel r) ((algebraMap S R) a_1) }) })
          y

Next tactic:
simp [add_quot]
instance instAlgebra [Algebra S R] (r : R → R → Prop) : Algebra S (RingQuot r) where
  smul := (· • ·)
  toFun r := ⟨Quot.mk _ (algebraMap S R r)⟩
  map_one' := by simp [← one_quot]
  map_mul' := by simp [mul_quot]
  map_zero' := by simp [← zero_quot]
  map_add' := by simp [add_quot]
  commutes' r := by
    

Proof state:
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝¹ : R → R → Prop
inst✝ : Algebra S R
r✝ : R → R → Prop
r : S
⊢ ∀ (x : RingQuot r✝),
    {
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun r => { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) r) },
                    map_one' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 1) } = 1) },
                map_mul' :=
                  (_ :
                    ∀ (a a_1 : S),
                      { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a * a_1)) } =
                        { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } *
                          { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) },
            map_zero' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 0) } = 0),
            map_add' :=
              (_ :
                ∀ (a a_1 : S),
                  { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a + a_1)) } =
                    { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } +
                      { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) }
          r *
        x =
      x *
        {
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun r => { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) r) },
                    map_one' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 1) } = 1) },
                map_mul' :=
                  (_ :
                    ∀ (a a_1 : S),
                      { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a * a_1)) } =
                        { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } *
                          { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) },
            map_zero' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 0) } = 0),
            map_add' :=
              (_ :
                ∀ (a a_1 : S),
                  { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a + a_1)) } =
                    { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } +
                      { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) }
          r

Next tactic:
rintro ⟨⟨a⟩⟩