[GOAL]
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
a b c : R
h : Rel r b c
⊢ Rel r (a + b) (a + c)
[PROOFSTEP]
rw [add_comm a b, add_comm a c]
[GOAL]
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
a b c : R
h : Rel r b c
⊢ Rel r (b + a) (c + a)
[PROOFSTEP]
exact Rel.add_left h
[GOAL]
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 : Type uR
inst✝ : Ring R
r : R → R → Prop
a b : R
h : Rel r a b
⊢ Rel r (-a) (-b)
[PROOFSTEP]
simp only [neg_eq_neg_one_mul a, neg_eq_neg_one_mul b, Rel.mul_right h]
[GOAL]
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 : Type uR
inst✝ : Ring R
r : R → R → Prop
a b c : R
h : Rel r a b
⊢ Rel r (a - c) (b - c)
[PROOFSTEP]
simp only [sub_eq_add_neg, h.add_left]
[GOAL]
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 : Type uR
inst✝ : Ring R
r : R → R → Prop
a b c : R
h : Rel r b c
⊢ Rel r (a - b) (a - c)
[PROOFSTEP]
simp only [sub_eq_add_neg, h.neg.add_right]
[GOAL]
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 : A → A → Prop
k : S
a b : A
h : Rel r a b
⊢ Rel r (k • a) (k • b)
[PROOFSTEP]
simp only [Algebra.smul_def, Rel.mul_right h]
[GOAL]
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
a b c d : R
hab : Setoid.r a b
hcd : Setoid.r c d
⊢ Setoid.r (a + c) (b + d)
[PROOFSTEP]
induction hab generalizing c d with
| rel _ _ hab =>
  refine' (EqvGen.rel _ _ hab.add_left).trans _ _ _ _
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
| refl =>
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
| symm x y _ hxy => exact (hxy hcd.symm).symm
| trans x y z _ _ h h' => exact (h hcd).trans _ _ _ (h' <| EqvGen.refl _)
[GOAL]
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
a b c d : R
hab : Setoid.r a b
hcd : Setoid.r c d
⊢ Setoid.r (a + c) (b + d)
[PROOFSTEP]
induction hab generalizing c d with
| rel _ _ hab =>
  refine' (EqvGen.rel _ _ hab.add_left).trans _ _ _ _
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
| refl =>
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
| symm x y _ hxy => exact (hxy hcd.symm).symm
| trans x y z _ _ h h' => exact (h hcd).trans _ _ _ (h' <| EqvGen.refl _)
[GOAL]
case rel
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
a b x✝ y✝ : R
hab : Rel r x✝ y✝
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x✝ + c) (y✝ + d)
[PROOFSTEP]

| rel _ _ hab =>
  refine' (EqvGen.rel _ _ hab.add_left).trans _ _ _ _
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case rel
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
a b x✝ y✝ : R
hab : Rel r x✝ y✝
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x✝ + c) (y✝ + d)
[PROOFSTEP]
refine' (EqvGen.rel _ _ hab.add_left).trans _ _ _ _
[GOAL]
case rel
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
a b x✝ y✝ : R
hab : Rel r x✝ y✝
c d : R
hcd : Setoid.r c d
⊢ EqvGen (Rel r) (y✝ + c) (y✝ + d)
[PROOFSTEP]
induction hcd with
| rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
| refl => exact EqvGen.refl _
| symm _ _ _ h => exact h.symm _ _
| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case rel
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
a b x✝ y✝ : R
hab : Rel r x✝ y✝
c d : R
hcd : Setoid.r c d
⊢ EqvGen (Rel r) (y✝ + c) (y✝ + d)
[PROOFSTEP]
induction hcd with
| rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
| refl => exact EqvGen.refl _
| symm _ _ _ h => exact h.symm _ _
| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case rel.rel
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ : R
hcd : Rel r x✝ y✝
⊢ EqvGen (Rel r) (y✝¹ + x✝) (y✝¹ + y✝)
[PROOFSTEP]

| rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
[GOAL]
case rel.rel
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ : R
hcd : Rel r x✝ y✝
⊢ EqvGen (Rel r) (y✝¹ + x✝) (y✝¹ + y✝)
[PROOFSTEP]
exact EqvGen.rel _ _ hcd.add_right
[GOAL]
case rel.refl
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
a b x✝¹ y✝ : R
hab : Rel r x✝¹ y✝
c d x✝ : R
⊢ EqvGen (Rel r) (y✝ + x✝) (y✝ + x✝)
[PROOFSTEP]

| refl => exact EqvGen.refl _
[GOAL]
case rel.refl
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
a b x✝¹ y✝ : R
hab : Rel r x✝¹ y✝
c d x✝ : R
⊢ EqvGen (Rel r) (y✝ + x✝) (y✝ + x✝)
[PROOFSTEP]
exact EqvGen.refl _
[GOAL]
case rel.symm
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ : R
a✝ : EqvGen (Rel r) x✝ y✝
h : EqvGen (Rel r) (y✝¹ + x✝) (y✝¹ + y✝)
⊢ EqvGen (Rel r) (y✝¹ + y✝) (y✝¹ + x✝)
[PROOFSTEP]

| symm _ _ _ h => exact h.symm _ _
[GOAL]
case rel.symm
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ : R
a✝ : EqvGen (Rel r) x✝ y✝
h : EqvGen (Rel r) (y✝¹ + x✝) (y✝¹ + y✝)
⊢ EqvGen (Rel r) (y✝¹ + y✝) (y✝¹ + x✝)
[PROOFSTEP]
exact h.symm _ _
[GOAL]
case rel.trans
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ z✝ : R
a✝¹ : EqvGen (Rel r) x✝ y✝
a✝ : EqvGen (Rel r) y✝ z✝
h : EqvGen (Rel r) (y✝¹ + x✝) (y✝¹ + y✝)
h' : EqvGen (Rel r) (y✝¹ + y✝) (y✝¹ + z✝)
⊢ EqvGen (Rel r) (y✝¹ + x✝) (y✝¹ + z✝)
[PROOFSTEP]

| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case rel.trans
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ z✝ : R
a✝¹ : EqvGen (Rel r) x✝ y✝
a✝ : EqvGen (Rel r) y✝ z✝
h : EqvGen (Rel r) (y✝¹ + x✝) (y✝¹ + y✝)
h' : EqvGen (Rel r) (y✝¹ + y✝) (y✝¹ + z✝)
⊢ EqvGen (Rel r) (y✝¹ + x✝) (y✝¹ + z✝)
[PROOFSTEP]
exact h.trans _ _ _ h'
[GOAL]
case refl
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
a b x✝ c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x✝ + c) (x✝ + d)
[PROOFSTEP]

| refl =>
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case refl
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
a b x✝ c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x✝ + c) (x✝ + d)
[PROOFSTEP]
induction hcd with
| rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
| refl => exact EqvGen.refl _
| symm _ _ _ h => exact h.symm _ _
| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case refl
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
a b x✝ c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x✝ + c) (x✝ + d)
[PROOFSTEP]
induction hcd with
| rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
| refl => exact EqvGen.refl _
| symm _ _ _ h => exact h.symm _ _
| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case refl.rel
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
a b x✝¹ c d x✝ y✝ : R
hcd : Rel r x✝ y✝
⊢ Setoid.r (x✝¹ + x✝) (x✝¹ + y✝)
[PROOFSTEP]

| rel _ _ hcd => exact EqvGen.rel _ _ hcd.add_right
[GOAL]
case refl.rel
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
a b x✝¹ c d x✝ y✝ : R
hcd : Rel r x✝ y✝
⊢ Setoid.r (x✝¹ + x✝) (x✝¹ + y✝)
[PROOFSTEP]
exact EqvGen.rel _ _ hcd.add_right
[GOAL]
case refl.refl
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
a b x✝¹ c d x✝ : R
⊢ Setoid.r (x✝¹ + x✝) (x✝¹ + x✝)
[PROOFSTEP]

| refl => exact EqvGen.refl _
[GOAL]
case refl.refl
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
a b x✝¹ c d x✝ : R
⊢ Setoid.r (x✝¹ + x✝) (x✝¹ + x✝)
[PROOFSTEP]
exact EqvGen.refl _
[GOAL]
case refl.symm
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
a b x✝¹ c d x✝ y✝ : R
a✝ : EqvGen (Rel r) x✝ y✝
h : Setoid.r (x✝¹ + x✝) (x✝¹ + y✝)
⊢ Setoid.r (x✝¹ + y✝) (x✝¹ + x✝)
[PROOFSTEP]

| symm _ _ _ h => exact h.symm _ _
[GOAL]
case refl.symm
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
a b x✝¹ c d x✝ y✝ : R
a✝ : EqvGen (Rel r) x✝ y✝
h : Setoid.r (x✝¹ + x✝) (x✝¹ + y✝)
⊢ Setoid.r (x✝¹ + y✝) (x✝¹ + x✝)
[PROOFSTEP]
exact h.symm _ _
[GOAL]
case refl.trans
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
a b x✝¹ c d x✝ y✝ z✝ : R
a✝¹ : EqvGen (Rel r) x✝ y✝
a✝ : EqvGen (Rel r) y✝ z✝
h : Setoid.r (x✝¹ + x✝) (x✝¹ + y✝)
h' : Setoid.r (x✝¹ + y✝) (x✝¹ + z✝)
⊢ Setoid.r (x✝¹ + x✝) (x✝¹ + z✝)
[PROOFSTEP]

| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case refl.trans
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
a b x✝¹ c d x✝ y✝ z✝ : R
a✝¹ : EqvGen (Rel r) x✝ y✝
a✝ : EqvGen (Rel r) y✝ z✝
h : Setoid.r (x✝¹ + x✝) (x✝¹ + y✝)
h' : Setoid.r (x✝¹ + y✝) (x✝¹ + z✝)
⊢ Setoid.r (x✝¹ + x✝) (x✝¹ + z✝)
[PROOFSTEP]
exact h.trans _ _ _ h'
[GOAL]
case symm
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
a b x y : R
a✝ : EqvGen (Rel r) x y
hxy : ∀ {c d : R}, Setoid.r c d → Setoid.r (x + c) (y + d)
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (y + c) (x + d)
[PROOFSTEP]

| symm x y _ hxy => exact (hxy hcd.symm).symm
[GOAL]
case symm
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
a b x y : R
a✝ : EqvGen (Rel r) x y
hxy : ∀ {c d : R}, Setoid.r c d → Setoid.r (x + c) (y + d)
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (y + c) (x + d)
[PROOFSTEP]
exact (hxy hcd.symm).symm
[GOAL]
case trans
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
a b x y z : R
a✝¹ : EqvGen (Rel r) x y
a✝ : EqvGen (Rel r) y z
h : ∀ {c d : R}, Setoid.r c d → Setoid.r (x + c) (y + d)
h' : ∀ {c d : R}, Setoid.r c d → Setoid.r (y + c) (z + d)
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x + c) (z + d)
[PROOFSTEP]

| trans x y z _ _ h h' => exact (h hcd).trans _ _ _ (h' <| EqvGen.refl _)
[GOAL]
case trans
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
a b x y z : R
a✝¹ : EqvGen (Rel r) x y
a✝ : EqvGen (Rel r) y z
h : ∀ {c d : R}, Setoid.r c d → Setoid.r (x + c) (y + d)
h' : ∀ {c d : R}, Setoid.r c d → Setoid.r (y + c) (z + d)
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x + c) (z + d)
[PROOFSTEP]
exact (h hcd).trans _ _ _ (h' <| EqvGen.refl _)
[GOAL]
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
a b c d : R
hab : Setoid.r a b
hcd : Setoid.r c d
⊢ Setoid.r (a * c) (b * d)
[PROOFSTEP]
induction hab generalizing c d with
| rel _ _ hab =>
  refine' (EqvGen.rel _ _ hab.mul_left).trans _ _ _ _
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
| refl =>
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
| symm x y _ hxy => exact (hxy hcd.symm).symm
| trans x y z _ _ h h' => exact (h hcd).trans _ _ _ (h' <| EqvGen.refl _)
[GOAL]
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
a b c d : R
hab : Setoid.r a b
hcd : Setoid.r c d
⊢ Setoid.r (a * c) (b * d)
[PROOFSTEP]
induction hab generalizing c d with
| rel _ _ hab =>
  refine' (EqvGen.rel _ _ hab.mul_left).trans _ _ _ _
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
| refl =>
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
| symm x y _ hxy => exact (hxy hcd.symm).symm
| trans x y z _ _ h h' => exact (h hcd).trans _ _ _ (h' <| EqvGen.refl _)
[GOAL]
case rel
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
a b x✝ y✝ : R
hab : Rel r x✝ y✝
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x✝ * c) (y✝ * d)
[PROOFSTEP]

| rel _ _ hab =>
  refine' (EqvGen.rel _ _ hab.mul_left).trans _ _ _ _
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case rel
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
a b x✝ y✝ : R
hab : Rel r x✝ y✝
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x✝ * c) (y✝ * d)
[PROOFSTEP]
refine' (EqvGen.rel _ _ hab.mul_left).trans _ _ _ _
[GOAL]
case rel
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
a b x✝ y✝ : R
hab : Rel r x✝ y✝
c d : R
hcd : Setoid.r c d
⊢ EqvGen (Rel r) (y✝ * c) (y✝ * d)
[PROOFSTEP]
induction hcd with
| rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
| refl => exact EqvGen.refl _
| symm _ _ _ h => exact h.symm _ _
| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case rel
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
a b x✝ y✝ : R
hab : Rel r x✝ y✝
c d : R
hcd : Setoid.r c d
⊢ EqvGen (Rel r) (y✝ * c) (y✝ * d)
[PROOFSTEP]
induction hcd with
| rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
| refl => exact EqvGen.refl _
| symm _ _ _ h => exact h.symm _ _
| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case rel.rel
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ : R
hcd : Rel r x✝ y✝
⊢ EqvGen (Rel r) (y✝¹ * x✝) (y✝¹ * y✝)
[PROOFSTEP]

| rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
[GOAL]
case rel.rel
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ : R
hcd : Rel r x✝ y✝
⊢ EqvGen (Rel r) (y✝¹ * x✝) (y✝¹ * y✝)
[PROOFSTEP]
exact EqvGen.rel _ _ hcd.mul_right
[GOAL]
case rel.refl
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
a b x✝¹ y✝ : R
hab : Rel r x✝¹ y✝
c d x✝ : R
⊢ EqvGen (Rel r) (y✝ * x✝) (y✝ * x✝)
[PROOFSTEP]

| refl => exact EqvGen.refl _
[GOAL]
case rel.refl
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
a b x✝¹ y✝ : R
hab : Rel r x✝¹ y✝
c d x✝ : R
⊢ EqvGen (Rel r) (y✝ * x✝) (y✝ * x✝)
[PROOFSTEP]
exact EqvGen.refl _
[GOAL]
case rel.symm
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ : R
a✝ : EqvGen (Rel r) x✝ y✝
h : EqvGen (Rel r) (y✝¹ * x✝) (y✝¹ * y✝)
⊢ EqvGen (Rel r) (y✝¹ * y✝) (y✝¹ * x✝)
[PROOFSTEP]

| symm _ _ _ h => exact h.symm _ _
[GOAL]
case rel.symm
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ : R
a✝ : EqvGen (Rel r) x✝ y✝
h : EqvGen (Rel r) (y✝¹ * x✝) (y✝¹ * y✝)
⊢ EqvGen (Rel r) (y✝¹ * y✝) (y✝¹ * x✝)
[PROOFSTEP]
exact h.symm _ _
[GOAL]
case rel.trans
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ z✝ : R
a✝¹ : EqvGen (Rel r) x✝ y✝
a✝ : EqvGen (Rel r) y✝ z✝
h : EqvGen (Rel r) (y✝¹ * x✝) (y✝¹ * y✝)
h' : EqvGen (Rel r) (y✝¹ * y✝) (y✝¹ * z✝)
⊢ EqvGen (Rel r) (y✝¹ * x✝) (y✝¹ * z✝)
[PROOFSTEP]

| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case rel.trans
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
a b x✝¹ y✝¹ : R
hab : Rel r x✝¹ y✝¹
c d x✝ y✝ z✝ : R
a✝¹ : EqvGen (Rel r) x✝ y✝
a✝ : EqvGen (Rel r) y✝ z✝
h : EqvGen (Rel r) (y✝¹ * x✝) (y✝¹ * y✝)
h' : EqvGen (Rel r) (y✝¹ * y✝) (y✝¹ * z✝)
⊢ EqvGen (Rel r) (y✝¹ * x✝) (y✝¹ * z✝)
[PROOFSTEP]
exact h.trans _ _ _ h'
[GOAL]
case refl
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
a b x✝ c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x✝ * c) (x✝ * d)
[PROOFSTEP]

| refl =>
  induction hcd with
  | rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
  | refl => exact EqvGen.refl _
  | symm _ _ _ h => exact h.symm _ _
  | trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case refl
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
a b x✝ c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x✝ * c) (x✝ * d)
[PROOFSTEP]
induction hcd with
| rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
| refl => exact EqvGen.refl _
| symm _ _ _ h => exact h.symm _ _
| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case refl
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
a b x✝ c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x✝ * c) (x✝ * d)
[PROOFSTEP]
induction hcd with
| rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
| refl => exact EqvGen.refl _
| symm _ _ _ h => exact h.symm _ _
| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case refl.rel
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
a b x✝¹ c d x✝ y✝ : R
hcd : Rel r x✝ y✝
⊢ Setoid.r (x✝¹ * x✝) (x✝¹ * y✝)
[PROOFSTEP]

| rel _ _ hcd => exact EqvGen.rel _ _ hcd.mul_right
[GOAL]
case refl.rel
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
a b x✝¹ c d x✝ y✝ : R
hcd : Rel r x✝ y✝
⊢ Setoid.r (x✝¹ * x✝) (x✝¹ * y✝)
[PROOFSTEP]
exact EqvGen.rel _ _ hcd.mul_right
[GOAL]
case refl.refl
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
a b x✝¹ c d x✝ : R
⊢ Setoid.r (x✝¹ * x✝) (x✝¹ * x✝)
[PROOFSTEP]

| refl => exact EqvGen.refl _
[GOAL]
case refl.refl
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
a b x✝¹ c d x✝ : R
⊢ Setoid.r (x✝¹ * x✝) (x✝¹ * x✝)
[PROOFSTEP]
exact EqvGen.refl _
[GOAL]
case refl.symm
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
a b x✝¹ c d x✝ y✝ : R
a✝ : EqvGen (Rel r) x✝ y✝
h : Setoid.r (x✝¹ * x✝) (x✝¹ * y✝)
⊢ Setoid.r (x✝¹ * y✝) (x✝¹ * x✝)
[PROOFSTEP]

| symm _ _ _ h => exact h.symm _ _
[GOAL]
case refl.symm
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
a b x✝¹ c d x✝ y✝ : R
a✝ : EqvGen (Rel r) x✝ y✝
h : Setoid.r (x✝¹ * x✝) (x✝¹ * y✝)
⊢ Setoid.r (x✝¹ * y✝) (x✝¹ * x✝)
[PROOFSTEP]
exact h.symm _ _
[GOAL]
case refl.trans
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
a b x✝¹ c d x✝ y✝ z✝ : R
a✝¹ : EqvGen (Rel r) x✝ y✝
a✝ : EqvGen (Rel r) y✝ z✝
h : Setoid.r (x✝¹ * x✝) (x✝¹ * y✝)
h' : Setoid.r (x✝¹ * y✝) (x✝¹ * z✝)
⊢ Setoid.r (x✝¹ * x✝) (x✝¹ * z✝)
[PROOFSTEP]

| trans _ _ _ _ _ h h' => exact h.trans _ _ _ h'
[GOAL]
case refl.trans
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
a b x✝¹ c d x✝ y✝ z✝ : R
a✝¹ : EqvGen (Rel r) x✝ y✝
a✝ : EqvGen (Rel r) y✝ z✝
h : Setoid.r (x✝¹ * x✝) (x✝¹ * y✝)
h' : Setoid.r (x✝¹ * y✝) (x✝¹ * z✝)
⊢ Setoid.r (x✝¹ * x✝) (x✝¹ * z✝)
[PROOFSTEP]
exact h.trans _ _ _ h'
[GOAL]
case symm
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
a b x y : R
a✝ : EqvGen (Rel r) x y
hxy : ∀ {c d : R}, Setoid.r c d → Setoid.r (x * c) (y * d)
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (y * c) (x * d)
[PROOFSTEP]

| symm x y _ hxy => exact (hxy hcd.symm).symm
[GOAL]
case symm
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
a b x y : R
a✝ : EqvGen (Rel r) x y
hxy : ∀ {c d : R}, Setoid.r c d → Setoid.r (x * c) (y * d)
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (y * c) (x * d)
[PROOFSTEP]
exact (hxy hcd.symm).symm
[GOAL]
case trans
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
a b x y z : R
a✝¹ : EqvGen (Rel r) x y
a✝ : EqvGen (Rel r) y z
h : ∀ {c d : R}, Setoid.r c d → Setoid.r (x * c) (y * d)
h' : ∀ {c d : R}, Setoid.r c d → Setoid.r (y * c) (z * d)
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x * c) (z * d)
[PROOFSTEP]

| trans x y z _ _ h h' => exact (h hcd).trans _ _ _ (h' <| EqvGen.refl _)
[GOAL]
case trans
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
a b x y z : R
a✝¹ : EqvGen (Rel r) x y
a✝ : EqvGen (Rel r) y z
h : ∀ {c d : R}, Setoid.r c d → Setoid.r (x * c) (y * d)
h' : ∀ {c d : R}, Setoid.r c d → Setoid.r (y * c) (z * d)
c d : R
hcd : Setoid.r c d
⊢ Setoid.r (x * c) (z * d)
[PROOFSTEP]
exact (h hcd).trans _ _ _ (h' <| EqvGen.refl _)
[GOAL]
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
⊢ EqvGen (Rel r) = RingConGen.Rel r
[PROOFSTEP]
ext x₁ x₂
[GOAL]
case h.h.a
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
x₁ x₂ : R
⊢ EqvGen (Rel r) x₁ x₂ ↔ RingConGen.Rel r x₁ x₂
[PROOFSTEP]
constructor
[GOAL]
case h.h.a.mp
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
x₁ x₂ : R
⊢ EqvGen (Rel r) x₁ x₂ → RingConGen.Rel r x₁ x₂
[PROOFSTEP]
intro h
[GOAL]
case h.h.a.mp
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
x₁ x₂ : R
h : EqvGen (Rel r) x₁ x₂
⊢ RingConGen.Rel r x₁ x₂
[PROOFSTEP]
induction h with
| rel _ _ h =>
  induction h with
  | of => exact RingConGen.Rel.of _ _ ‹_›
  | add_left _ h => exact h.add (RingConGen.Rel.refl _)
  | mul_left _ h => exact h.mul (RingConGen.Rel.refl _)
  | mul_right _ h => exact (RingConGen.Rel.refl _).mul h
| refl => exact RingConGen.Rel.refl _
| symm => exact RingConGen.Rel.symm ‹_›
| trans => exact RingConGen.Rel.trans ‹_› ‹_›
[GOAL]
case h.h.a.mp
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
x₁ x₂ : R
h : EqvGen (Rel r) x₁ x₂
⊢ RingConGen.Rel r x₁ x₂
[PROOFSTEP]
induction h with
| rel _ _ h =>
  induction h with
  | of => exact RingConGen.Rel.of _ _ ‹_›
  | add_left _ h => exact h.add (RingConGen.Rel.refl _)
  | mul_left _ h => exact h.mul (RingConGen.Rel.refl _)
  | mul_right _ h => exact (RingConGen.Rel.refl _).mul h
| refl => exact RingConGen.Rel.refl _
| symm => exact RingConGen.Rel.symm ‹_›
| trans => exact RingConGen.Rel.trans ‹_› ‹_›
[GOAL]
case h.h.a.mp.rel
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
x₁ x₂ x✝ y✝ : R
h : Rel r x✝ y✝
⊢ RingConGen.Rel r x✝ y✝
[PROOFSTEP]

| rel _ _ h =>
  induction h with
  | of => exact RingConGen.Rel.of _ _ ‹_›
  | add_left _ h => exact h.add (RingConGen.Rel.refl _)
  | mul_left _ h => exact h.mul (RingConGen.Rel.refl _)
  | mul_right _ h => exact (RingConGen.Rel.refl _).mul h
[GOAL]
case h.h.a.mp.rel
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
x₁ x₂ x✝ y✝ : R
h : Rel r x✝ y✝
⊢ RingConGen.Rel r x✝ y✝
[PROOFSTEP]
induction h with
| of => exact RingConGen.Rel.of _ _ ‹_›
| add_left _ h => exact h.add (RingConGen.Rel.refl _)
| mul_left _ h => exact h.mul (RingConGen.Rel.refl _)
| mul_right _ h => exact (RingConGen.Rel.refl _).mul h
[GOAL]
case h.h.a.mp.rel
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
x₁ x₂ x✝ y✝ : R
h : Rel r x✝ y✝
⊢ RingConGen.Rel r x✝ y✝
[PROOFSTEP]
induction h with
| of => exact RingConGen.Rel.of _ _ ‹_›
| add_left _ h => exact h.add (RingConGen.Rel.refl _)
| mul_left _ h => exact h.mul (RingConGen.Rel.refl _)
| mul_right _ h => exact (RingConGen.Rel.refl _).mul h
[GOAL]
case h.h.a.mp.rel.of
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
x₁ x₂ x✝¹ y✝¹ x✝ y✝ : R
h✝ : r x✝ y✝
⊢ RingConGen.Rel r x✝ y✝
[PROOFSTEP]

| of => exact RingConGen.Rel.of _ _ ‹_›
[GOAL]
case h.h.a.mp.rel.of
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
x₁ x₂ x✝¹ y✝¹ x✝ y✝ : R
h✝ : r x✝ y✝
⊢ RingConGen.Rel r x✝ y✝
[PROOFSTEP]
exact RingConGen.Rel.of _ _ ‹_›
[GOAL]
case h.h.a.mp.rel.add_left
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
x₁ x₂ x✝ y✝ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
h : RingConGen.Rel r a✝¹ b✝
⊢ RingConGen.Rel r (a✝¹ + c✝) (b✝ + c✝)
[PROOFSTEP]

| add_left _ h => exact h.add (RingConGen.Rel.refl _)
[GOAL]
case h.h.a.mp.rel.add_left
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
x₁ x₂ x✝ y✝ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
h : RingConGen.Rel r a✝¹ b✝
⊢ RingConGen.Rel r (a✝¹ + c✝) (b✝ + c✝)
[PROOFSTEP]
exact h.add (RingConGen.Rel.refl _)
[GOAL]
case h.h.a.mp.rel.mul_left
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
x₁ x₂ x✝ y✝ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
h : RingConGen.Rel r a✝¹ b✝
⊢ RingConGen.Rel r (a✝¹ * c✝) (b✝ * c✝)
[PROOFSTEP]

| mul_left _ h => exact h.mul (RingConGen.Rel.refl _)
[GOAL]
case h.h.a.mp.rel.mul_left
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
x₁ x₂ x✝ y✝ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
h : RingConGen.Rel r a✝¹ b✝
⊢ RingConGen.Rel r (a✝¹ * c✝) (b✝ * c✝)
[PROOFSTEP]
exact h.mul (RingConGen.Rel.refl _)
[GOAL]
case h.h.a.mp.rel.mul_right
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
x₁ x₂ x✝ y✝ a✝¹ b✝ c✝ : R
a✝ : Rel r b✝ c✝
h : RingConGen.Rel r b✝ c✝
⊢ RingConGen.Rel r (a✝¹ * b✝) (a✝¹ * c✝)
[PROOFSTEP]

| mul_right _ h => exact (RingConGen.Rel.refl _).mul h
[GOAL]
case h.h.a.mp.rel.mul_right
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
x₁ x₂ x✝ y✝ a✝¹ b✝ c✝ : R
a✝ : Rel r b✝ c✝
h : RingConGen.Rel r b✝ c✝
⊢ RingConGen.Rel r (a✝¹ * b✝) (a✝¹ * c✝)
[PROOFSTEP]
exact (RingConGen.Rel.refl _).mul h
[GOAL]
case h.h.a.mp.refl
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
x₁ x₂ x✝ : R
⊢ RingConGen.Rel r x✝ x✝
[PROOFSTEP]

| refl => exact RingConGen.Rel.refl _
[GOAL]
case h.h.a.mp.refl
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
x₁ x₂ x✝ : R
⊢ RingConGen.Rel r x✝ x✝
[PROOFSTEP]
exact RingConGen.Rel.refl _
[GOAL]
case h.h.a.mp.symm
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
x₁ x₂ x✝ y✝ : R
a✝ : EqvGen (Rel r) x✝ y✝
a_ih✝ : RingConGen.Rel r x✝ y✝
⊢ RingConGen.Rel r y✝ x✝
[PROOFSTEP]

| symm => exact RingConGen.Rel.symm ‹_›
[GOAL]
case h.h.a.mp.symm
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
x₁ x₂ x✝ y✝ : R
a✝ : EqvGen (Rel r) x✝ y✝
a_ih✝ : RingConGen.Rel r x✝ y✝
⊢ RingConGen.Rel r y✝ x✝
[PROOFSTEP]
exact RingConGen.Rel.symm ‹_›
[GOAL]
case h.h.a.mp.trans
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
x₁ x₂ x✝ y✝ z✝ : R
a✝¹ : EqvGen (Rel r) x✝ y✝
a✝ : EqvGen (Rel r) y✝ z✝
a_ih✝¹ : RingConGen.Rel r x✝ y✝
a_ih✝ : RingConGen.Rel r y✝ z✝
⊢ RingConGen.Rel r x✝ z✝
[PROOFSTEP]

| trans => exact RingConGen.Rel.trans ‹_› ‹_›
[GOAL]
case h.h.a.mp.trans
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
x₁ x₂ x✝ y✝ z✝ : R
a✝¹ : EqvGen (Rel r) x✝ y✝
a✝ : EqvGen (Rel r) y✝ z✝
a_ih✝¹ : RingConGen.Rel r x✝ y✝
a_ih✝ : RingConGen.Rel r y✝ z✝
⊢ RingConGen.Rel r x✝ z✝
[PROOFSTEP]
exact RingConGen.Rel.trans ‹_› ‹_›
[GOAL]
case h.h.a.mpr
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
x₁ x₂ : R
⊢ RingConGen.Rel r x₁ x₂ → EqvGen (Rel r) x₁ x₂
[PROOFSTEP]
intro h
[GOAL]
case h.h.a.mpr
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
x₁ x₂ : R
h : RingConGen.Rel r x₁ x₂
⊢ EqvGen (Rel r) x₁ x₂
[PROOFSTEP]
induction h with
| of => exact EqvGen.rel _ _ (Rel.of ‹_›)
| refl => exact (RingQuot.ringCon r).refl _
| symm => exact (RingQuot.ringCon r).symm ‹_›
| trans => exact (RingQuot.ringCon r).trans ‹_› ‹_›
| add => exact (RingQuot.ringCon r).add ‹_› ‹_›
| mul => exact (RingQuot.ringCon r).mul ‹_› ‹_›
[GOAL]
case h.h.a.mpr
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
x₁ x₂ : R
h : RingConGen.Rel r x₁ x₂
⊢ EqvGen (Rel r) x₁ x₂
[PROOFSTEP]
induction h with
| of => exact EqvGen.rel _ _ (Rel.of ‹_›)
| refl => exact (RingQuot.ringCon r).refl _
| symm => exact (RingQuot.ringCon r).symm ‹_›
| trans => exact (RingQuot.ringCon r).trans ‹_› ‹_›
| add => exact (RingQuot.ringCon r).add ‹_› ‹_›
| mul => exact (RingQuot.ringCon r).mul ‹_› ‹_›
[GOAL]
case h.h.a.mpr.of
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
x₁ x₂ x✝ y✝ : R
a✝ : r x✝ y✝
⊢ EqvGen (Rel r) x✝ y✝
[PROOFSTEP]

| of => exact EqvGen.rel _ _ (Rel.of ‹_›)
[GOAL]
case h.h.a.mpr.of
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
x₁ x₂ x✝ y✝ : R
a✝ : r x✝ y✝
⊢ EqvGen (Rel r) x✝ y✝
[PROOFSTEP]
exact EqvGen.rel _ _ (Rel.of ‹_›)
[GOAL]
case h.h.a.mpr.refl
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
x₁ x₂ x✝ : R
⊢ EqvGen (Rel r) x✝ x✝
[PROOFSTEP]

| refl => exact (RingQuot.ringCon r).refl _
[GOAL]
case h.h.a.mpr.refl
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
x₁ x₂ x✝ : R
⊢ EqvGen (Rel r) x✝ x✝
[PROOFSTEP]
exact (RingQuot.ringCon r).refl _
[GOAL]
case h.h.a.mpr.symm
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
x₁ x₂ x✝ y✝ : R
a✝ : RingConGen.Rel r x✝ y✝
a_ih✝ : EqvGen (Rel r) x✝ y✝
⊢ EqvGen (Rel r) y✝ x✝
[PROOFSTEP]

| symm => exact (RingQuot.ringCon r).symm ‹_›
[GOAL]
case h.h.a.mpr.symm
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
x₁ x₂ x✝ y✝ : R
a✝ : RingConGen.Rel r x✝ y✝
a_ih✝ : EqvGen (Rel r) x✝ y✝
⊢ EqvGen (Rel r) y✝ x✝
[PROOFSTEP]
exact (RingQuot.ringCon r).symm ‹_›
[GOAL]
case h.h.a.mpr.trans
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
x₁ x₂ x✝ y✝ z✝ : R
a✝¹ : RingConGen.Rel r x✝ y✝
a✝ : RingConGen.Rel r y✝ z✝
a_ih✝¹ : EqvGen (Rel r) x✝ y✝
a_ih✝ : EqvGen (Rel r) y✝ z✝
⊢ EqvGen (Rel r) x✝ z✝
[PROOFSTEP]

| trans => exact (RingQuot.ringCon r).trans ‹_› ‹_›
[GOAL]
case h.h.a.mpr.trans
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
x₁ x₂ x✝ y✝ z✝ : R
a✝¹ : RingConGen.Rel r x✝ y✝
a✝ : RingConGen.Rel r y✝ z✝
a_ih✝¹ : EqvGen (Rel r) x✝ y✝
a_ih✝ : EqvGen (Rel r) y✝ z✝
⊢ EqvGen (Rel r) x✝ z✝
[PROOFSTEP]
exact (RingQuot.ringCon r).trans ‹_› ‹_›
[GOAL]
case h.h.a.mpr.add
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
x₁ x₂ w✝ x✝ y✝ z✝ : R
a✝¹ : RingConGen.Rel r w✝ x✝
a✝ : RingConGen.Rel r y✝ z✝
a_ih✝¹ : EqvGen (Rel r) w✝ x✝
a_ih✝ : EqvGen (Rel r) y✝ z✝
⊢ EqvGen (Rel r) (w✝ + y✝) (x✝ + z✝)
[PROOFSTEP]

| add => exact (RingQuot.ringCon r).add ‹_› ‹_›
[GOAL]
case h.h.a.mpr.add
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
x₁ x₂ w✝ x✝ y✝ z✝ : R
a✝¹ : RingConGen.Rel r w✝ x✝
a✝ : RingConGen.Rel r y✝ z✝
a_ih✝¹ : EqvGen (Rel r) w✝ x✝
a_ih✝ : EqvGen (Rel r) y✝ z✝
⊢ EqvGen (Rel r) (w✝ + y✝) (x✝ + z✝)
[PROOFSTEP]
exact (RingQuot.ringCon r).add ‹_› ‹_›
[GOAL]
case h.h.a.mpr.mul
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
x₁ x₂ w✝ x✝ y✝ z✝ : R
a✝¹ : RingConGen.Rel r w✝ x✝
a✝ : RingConGen.Rel r y✝ z✝
a_ih✝¹ : EqvGen (Rel r) w✝ x✝
a_ih✝ : EqvGen (Rel r) y✝ z✝
⊢ EqvGen (Rel r) (w✝ * y✝) (x✝ * z✝)
[PROOFSTEP]

| mul => exact (RingQuot.ringCon r).mul ‹_› ‹_›
[GOAL]
case h.h.a.mpr.mul
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
x₁ x₂ w✝ x✝ y✝ z✝ : R
a✝¹ : RingConGen.Rel r w✝ x✝
a✝ : RingConGen.Rel r y✝ z✝
a_ih✝¹ : EqvGen (Rel r) w✝ x✝
a_ih✝ : EqvGen (Rel r) y✝ z✝
⊢ EqvGen (Rel r) (w✝ * y✝) (x✝ * z✝)
[PROOFSTEP]
exact (RingQuot.ringCon r).mul ‹_› ‹_›
[GOAL]
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
n : ℕ
a✝ : Quot (Rel r)
a b : R
h : Rel r a b
⊢ (fun a => Quot.mk (Rel r) (a ^ n)) a = (fun a => Quot.mk (Rel r) (a ^ n)) b
[PROOFSTEP]
dsimp only
[GOAL]
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
n : ℕ
a✝ : Quot (Rel r)
a b : R
h : Rel r a b
⊢ Quot.mk (Rel r) (a ^ n) = Quot.mk (Rel r) (b ^ n)
[PROOFSTEP]
induction n with
| zero => rw [pow_zero, pow_zero]
|
  succ n ih =>
  rw [pow_succ, pow_succ]
    -- Porting note:
                -- `simpa [mul_def] using congr_arg₂ (fun x y ↦ mul r ⟨x⟩ ⟨y⟩) (Quot.sound h) ih`
                -- mysteriously doesn't work
  have := congr_arg₂ (fun x y ↦ mul r ⟨x⟩ ⟨y⟩) (Quot.sound h) ih
  dsimp only at this
  simp [mul_def] at this
  exact this
[GOAL]
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
n : ℕ
a✝ : Quot (Rel r)
a b : R
h : Rel r a b
⊢ Quot.mk (Rel r) (a ^ n) = Quot.mk (Rel r) (b ^ n)
[PROOFSTEP]
induction n with
| zero => rw [pow_zero, pow_zero]
|
  succ n ih =>
  rw [pow_succ, pow_succ]
    -- Porting note:
                -- `simpa [mul_def] using congr_arg₂ (fun x y ↦ mul r ⟨x⟩ ⟨y⟩) (Quot.sound h) ih`
                -- mysteriously doesn't work
  have := congr_arg₂ (fun x y ↦ mul r ⟨x⟩ ⟨y⟩) (Quot.sound h) ih
  dsimp only at this
  simp [mul_def] at this
  exact this
[GOAL]
case zero
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
a✝ : Quot (Rel r)
a b : R
h : Rel r a b
⊢ Quot.mk (Rel r) (a ^ Nat.zero) = Quot.mk (Rel r) (b ^ Nat.zero)
[PROOFSTEP]

| zero => rw [pow_zero, pow_zero]
[GOAL]
case zero
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
a✝ : Quot (Rel r)
a b : R
h : Rel r a b
⊢ Quot.mk (Rel r) (a ^ Nat.zero) = Quot.mk (Rel r) (b ^ Nat.zero)
[PROOFSTEP]
rw [pow_zero, pow_zero]
[GOAL]
case succ
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
a✝ : Quot (Rel r)
a b : R
h : Rel r a b
n : ℕ
ih : Quot.mk (Rel r) (a ^ n) = Quot.mk (Rel r) (b ^ n)
⊢ Quot.mk (Rel r) (a ^ Nat.succ n) = Quot.mk (Rel r) (b ^ Nat.succ n)
[PROOFSTEP]

|
  succ n ih =>
  rw [pow_succ, pow_succ]
    -- Porting note:
                -- `simpa [mul_def] using congr_arg₂ (fun x y ↦ mul r ⟨x⟩ ⟨y⟩) (Quot.sound h) ih`
                -- mysteriously doesn't work
  have := congr_arg₂ (fun x y ↦ mul r ⟨x⟩ ⟨y⟩) (Quot.sound h) ih
  dsimp only at this
  simp [mul_def] at this
  exact this
[GOAL]
case succ
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
a✝ : Quot (Rel r)
a b : R
h : Rel r a b
n : ℕ
ih : Quot.mk (Rel r) (a ^ n) = Quot.mk (Rel r) (b ^ n)
⊢ Quot.mk (Rel r) (a ^ Nat.succ n) = Quot.mk (Rel r) (b ^ Nat.succ n)
[PROOFSTEP]
rw [pow_succ, pow_succ]
  -- Porting note:
              -- `simpa [mul_def] using congr_arg₂ (fun x y ↦ mul r ⟨x⟩ ⟨y⟩) (Quot.sound h) ih`
              -- mysteriously doesn't work
[GOAL]
case succ
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
a✝ : Quot (Rel r)
a b : R
h : Rel r a b
n : ℕ
ih : Quot.mk (Rel r) (a ^ n) = Quot.mk (Rel r) (b ^ n)
⊢ Quot.mk (Rel r) (a * a ^ n) = Quot.mk (Rel r) (b * b ^ n)
[PROOFSTEP]
have := congr_arg₂ (fun x y ↦ mul r ⟨x⟩ ⟨y⟩) (Quot.sound h) ih
[GOAL]
case succ
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
a✝ : Quot (Rel r)
a b : R
h : Rel r a b
n : ℕ
ih : Quot.mk (Rel r) (a ^ n) = Quot.mk (Rel r) (b ^ n)
this :
  (fun x y => RingQuot.mul r { toQuot := x } { toQuot := y }) (Quot.mk (Rel r) a) (Quot.mk (Rel r) (a ^ n)) =
    (fun x y => RingQuot.mul r { toQuot := x } { toQuot := y }) (Quot.mk (Rel r) b) (Quot.mk (Rel r) (b ^ n))
⊢ Quot.mk (Rel r) (a * a ^ n) = Quot.mk (Rel r) (b * b ^ n)
[PROOFSTEP]
dsimp only at this
[GOAL]
case succ
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
a✝ : Quot (Rel r)
a b : R
h : Rel r a b
n : ℕ
ih : Quot.mk (Rel r) (a ^ n) = Quot.mk (Rel r) (b ^ n)
this :
  RingQuot.mul r { toQuot := Quot.mk (Rel r) a } { toQuot := Quot.mk (Rel r) (a ^ n) } =
    RingQuot.mul r { toQuot := Quot.mk (Rel r) b } { toQuot := Quot.mk (Rel r) (b ^ n) }
⊢ Quot.mk (Rel r) (a * a ^ n) = Quot.mk (Rel r) (b * b ^ n)
[PROOFSTEP]
simp [mul_def] at this
[GOAL]
case succ
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
a✝ : Quot (Rel r)
a b : R
h : Rel r a b
n : ℕ
ih : Quot.mk (Rel r) (a ^ n) = Quot.mk (Rel r) (b ^ n)
this : Quot.mk (Rel r) (a * a ^ n) = Quot.mk (Rel r) (b * b ^ n)
⊢ Quot.mk (Rel r) (a * a ^ n) = Quot.mk (Rel r) (b * b ^ n)
[PROOFSTEP]
exact this
[GOAL]
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
⊢ { toQuot := Quot.mk (Rel r) 0 } = RingQuot.zero r
[PROOFSTEP]
rw [zero_def]
[GOAL]
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
⊢ { toQuot := Quot.mk (Rel r) 1 } = RingQuot.one r
[PROOFSTEP]
rw [one_def]
[GOAL]
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
a b : R
⊢ { toQuot := Quot.mk (Rel r) a } + { toQuot := Quot.mk (Rel r) b } = { toQuot := Quot.mk (Rel r) (a + b) }
[PROOFSTEP]
show add r _ _ = _
[GOAL]
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
a b : R
⊢ RingQuot.add r { toQuot := Quot.mk (Rel r) a } { toQuot := Quot.mk (Rel r) b } = { toQuot := Quot.mk (Rel r) (a + b) }
[PROOFSTEP]
rw [add_def]
[GOAL]
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
a b : R
⊢ (match { toQuot := Quot.mk (Rel r) a }, { toQuot := Quot.mk (Rel r) b } with
    | { toQuot := a }, { toQuot := b } =>
      {
        toQuot :=
          Quot.map₂ (fun x x_1 => x + x_1) (_ : ∀ ⦃a b c : R⦄, Rel r b c → Rel r (a + b) (a + c))
            (_ : ∀ ⦃a b c : R⦄, Rel r a b → Rel r (a + c) (b + c)) a b }) =
    { toQuot := Quot.mk (Rel r) (a + b) }
[PROOFSTEP]
rfl
[GOAL]
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
a b : R
⊢ { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) b } = { toQuot := Quot.mk (Rel r) (a * b) }
[PROOFSTEP]
show mul r _ _ = _
[GOAL]
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
a b : R
⊢ RingQuot.mul r { toQuot := Quot.mk (Rel r) a } { toQuot := Quot.mk (Rel r) b } = { toQuot := Quot.mk (Rel r) (a * b) }
[PROOFSTEP]
rw [mul_def]
[GOAL]
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
a b : R
⊢ (match { toQuot := Quot.mk (Rel r) a }, { toQuot := Quot.mk (Rel r) b } with
    | { toQuot := a }, { toQuot := b } =>
      {
        toQuot :=
          Quot.map₂ (fun x x_1 => x * x_1) (_ : ∀ ⦃a b c : R⦄, Rel r b c → Rel r (a * b) (a * c))
            (_ : ∀ ⦃a b c : R⦄, Rel r a b → Rel r (a * c) (b * c)) a b }) =
    { toQuot := Quot.mk (Rel r) (a * b) }
[PROOFSTEP]
rfl
[GOAL]
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
a : R
n : ℕ
⊢ { toQuot := Quot.mk (Rel r) a } ^ n = { toQuot := Quot.mk (Rel r) (a ^ n) }
[PROOFSTEP]
show npow r _ _ = _
[GOAL]
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
a : R
n : ℕ
⊢ RingQuot.npow r n { toQuot := Quot.mk (Rel r) a } = { toQuot := Quot.mk (Rel r) (a ^ n) }
[PROOFSTEP]
rw [npow_def]
[GOAL]
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
a : R
⊢ -{ toQuot := Quot.mk (Rel r) a } = { toQuot := Quot.mk (Rel r) (-a) }
[PROOFSTEP]
show neg r _ = _
[GOAL]
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
a : R
⊢ RingQuot.neg r { toQuot := Quot.mk (Rel r) a } = { toQuot := Quot.mk (Rel r) (-a) }
[PROOFSTEP]
rw [neg_def]
[GOAL]
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
a : R
⊢ (match { toQuot := Quot.mk (Rel r) a } with
    | { toQuot := a } => { toQuot := Quot.map (fun a => -a) (_ : ∀ ⦃a b : R⦄, Rel r a b → Rel r (-a) (-b)) a }) =
    { toQuot := Quot.mk (Rel r) (-a) }
[PROOFSTEP]
rfl
[GOAL]
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
a b : R
⊢ { toQuot := Quot.mk (Rel r) a } - { toQuot := Quot.mk (Rel r) b } = { toQuot := Quot.mk (Rel r) (a - b) }
[PROOFSTEP]
show sub r _ _ = _
[GOAL]
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
a b : R
⊢ RingQuot.sub r { toQuot := Quot.mk (Rel r) a } { toQuot := Quot.mk (Rel r) b } = { toQuot := Quot.mk (Rel r) (a - b) }
[PROOFSTEP]
rw [sub_def]
[GOAL]
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
a b : R
⊢ (match { toQuot := Quot.mk (Rel r) a }, { toQuot := Quot.mk (Rel r) b } with
    | { toQuot := a }, { toQuot := b } =>
      {
        toQuot :=
          Quot.map₂ Sub.sub (_ : ∀ ⦃a b c : R⦄, Rel r b c → Rel r (a - b) (a - c))
            (_ : ∀ ⦃a b c : R⦄, Rel r a b → Rel r (a - c) (b - c)) a b }) =
    { toQuot := Quot.mk (Rel r) (a - b) }
[PROOFSTEP]
rfl
[GOAL]
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
n : S
a : R
⊢ n • { toQuot := Quot.mk (Rel r) a } = { toQuot := Quot.mk (Rel r) (n • a) }
[PROOFSTEP]
show smul r _ _ = _
[GOAL]
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
n : S
a : R
⊢ RingQuot.smul r n { toQuot := Quot.mk (Rel r) a } = { toQuot := Quot.mk (Rel r) (n • a) }
[PROOFSTEP]
rw [smul]
[GOAL]
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
n : S
a : R
⊢ (match { toQuot := Quot.mk (Rel r) a } with
    | { toQuot := a } =>
      { toQuot := Quot.map (fun a => n • a) (_ : ∀ ⦃a b : R⦄, Rel r a b → Rel r (n • a) (n • b)) a }) =
    { toQuot := Quot.mk (Rel r) (n • a) }
[PROOFSTEP]
rfl
[GOAL]
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✝⁴ : CommSemiring T
inst✝³ : SMul S T
inst✝² : Algebra S R
inst✝¹ : Algebra T R
inst✝ : IsScalarTower S T R
s : S
t : T
x✝ : RingQuot r
a : Quot (Rel r)
a' : R
⊢ (s • t) • { toQuot := Quot.mk (Rel r) a' } = s • t • { toQuot := Quot.mk (Rel r) a' }
[PROOFSTEP]
simp only [RingQuot.smul_quot, smul_assoc]
[GOAL]
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✝³ : CommSemiring T
inst✝² : Algebra S R
inst✝¹ : Algebra T R
inst✝ : SMulCommClass S T R
s : S
t : T
x✝ : RingQuot r
a : Quot (Rel r)
a' : R
⊢ s • t • { toQuot := Quot.mk (Rel r) a' } = t • s • { toQuot := Quot.mk (Rel r) a' }
[PROOFSTEP]
simp only [RingQuot.smul_quot, smul_comm]
[GOAL]
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
⊢ ∀ (a b c : RingQuot r), a + b + c = a + (b + c)
[PROOFSTEP]
rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩ ⟨⟨⟩⟩
[GOAL]
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
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✝ })
[PROOFSTEP]
simp only [add_quot, add_assoc]
[GOAL]
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
⊢ ∀ (a : RingQuot r), 0 + a = a
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ 0 + { toQuot := Quot.mk (Rel r) a✝ } = { toQuot := Quot.mk (Rel r) a✝ }
[PROOFSTEP]
simp [add_quot, ← zero_quot, zero_add]
[GOAL]
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
⊢ ∀ (a : RingQuot r), a + 0 = a
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ { toQuot := Quot.mk (Rel r) a✝ } + 0 = { toQuot := Quot.mk (Rel r) a✝ }
[PROOFSTEP]
simp only [add_quot, ← zero_quot, add_zero]
[GOAL]
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
⊢ ∀ (x : RingQuot r), (fun x x_1 => x • x_1) 0 x = 0
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ (fun x x_1 => x • x_1) 0 { toQuot := Quot.mk (Rel r) a✝ } = 0
[PROOFSTEP]
simp only [smul_quot, zero_smul, zero_quot]
[GOAL]
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
⊢ ∀ (n : ℕ) (x : RingQuot r), (fun x x_1 => x • x_1) (n + 1) x = x + (fun x x_1 => x • x_1) n x
[PROOFSTEP]
rintro n ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
n : ℕ
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ (fun x x_1 => x • x_1) (n + 1) { toQuot := Quot.mk (Rel r) a✝ } =
    { toQuot := Quot.mk (Rel r) a✝ } + (fun x x_1 => x • x_1) n { toQuot := Quot.mk (Rel r) a✝ }
[PROOFSTEP]
simp only [smul_quot, nsmul_eq_mul, Nat.cast_add, Nat.cast_one, add_mul, one_mul, add_comm, add_quot]
[GOAL]
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
⊢ ∀ (a b : RingQuot r), a + b = b + a
[PROOFSTEP]
rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
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✝¹ }
[PROOFSTEP]
simp only [add_quot, add_comm]
[GOAL]
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
⊢ ∀ (a b c : RingQuot r), a * b * c = a * (b * c)
[PROOFSTEP]
rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩ ⟨⟨⟩⟩
[GOAL]
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
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✝ })
[PROOFSTEP]
simp only [mul_quot, mul_assoc]
[GOAL]
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
⊢ ∀ (a : RingQuot r), 1 * a = a
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ 1 * { toQuot := Quot.mk (Rel r) a✝ } = { toQuot := Quot.mk (Rel r) a✝ }
[PROOFSTEP]
simp only [mul_quot, ← one_quot, one_mul]
[GOAL]
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
⊢ ∀ (a : RingQuot r), a * 1 = a
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ { toQuot := Quot.mk (Rel r) a✝ } * 1 = { toQuot := Quot.mk (Rel r) a✝ }
[PROOFSTEP]
simp only [mul_quot, ← one_quot, mul_one]
[GOAL]
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
⊢ ∀ (x : RingQuot r), (fun n x => x ^ n) 0 x = 1
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ (fun n x => x ^ n) 0 { toQuot := Quot.mk (Rel r) a✝ } = 1
[PROOFSTEP]
simp only [pow_quot, ← one_quot, pow_zero]
[GOAL]
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
⊢ ∀ (n : ℕ) (x : RingQuot r), (fun n x => x ^ n) (n + 1) x = x * (fun n x => x ^ n) n x
[PROOFSTEP]
rintro n ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
n : ℕ
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ (fun n x => x ^ n) (n + 1) { toQuot := Quot.mk (Rel r) a✝ } =
    { toQuot := Quot.mk (Rel r) a✝ } * (fun n x => x ^ n) n { toQuot := Quot.mk (Rel r) a✝ }
[PROOFSTEP]
simp only [pow_quot, mul_quot, pow_succ]
[GOAL]
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
⊢ ∀ (a : RingQuot r), 0 * a = 0
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ 0 * { toQuot := Quot.mk (Rel r) a✝ } = 0
[PROOFSTEP]
simp only [mul_quot, ← zero_quot, zero_mul]
[GOAL]
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
⊢ ∀ (a : RingQuot r), a * 0 = 0
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ { toQuot := Quot.mk (Rel r) a✝ } * 0 = 0
[PROOFSTEP]
simp only [mul_quot, ← zero_quot, mul_zero]
[GOAL]
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
⊢ ∀ (x : RingQuot r), (fun x x_1 => x • x_1) 0 x = 0
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
src✝¹ : AddCommMonoid (RingQuot r) := instAddCommMonoid r
src✝ : MonoidWithZero (RingQuot r) := instMonoidWithZero r
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ (fun x x_1 => x • x_1) 0 { toQuot := Quot.mk (Rel r) a✝ } = 0
[PROOFSTEP]
simp only [smul_quot, zero_smul, zero_quot]
[GOAL]
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 : ℕ) (x : RingQuot r), (fun x x_1 => x • x_1) (n + 1) x = x + (fun x x_1 => x • x_1) n x
[PROOFSTEP]
rintro n ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
src✝¹ : AddCommMonoid (RingQuot r) := instAddCommMonoid r
src✝ : MonoidWithZero (RingQuot r) := instMonoidWithZero r
n : ℕ
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ (fun x x_1 => x • x_1) (n + 1) { toQuot := Quot.mk (Rel r) a✝ } =
    { toQuot := Quot.mk (Rel r) a✝ } + (fun x x_1 => x • x_1) n { toQuot := Quot.mk (Rel r) a✝ }
[PROOFSTEP]
simp only [smul_quot, nsmul_eq_mul, Nat.cast_add, Nat.cast_one, add_mul, one_mul, add_comm, add_quot]
[GOAL]
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
⊢ ∀ (a b c : RingQuot r), a * (b + c) = a * b + a * c
[PROOFSTEP]
rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩ ⟨⟨⟩⟩
[GOAL]
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✝ }
[PROOFSTEP]
simp only [mul_quot, add_quot, left_distrib]
[GOAL]
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
⊢ ∀ (a b c : RingQuot r), (a + b) * c = a * c + b * c
[PROOFSTEP]
rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩ ⟨⟨⟩⟩
[GOAL]
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✝ }
[PROOFSTEP]
simp only [mul_quot, add_quot, right_distrib]
[GOAL]
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
[PROOFSTEP]
simp [Nat.cast, natCast, ← zero_quot]
[GOAL]
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
[PROOFSTEP]
simp [Nat.cast, natCast, ← one_quot, add_quot]
[GOAL]
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
[PROOFSTEP]
rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
[GOAL]
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✝ }
[PROOFSTEP]
simp [neg_quot, sub_quot, add_quot, sub_eq_add_neg]
[GOAL]
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
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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
[PROOFSTEP]
simp [smul_quot, ← zero_quot]
[GOAL]
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
[PROOFSTEP]
rintro n ⟨⟨⟩⟩
[GOAL]
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✝ }
[PROOFSTEP]
simp [smul_quot, add_quot, add_mul, add_comm]
[GOAL]
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
[PROOFSTEP]
rintro n ⟨⟨⟩⟩
[GOAL]
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✝ }
[PROOFSTEP]
simp [smul_quot, neg_quot, add_mul]
[GOAL]
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
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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
[PROOFSTEP]
simp [neg_quot, add_quot, ← zero_quot]
[GOAL]
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
[PROOFSTEP]
exact congrArg (Quot.mk _) (Int.cast_ofNat _)
[GOAL]
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
[PROOFSTEP]
simp_rw [neg_def]
[GOAL]
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
[PROOFSTEP]
exact congrArg (Quot.mk _) (Int.cast_negSucc n)
[GOAL]
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
[PROOFSTEP]
rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
[GOAL]
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✝¹ }
[PROOFSTEP]
simp [mul_quot, mul_comm]
[GOAL]
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
[PROOFSTEP]
simp [← one_quot]
[GOAL]
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
[PROOFSTEP]
simp [mul_quot]
[GOAL]
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
[PROOFSTEP]
simp [← zero_quot]
[GOAL]
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
[PROOFSTEP]
simp [add_quot]
[GOAL]
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 : (fun x => RingQuot r✝) 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
[PROOFSTEP]
rintro ⟨⟨a⟩⟩
[GOAL]
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
inst✝ : Algebra S R
r✝ : R → R → Prop
r : S
toQuot✝ : Quot (Rel r✝)
a : 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 *
      { toQuot := Quot.mk (Rel r✝) a } =
    { toQuot := Quot.mk (Rel r✝) a } *
      ↑{
            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
[PROOFSTEP]
simp [Algebra.commutes, mul_quot]
[GOAL]
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 : (fun x => RingQuot r✝) r),
    r • 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 *
        x
[PROOFSTEP]
rintro ⟨⟨a⟩⟩
[GOAL]
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
inst✝ : Algebra S R
r✝ : R → R → Prop
r : S
toQuot✝ : Quot (Rel r✝)
a : R
⊢ r • { toQuot := Quot.mk (Rel r✝) a } =
    ↑{
            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 *
      { toQuot := Quot.mk (Rel r✝) a }
[PROOFSTEP]
simp [smul_quot, Algebra.smul_def, mul_quot]
[GOAL]
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
⊢ (fun x => { toQuot := Quot.mk (Rel r) x }) 1 = 1
[PROOFSTEP]
simp [← one_quot]
[GOAL]
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
⊢ ∀ (x y : R),
    OneHom.toFun
        { toFun := fun x => { toQuot := Quot.mk (Rel r) x }, map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) }
        (x * y) =
      OneHom.toFun
          { toFun := fun x => { toQuot := Quot.mk (Rel r) x }, map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) }
          x *
        OneHom.toFun
          { toFun := fun x => { toQuot := Quot.mk (Rel r) x }, map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) } y
[PROOFSTEP]
simp [mul_quot]
[GOAL]
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
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
              map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
          map_mul' :=
            (_ :
              ∀ (a a_1 : R),
                { toQuot := Quot.mk (Rel r) (a * a_1) } =
                  { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) })
      0 =
    0
[PROOFSTEP]
simp [← zero_quot]
[GOAL]
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
⊢ ∀ (x y : R),
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
            map_mul' :=
              (_ :
                ∀ (a a_1 : R),
                  { toQuot := Quot.mk (Rel r) (a * a_1) } =
                    { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) })
        (x + y) =
      OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                  map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
              map_mul' :=
                (_ :
                  ∀ (a a_1 : R),
                    { toQuot := Quot.mk (Rel r) (a * a_1) } =
                      { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) })
          x +
        OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                  map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
              map_mul' :=
                (_ :
                  ∀ (a a_1 : R),
                    { toQuot := Quot.mk (Rel r) (a * a_1) } =
                      { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) })
          y
[PROOFSTEP]
simp [add_quot]
[GOAL]
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
x y : R
w : r x y
⊢ ↑(mkRingHom r) x = ↑(mkRingHom r) y
[PROOFSTEP]
simp [mkRingHom_def, Quot.sound (Rel.of w)]
[GOAL]
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
⊢ Function.Surjective ↑(mkRingHom r)
[PROOFSTEP]
simp [mkRingHom_def]
[GOAL]
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
⊢ Function.Surjective fun x => { toQuot := Quot.mk (Rel r) x }
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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 → R → Prop
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ ∃ a, (fun x => { toQuot := Quot.mk (Rel r) x }) a = { toQuot := Quot.mk (Rel r) a✝ }
[PROOFSTEP]
simp
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f g : RingQuot r →+* T
w : RingHom.comp f (mkRingHom r) = RingHom.comp g (mkRingHom r)
⊢ f = g
[PROOFSTEP]
ext x
[GOAL]
case a
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✝ : Semiring T
r : R → R → Prop
f g : RingQuot r →+* T
w : RingHom.comp f (mkRingHom r) = RingHom.comp g (mkRingHom r)
x : RingQuot r
⊢ ↑f x = ↑g x
[PROOFSTEP]
rcases mkRingHom_surjective r x with ⟨x, rfl⟩
[GOAL]
case a.intro
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✝ : Semiring T
r : R → R → Prop
f g : RingQuot r →+* T
w : RingHom.comp f (mkRingHom r) = RingHom.comp g (mkRingHom r)
x : R
⊢ ↑f (↑(mkRingHom r) x) = ↑g (↑(mkRingHom r) x)
[PROOFSTEP]
exact (RingHom.congr_fun w x : _)
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
x : RingQuot r
⊢ ∀ (a b : R), Rel r a b → ↑f a = ↑f b
[PROOFSTEP]
rintro _ _ r
[GOAL]
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✝ : Semiring T
r✝ : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r✝ x y → ↑f x = ↑f y
x : RingQuot r✝
a✝ b✝ : R
r : Rel r✝ a✝ b✝
⊢ ↑f a✝ = ↑f b✝
[PROOFSTEP]
induction r with
| of r => exact h r
| add_left _ r' => rw [map_add, map_add, r']
| mul_left _ r' => rw [map_mul, map_mul, r']
| mul_right _ r' => rw [map_mul, map_mul, r']
[GOAL]
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✝ : Semiring T
r✝ : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r✝ x y → ↑f x = ↑f y
x : RingQuot r✝
a✝ b✝ : R
r : Rel r✝ a✝ b✝
⊢ ↑f a✝ = ↑f b✝
[PROOFSTEP]
induction r with
| of r => exact h r
| add_left _ r' => rw [map_add, map_add, r']
| mul_left _ r' => rw [map_mul, map_mul, r']
| mul_right _ r' => rw [map_mul, map_mul, r']
[GOAL]
case of
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✝ : Semiring T
r✝ : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r✝ x y → ↑f x = ↑f y
x : RingQuot r✝
a✝ b✝ x✝ y✝ : R
r : r✝ x✝ y✝
⊢ ↑f x✝ = ↑f y✝
[PROOFSTEP]

| of r => exact h r
[GOAL]
case of
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✝ : Semiring T
r✝ : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r✝ x y → ↑f x = ↑f y
x : RingQuot r✝
a✝ b✝ x✝ y✝ : R
r : r✝ x✝ y✝
⊢ ↑f x✝ = ↑f y✝
[PROOFSTEP]
exact h r
[GOAL]
case add_left
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✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
r' : ↑f a✝¹ = ↑f b✝
⊢ ↑f (a✝¹ + c✝) = ↑f (b✝ + c✝)
[PROOFSTEP]

| add_left _ r' => rw [map_add, map_add, r']
[GOAL]
case add_left
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✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
r' : ↑f a✝¹ = ↑f b✝
⊢ ↑f (a✝¹ + c✝) = ↑f (b✝ + c✝)
[PROOFSTEP]
rw [map_add, map_add, r']
[GOAL]
case mul_left
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✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
r' : ↑f a✝¹ = ↑f b✝
⊢ ↑f (a✝¹ * c✝) = ↑f (b✝ * c✝)
[PROOFSTEP]

| mul_left _ r' => rw [map_mul, map_mul, r']
[GOAL]
case mul_left
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✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
r' : ↑f a✝¹ = ↑f b✝
⊢ ↑f (a✝¹ * c✝) = ↑f (b✝ * c✝)
[PROOFSTEP]
rw [map_mul, map_mul, r']
[GOAL]
case mul_right
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✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r b✝ c✝
r' : ↑f b✝ = ↑f c✝
⊢ ↑f (a✝¹ * b✝) = ↑f (a✝¹ * c✝)
[PROOFSTEP]

| mul_right _ r' => rw [map_mul, map_mul, r']
[GOAL]
case mul_right
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✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r b✝ c✝
r' : ↑f b✝ = ↑f c✝
⊢ ↑f (a✝¹ * b✝) = ↑f (a✝¹ * c✝)
[PROOFSTEP]
rw [map_mul, map_mul, r']
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
⊢ (fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot) 1 = 1
[PROOFSTEP]
simp only [← one_quot, f.map_one]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
⊢ ∀ (x y : RingQuot r),
    OneHom.toFun
        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
        (x * y) =
      OneHom.toFun
          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
          x *
        OneHom.toFun
          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
          y
[PROOFSTEP]
rintro ⟨⟨x⟩⟩ ⟨⟨y⟩⟩
[GOAL]
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
inst✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
toQuot✝¹ : Quot (Rel r)
x : R
toQuot✝ : Quot (Rel r)
y : R
⊢ OneHom.toFun
      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
      ({ toQuot := Quot.mk (Rel r) x } * { toQuot := Quot.mk (Rel r) y }) =
    OneHom.toFun
        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
        { toQuot := Quot.mk (Rel r) x } *
      OneHom.toFun
        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
        { toQuot := Quot.mk (Rel r) y }
[PROOFSTEP]
simp only [mul_quot, f.map_mul x y]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
              map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : RingQuot r),
                OneHom.toFun
                    { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                      map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                    (x * y) =
                  OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      x *
                    OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      y) })
      0 =
    0
[PROOFSTEP]
simp only [← zero_quot, f.map_zero]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
⊢ ∀ (x y : RingQuot r),
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : RingQuot r),
                  OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      (x * y) =
                    OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        y) })
        (x + y) =
      OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                  map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) },
              map_mul' :=
                (_ :
                  ∀ (x y : RingQuot r),
                    OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        (x * y) =
                      OneHom.toFun
                          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                          x *
                        OneHom.toFun
                          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                          y) })
          x +
        OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                  map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) },
              map_mul' :=
                (_ :
                  ∀ (x y : RingQuot r),
                    OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        (x * y) =
                      OneHom.toFun
                          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                          x *
                        OneHom.toFun
                          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                          y) })
          y
[PROOFSTEP]
rintro ⟨⟨x⟩⟩ ⟨⟨y⟩⟩
[GOAL]
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
inst✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
toQuot✝¹ : Quot (Rel r)
x : R
toQuot✝ : Quot (Rel r)
y : R
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
              map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : RingQuot r),
                OneHom.toFun
                    { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                      map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                    (x * y) =
                  OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      x *
                    OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      y) })
      ({ toQuot := Quot.mk (Rel r) x } + { toQuot := Quot.mk (Rel r) y }) =
    OneHom.toFun
        ↑{
            toOneHom :=
              { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : RingQuot r),
                  OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      (x * y) =
                    OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        y) }
        { toQuot := Quot.mk (Rel r) x } +
      OneHom.toFun
        ↑{
            toOneHom :=
              { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : RingQuot r),
                  OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      (x * y) =
                    OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : R), Rel r a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        y) }
        { toQuot := Quot.mk (Rel r) y }
[PROOFSTEP]
simp only [add_quot, f.map_add x y]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : { f // ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y }
⊢ (fun F =>
        { val := RingHom.comp F (mkRingHom r),
          property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) })
      ((fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y)) f) =
    f
[PROOFSTEP]
ext
[GOAL]
case a.a
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✝ : Semiring T
r : R → R → Prop
f : { f // ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y }
x✝ : R
⊢ ↑↑((fun F =>
              { val := RingHom.comp F (mkRingHom r),
                property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) })
            ((fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y)) f))
      x✝ =
    ↑↑f x✝
[PROOFSTEP]
simp only [preLift_def, mkRingHom_def, RingHom.coe_comp, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk,
  Function.comp_apply]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
F : RingQuot r →+* T
⊢ (fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y))
      ((fun F =>
          { val := RingHom.comp F (mkRingHom r),
            property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) })
        F) =
    F
[PROOFSTEP]
simp only [preLift_def]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
F : RingQuot r →+* T
⊢ {
      toMonoidHom :=
        {
          toOneHom :=
            {
              toFun := fun x =>
                Quot.lift ↑(RingHom.comp F (mkRingHom r))
                  (_ : ∀ (a b : R), Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                  x.toQuot,
              map_one' :=
                (_ :
                  Quot.lift ↑(RingHom.comp F (mkRingHom r))
                      (_ :
                        ∀ (a b : R), Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                      1.toQuot =
                    1) },
          map_mul' :=
            (_ :
              ∀ (x y : RingQuot r),
                OneHom.toFun
                    {
                      toFun := fun x =>
                        Quot.lift ↑(RingHom.comp F (mkRingHom r))
                          (_ :
                            ∀ (a b : R),
                              Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                          x.toQuot,
                      map_one' :=
                        (_ :
                          Quot.lift ↑(RingHom.comp F (mkRingHom r))
                              (_ :
                                ∀ (a b : R),
                                  Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                              1.toQuot =
                            1) }
                    (x * y) =
                  OneHom.toFun
                      {
                        toFun := fun x =>
                          Quot.lift ↑(RingHom.comp F (mkRingHom r))
                            (_ :
                              ∀ (a b : R),
                                Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                            x.toQuot,
                        map_one' :=
                          (_ :
                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                (_ :
                                  ∀ (a b : R),
                                    Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                1.toQuot =
                              1) }
                      x *
                    OneHom.toFun
                      {
                        toFun := fun x =>
                          Quot.lift ↑(RingHom.comp F (mkRingHom r))
                            (_ :
                              ∀ (a b : R),
                                Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                            x.toQuot,
                        map_one' :=
                          (_ :
                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                (_ :
                                  ∀ (a b : R),
                                    Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                1.toQuot =
                              1) }
                      y) },
      map_zero' :=
        (_ :
          Quot.lift ↑(RingHom.comp F (mkRingHom r))
              (_ : ∀ (a b : R), Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
              0.toQuot =
            0),
      map_add' :=
        (_ :
          ∀ (x y : RingQuot r),
            OneHom.toFun
                (↑{
                    toOneHom :=
                      {
                        toFun := fun x =>
                          Quot.lift ↑(RingHom.comp F (mkRingHom r))
                            (_ :
                              ∀ (a b : R),
                                Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                            x.toQuot,
                        map_one' :=
                          (_ :
                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                (_ :
                                  ∀ (a b : R),
                                    Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                1.toQuot =
                              1) },
                    map_mul' :=
                      (_ :
                        ∀ (x y : RingQuot r),
                          OneHom.toFun
                              {
                                toFun := fun x =>
                                  Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                    (_ :
                                      ∀ (a b : R),
                                        Rel r a b →
                                          ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                    x.toQuot,
                                map_one' :=
                                  (_ :
                                    Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                        (_ :
                                          ∀ (a b : R),
                                            Rel r a b →
                                              ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                        1.toQuot =
                                      1) }
                              (x * y) =
                            OneHom.toFun
                                {
                                  toFun := fun x =>
                                    Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                      (_ :
                                        ∀ (a b : R),
                                          Rel r a b →
                                            ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                      x.toQuot,
                                  map_one' :=
                                    (_ :
                                      Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                          (_ :
                                            ∀ (a b : R),
                                              Rel r a b →
                                                ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                          1.toQuot =
                                        1) }
                                x *
                              OneHom.toFun
                                {
                                  toFun := fun x =>
                                    Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                      (_ :
                                        ∀ (a b : R),
                                          Rel r a b →
                                            ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                      x.toQuot,
                                  map_one' :=
                                    (_ :
                                      Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                          (_ :
                                            ∀ (a b : R),
                                              Rel r a b →
                                                ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                          1.toQuot =
                                        1) }
                                y) })
                (x + y) =
              OneHom.toFun
                  (↑{
                      toOneHom :=
                        {
                          toFun := fun x =>
                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                              (_ :
                                ∀ (a b : R),
                                  Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                              x.toQuot,
                          map_one' :=
                            (_ :
                              Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                  (_ :
                                    ∀ (a b : R),
                                      Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                  1.toQuot =
                                1) },
                      map_mul' :=
                        (_ :
                          ∀ (x y : RingQuot r),
                            OneHom.toFun
                                {
                                  toFun := fun x =>
                                    Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                      (_ :
                                        ∀ (a b : R),
                                          Rel r a b →
                                            ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                      x.toQuot,
                                  map_one' :=
                                    (_ :
                                      Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                          (_ :
                                            ∀ (a b : R),
                                              Rel r a b →
                                                ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                          1.toQuot =
                                        1) }
                                (x * y) =
                              OneHom.toFun
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                        (_ :
                                          ∀ (a b : R),
                                            Rel r a b →
                                              ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                            (_ :
                                              ∀ (a b : R),
                                                Rel r a b →
                                                  ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                            1.toQuot =
                                          1) }
                                  x *
                                OneHom.toFun
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                        (_ :
                                          ∀ (a b : R),
                                            Rel r a b →
                                              ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                            (_ :
                                              ∀ (a b : R),
                                                Rel r a b →
                                                  ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                            1.toQuot =
                                          1) }
                                  y) })
                  x +
                OneHom.toFun
                  (↑{
                      toOneHom :=
                        {
                          toFun := fun x =>
                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                              (_ :
                                ∀ (a b : R),
                                  Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                              x.toQuot,
                          map_one' :=
                            (_ :
                              Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                  (_ :
                                    ∀ (a b : R),
                                      Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                  1.toQuot =
                                1) },
                      map_mul' :=
                        (_ :
                          ∀ (x y : RingQuot r),
                            OneHom.toFun
                                {
                                  toFun := fun x =>
                                    Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                      (_ :
                                        ∀ (a b : R),
                                          Rel r a b →
                                            ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                      x.toQuot,
                                  map_one' :=
                                    (_ :
                                      Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                          (_ :
                                            ∀ (a b : R),
                                              Rel r a b →
                                                ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                          1.toQuot =
                                        1) }
                                (x * y) =
                              OneHom.toFun
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                        (_ :
                                          ∀ (a b : R),
                                            Rel r a b →
                                              ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                            (_ :
                                              ∀ (a b : R),
                                                Rel r a b →
                                                  ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                            1.toQuot =
                                          1) }
                                  x *
                                OneHom.toFun
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                        (_ :
                                          ∀ (a b : R),
                                            Rel r a b →
                                              ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                            (_ :
                                              ∀ (a b : R),
                                                Rel r a b →
                                                  ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                            1.toQuot =
                                          1) }
                                  y) })
                  y) } =
    F
[PROOFSTEP]
ext
[GOAL]
case w.a
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✝ : Semiring T
r : R → R → Prop
F : RingQuot r →+* T
x✝ : R
⊢ ↑(RingHom.comp
          {
            toMonoidHom :=
              {
                toOneHom :=
                  {
                    toFun := fun x =>
                      Quot.lift ↑(RingHom.comp F (mkRingHom r))
                        (_ :
                          ∀ (a b : R),
                            Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                        x.toQuot,
                    map_one' :=
                      (_ :
                        Quot.lift ↑(RingHom.comp F (mkRingHom r))
                            (_ :
                              ∀ (a b : R),
                                Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                            1.toQuot =
                          1) },
                map_mul' :=
                  (_ :
                    ∀ (x y : RingQuot r),
                      OneHom.toFun
                          {
                            toFun := fun x =>
                              Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                (_ :
                                  ∀ (a b : R),
                                    Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                x.toQuot,
                            map_one' :=
                              (_ :
                                Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                    (_ :
                                      ∀ (a b : R),
                                        Rel r a b →
                                          ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                    1.toQuot =
                                  1) }
                          (x * y) =
                        OneHom.toFun
                            {
                              toFun := fun x =>
                                Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                  (_ :
                                    ∀ (a b : R),
                                      Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                  x.toQuot,
                              map_one' :=
                                (_ :
                                  Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                      (_ :
                                        ∀ (a b : R),
                                          Rel r a b →
                                            ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                      1.toQuot =
                                    1) }
                            x *
                          OneHom.toFun
                            {
                              toFun := fun x =>
                                Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                  (_ :
                                    ∀ (a b : R),
                                      Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                  x.toQuot,
                              map_one' :=
                                (_ :
                                  Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                      (_ :
                                        ∀ (a b : R),
                                          Rel r a b →
                                            ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                      1.toQuot =
                                    1) }
                            y) },
            map_zero' :=
              (_ :
                Quot.lift ↑(RingHom.comp F (mkRingHom r))
                    (_ : ∀ (a b : R), Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                    0.toQuot =
                  0),
            map_add' :=
              (_ :
                ∀ (x y : RingQuot r),
                  OneHom.toFun
                      (↑{
                          toOneHom :=
                            {
                              toFun := fun x =>
                                Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                  (_ :
                                    ∀ (a b : R),
                                      Rel r a b → ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                  x.toQuot,
                              map_one' :=
                                (_ :
                                  Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                      (_ :
                                        ∀ (a b : R),
                                          Rel r a b →
                                            ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                      1.toQuot =
                                    1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : RingQuot r),
                                OneHom.toFun
                                    {
                                      toFun := fun x =>
                                        Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                          (_ :
                                            ∀ (a b : R),
                                              Rel r a b →
                                                ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                          x.toQuot,
                                      map_one' :=
                                        (_ :
                                          Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                              (_ :
                                                ∀ (a b : R),
                                                  Rel r a b →
                                                    ↑(RingHom.comp F (mkRingHom r)) a =
                                                      ↑(RingHom.comp F (mkRingHom r)) b)
                                              1.toQuot =
                                            1) }
                                    (x * y) =
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                            (_ :
                                              ∀ (a b : R),
                                                Rel r a b →
                                                  ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                                (_ :
                                                  ∀ (a b : R),
                                                    Rel r a b →
                                                      ↑(RingHom.comp F (mkRingHom r)) a =
                                                        ↑(RingHom.comp F (mkRingHom r)) b)
                                                1.toQuot =
                                              1) }
                                      x *
                                    OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                            (_ :
                                              ∀ (a b : R),
                                                Rel r a b →
                                                  ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                                (_ :
                                                  ∀ (a b : R),
                                                    Rel r a b →
                                                      ↑(RingHom.comp F (mkRingHom r)) a =
                                                        ↑(RingHom.comp F (mkRingHom r)) b)
                                                1.toQuot =
                                              1) }
                                      y) })
                      (x + y) =
                    OneHom.toFun
                        (↑{
                            toOneHom :=
                              {
                                toFun := fun x =>
                                  Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                    (_ :
                                      ∀ (a b : R),
                                        Rel r a b →
                                          ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                    x.toQuot,
                                map_one' :=
                                  (_ :
                                    Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                        (_ :
                                          ∀ (a b : R),
                                            Rel r a b →
                                              ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                        1.toQuot =
                                      1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : RingQuot r),
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                            (_ :
                                              ∀ (a b : R),
                                                Rel r a b →
                                                  ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                                (_ :
                                                  ∀ (a b : R),
                                                    Rel r a b →
                                                      ↑(RingHom.comp F (mkRingHom r)) a =
                                                        ↑(RingHom.comp F (mkRingHom r)) b)
                                                1.toQuot =
                                              1) }
                                      (x * y) =
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                              (_ :
                                                ∀ (a b : R),
                                                  Rel r a b →
                                                    ↑(RingHom.comp F (mkRingHom r)) a =
                                                      ↑(RingHom.comp F (mkRingHom r)) b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                                  (_ :
                                                    ∀ (a b : R),
                                                      Rel r a b →
                                                        ↑(RingHom.comp F (mkRingHom r)) a =
                                                          ↑(RingHom.comp F (mkRingHom r)) b)
                                                  1.toQuot =
                                                1) }
                                        x *
                                      OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                              (_ :
                                                ∀ (a b : R),
                                                  Rel r a b →
                                                    ↑(RingHom.comp F (mkRingHom r)) a =
                                                      ↑(RingHom.comp F (mkRingHom r)) b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                                  (_ :
                                                    ∀ (a b : R),
                                                      Rel r a b →
                                                        ↑(RingHom.comp F (mkRingHom r)) a =
                                                          ↑(RingHom.comp F (mkRingHom r)) b)
                                                  1.toQuot =
                                                1) }
                                        y) })
                        x +
                      OneHom.toFun
                        (↑{
                            toOneHom :=
                              {
                                toFun := fun x =>
                                  Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                    (_ :
                                      ∀ (a b : R),
                                        Rel r a b →
                                          ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                    x.toQuot,
                                map_one' :=
                                  (_ :
                                    Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                        (_ :
                                          ∀ (a b : R),
                                            Rel r a b →
                                              ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                        1.toQuot =
                                      1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : RingQuot r),
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                            (_ :
                                              ∀ (a b : R),
                                                Rel r a b →
                                                  ↑(RingHom.comp F (mkRingHom r)) a = ↑(RingHom.comp F (mkRingHom r)) b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                                (_ :
                                                  ∀ (a b : R),
                                                    Rel r a b →
                                                      ↑(RingHom.comp F (mkRingHom r)) a =
                                                        ↑(RingHom.comp F (mkRingHom r)) b)
                                                1.toQuot =
                                              1) }
                                      (x * y) =
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                              (_ :
                                                ∀ (a b : R),
                                                  Rel r a b →
                                                    ↑(RingHom.comp F (mkRingHom r)) a =
                                                      ↑(RingHom.comp F (mkRingHom r)) b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                                  (_ :
                                                    ∀ (a b : R),
                                                      Rel r a b →
                                                        ↑(RingHom.comp F (mkRingHom r)) a =
                                                          ↑(RingHom.comp F (mkRingHom r)) b)
                                                  1.toQuot =
                                                1) }
                                        x *
                                      OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                              (_ :
                                                ∀ (a b : R),
                                                  Rel r a b →
                                                    ↑(RingHom.comp F (mkRingHom r)) a =
                                                      ↑(RingHom.comp F (mkRingHom r)) b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑(RingHom.comp F (mkRingHom r))
                                                  (_ :
                                                    ∀ (a b : R),
                                                      Rel r a b →
                                                        ↑(RingHom.comp F (mkRingHom r)) a =
                                                          ↑(RingHom.comp F (mkRingHom r)) b)
                                                  1.toQuot =
                                                1) }
                                        y) })
                        y) }
          (mkRingHom r))
      x✝ =
    ↑(RingHom.comp F (mkRingHom r)) x✝
[PROOFSTEP]
simp only [mkRingHom_def, RingHom.coe_comp, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk, Function.comp_apply,
  forall_const]
[GOAL]
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✝ : Semiring T
f : R →+* T
r : R → R → Prop
w : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
x : R
⊢ ↑(↑lift { val := f, property := w }) (↑(mkRingHom r) x) = ↑f x
[PROOFSTEP]
simp_rw [lift_def, preLift_def, mkRingHom_def]
[GOAL]
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✝ : Semiring T
f : R →+* T
r : R → R → Prop
w : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
x : R
⊢ ↑(↑{
              toFun := fun f =>
                {
                  toMonoidHom :=
                    {
                      toOneHom :=
                        {
                          toFun := fun x =>
                            Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                          map_one' :=
                            (_ :
                              Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 1.toQuot =
                                1) },
                      map_mul' :=
                        (_ :
                          ∀ (x y : RingQuot fun x y => r x y),
                            OneHom.toFun
                                {
                                  toFun := fun x =>
                                    Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                      x.toQuot,
                                  map_one' :=
                                    (_ :
                                      Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                          1.toQuot =
                                        1) }
                                (x * y) =
                              OneHom.toFun
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            1.toQuot =
                                          1) }
                                  x *
                                OneHom.toFun
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            1.toQuot =
                                          1) }
                                  y) },
                  map_zero' :=
                    (_ : Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot = 0),
                  map_add' :=
                    (_ :
                      ∀ (x y : RingQuot fun x y => r x y),
                        OneHom.toFun
                            (↑{
                                toOneHom :=
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            1.toQuot =
                                          1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (x y : RingQuot fun x y => r x y),
                                      OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f
                                                (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f
                                                    (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    1.toQuot =
                                                  1) }
                                          (x * y) =
                                        OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            x *
                                          OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            y) })
                            (x + y) =
                          OneHom.toFun
                              (↑{
                                  toOneHom :=
                                    {
                                      toFun := fun x =>
                                        Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                          x.toQuot,
                                      map_one' :=
                                        (_ :
                                          Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              1.toQuot =
                                            1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (x y : RingQuot fun x y => r x y),
                                        OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            (x * y) =
                                          OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              x *
                                            OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              y) })
                              x +
                            OneHom.toFun
                              (↑{
                                  toOneHom :=
                                    {
                                      toFun := fun x =>
                                        Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                          x.toQuot,
                                      map_one' :=
                                        (_ :
                                          Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              1.toQuot =
                                            1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (x y : RingQuot fun x y => r x y),
                                        OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            (x * y) =
                                          OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              x *
                                            OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              y) })
                              y) },
              invFun := fun F =>
                {
                  val :=
                    RingHom.comp F
                      {
                        toMonoidHom :=
                          {
                            toOneHom :=
                              { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (a a_1 : R),
                                  { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                    { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                      { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                        map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                        map_add' :=
                          (_ :
                            ∀ (a a_1 : R),
                              { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                  { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                  property :=
                    (_ :
                      (fun f => ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y)
                        (RingHom.comp F
                          {
                            toMonoidHom :=
                              {
                                toOneHom :=
                                  { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                    map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (a a_1 : R),
                                      { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                        { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                            map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                            map_add' :=
                              (_ :
                                ∀ (a a_1 : R),
                                  { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                    { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                      { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) },
              left_inv :=
                (_ :
                  Function.LeftInverse
                    (fun F =>
                      {
                        val :=
                          RingHom.comp F
                            {
                              toMonoidHom :=
                                {
                                  toOneHom :=
                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                      map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (a a_1 : R),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                              map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                              map_add' :=
                                (_ :
                                  ∀ (a a_1 : R),
                                    { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                      { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                        { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                        property :=
                          (_ :
                            (fun f => ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y)
                              (RingHom.comp F
                                {
                                  toMonoidHom :=
                                    {
                                      toOneHom :=
                                        { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                          map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (a a_1 : R),
                                            { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                              { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                  map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                  map_add' :=
                                    (_ :
                                      ∀ (a a_1 : R),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) })
                    fun f =>
                    {
                      toMonoidHom :=
                        {
                          toOneHom :=
                            {
                              toFun := fun x =>
                                Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                              map_one' :=
                                (_ :
                                  Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 1.toQuot =
                                    1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : RingQuot fun x y => r x y),
                                OneHom.toFun
                                    {
                                      toFun := fun x =>
                                        Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                          x.toQuot,
                                      map_one' :=
                                        (_ :
                                          Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              1.toQuot =
                                            1) }
                                    (x * y) =
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) }
                                      x *
                                    OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) }
                                      y) },
                      map_zero' :=
                        (_ : Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot = 0),
                      map_add' :=
                        (_ :
                          ∀ (x y : RingQuot fun x y => r x y),
                            OneHom.toFun
                                (↑{
                                    toOneHom :=
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) },
                                    map_mul' :=
                                      (_ :
                                        ∀ (x y : RingQuot fun x y => r x y),
                                          OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              (x * y) =
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                x *
                                              OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                y) })
                                (x + y) =
                              OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => r x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  x +
                                OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => r x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  y) }),
              right_inv :=
                (_ :
                  Function.RightInverse
                    (fun F =>
                      {
                        val :=
                          RingHom.comp F
                            {
                              toMonoidHom :=
                                {
                                  toOneHom :=
                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                      map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (a a_1 : R),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                              map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                              map_add' :=
                                (_ :
                                  ∀ (a a_1 : R),
                                    { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                      { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                        { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                        property :=
                          (_ :
                            (fun f => ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y)
                              (RingHom.comp F
                                {
                                  toMonoidHom :=
                                    {
                                      toOneHom :=
                                        { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                          map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (a a_1 : R),
                                            { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                              { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                  map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                  map_add' :=
                                    (_ :
                                      ∀ (a a_1 : R),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) })
                    fun f =>
                    {
                      toMonoidHom :=
                        {
                          toOneHom :=
                            {
                              toFun := fun x =>
                                Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                              map_one' :=
                                (_ :
                                  Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 1.toQuot =
                                    1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : RingQuot fun x y => r x y),
                                OneHom.toFun
                                    {
                                      toFun := fun x =>
                                        Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                          x.toQuot,
                                      map_one' :=
                                        (_ :
                                          Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              1.toQuot =
                                            1) }
                                    (x * y) =
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) }
                                      x *
                                    OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) }
                                      y) },
                      map_zero' :=
                        (_ : Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot = 0),
                      map_add' :=
                        (_ :
                          ∀ (x y : RingQuot fun x y => r x y),
                            OneHom.toFun
                                (↑{
                                    toOneHom :=
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) },
                                    map_mul' :=
                                      (_ :
                                        ∀ (x y : RingQuot fun x y => r x y),
                                          OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              (x * y) =
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                x *
                                              OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                y) })
                                (x + y) =
                              OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => r x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  x +
                                OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => r x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : R), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  y) }) }
          { val := f, property := w })
      (↑{
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                    map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
                map_mul' :=
                  (_ :
                    ∀ (a a_1 : R),
                      { toQuot := Quot.mk (Rel r) (a * a_1) } =
                        { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) },
            map_zero' := (_ : { toQuot := Quot.mk (Rel r) 0 } = 0),
            map_add' :=
              (_ :
                ∀ (a a_1 : R),
                  { toQuot := Quot.mk (Rel r) (a + a_1) } =
                    { toQuot := Quot.mk (Rel r) a } + { toQuot := Quot.mk (Rel r) a_1 }) }
        x) =
    ↑f x
[PROOFSTEP]
rfl
[GOAL]
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✝ : Semiring T
f : R →+* T
r : R → R → Prop
w : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
g : RingQuot r →+* T
h : RingHom.comp g (mkRingHom r) = f
⊢ g = ↑lift { val := f, property := w }
[PROOFSTEP]
ext
[GOAL]
case w.a
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✝ : Semiring T
f : R →+* T
r : R → R → Prop
w : ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y
g : RingQuot r →+* T
h : RingHom.comp g (mkRingHom r) = f
x✝ : R
⊢ ↑(RingHom.comp g (mkRingHom r)) x✝ = ↑(RingHom.comp (↑lift { val := f, property := w }) (mkRingHom r)) x✝
[PROOFSTEP]
simp [h]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : RingQuot r →+* T
⊢ f =
    ↑lift
      { val := RingHom.comp f (mkRingHom r),
        property := (_ : ∀ (x y : R), r x y → ↑f (↑(mkRingHom r) x) = ↑f (↑(mkRingHom r) y)) }
[PROOFSTEP]
conv_lhs => rw [← lift.apply_symm_apply f]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : RingQuot r →+* T
| f
[PROOFSTEP]
rw [← lift.apply_symm_apply f]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : RingQuot r →+* T
| f
[PROOFSTEP]
rw [← lift.apply_symm_apply f]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : RingQuot r →+* T
| f
[PROOFSTEP]
rw [← lift.apply_symm_apply f]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : RingQuot r →+* T
⊢ ↑lift (↑lift.symm f) =
    ↑lift
      { val := RingHom.comp f (mkRingHom r),
        property := (_ : ∀ (x y : R), r x y → ↑f (↑(mkRingHom r) x) = ↑f (↑(mkRingHom r) y)) }
[PROOFSTEP]
rw [lift_def]
[GOAL]
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✝ : Semiring T
r : R → R → Prop
f : RingQuot r →+* T
⊢ ↑{ toFun := fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y),
          invFun := fun F =>
            { val := RingHom.comp F (mkRingHom r),
              property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) },
          left_inv :=
            (_ :
              ∀ (f : { f // ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y }),
                (fun F =>
                      { val := RingHom.comp F (mkRingHom r),
                        property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) })
                    ((fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y)) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (F : RingQuot r →+* T),
                (fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y))
                    ((fun F =>
                        { val := RingHom.comp F (mkRingHom r),
                          property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) })
                      F) =
                  F) }
      (↑{ toFun := fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y),
              invFun := fun F =>
                { val := RingHom.comp F (mkRingHom r),
                  property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) },
              left_inv :=
                (_ :
                  ∀ (f : { f // ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y }),
                    (fun F =>
                          { val := RingHom.comp F (mkRingHom r),
                            property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) })
                        ((fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y)) f) =
                      f),
              right_inv :=
                (_ :
                  ∀ (F : RingQuot r →+* T),
                    (fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y))
                        ((fun F =>
                            { val := RingHom.comp F (mkRingHom r),
                              property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) })
                          F) =
                      F) }.symm
        f) =
    ↑{ toFun := fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y),
          invFun := fun F =>
            { val := RingHom.comp F (mkRingHom r),
              property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) },
          left_inv :=
            (_ :
              ∀ (f : { f // ∀ ⦃x y : R⦄, r x y → ↑f x = ↑f y }),
                (fun F =>
                      { val := RingHom.comp F (mkRingHom r),
                        property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) })
                    ((fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y)) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (F : RingQuot r →+* T),
                (fun f => preLift (_ : ∀ ⦃x y : R⦄, r x y → ↑↑f x = ↑↑f y))
                    ((fun F =>
                        { val := RingHom.comp F (mkRingHom r),
                          property := (_ : ∀ (x y : R), r x y → ↑F (↑(mkRingHom r) x) = ↑F (↑(mkRingHom r) y)) })
                      F) =
                  F) }
      { val := RingHom.comp f (mkRingHom r),
        property := (_ : ∀ (x y : R), r x y → ↑f (↑(mkRingHom r) x) = ↑f (↑(mkRingHom r) y)) }
[PROOFSTEP]
rfl
[GOAL]
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
⊢ ↑(ringQuotToIdealQuotient r) (↑(mkRingHom r) x) = ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x
[PROOFSTEP]
simp_rw [ringQuotToIdealQuotient, lift_def, preLift_def, mkRingHom_def]
[GOAL]
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
⊢ ↑(↑{
              toFun := fun f =>
                {
                  toMonoidHom :=
                    {
                      toOneHom :=
                        {
                          toFun := fun x =>
                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                          map_one' :=
                            (_ :
                              Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 1.toQuot =
                                1) },
                      map_mul' :=
                        (_ :
                          ∀ (x y : RingQuot fun x y => r x y),
                            OneHom.toFun
                                {
                                  toFun := fun x =>
                                    Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                      x.toQuot,
                                  map_one' :=
                                    (_ :
                                      Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                          1.toQuot =
                                        1) }
                                (x * y) =
                              OneHom.toFun
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            1.toQuot =
                                          1) }
                                  x *
                                OneHom.toFun
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            1.toQuot =
                                          1) }
                                  y) },
                  map_zero' :=
                    (_ : Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot = 0),
                  map_add' :=
                    (_ :
                      ∀ (x y : RingQuot fun x y => r x y),
                        OneHom.toFun
                            (↑{
                                toOneHom :=
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            1.toQuot =
                                          1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (x y : RingQuot fun x y => r x y),
                                      OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f
                                                (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    1.toQuot =
                                                  1) }
                                          (x * y) =
                                        OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            x *
                                          OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            y) })
                            (x + y) =
                          OneHom.toFun
                              (↑{
                                  toOneHom :=
                                    {
                                      toFun := fun x =>
                                        Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                          x.toQuot,
                                      map_one' :=
                                        (_ :
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              1.toQuot =
                                            1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (x y : RingQuot fun x y => r x y),
                                        OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            (x * y) =
                                          OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              x *
                                            OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              y) })
                              x +
                            OneHom.toFun
                              (↑{
                                  toOneHom :=
                                    {
                                      toFun := fun x =>
                                        Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                          x.toQuot,
                                      map_one' :=
                                        (_ :
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              1.toQuot =
                                            1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (x y : RingQuot fun x y => r x y),
                                        OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            (x * y) =
                                          OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              x *
                                            OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              y) })
                              y) },
              invFun := fun F =>
                {
                  val :=
                    RingHom.comp F
                      {
                        toMonoidHom :=
                          {
                            toOneHom :=
                              { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (a a_1 : B),
                                  { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                    { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                      { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                        map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                        map_add' :=
                          (_ :
                            ∀ (a a_1 : B),
                              { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                  { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                  property :=
                    (_ :
                      (fun f => ∀ ⦃x y : B⦄, r x y → ↑f x = ↑f y)
                        (RingHom.comp F
                          {
                            toMonoidHom :=
                              {
                                toOneHom :=
                                  { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                    map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (a a_1 : B),
                                      { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                        { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                            map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                            map_add' :=
                              (_ :
                                ∀ (a a_1 : B),
                                  { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                    { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                      { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) },
              left_inv :=
                (_ :
                  Function.LeftInverse
                    (fun F =>
                      {
                        val :=
                          RingHom.comp F
                            {
                              toMonoidHom :=
                                {
                                  toOneHom :=
                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                      map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (a a_1 : B),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                              map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                              map_add' :=
                                (_ :
                                  ∀ (a a_1 : B),
                                    { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                      { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                        { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                        property :=
                          (_ :
                            (fun f => ∀ ⦃x y : B⦄, r x y → ↑f x = ↑f y)
                              (RingHom.comp F
                                {
                                  toMonoidHom :=
                                    {
                                      toOneHom :=
                                        { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                          map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (a a_1 : B),
                                            { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                              { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                  map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                  map_add' :=
                                    (_ :
                                      ∀ (a a_1 : B),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) })
                    fun f =>
                    {
                      toMonoidHom :=
                        {
                          toOneHom :=
                            {
                              toFun := fun x =>
                                Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                              map_one' :=
                                (_ :
                                  Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 1.toQuot =
                                    1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : RingQuot fun x y => r x y),
                                OneHom.toFun
                                    {
                                      toFun := fun x =>
                                        Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                          x.toQuot,
                                      map_one' :=
                                        (_ :
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              1.toQuot =
                                            1) }
                                    (x * y) =
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) }
                                      x *
                                    OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) }
                                      y) },
                      map_zero' :=
                        (_ : Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot = 0),
                      map_add' :=
                        (_ :
                          ∀ (x y : RingQuot fun x y => r x y),
                            OneHom.toFun
                                (↑{
                                    toOneHom :=
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) },
                                    map_mul' :=
                                      (_ :
                                        ∀ (x y : RingQuot fun x y => r x y),
                                          OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              (x * y) =
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                x *
                                              OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                y) })
                                (x + y) =
                              OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => r x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  x +
                                OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => r x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  y) }),
              right_inv :=
                (_ :
                  Function.RightInverse
                    (fun F =>
                      {
                        val :=
                          RingHom.comp F
                            {
                              toMonoidHom :=
                                {
                                  toOneHom :=
                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                      map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (a a_1 : B),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                              map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                              map_add' :=
                                (_ :
                                  ∀ (a a_1 : B),
                                    { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                      { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                        { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                        property :=
                          (_ :
                            (fun f => ∀ ⦃x y : B⦄, r x y → ↑f x = ↑f y)
                              (RingHom.comp F
                                {
                                  toMonoidHom :=
                                    {
                                      toOneHom :=
                                        { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                          map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (a a_1 : B),
                                            { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                              { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                  map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                  map_add' :=
                                    (_ :
                                      ∀ (a a_1 : B),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) })
                    fun f =>
                    {
                      toMonoidHom :=
                        {
                          toOneHom :=
                            {
                              toFun := fun x =>
                                Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                              map_one' :=
                                (_ :
                                  Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 1.toQuot =
                                    1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : RingQuot fun x y => r x y),
                                OneHom.toFun
                                    {
                                      toFun := fun x =>
                                        Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                          x.toQuot,
                                      map_one' :=
                                        (_ :
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              1.toQuot =
                                            1) }
                                    (x * y) =
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) }
                                      x *
                                    OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) }
                                      y) },
                      map_zero' :=
                        (_ : Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot = 0),
                      map_add' :=
                        (_ :
                          ∀ (x y : RingQuot fun x y => r x y),
                            OneHom.toFun
                                (↑{
                                    toOneHom :=
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) },
                                    map_mul' :=
                                      (_ :
                                        ∀ (x y : RingQuot fun x y => r x y),
                                          OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) }
                                              (x * y) =
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                x *
                                              OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                y) })
                                (x + y) =
                              OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => r x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  x +
                                OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => r x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  y) }) }
          { val := Ideal.Quotient.mk (Ideal.ofRel r),
            property :=
              (_ :
                ∀ (x y : B), r x y → ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x = ↑(Ideal.Quotient.mk (Ideal.ofRel r)) y) })
      (↑{
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                    map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
                map_mul' :=
                  (_ :
                    ∀ (a a_1 : B),
                      { toQuot := Quot.mk (Rel r) (a * a_1) } =
                        { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) },
            map_zero' := (_ : { toQuot := Quot.mk (Rel r) 0 } = 0),
            map_add' :=
              (_ :
                ∀ (a a_1 : B),
                  { toQuot := Quot.mk (Rel r) (a + a_1) } =
                    { toQuot := Quot.mk (Rel r) a } + { toQuot := Quot.mk (Rel r) a_1 }) }
        x) =
    ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x
[PROOFSTEP]
rfl
[GOAL]
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
⊢ ∀ (a : B), a ∈ Ideal.ofRel r → ↑(mkRingHom r) a = 0
[PROOFSTEP]
refine' fun x h ↦ Submodule.span_induction h _ _ _ _
[GOAL]
case refine'_1
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
h : x ∈ Ideal.ofRel r
⊢ ∀ (x : B), x ∈ {x | ∃ a b _h, x + b = a} → ↑(mkRingHom r) x = 0
[PROOFSTEP]
rintro y ⟨a, b, h, su⟩
[GOAL]
case refine'_1.intro.intro.intro
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
h✝ : x ∈ Ideal.ofRel r
y a b : B
h : r a b
su : y + b = a
⊢ ↑(mkRingHom r) y = 0
[PROOFSTEP]
symm at su
[GOAL]
case refine'_1.intro.intro.intro
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
h✝ : x ∈ Ideal.ofRel r
y a b : B
h : r a b
su : a = y + b
⊢ ↑(mkRingHom r) y = 0
[PROOFSTEP]
rw [← sub_eq_iff_eq_add] at su
[GOAL]
case refine'_1.intro.intro.intro
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
h✝ : x ∈ Ideal.ofRel r
y a b : B
h : r a b
su : a - b = y
⊢ ↑(mkRingHom r) y = 0
[PROOFSTEP]
rw [← su, RingHom.map_sub, mkRingHom_rel h, sub_self]
[GOAL]
case refine'_2
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
h : x ∈ Ideal.ofRel r
⊢ ↑(mkRingHom r) 0 = 0
[PROOFSTEP]
simp
[GOAL]
case refine'_3
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
h : x ∈ Ideal.ofRel r
⊢ ∀ (x y : B), ↑(mkRingHom r) x = 0 → ↑(mkRingHom r) y = 0 → ↑(mkRingHom r) (x + y) = 0
[PROOFSTEP]
intro a b ha hb
[GOAL]
case refine'_3
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
h : x ∈ Ideal.ofRel r
a b : B
ha : ↑(mkRingHom r) a = 0
hb : ↑(mkRingHom r) b = 0
⊢ ↑(mkRingHom r) (a + b) = 0
[PROOFSTEP]
simp [ha, hb]
[GOAL]
case refine'_4
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
h : x ∈ Ideal.ofRel r
⊢ ∀ (a x : B), ↑(mkRingHom r) x = 0 → ↑(mkRingHom r) (a • x) = 0
[PROOFSTEP]
intro a x hx
[GOAL]
case refine'_4
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x✝ : B
h : x✝ ∈ Ideal.ofRel r
a x : B
hx : ↑(mkRingHom r) x = 0
⊢ ↑(mkRingHom r) (a • x) = 0
[PROOFSTEP]
simp [hx]
[GOAL]
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
⊢ RingHom.comp ↑(idealQuotientToRingQuot r) ↑(ringQuotToIdealQuotient r) = RingHom.id (RingQuot r)
[PROOFSTEP]
ext x
[GOAL]
case w.a
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
⊢ ↑(RingHom.comp (RingHom.comp ↑(idealQuotientToRingQuot r) ↑(ringQuotToIdealQuotient r)) (mkRingHom r)) x =
    ↑(RingHom.comp (RingHom.id (RingQuot r)) (mkRingHom r)) x
[PROOFSTEP]
simp_rw [ringQuotToIdealQuotient, lift_def, preLift_def, mkRingHom_def]
[GOAL]
case w.a
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
⊢ ↑(RingHom.comp
          (RingHom.comp ↑(idealQuotientToRingQuot r)
            ↑(↑{
                    toFun := fun f =>
                      {
                        toMonoidHom :=
                          {
                            toOneHom :=
                              {
                                toFun := fun x =>
                                  Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                map_one' :=
                                  (_ :
                                    Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        1.toQuot =
                                      1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : RingQuot fun x y => r x y),
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) }
                                      (x * y) =
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) }
                                        x *
                                      OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) }
                                        y) },
                        map_zero' :=
                          (_ :
                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot = 0),
                        map_add' :=
                          (_ :
                            ∀ (x y : RingQuot fun x y => r x y),
                              OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => r x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  (x + y) =
                                OneHom.toFun
                                    (↑{
                                        toOneHom :=
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f
                                                (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    1.toQuot =
                                                  1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (x y : RingQuot fun x y => r x y),
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  (x * y) =
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    x *
                                                  OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    y) })
                                    x +
                                  OneHom.toFun
                                    (↑{
                                        toOneHom :=
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f
                                                (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    1.toQuot =
                                                  1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (x y : RingQuot fun x y => r x y),
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  (x * y) =
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    x *
                                                  OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    y) })
                                    y) },
                    invFun := fun F =>
                      {
                        val :=
                          RingHom.comp F
                            {
                              toMonoidHom :=
                                {
                                  toOneHom :=
                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                      map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (a a_1 : B),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                              map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                              map_add' :=
                                (_ :
                                  ∀ (a a_1 : B),
                                    { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                      { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                        { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                        property :=
                          (_ :
                            (fun f => ∀ ⦃x y : B⦄, r x y → ↑f x = ↑f y)
                              (RingHom.comp F
                                {
                                  toMonoidHom :=
                                    {
                                      toOneHom :=
                                        { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                          map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (a a_1 : B),
                                            { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                              { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                  map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                  map_add' :=
                                    (_ :
                                      ∀ (a a_1 : B),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) },
                    left_inv :=
                      (_ :
                        Function.LeftInverse
                          (fun F =>
                            {
                              val :=
                                RingHom.comp F
                                  {
                                    toMonoidHom :=
                                      {
                                        toOneHom :=
                                          { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                            map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (a a_1 : B),
                                              { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                    map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                    map_add' :=
                                      (_ :
                                        ∀ (a a_1 : B),
                                          { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                              { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                              property :=
                                (_ :
                                  (fun f => ∀ ⦃x y : B⦄, r x y → ↑f x = ↑f y)
                                    (RingHom.comp F
                                      {
                                        toMonoidHom :=
                                          {
                                            toOneHom :=
                                              { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                                map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (a a_1 : B),
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                                    { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                      { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                        map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                        map_add' :=
                                          (_ :
                                            ∀ (a a_1 : B),
                                              { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) })
                          fun f =>
                          {
                            toMonoidHom :=
                              {
                                toOneHom :=
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            1.toQuot =
                                          1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (x y : RingQuot fun x y => r x y),
                                      OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f
                                                (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    1.toQuot =
                                                  1) }
                                          (x * y) =
                                        OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            x *
                                          OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            y) },
                            map_zero' :=
                              (_ :
                                Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot =
                                  0),
                            map_add' :=
                              (_ :
                                ∀ (x y : RingQuot fun x y => r x y),
                                  OneHom.toFun
                                      (↑{
                                          toOneHom :=
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : RingQuot fun x y => r x y),
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    (x * y) =
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      x *
                                                    OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      y) })
                                      (x + y) =
                                    OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : RingQuot fun x y => r x y),
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      (x * y) =
                                                    OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        x *
                                                      OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        y) })
                                        x +
                                      OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : RingQuot fun x y => r x y),
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      (x * y) =
                                                    OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        x *
                                                      OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        y) })
                                        y) }),
                    right_inv :=
                      (_ :
                        Function.RightInverse
                          (fun F =>
                            {
                              val :=
                                RingHom.comp F
                                  {
                                    toMonoidHom :=
                                      {
                                        toOneHom :=
                                          { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                            map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (a a_1 : B),
                                              { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                    map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                    map_add' :=
                                      (_ :
                                        ∀ (a a_1 : B),
                                          { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                              { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                              property :=
                                (_ :
                                  (fun f => ∀ ⦃x y : B⦄, r x y → ↑f x = ↑f y)
                                    (RingHom.comp F
                                      {
                                        toMonoidHom :=
                                          {
                                            toOneHom :=
                                              { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                                map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (a a_1 : B),
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                                    { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                      { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                        map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                        map_add' :=
                                          (_ :
                                            ∀ (a a_1 : B),
                                              { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) })
                          fun f =>
                          {
                            toMonoidHom :=
                              {
                                toOneHom :=
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            1.toQuot =
                                          1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (x y : RingQuot fun x y => r x y),
                                      OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f
                                                (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    1.toQuot =
                                                  1) }
                                          (x * y) =
                                        OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            x *
                                          OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            y) },
                            map_zero' :=
                              (_ :
                                Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot =
                                  0),
                            map_add' :=
                              (_ :
                                ∀ (x y : RingQuot fun x y => r x y),
                                  OneHom.toFun
                                      (↑{
                                          toOneHom :=
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : RingQuot fun x y => r x y),
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    (x * y) =
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      x *
                                                    OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      y) })
                                      (x + y) =
                                    OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : RingQuot fun x y => r x y),
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      (x * y) =
                                                    OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        x *
                                                      OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        y) })
                                        x +
                                      OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : RingQuot fun x y => r x y),
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      (x * y) =
                                                    OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        x *
                                                      OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        y) })
                                        y) }) }
                { val := Ideal.Quotient.mk (Ideal.ofRel r),
                  property :=
                    (_ :
                      ∀ (x y : B),
                        r x y → ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x = ↑(Ideal.Quotient.mk (Ideal.ofRel r)) y) }))
          {
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                    map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
                map_mul' :=
                  (_ :
                    ∀ (a a_1 : B),
                      { toQuot := Quot.mk (Rel r) (a * a_1) } =
                        { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) },
            map_zero' := (_ : { toQuot := Quot.mk (Rel r) 0 } = 0),
            map_add' :=
              (_ :
                ∀ (a a_1 : B),
                  { toQuot := Quot.mk (Rel r) (a + a_1) } =
                    { toQuot := Quot.mk (Rel r) a } + { toQuot := Quot.mk (Rel r) a_1 }) })
      x =
    ↑(RingHom.comp (RingHom.id (RingQuot r))
          {
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                    map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
                map_mul' :=
                  (_ :
                    ∀ (a a_1 : B),
                      { toQuot := Quot.mk (Rel r) (a * a_1) } =
                        { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) },
            map_zero' := (_ : { toQuot := Quot.mk (Rel r) 0 } = 0),
            map_add' :=
              (_ :
                ∀ (a a_1 : B),
                  { toQuot := Quot.mk (Rel r) (a + a_1) } =
                    { toQuot := Quot.mk (Rel r) a } + { toQuot := Quot.mk (Rel r) a_1 }) })
      x
[PROOFSTEP]
change mkRingHom r x = _
[GOAL]
case w.a
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
⊢ ↑(mkRingHom r) x =
    ↑(RingHom.comp (RingHom.id (RingQuot r))
          {
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                    map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
                map_mul' :=
                  (_ :
                    ∀ (a a_1 : B),
                      { toQuot := Quot.mk (Rel r) (a * a_1) } =
                        { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) },
            map_zero' := (_ : { toQuot := Quot.mk (Rel r) 0 } = 0),
            map_add' :=
              (_ :
                ∀ (a a_1 : B),
                  { toQuot := Quot.mk (Rel r) (a + a_1) } =
                    { toQuot := Quot.mk (Rel r) a } + { toQuot := Quot.mk (Rel r) a_1 }) })
      x
[PROOFSTEP]
rw [mkRingHom_def]
[GOAL]
case w.a
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
⊢ ↑{
          toMonoidHom :=
            {
              toOneHom :=
                { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                  map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
              map_mul' :=
                (_ :
                  ∀ (a a_1 : B),
                    { toQuot := Quot.mk (Rel r) (a * a_1) } =
                      { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) },
          map_zero' := (_ : { toQuot := Quot.mk (Rel r) 0 } = 0),
          map_add' :=
            (_ :
              ∀ (a a_1 : B),
                { toQuot := Quot.mk (Rel r) (a + a_1) } =
                  { toQuot := Quot.mk (Rel r) a } + { toQuot := Quot.mk (Rel r) a_1 }) }
      x =
    ↑(RingHom.comp (RingHom.id (RingQuot r))
          {
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                    map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
                map_mul' :=
                  (_ :
                    ∀ (a a_1 : B),
                      { toQuot := Quot.mk (Rel r) (a * a_1) } =
                        { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) },
            map_zero' := (_ : { toQuot := Quot.mk (Rel r) 0 } = 0),
            map_add' :=
              (_ :
                ∀ (a a_1 : B),
                  { toQuot := Quot.mk (Rel r) (a + a_1) } =
                    { toQuot := Quot.mk (Rel r) a } + { toQuot := Quot.mk (Rel r) a_1 }) })
      x
[PROOFSTEP]
rfl
[GOAL]
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
⊢ RingHom.comp ↑(ringQuotToIdealQuotient r) ↑(idealQuotientToRingQuot r) = RingHom.id (B ⧸ Ideal.ofRel r)
[PROOFSTEP]
ext x
[GOAL]
case h.a
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
⊢ ↑(RingHom.comp (RingHom.comp ↑(ringQuotToIdealQuotient r) ↑(idealQuotientToRingQuot r))
          (Ideal.Quotient.mk (Ideal.ofRel r)))
      x =
    ↑(RingHom.comp (RingHom.id (B ⧸ Ideal.ofRel r)) (Ideal.Quotient.mk (Ideal.ofRel r))) x
[PROOFSTEP]
simp_rw [ringQuotToIdealQuotient, lift_def, preLift_def, mkRingHom_def]
[GOAL]
case h.a
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
⊢ ↑(RingHom.comp
          (RingHom.comp
            ↑(↑{
                    toFun := fun f =>
                      {
                        toMonoidHom :=
                          {
                            toOneHom :=
                              {
                                toFun := fun x =>
                                  Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                map_one' :=
                                  (_ :
                                    Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        1.toQuot =
                                      1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : RingQuot fun x y => r x y),
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                1.toQuot =
                                              1) }
                                      (x * y) =
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) }
                                        x *
                                      OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) }
                                        y) },
                        map_zero' :=
                          (_ :
                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot = 0),
                        map_add' :=
                          (_ :
                            ∀ (x y : RingQuot fun x y => r x y),
                              OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                              x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => r x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  (x + y) =
                                OneHom.toFun
                                    (↑{
                                        toOneHom :=
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f
                                                (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    1.toQuot =
                                                  1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (x y : RingQuot fun x y => r x y),
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  (x * y) =
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    x *
                                                  OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    y) })
                                    x +
                                  OneHom.toFun
                                    (↑{
                                        toOneHom :=
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f
                                                (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    1.toQuot =
                                                  1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (x y : RingQuot fun x y => r x y),
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            1.toQuot =
                                                          1) }
                                                  (x * y) =
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    x *
                                                  OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    y) })
                                    y) },
                    invFun := fun F =>
                      {
                        val :=
                          RingHom.comp F
                            {
                              toMonoidHom :=
                                {
                                  toOneHom :=
                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                      map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                  map_mul' :=
                                    (_ :
                                      ∀ (a a_1 : B),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                              map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                              map_add' :=
                                (_ :
                                  ∀ (a a_1 : B),
                                    { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                      { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                        { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                        property :=
                          (_ :
                            (fun f => ∀ ⦃x y : B⦄, r x y → ↑f x = ↑f y)
                              (RingHom.comp F
                                {
                                  toMonoidHom :=
                                    {
                                      toOneHom :=
                                        { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                          map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (a a_1 : B),
                                            { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                              { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                  map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                  map_add' :=
                                    (_ :
                                      ∀ (a a_1 : B),
                                        { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                          { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) },
                    left_inv :=
                      (_ :
                        Function.LeftInverse
                          (fun F =>
                            {
                              val :=
                                RingHom.comp F
                                  {
                                    toMonoidHom :=
                                      {
                                        toOneHom :=
                                          { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                            map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (a a_1 : B),
                                              { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                    map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                    map_add' :=
                                      (_ :
                                        ∀ (a a_1 : B),
                                          { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                              { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                              property :=
                                (_ :
                                  (fun f => ∀ ⦃x y : B⦄, r x y → ↑f x = ↑f y)
                                    (RingHom.comp F
                                      {
                                        toMonoidHom :=
                                          {
                                            toOneHom :=
                                              { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                                map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (a a_1 : B),
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                                    { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                      { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                        map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                        map_add' :=
                                          (_ :
                                            ∀ (a a_1 : B),
                                              { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) })
                          fun f =>
                          {
                            toMonoidHom :=
                              {
                                toOneHom :=
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            1.toQuot =
                                          1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (x y : RingQuot fun x y => r x y),
                                      OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f
                                                (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    1.toQuot =
                                                  1) }
                                          (x * y) =
                                        OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            x *
                                          OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            y) },
                            map_zero' :=
                              (_ :
                                Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot =
                                  0),
                            map_add' :=
                              (_ :
                                ∀ (x y : RingQuot fun x y => r x y),
                                  OneHom.toFun
                                      (↑{
                                          toOneHom :=
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : RingQuot fun x y => r x y),
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    (x * y) =
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      x *
                                                    OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      y) })
                                      (x + y) =
                                    OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : RingQuot fun x y => r x y),
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      (x * y) =
                                                    OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        x *
                                                      OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        y) })
                                        x +
                                      OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : RingQuot fun x y => r x y),
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      (x * y) =
                                                    OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        x *
                                                      OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        y) })
                                        y) }),
                    right_inv :=
                      (_ :
                        Function.RightInverse
                          (fun F =>
                            {
                              val :=
                                RingHom.comp F
                                  {
                                    toMonoidHom :=
                                      {
                                        toOneHom :=
                                          { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                            map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (a a_1 : B),
                                              { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                    map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                    map_add' :=
                                      (_ :
                                        ∀ (a a_1 : B),
                                          { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                            { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                              { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                              property :=
                                (_ :
                                  (fun f => ∀ ⦃x y : B⦄, r x y → ↑f x = ↑f y)
                                    (RingHom.comp F
                                      {
                                        toMonoidHom :=
                                          {
                                            toOneHom :=
                                              { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => r x y) x },
                                                map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 1 } = 1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (a a_1 : B),
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) (a * a_1) } =
                                                    { toQuot := Quot.mk (Rel fun x y => r x y) a } *
                                                      { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) },
                                        map_zero' := (_ : { toQuot := Quot.mk (Rel fun x y => r x y) 0 } = 0),
                                        map_add' :=
                                          (_ :
                                            ∀ (a a_1 : B),
                                              { toQuot := Quot.mk (Rel fun x y => r x y) (a + a_1) } =
                                                { toQuot := Quot.mk (Rel fun x y => r x y) a } +
                                                  { toQuot := Quot.mk (Rel fun x y => r x y) a_1 }) })) })
                          fun f =>
                          {
                            toMonoidHom :=
                              {
                                toOneHom :=
                                  {
                                    toFun := fun x =>
                                      Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                        x.toQuot,
                                    map_one' :=
                                      (_ :
                                        Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                            1.toQuot =
                                          1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (x y : RingQuot fun x y => r x y),
                                      OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f
                                                (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    1.toQuot =
                                                  1) }
                                          (x * y) =
                                        OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            x *
                                          OneHom.toFun
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) }
                                            y) },
                            map_zero' :=
                              (_ :
                                Quot.lift ↑↑f (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b) 0.toQuot =
                                  0),
                            map_add' :=
                              (_ :
                                ∀ (x y : RingQuot fun x y => r x y),
                                  OneHom.toFun
                                      (↑{
                                          toOneHom :=
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f
                                                  (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f
                                                      (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                      1.toQuot =
                                                    1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : RingQuot fun x y => r x y),
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f
                                                          (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              1.toQuot =
                                                            1) }
                                                    (x * y) =
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      x *
                                                    OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      y) })
                                      (x + y) =
                                    OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : RingQuot fun x y => r x y),
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      (x * y) =
                                                    OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        x *
                                                      OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        y) })
                                        x +
                                      OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f
                                                    (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f
                                                        (_ : ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                        1.toQuot =
                                                      1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (x y : RingQuot fun x y => r x y),
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f
                                                            (_ :
                                                              ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f
                                                                (_ :
                                                                  ∀ (a b : B),
                                                                    Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                1.toQuot =
                                                              1) }
                                                      (x * y) =
                                                    OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        x *
                                                      OneHom.toFun
                                                        {
                                                          toFun := fun x =>
                                                            Quot.lift ↑↑f
                                                              (_ :
                                                                ∀ (a b : B), Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                              x.toQuot,
                                                          map_one' :=
                                                            (_ :
                                                              Quot.lift ↑↑f
                                                                  (_ :
                                                                    ∀ (a b : B),
                                                                      Rel (fun x y => r x y) a b → ↑↑f a = ↑↑f b)
                                                                  1.toQuot =
                                                                1) }
                                                        y) })
                                        y) }) }
                { val := Ideal.Quotient.mk (Ideal.ofRel r),
                  property :=
                    (_ :
                      ∀ (x y : B),
                        r x y → ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x = ↑(Ideal.Quotient.mk (Ideal.ofRel r)) y) })
            ↑(idealQuotientToRingQuot r))
          (Ideal.Quotient.mk (Ideal.ofRel r)))
      x =
    ↑(RingHom.comp (RingHom.id (B ⧸ Ideal.ofRel r)) (Ideal.Quotient.mk (Ideal.ofRel r))) x
[PROOFSTEP]
change Quot.lift _ _ ((mkRingHom r) x).toQuot = _
[GOAL]
case h.a
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
⊢ Quot.lift
      ↑↑{ val := Ideal.Quotient.mk (Ideal.ofRel r),
            property :=
              (_ :
                ∀ (x y : B), r x y → ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x = ↑(Ideal.Quotient.mk (Ideal.ofRel r)) y) }
      (_ :
        ∀ (a b : B),
          Rel (fun x y => r x y) a b →
            ↑↑{ val := Ideal.Quotient.mk (Ideal.ofRel r),
                      property :=
                        (_ :
                          ∀ (x y : B),
                            r x y → ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x = ↑(Ideal.Quotient.mk (Ideal.ofRel r)) y) }
                a =
              ↑↑{ val := Ideal.Quotient.mk (Ideal.ofRel r),
                      property :=
                        (_ :
                          ∀ (x y : B),
                            r x y → ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x = ↑(Ideal.Quotient.mk (Ideal.ofRel r)) y) }
                b)
      (↑(mkRingHom r) x).toQuot =
    ↑(RingHom.comp (RingHom.id (B ⧸ Ideal.ofRel r)) (Ideal.Quotient.mk (Ideal.ofRel r))) x
[PROOFSTEP]
rw [mkRingHom_def]
[GOAL]
case h.a
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✝¹ : Semiring T
B : Type uR
inst✝ : CommRing B
r : B → B → Prop
x : B
⊢ Quot.lift
      ↑↑{ val := Ideal.Quotient.mk (Ideal.ofRel r),
            property :=
              (_ :
                ∀ (x y : B), r x y → ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x = ↑(Ideal.Quotient.mk (Ideal.ofRel r)) y) }
      (_ :
        ∀ (a b : B),
          Rel (fun x y => r x y) a b →
            ↑↑{ val := Ideal.Quotient.mk (Ideal.ofRel r),
                      property :=
                        (_ :
                          ∀ (x y : B),
                            r x y → ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x = ↑(Ideal.Quotient.mk (Ideal.ofRel r)) y) }
                a =
              ↑↑{ val := Ideal.Quotient.mk (Ideal.ofRel r),
                      property :=
                        (_ :
                          ∀ (x y : B),
                            r x y → ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x = ↑(Ideal.Quotient.mk (Ideal.ofRel r)) y) }
                b)
      (↑{
              toMonoidHom :=
                {
                  toOneHom :=
                    { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                      map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
                  map_mul' :=
                    (_ :
                      ∀ (a a_1 : B),
                        { toQuot := Quot.mk (Rel r) (a * a_1) } =
                          { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) },
              map_zero' := (_ : { toQuot := Quot.mk (Rel r) 0 } = 0),
              map_add' :=
                (_ :
                  ∀ (a a_1 : B),
                    { toQuot := Quot.mk (Rel r) (a + a_1) } =
                      { toQuot := Quot.mk (Rel r) a } + { toQuot := Quot.mk (Rel r) a_1 }) }
          x).toQuot =
    ↑(RingHom.comp (RingHom.id (B ⧸ Ideal.ofRel r)) (Ideal.Quotient.mk (Ideal.ofRel r))) x
[PROOFSTEP]
rfl
[GOAL]
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b : R
h : Rel r a b
⊢ Rel r (Star.star a) (Star.star b)
[PROOFSTEP]
induction h with
| of h => exact Rel.of (hr _ _ h)
| add_left _ h =>
  rw [star_add, star_add]
  exact Rel.add_left h
| mul_left _ h =>
  rw [star_mul, star_mul]
  exact Rel.mul_right h
| mul_right _ h =>
  rw [star_mul, star_mul]
  exact Rel.mul_left h
[GOAL]
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b : R
h : Rel r a b
⊢ Rel r (Star.star a) (Star.star b)
[PROOFSTEP]
induction h with
| of h => exact Rel.of (hr _ _ h)
| add_left _ h =>
  rw [star_add, star_add]
  exact Rel.add_left h
| mul_left _ h =>
  rw [star_mul, star_mul]
  exact Rel.mul_right h
| mul_right _ h =>
  rw [star_mul, star_mul]
  exact Rel.mul_left h
[GOAL]
case of
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b x✝ y✝ : R
h : r x✝ y✝
⊢ Rel r (Star.star x✝) (Star.star y✝)
[PROOFSTEP]

| of h => exact Rel.of (hr _ _ h)
[GOAL]
case of
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b x✝ y✝ : R
h : r x✝ y✝
⊢ Rel r (Star.star x✝) (Star.star y✝)
[PROOFSTEP]
exact Rel.of (hr _ _ h)
[GOAL]
case add_left
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
h : Rel r (Star.star a✝¹) (Star.star b✝)
⊢ Rel r (Star.star (a✝¹ + c✝)) (Star.star (b✝ + c✝))
[PROOFSTEP]

| add_left _ h =>
  rw [star_add, star_add]
  exact Rel.add_left h
[GOAL]
case add_left
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
h : Rel r (Star.star a✝¹) (Star.star b✝)
⊢ Rel r (Star.star (a✝¹ + c✝)) (Star.star (b✝ + c✝))
[PROOFSTEP]
rw [star_add, star_add]
[GOAL]
case add_left
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
h : Rel r (Star.star a✝¹) (Star.star b✝)
⊢ Rel r (Star.star a✝¹ + Star.star c✝) (Star.star b✝ + Star.star c✝)
[PROOFSTEP]
exact Rel.add_left h
[GOAL]
case mul_left
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
h : Rel r (Star.star a✝¹) (Star.star b✝)
⊢ Rel r (Star.star (a✝¹ * c✝)) (Star.star (b✝ * c✝))
[PROOFSTEP]

| mul_left _ h =>
  rw [star_mul, star_mul]
  exact Rel.mul_right h
[GOAL]
case mul_left
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
h : Rel r (Star.star a✝¹) (Star.star b✝)
⊢ Rel r (Star.star (a✝¹ * c✝)) (Star.star (b✝ * c✝))
[PROOFSTEP]
rw [star_mul, star_mul]
[GOAL]
case mul_left
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
h : Rel r (Star.star a✝¹) (Star.star b✝)
⊢ Rel r (Star.star c✝ * Star.star a✝¹) (Star.star c✝ * Star.star b✝)
[PROOFSTEP]
exact Rel.mul_right h
[GOAL]
case mul_right
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b a✝¹ b✝ c✝ : R
a✝ : Rel r b✝ c✝
h : Rel r (Star.star b✝) (Star.star c✝)
⊢ Rel r (Star.star (a✝¹ * b✝)) (Star.star (a✝¹ * c✝))
[PROOFSTEP]

| mul_right _ h =>
  rw [star_mul, star_mul]
  exact Rel.mul_left h
[GOAL]
case mul_right
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b a✝¹ b✝ c✝ : R
a✝ : Rel r b✝ c✝
h : Rel r (Star.star b✝) (Star.star c✝)
⊢ Rel r (Star.star (a✝¹ * b✝)) (Star.star (a✝¹ * c✝))
[PROOFSTEP]
rw [star_mul, star_mul]
[GOAL]
case mul_right
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✝¹ : Semiring T
inst✝ : StarRing R
hr : ∀ (a b : R), r a b → r (Star.star a) (Star.star b)
a b a✝¹ b✝ c✝ : R
a✝ : Rel r b✝ c✝
h : Rel r (Star.star b✝) (Star.star c✝)
⊢ Rel r (Star.star b✝ * Star.star a✝¹) (Star.star c✝ * Star.star a✝¹)
[PROOFSTEP]
exact Rel.mul_left h
[GOAL]
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✝³ : Semiring T
inst✝² : StarRing R✝
hr✝ : ∀ (a b : R✝), r✝ a b → r✝ (star a) (star b)
R : Type uR
inst✝¹ : Semiring R
inst✝ : StarRing R
r : R → R → Prop
hr : ∀ (a b : R), r a b → r (star a) (star b)
⊢ Function.Involutive star
[PROOFSTEP]
rintro ⟨⟨⟩⟩
[GOAL]
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
inst✝³ : Semiring T
inst✝² : StarRing R✝
hr✝ : ∀ (a b : R✝), r✝ a b → r✝ (star a) (star b)
R : Type uR
inst✝¹ : Semiring R
inst✝ : StarRing R
r : R → R → Prop
hr : ∀ (a b : R), r a b → r (star a) (star b)
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ star (star { toQuot := Quot.mk (Rel r) a✝ }) = { toQuot := Quot.mk (Rel r) a✝ }
[PROOFSTEP]
simp [star'_quot]
[GOAL]
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✝³ : Semiring T
inst✝² : StarRing R✝
hr✝ : ∀ (a b : R✝), r✝ a b → r✝ (star a) (star b)
R : Type uR
inst✝¹ : Semiring R
inst✝ : StarRing R
r : R → R → Prop
hr : ∀ (a b : R), r a b → r (star a) (star b)
⊢ ∀ (r_1 s : RingQuot r), star (r_1 * s) = star s * star r_1
[PROOFSTEP]
rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
[GOAL]
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
inst✝³ : Semiring T
inst✝² : StarRing R✝
hr✝ : ∀ (a b : R✝), r✝ a b → r✝ (star a) (star b)
R : Type uR
inst✝¹ : Semiring R
inst✝ : StarRing R
r : R → R → Prop
hr : ∀ (a b : R), r a b → r (star a) (star b)
toQuot✝¹ : Quot (Rel r)
a✝¹ : R
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ star ({ toQuot := Quot.mk (Rel r) a✝¹ } * { toQuot := Quot.mk (Rel r) a✝ }) =
    star { toQuot := Quot.mk (Rel r) a✝ } * star { toQuot := Quot.mk (Rel r) a✝¹ }
[PROOFSTEP]
simp [star'_quot, mul_quot, star_mul]
[GOAL]
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✝³ : Semiring T
inst✝² : StarRing R✝
hr✝ : ∀ (a b : R✝), r✝ a b → r✝ (star a) (star b)
R : Type uR
inst✝¹ : Semiring R
inst✝ : StarRing R
r : R → R → Prop
hr : ∀ (a b : R), r a b → r (star a) (star b)
⊢ ∀ (r_1 s : RingQuot r), star (r_1 + s) = star r_1 + star s
[PROOFSTEP]
rintro ⟨⟨⟩⟩ ⟨⟨⟩⟩
[GOAL]
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
inst✝³ : Semiring T
inst✝² : StarRing R✝
hr✝ : ∀ (a b : R✝), r✝ a b → r✝ (star a) (star b)
R : Type uR
inst✝¹ : Semiring R
inst✝ : StarRing R
r : R → R → Prop
hr : ∀ (a b : R), r a b → r (star a) (star b)
toQuot✝¹ : Quot (Rel r)
a✝¹ : R
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ star ({ toQuot := Quot.mk (Rel r) a✝¹ } + { toQuot := Quot.mk (Rel r) a✝ }) =
    star { toQuot := Quot.mk (Rel r) a✝¹ } + star { toQuot := Quot.mk (Rel r) a✝ }
[PROOFSTEP]
simp [star'_quot, add_quot, star_add]
[GOAL]
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✝ : Semiring T
s : A → A → Prop
src✝ : A →+* RingQuot s := mkRingHom s
x✝ : S
⊢ OneHom.toFun
      (↑↑{ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : A), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) })
      (↑(algebraMap S A) x✝) =
    ↑(algebraMap S (RingQuot s)) x✝
[PROOFSTEP]
simp [mkRingHom_def]
[GOAL]
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✝ : Semiring T
s : A → A → Prop
src✝ : A →+* RingQuot s := mkRingHom s
x✝ : S
⊢ { toQuot := Quot.mk (Rel s) (↑(algebraMap S A) x✝) } = ↑(algebraMap S (RingQuot s)) x✝
[PROOFSTEP]
rfl
[GOAL]
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✝ : Semiring T
s : A → A → Prop
⊢ ↑(mkAlgHom S s) = mkRingHom s
[PROOFSTEP]
simp_rw [mkAlgHom_def, mkRingHom_def]
[GOAL]
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✝ : Semiring T
s : A → A → Prop
⊢ ↑{
        toRingHom :=
          {
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                    map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                map_mul' :=
                  (_ :
                    ∀ (a a_1 : A),
                      { toQuot := Quot.mk (Rel s) (a * a_1) } =
                        { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) },
            map_zero' :=
              (_ :
                OneHom.toFun
                    (↑{
                        toOneHom :=
                          { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                            map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                        map_mul' :=
                          (_ :
                            ∀ (a a_1 : A),
                              { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                    0 =
                  0),
            map_add' :=
              (_ :
                ∀ (x y : A),
                  OneHom.toFun
                      (↑{
                          toOneHom :=
                            { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                              map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                          map_mul' :=
                            (_ :
                              ∀ (a a_1 : A),
                                { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                  { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                      (x + y) =
                    OneHom.toFun
                        (↑{
                            toOneHom :=
                              { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (a a_1 : A),
                                  { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                    { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                        x +
                      OneHom.toFun
                        (↑{
                            toOneHom :=
                              { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (a a_1 : A),
                                  { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                    { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                        y) },
        commutes' :=
          (_ :
            ∀ (r : S),
              OneHom.toFun
                  (↑↑{
                        toMonoidHom :=
                          {
                            toOneHom :=
                              { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (a a_1 : A),
                                  { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                    { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) },
                        map_zero' :=
                          (_ :
                            OneHom.toFun
                                (↑{
                                    toOneHom :=
                                      { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                        map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                                    map_mul' :=
                                      (_ :
                                        ∀ (a a_1 : A),
                                          { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                            { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                                0 =
                              0),
                        map_add' :=
                          (_ :
                            ∀ (x y : A),
                              OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                          map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (a a_1 : A),
                                            { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                              { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                                  (x + y) =
                                OneHom.toFun
                                    (↑{
                                        toOneHom :=
                                          { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                            map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (a a_1 : A),
                                              { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                                { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                                    x +
                                  OneHom.toFun
                                    (↑{
                                        toOneHom :=
                                          { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                            map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (a a_1 : A),
                                              { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                                { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                                    y) })
                  (↑(algebraMap S A) r) =
                ↑(algebraMap S (RingQuot s)) r) } =
    {
      toMonoidHom :=
        {
          toOneHom :=
            { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
              map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
          map_mul' :=
            (_ :
              ∀ (a a_1 : A),
                { toQuot := Quot.mk (Rel s) (a * a_1) } =
                  { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) },
      map_zero' := (_ : { toQuot := Quot.mk (Rel s) 0 } = 0),
      map_add' :=
        (_ :
          ∀ (a a_1 : A),
            { toQuot := Quot.mk (Rel s) (a + a_1) } =
              { toQuot := Quot.mk (Rel s) a } + { toQuot := Quot.mk (Rel s) a_1 }) }
[PROOFSTEP]
rfl
[GOAL]
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✝ : Semiring T
s : A → A → Prop
x y : A
w : s x y
⊢ ↑(mkAlgHom S s) x = ↑(mkAlgHom S s) y
[PROOFSTEP]
simp [mkAlgHom_def, mkRingHom_def, Quot.sound (Rel.of w)]
[GOAL]
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✝ : Semiring T
s : A → A → Prop
⊢ Function.Surjective ↑(mkAlgHom S s)
[PROOFSTEP]
suffices : Function.Surjective fun x ↦ (⟨.mk (Rel s) x⟩ : RingQuot s)
[GOAL]
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✝ : Semiring T
s : A → A → Prop
this : Function.Surjective fun x => { toQuot := Quot.mk (Rel s) x }
⊢ Function.Surjective ↑(mkAlgHom S s)
[PROOFSTEP]
simpa [mkAlgHom_def, mkRingHom_def]
[GOAL]
case this
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✝ : Semiring T
s : A → A → Prop
⊢ Function.Surjective fun x => { toQuot := Quot.mk (Rel s) x }
[PROOFSTEP]
rintro ⟨⟨a⟩⟩
[GOAL]
case this.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
inst✝ : Semiring T
s : A → A → Prop
toQuot✝ : Quot (Rel s)
a : A
⊢ ∃ a_1, (fun x => { toQuot := Quot.mk (Rel s) x }) a_1 = { toQuot := Quot.mk (Rel s) a }
[PROOFSTEP]
use a
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f g : RingQuot s →ₐ[S] B
w : AlgHom.comp f (mkAlgHom S s) = AlgHom.comp g (mkAlgHom S s)
⊢ f = g
[PROOFSTEP]
ext x
[GOAL]
case H
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f g : RingQuot s →ₐ[S] B
w : AlgHom.comp f (mkAlgHom S s) = AlgHom.comp g (mkAlgHom S s)
x : RingQuot s
⊢ ↑f x = ↑g x
[PROOFSTEP]
rcases mkAlgHom_surjective S s x with ⟨x, rfl⟩
[GOAL]
case H.intro
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f g : RingQuot s →ₐ[S] B
w : AlgHom.comp f (mkAlgHom S s) = AlgHom.comp g (mkAlgHom S s)
x : A
⊢ ↑f (↑(mkAlgHom S s) x) = ↑g (↑(mkAlgHom S s) x)
[PROOFSTEP]
exact AlgHom.congr_fun w x
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : RingQuot s
⊢ ∀ (a b : A), Rel s a b → ↑f a = ↑f b
[PROOFSTEP]
rintro _ _ r
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : RingQuot s
a✝ b✝ : A
r : Rel s a✝ b✝
⊢ ↑f a✝ = ↑f b✝
[PROOFSTEP]
induction r with
| of r => exact h r
| add_left _ r' => simp only [map_add, r']
| mul_left _ r' => simp only [map_mul, r']
| mul_right _ r' => simp only [map_mul, r']
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : RingQuot s
a✝ b✝ : A
r : Rel s a✝ b✝
⊢ ↑f a✝ = ↑f b✝
[PROOFSTEP]
induction r with
| of r => exact h r
| add_left _ r' => simp only [map_add, r']
| mul_left _ r' => simp only [map_mul, r']
| mul_right _ r' => simp only [map_mul, r']
[GOAL]
case of
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : RingQuot s
a✝ b✝ x✝ y✝ : A
r : s x✝ y✝
⊢ ↑f x✝ = ↑f y✝
[PROOFSTEP]

| of r => exact h r
[GOAL]
case of
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : RingQuot s
a✝ b✝ x✝ y✝ : A
r : s x✝ y✝
⊢ ↑f x✝ = ↑f y✝
[PROOFSTEP]
exact h r
[GOAL]
case add_left
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : RingQuot s
a✝² b✝¹ a✝¹ b✝ c✝ : A
a✝ : Rel s a✝¹ b✝
r' : ↑f a✝¹ = ↑f b✝
⊢ ↑f (a✝¹ + c✝) = ↑f (b✝ + c✝)
[PROOFSTEP]

| add_left _ r' => simp only [map_add, r']
[GOAL]
case add_left
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : RingQuot s
a✝² b✝¹ a✝¹ b✝ c✝ : A
a✝ : Rel s a✝¹ b✝
r' : ↑f a✝¹ = ↑f b✝
⊢ ↑f (a✝¹ + c✝) = ↑f (b✝ + c✝)
[PROOFSTEP]
simp only [map_add, r']
[GOAL]
case mul_left
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : RingQuot s
a✝² b✝¹ a✝¹ b✝ c✝ : A
a✝ : Rel s a✝¹ b✝
r' : ↑f a✝¹ = ↑f b✝
⊢ ↑f (a✝¹ * c✝) = ↑f (b✝ * c✝)
[PROOFSTEP]

| mul_left _ r' => simp only [map_mul, r']
[GOAL]
case mul_left
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : RingQuot s
a✝² b✝¹ a✝¹ b✝ c✝ : A
a✝ : Rel s a✝¹ b✝
r' : ↑f a✝¹ = ↑f b✝
⊢ ↑f (a✝¹ * c✝) = ↑f (b✝ * c✝)
[PROOFSTEP]
simp only [map_mul, r']
[GOAL]
case mul_right
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : RingQuot s
a✝² b✝¹ a✝¹ b✝ c✝ : A
a✝ : Rel s b✝ c✝
r' : ↑f b✝ = ↑f c✝
⊢ ↑f (a✝¹ * b✝) = ↑f (a✝¹ * c✝)
[PROOFSTEP]

| mul_right _ r' => simp only [map_mul, r']
[GOAL]
case mul_right
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : RingQuot s
a✝² b✝¹ a✝¹ b✝ c✝ : A
a✝ : Rel s b✝ c✝
r' : ↑f b✝ = ↑f c✝
⊢ ↑f (a✝¹ * b✝) = ↑f (a✝¹ * c✝)
[PROOFSTEP]
simp only [map_mul, r']
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
⊢ (fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot) 1 = 1
[PROOFSTEP]
simp only [← one_quot, f.map_one]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
⊢ ∀ (x y : RingQuot s),
    OneHom.toFun
        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
        (x * y) =
      OneHom.toFun
          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
          x *
        OneHom.toFun
          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
          y
[PROOFSTEP]
rintro ⟨⟨x⟩⟩ ⟨⟨y⟩⟩
[GOAL]
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
inst✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
toQuot✝¹ : Quot (Rel s)
x : A
toQuot✝ : Quot (Rel s)
y : A
⊢ OneHom.toFun
      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
      ({ toQuot := Quot.mk (Rel s) x } * { toQuot := Quot.mk (Rel s) y }) =
    OneHom.toFun
        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
        { toQuot := Quot.mk (Rel s) x } *
      OneHom.toFun
        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
        { toQuot := Quot.mk (Rel s) y }
[PROOFSTEP]
simp only [mul_quot, f.map_mul x y]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
              map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : RingQuot s),
                OneHom.toFun
                    { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                      map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                    (x * y) =
                  OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      x *
                    OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      y) })
      0 =
    0
[PROOFSTEP]
simp only [← zero_quot, f.map_zero]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
⊢ ∀ (x y : RingQuot s),
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : RingQuot s),
                  OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      (x * y) =
                    OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        y) })
        (x + y) =
      OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                  map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
              map_mul' :=
                (_ :
                  ∀ (x y : RingQuot s),
                    OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        (x * y) =
                      OneHom.toFun
                          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                          x *
                        OneHom.toFun
                          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                          y) })
          x +
        OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                  map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
              map_mul' :=
                (_ :
                  ∀ (x y : RingQuot s),
                    OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        (x * y) =
                      OneHom.toFun
                          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                          x *
                        OneHom.toFun
                          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                          y) })
          y
[PROOFSTEP]
rintro ⟨⟨x⟩⟩ ⟨⟨y⟩⟩
[GOAL]
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
inst✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
toQuot✝¹ : Quot (Rel s)
x : A
toQuot✝ : Quot (Rel s)
y : A
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
              map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : RingQuot s),
                OneHom.toFun
                    { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                      map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                    (x * y) =
                  OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      x *
                    OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      y) })
      ({ toQuot := Quot.mk (Rel s) x } + { toQuot := Quot.mk (Rel s) y }) =
    OneHom.toFun
        ↑{
            toOneHom :=
              { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : RingQuot s),
                  OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      (x * y) =
                    OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        y) }
        { toQuot := Quot.mk (Rel s) x } +
      OneHom.toFun
        ↑{
            toOneHom :=
              { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : RingQuot s),
                  OneHom.toFun
                      { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                        map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                      (x * y) =
                    OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                          map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                        y) }
        { toQuot := Quot.mk (Rel s) y }
[PROOFSTEP]
simp only [add_quot, f.map_add x y]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
⊢ ∀ (r : S),
    OneHom.toFun
        (↑↑{
              toMonoidHom :=
                {
                  toOneHom :=
                    { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                      map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
                  map_mul' :=
                    (_ :
                      ∀ (x y : RingQuot s),
                        OneHom.toFun
                            { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                              map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                            (x * y) =
                          OneHom.toFun
                              { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                              x *
                            OneHom.toFun
                              { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                              y) },
              map_zero' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 0.toQuot = 0),
              map_add' :=
                (_ :
                  ∀ (x y : RingQuot s),
                    OneHom.toFun
                        (↑{
                            toOneHom :=
                              { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                map_one' :=
                                  (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : RingQuot s),
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                        map_one' :=
                                          (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                      (x * y) =
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                          map_one' :=
                                            (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                        x *
                                      OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                          map_one' :=
                                            (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                        y) })
                        (x + y) =
                      OneHom.toFun
                          (↑{
                              toOneHom :=
                                { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                  map_one' :=
                                    (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
                              map_mul' :=
                                (_ :
                                  ∀ (x y : RingQuot s),
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                          map_one' :=
                                            (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                        (x * y) =
                                      OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                          x *
                                        OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                          y) })
                          x +
                        OneHom.toFun
                          (↑{
                              toOneHom :=
                                { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                  map_one' :=
                                    (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
                              map_mul' :=
                                (_ :
                                  ∀ (x y : RingQuot s),
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                          map_one' :=
                                            (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                        (x * y) =
                                      OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                          x *
                                        OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                          y) })
                          y) })
        (↑(algebraMap S (RingQuot s)) r) =
      ↑(algebraMap S B) r
[PROOFSTEP]
rintro x
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : A →ₐ[S] B
h : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : S
⊢ OneHom.toFun
      (↑↑{
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                    map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
                map_mul' :=
                  (_ :
                    ∀ (x y : RingQuot s),
                      OneHom.toFun
                          { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                            map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                          (x * y) =
                        OneHom.toFun
                            { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                              map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                            x *
                          OneHom.toFun
                            { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                              map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                            y) },
            map_zero' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 0.toQuot = 0),
            map_add' :=
              (_ :
                ∀ (x y : RingQuot s),
                  OneHom.toFun
                      (↑{
                          toOneHom :=
                            { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                              map_one' := (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : RingQuot s),
                                OneHom.toFun
                                    {
                                      toFun := fun x =>
                                        Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                      map_one' :=
                                        (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                    (x * y) =
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                        map_one' :=
                                          (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                      x *
                                    OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                        map_one' :=
                                          (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                      y) })
                      (x + y) =
                    OneHom.toFun
                        (↑{
                            toOneHom :=
                              { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                map_one' :=
                                  (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : RingQuot s),
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                        map_one' :=
                                          (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                      (x * y) =
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                          map_one' :=
                                            (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                        x *
                                      OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                          map_one' :=
                                            (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                        y) })
                        x +
                      OneHom.toFun
                        (↑{
                            toOneHom :=
                              { toFun := fun x => Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                map_one' :=
                                  (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (x y : RingQuot s),
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                        map_one' :=
                                          (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                      (x * y) =
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                          map_one' :=
                                            (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                        x *
                                      OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) x.toQuot,
                                          map_one' :=
                                            (_ : Quot.lift ↑f (_ : ∀ (a b : A), Rel s a b → ↑f a = ↑f b) 1.toQuot = 1) }
                                        y) })
                        y) })
      (↑(algebraMap S (RingQuot s)) x) =
    ↑(algebraMap S B) x
[PROOFSTEP]
simp [← one_quot, smul_quot, Algebra.algebraMap_eq_smul_one]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : { f // ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y }
⊢ (fun F =>
        { val := AlgHom.comp F (mkAlgHom S s),
          property := (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) })
      ((fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y)) f) =
    f
[PROOFSTEP]
ext
[GOAL]
case a.H
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : { f // ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y }
x✝ : A
⊢ ↑↑((fun F =>
              { val := AlgHom.comp F (mkAlgHom S s),
                property := (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) })
            ((fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y)) f))
      x✝ =
    ↑↑f x✝
[PROOFSTEP]
simp only [preLiftAlgHom_def, mkAlgHom_def, mkRingHom_def, RingHom.toMonoidHom_eq_coe, RingHom.coe_monoidHom_mk,
  AlgHom.coe_comp, AlgHom.coe_mk, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk, Function.comp_apply]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
F : RingQuot s →ₐ[S] B
⊢ (fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y))
      ((fun F =>
          { val := AlgHom.comp F (mkAlgHom S s),
            property := (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) })
        F) =
    F
[PROOFSTEP]
ext
[GOAL]
case w.H
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
F : RingQuot s →ₐ[S] B
x✝ : A
⊢ ↑(AlgHom.comp
          ((fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y))
            ((fun F =>
                { val := AlgHom.comp F (mkAlgHom S s),
                  property := (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) })
              F))
          (mkAlgHom S s))
      x✝ =
    ↑(AlgHom.comp F (mkAlgHom S s)) x✝
[PROOFSTEP]
simp only [preLiftAlgHom_def, mkAlgHom_def, mkRingHom_def, RingHom.toMonoidHom_eq_coe, RingHom.coe_monoidHom_mk,
  AlgHom.coe_comp, AlgHom.coe_mk, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk, Function.comp_apply]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
f : A →ₐ[S] B
s : A → A → Prop
w : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : A
⊢ ↑(↑(liftAlgHom S) { val := f, property := w }) (↑(mkAlgHom S s) x) = ↑f x
[PROOFSTEP]
simp_rw [liftAlgHom_def, preLiftAlgHom_def, mkAlgHom_def, mkRingHom_def]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
f : A →ₐ[S] B
s : A → A → Prop
w : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
x : A
⊢ ↑(↑{
              toFun := fun f' =>
                {
                  toRingHom :=
                    {
                      toMonoidHom :=
                        {
                          toOneHom :=
                            {
                              toFun := fun x =>
                                Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b) x.toQuot,
                              map_one' :=
                                (_ :
                                  Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                      1.toQuot =
                                    1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : RingQuot fun x y => s x y),
                                OneHom.toFun
                                    {
                                      toFun := fun x =>
                                        Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                          x.toQuot,
                                      map_one' :=
                                        (_ :
                                          Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                              1.toQuot =
                                            1) }
                                    (x * y) =
                                  OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f'
                                                (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                1.toQuot =
                                              1) }
                                      x *
                                    OneHom.toFun
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f'
                                                (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                1.toQuot =
                                              1) }
                                      y) },
                      map_zero' :=
                        (_ :
                          Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b) 0.toQuot = 0),
                      map_add' :=
                        (_ :
                          ∀ (x y : RingQuot fun x y => s x y),
                            OneHom.toFun
                                (↑{
                                    toOneHom :=
                                      {
                                        toFun := fun x =>
                                          Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                            x.toQuot,
                                        map_one' :=
                                          (_ :
                                            Quot.lift ↑↑f'
                                                (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                1.toQuot =
                                              1) },
                                    map_mul' :=
                                      (_ :
                                        ∀ (x y : RingQuot fun x y => s x y),
                                          OneHom.toFun
                                              {
                                                toFun := fun x =>
                                                  Quot.lift ↑↑f'
                                                    (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                    x.toQuot,
                                                map_one' :=
                                                  (_ :
                                                    Quot.lift ↑↑f'
                                                        (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                        1.toQuot =
                                                      1) }
                                              (x * y) =
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f'
                                                      (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          1.toQuot =
                                                        1) }
                                                x *
                                              OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f'
                                                      (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          1.toQuot =
                                                        1) }
                                                y) })
                                (x + y) =
                              OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f'
                                              (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b) x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f'
                                                  (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => s x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f'
                                                      (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f'
                                                        (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f'
                                                        (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  x +
                                OneHom.toFun
                                  (↑{
                                      toOneHom :=
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f'
                                              (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b) x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f'
                                                  (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                  1.toQuot =
                                                1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (x y : RingQuot fun x y => s x y),
                                            OneHom.toFun
                                                {
                                                  toFun := fun x =>
                                                    Quot.lift ↑↑f'
                                                      (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                      x.toQuot,
                                                  map_one' :=
                                                    (_ :
                                                      Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          1.toQuot =
                                                        1) }
                                                (x * y) =
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f'
                                                        (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            1.toQuot =
                                                          1) }
                                                  x *
                                                OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f'
                                                        (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            1.toQuot =
                                                          1) }
                                                  y) })
                                  y) },
                  commutes' :=
                    (_ :
                      ∀ (x : S),
                        Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                            (↑(algebraMap S (RingQuot fun x y => s x y)) x).toQuot =
                          ↑(algebraMap S B) x) },
              invFun := fun F =>
                {
                  val :=
                    AlgHom.comp F
                      {
                        toRingHom :=
                          {
                            toMonoidHom :=
                              {
                                toOneHom :=
                                  { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                    map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (a a_1 : A),
                                      { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                        { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                          { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                            map_zero' :=
                              (_ :
                                OneHom.toFun
                                    (↑{
                                        toOneHom :=
                                          { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                            map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (a a_1 : A),
                                              { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                  { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                    0 =
                                  0),
                            map_add' :=
                              (_ :
                                ∀ (x y : A),
                                  OneHom.toFun
                                      (↑{
                                          toOneHom :=
                                            { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                              map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (a a_1 : A),
                                                { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                  { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                      (x + y) =
                                    OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (a a_1 : A),
                                                  { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                        x +
                                      OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (a a_1 : A),
                                                  { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                        y) },
                        commutes' :=
                          (_ :
                            ∀ (r : S),
                              OneHom.toFun
                                  (↑↑{
                                        toMonoidHom :=
                                          {
                                            toOneHom :=
                                              { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (a a_1 : A),
                                                  { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                                        map_zero' :=
                                          (_ :
                                            OneHom.toFun
                                                (↑{
                                                    toOneHom :=
                                                      {
                                                        toFun := fun x =>
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                        map_one' :=
                                                          (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                    map_mul' :=
                                                      (_ :
                                                        ∀ (a a_1 : A),
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                0 =
                                              0),
                                        map_add' :=
                                          (_ :
                                            ∀ (x y : A),
                                              OneHom.toFun
                                                  (↑{
                                                      toOneHom :=
                                                        {
                                                          toFun := fun x =>
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                          map_one' :=
                                                            (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                      map_mul' :=
                                                        (_ :
                                                          ∀ (a a_1 : A),
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                  (x + y) =
                                                OneHom.toFun
                                                    (↑{
                                                        toOneHom :=
                                                          {
                                                            toFun := fun x =>
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                            map_one' :=
                                                              (_ :
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                        map_mul' :=
                                                          (_ :
                                                            ∀ (a a_1 : A),
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                    x +
                                                  OneHom.toFun
                                                    (↑{
                                                        toOneHom :=
                                                          {
                                                            toFun := fun x =>
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                            map_one' :=
                                                              (_ :
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                        map_mul' :=
                                                          (_ :
                                                            ∀ (a a_1 : A),
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                    y) })
                                  (↑(algebraMap S A) r) =
                                ↑(algebraMap S (RingQuot fun x y => s x y)) r) },
                  property :=
                    (_ :
                      (fun f => ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y)
                        (AlgHom.comp F
                          {
                            toRingHom :=
                              {
                                toMonoidHom :=
                                  {
                                    toOneHom :=
                                      { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                        map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                    map_mul' :=
                                      (_ :
                                        ∀ (a a_1 : A),
                                          { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                            { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                              { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                                map_zero' :=
                                  (_ :
                                    OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (a a_1 : A),
                                                  { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                        0 =
                                      0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : A),
                                      OneHom.toFun
                                          (↑{
                                              toOneHom :=
                                                { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                  map_one' :=
                                                    (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                              map_mul' :=
                                                (_ :
                                                  ∀ (a a_1 : A),
                                                    { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                          (x + y) =
                                        OneHom.toFun
                                            (↑{
                                                toOneHom :=
                                                  { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                    map_one' :=
                                                      (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                map_mul' :=
                                                  (_ :
                                                    ∀ (a a_1 : A),
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                            x +
                                          OneHom.toFun
                                            (↑{
                                                toOneHom :=
                                                  { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                    map_one' :=
                                                      (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                map_mul' :=
                                                  (_ :
                                                    ∀ (a a_1 : A),
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                            y) },
                            commutes' :=
                              (_ :
                                ∀ (r : S),
                                  OneHom.toFun
                                      (↑↑{
                                            toMonoidHom :=
                                              {
                                                toOneHom :=
                                                  { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                    map_one' :=
                                                      (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                map_mul' :=
                                                  (_ :
                                                    ∀ (a a_1 : A),
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                                            map_zero' :=
                                              (_ :
                                                OneHom.toFun
                                                    (↑{
                                                        toOneHom :=
                                                          {
                                                            toFun := fun x =>
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                            map_one' :=
                                                              (_ :
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                        map_mul' :=
                                                          (_ :
                                                            ∀ (a a_1 : A),
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                    0 =
                                                  0),
                                            map_add' :=
                                              (_ :
                                                ∀ (x y : A),
                                                  OneHom.toFun
                                                      (↑{
                                                          toOneHom :=
                                                            {
                                                              toFun := fun x =>
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                              map_one' :=
                                                                (_ :
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                          map_mul' :=
                                                            (_ :
                                                              ∀ (a a_1 : A),
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                      (x + y) =
                                                    OneHom.toFun
                                                        (↑{
                                                            toOneHom :=
                                                              {
                                                                toFun := fun x =>
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                map_one' :=
                                                                  (_ :
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                      1) },
                                                            map_mul' :=
                                                              (_ :
                                                                ∀ (a a_1 : A),
                                                                  {
                                                                      toQuot :=
                                                                        Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                      {
                                                                        toQuot :=
                                                                          Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                        x +
                                                      OneHom.toFun
                                                        (↑{
                                                            toOneHom :=
                                                              {
                                                                toFun := fun x =>
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                map_one' :=
                                                                  (_ :
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                      1) },
                                                            map_mul' :=
                                                              (_ :
                                                                ∀ (a a_1 : A),
                                                                  {
                                                                      toQuot :=
                                                                        Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                      {
                                                                        toQuot :=
                                                                          Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                        y) })
                                      (↑(algebraMap S A) r) =
                                    ↑(algebraMap S (RingQuot fun x y => s x y)) r) })) },
              left_inv :=
                (_ :
                  Function.LeftInverse
                    (fun F =>
                      {
                        val :=
                          AlgHom.comp F
                            {
                              toRingHom :=
                                {
                                  toMonoidHom :=
                                    {
                                      toOneHom :=
                                        { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                          map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (a a_1 : A),
                                            { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                              { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                                  map_zero' :=
                                    (_ :
                                      OneHom.toFun
                                          (↑{
                                              toOneHom :=
                                                { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                  map_one' :=
                                                    (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                              map_mul' :=
                                                (_ :
                                                  ∀ (a a_1 : A),
                                                    { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                          0 =
                                        0),
                                  map_add' :=
                                    (_ :
                                      ∀ (x y : A),
                                        OneHom.toFun
                                            (↑{
                                                toOneHom :=
                                                  { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                    map_one' :=
                                                      (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                map_mul' :=
                                                  (_ :
                                                    ∀ (a a_1 : A),
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                            (x + y) =
                                          OneHom.toFun
                                              (↑{
                                                  toOneHom :=
                                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                      map_one' :=
                                                        (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                  map_mul' :=
                                                    (_ :
                                                      ∀ (a a_1 : A),
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                              x +
                                            OneHom.toFun
                                              (↑{
                                                  toOneHom :=
                                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                      map_one' :=
                                                        (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                  map_mul' :=
                                                    (_ :
                                                      ∀ (a a_1 : A),
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                              y) },
                              commutes' :=
                                (_ :
                                  ∀ (r : S),
                                    OneHom.toFun
                                        (↑↑{
                                              toMonoidHom :=
                                                {
                                                  toOneHom :=
                                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                      map_one' :=
                                                        (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                  map_mul' :=
                                                    (_ :
                                                      ∀ (a a_1 : A),
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                                              map_zero' :=
                                                (_ :
                                                  OneHom.toFun
                                                      (↑{
                                                          toOneHom :=
                                                            {
                                                              toFun := fun x =>
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                              map_one' :=
                                                                (_ :
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                          map_mul' :=
                                                            (_ :
                                                              ∀ (a a_1 : A),
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                      0 =
                                                    0),
                                              map_add' :=
                                                (_ :
                                                  ∀ (x y : A),
                                                    OneHom.toFun
                                                        (↑{
                                                            toOneHom :=
                                                              {
                                                                toFun := fun x =>
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                map_one' :=
                                                                  (_ :
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                      1) },
                                                            map_mul' :=
                                                              (_ :
                                                                ∀ (a a_1 : A),
                                                                  {
                                                                      toQuot :=
                                                                        Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                      {
                                                                        toQuot :=
                                                                          Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                        (x + y) =
                                                      OneHom.toFun
                                                          (↑{
                                                              toOneHom :=
                                                                {
                                                                  toFun := fun x =>
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                  map_one' :=
                                                                    (_ :
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                        1) },
                                                              map_mul' :=
                                                                (_ :
                                                                  ∀ (a a_1 : A),
                                                                    {
                                                                        toQuot :=
                                                                          Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                        {
                                                                          toQuot :=
                                                                            Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                          x +
                                                        OneHom.toFun
                                                          (↑{
                                                              toOneHom :=
                                                                {
                                                                  toFun := fun x =>
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                  map_one' :=
                                                                    (_ :
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                        1) },
                                                              map_mul' :=
                                                                (_ :
                                                                  ∀ (a a_1 : A),
                                                                    {
                                                                        toQuot :=
                                                                          Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                        {
                                                                          toQuot :=
                                                                            Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                          y) })
                                        (↑(algebraMap S A) r) =
                                      ↑(algebraMap S (RingQuot fun x y => s x y)) r) },
                        property :=
                          (_ :
                            (fun f => ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y)
                              (AlgHom.comp F
                                {
                                  toRingHom :=
                                    {
                                      toMonoidHom :=
                                        {
                                          toOneHom :=
                                            { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                              map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (a a_1 : A),
                                                { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                  { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                                      map_zero' :=
                                        (_ :
                                          OneHom.toFun
                                              (↑{
                                                  toOneHom :=
                                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                      map_one' :=
                                                        (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                  map_mul' :=
                                                    (_ :
                                                      ∀ (a a_1 : A),
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                              0 =
                                            0),
                                      map_add' :=
                                        (_ :
                                          ∀ (x y : A),
                                            OneHom.toFun
                                                (↑{
                                                    toOneHom :=
                                                      {
                                                        toFun := fun x =>
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                        map_one' :=
                                                          (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                    map_mul' :=
                                                      (_ :
                                                        ∀ (a a_1 : A),
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                (x + y) =
                                              OneHom.toFun
                                                  (↑{
                                                      toOneHom :=
                                                        {
                                                          toFun := fun x =>
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                          map_one' :=
                                                            (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                      map_mul' :=
                                                        (_ :
                                                          ∀ (a a_1 : A),
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                  x +
                                                OneHom.toFun
                                                  (↑{
                                                      toOneHom :=
                                                        {
                                                          toFun := fun x =>
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                          map_one' :=
                                                            (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                      map_mul' :=
                                                        (_ :
                                                          ∀ (a a_1 : A),
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                  y) },
                                  commutes' :=
                                    (_ :
                                      ∀ (r : S),
                                        OneHom.toFun
                                            (↑↑{
                                                  toMonoidHom :=
                                                    {
                                                      toOneHom :=
                                                        {
                                                          toFun := fun x =>
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                          map_one' :=
                                                            (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                      map_mul' :=
                                                        (_ :
                                                          ∀ (a a_1 : A),
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                                                  map_zero' :=
                                                    (_ :
                                                      OneHom.toFun
                                                          (↑{
                                                              toOneHom :=
                                                                {
                                                                  toFun := fun x =>
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                  map_one' :=
                                                                    (_ :
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                        1) },
                                                              map_mul' :=
                                                                (_ :
                                                                  ∀ (a a_1 : A),
                                                                    {
                                                                        toQuot :=
                                                                          Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                        {
                                                                          toQuot :=
                                                                            Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                          0 =
                                                        0),
                                                  map_add' :=
                                                    (_ :
                                                      ∀ (x y : A),
                                                        OneHom.toFun
                                                            (↑{
                                                                toOneHom :=
                                                                  {
                                                                    toFun := fun x =>
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                    map_one' :=
                                                                      (_ :
                                                                        { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                          1) },
                                                                map_mul' :=
                                                                  (_ :
                                                                    ∀ (a a_1 : A),
                                                                      {
                                                                          toQuot :=
                                                                            Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                        { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                          {
                                                                            toQuot :=
                                                                              Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                            (x + y) =
                                                          OneHom.toFun
                                                              (↑{
                                                                  toOneHom :=
                                                                    {
                                                                      toFun := fun x =>
                                                                        { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                      map_one' :=
                                                                        (_ :
                                                                          {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) 1 } =
                                                                            1) },
                                                                  map_mul' :=
                                                                    (_ :
                                                                      ∀ (a a_1 : A),
                                                                        {
                                                                            toQuot :=
                                                                              Quot.mk (Rel fun x y => s x y)
                                                                                (a * a_1) } =
                                                                          {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) a } *
                                                                            {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                              x +
                                                            OneHom.toFun
                                                              (↑{
                                                                  toOneHom :=
                                                                    {
                                                                      toFun := fun x =>
                                                                        { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                      map_one' :=
                                                                        (_ :
                                                                          {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) 1 } =
                                                                            1) },
                                                                  map_mul' :=
                                                                    (_ :
                                                                      ∀ (a a_1 : A),
                                                                        {
                                                                            toQuot :=
                                                                              Quot.mk (Rel fun x y => s x y)
                                                                                (a * a_1) } =
                                                                          {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) a } *
                                                                            {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                              y) })
                                            (↑(algebraMap S A) r) =
                                          ↑(algebraMap S (RingQuot fun x y => s x y)) r) })) })
                    fun f' =>
                    {
                      toRingHom :=
                        {
                          toMonoidHom :=
                            {
                              toOneHom :=
                                {
                                  toFun := fun x =>
                                    Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                      x.toQuot,
                                  map_one' :=
                                    (_ :
                                      Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                          1.toQuot =
                                        1) },
                              map_mul' :=
                                (_ :
                                  ∀ (x y : RingQuot fun x y => s x y),
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f'
                                              (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b) x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f'
                                                  (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                  1.toQuot =
                                                1) }
                                        (x * y) =
                                      OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f'
                                                (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f'
                                                    (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                    1.toQuot =
                                                  1) }
                                          x *
                                        OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f'
                                                (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f'
                                                    (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                    1.toQuot =
                                                  1) }
                                          y) },
                          map_zero' :=
                            (_ :
                              Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b) 0.toQuot =
                                0),
                          map_add' :=
                            (_ :
                              ∀ (x y : RingQuot fun x y => s x y),
                                OneHom.toFun
                                    (↑{
                                        toOneHom :=
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f'
                                                (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f'
                                                    (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                    1.toQuot =
                                                  1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (x y : RingQuot fun x y => s x y),
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f'
                                                        (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            1.toQuot =
                                                          1) }
                                                  (x * y) =
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f'
                                                              (_ :
                                                                ∀ (a b : A),
                                                                  Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                              1.toQuot =
                                                            1) }
                                                    x *
                                                  OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f'
                                                              (_ :
                                                                ∀ (a b : A),
                                                                  Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                              1.toQuot =
                                                            1) }
                                                    y) })
                                    (x + y) =
                                  OneHom.toFun
                                      (↑{
                                          toOneHom :=
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f'
                                                  (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f'
                                                      (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                      1.toQuot =
                                                    1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : RingQuot fun x y => s x y),
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f'
                                                              (_ :
                                                                ∀ (a b : A),
                                                                  Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                              1.toQuot =
                                                            1) }
                                                    (x * y) =
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f'
                                                                (_ :
                                                                  ∀ (a b : A),
                                                                    Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                                1.toQuot =
                                                              1) }
                                                      x *
                                                    OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f'
                                                                (_ :
                                                                  ∀ (a b : A),
                                                                    Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                                1.toQuot =
                                                              1) }
                                                      y) })
                                      x +
                                    OneHom.toFun
                                      (↑{
                                          toOneHom :=
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f'
                                                  (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f'
                                                      (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                      1.toQuot =
                                                    1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : RingQuot fun x y => s x y),
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f'
                                                              (_ :
                                                                ∀ (a b : A),
                                                                  Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                              1.toQuot =
                                                            1) }
                                                    (x * y) =
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f'
                                                                (_ :
                                                                  ∀ (a b : A),
                                                                    Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                                1.toQuot =
                                                              1) }
                                                      x *
                                                    OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f'
                                                                (_ :
                                                                  ∀ (a b : A),
                                                                    Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                                1.toQuot =
                                                              1) }
                                                      y) })
                                      y) },
                      commutes' :=
                        (_ :
                          ∀ (x : S),
                            Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                (↑(algebraMap S (RingQuot fun x y => s x y)) x).toQuot =
                              ↑(algebraMap S B) x) }),
              right_inv :=
                (_ :
                  Function.RightInverse
                    (fun F =>
                      {
                        val :=
                          AlgHom.comp F
                            {
                              toRingHom :=
                                {
                                  toMonoidHom :=
                                    {
                                      toOneHom :=
                                        { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                          map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                      map_mul' :=
                                        (_ :
                                          ∀ (a a_1 : A),
                                            { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                              { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                                  map_zero' :=
                                    (_ :
                                      OneHom.toFun
                                          (↑{
                                              toOneHom :=
                                                { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                  map_one' :=
                                                    (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                              map_mul' :=
                                                (_ :
                                                  ∀ (a a_1 : A),
                                                    { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                          0 =
                                        0),
                                  map_add' :=
                                    (_ :
                                      ∀ (x y : A),
                                        OneHom.toFun
                                            (↑{
                                                toOneHom :=
                                                  { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                    map_one' :=
                                                      (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                map_mul' :=
                                                  (_ :
                                                    ∀ (a a_1 : A),
                                                      { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                            (x + y) =
                                          OneHom.toFun
                                              (↑{
                                                  toOneHom :=
                                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                      map_one' :=
                                                        (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                  map_mul' :=
                                                    (_ :
                                                      ∀ (a a_1 : A),
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                              x +
                                            OneHom.toFun
                                              (↑{
                                                  toOneHom :=
                                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                      map_one' :=
                                                        (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                  map_mul' :=
                                                    (_ :
                                                      ∀ (a a_1 : A),
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                              y) },
                              commutes' :=
                                (_ :
                                  ∀ (r : S),
                                    OneHom.toFun
                                        (↑↑{
                                              toMonoidHom :=
                                                {
                                                  toOneHom :=
                                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                      map_one' :=
                                                        (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                  map_mul' :=
                                                    (_ :
                                                      ∀ (a a_1 : A),
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                                              map_zero' :=
                                                (_ :
                                                  OneHom.toFun
                                                      (↑{
                                                          toOneHom :=
                                                            {
                                                              toFun := fun x =>
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                              map_one' :=
                                                                (_ :
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                          map_mul' :=
                                                            (_ :
                                                              ∀ (a a_1 : A),
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                      0 =
                                                    0),
                                              map_add' :=
                                                (_ :
                                                  ∀ (x y : A),
                                                    OneHom.toFun
                                                        (↑{
                                                            toOneHom :=
                                                              {
                                                                toFun := fun x =>
                                                                  { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                map_one' :=
                                                                  (_ :
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                      1) },
                                                            map_mul' :=
                                                              (_ :
                                                                ∀ (a a_1 : A),
                                                                  {
                                                                      toQuot :=
                                                                        Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                      {
                                                                        toQuot :=
                                                                          Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                        (x + y) =
                                                      OneHom.toFun
                                                          (↑{
                                                              toOneHom :=
                                                                {
                                                                  toFun := fun x =>
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                  map_one' :=
                                                                    (_ :
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                        1) },
                                                              map_mul' :=
                                                                (_ :
                                                                  ∀ (a a_1 : A),
                                                                    {
                                                                        toQuot :=
                                                                          Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                        {
                                                                          toQuot :=
                                                                            Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                          x +
                                                        OneHom.toFun
                                                          (↑{
                                                              toOneHom :=
                                                                {
                                                                  toFun := fun x =>
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                  map_one' :=
                                                                    (_ :
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                        1) },
                                                              map_mul' :=
                                                                (_ :
                                                                  ∀ (a a_1 : A),
                                                                    {
                                                                        toQuot :=
                                                                          Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                        {
                                                                          toQuot :=
                                                                            Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                          y) })
                                        (↑(algebraMap S A) r) =
                                      ↑(algebraMap S (RingQuot fun x y => s x y)) r) },
                        property :=
                          (_ :
                            (fun f => ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y)
                              (AlgHom.comp F
                                {
                                  toRingHom :=
                                    {
                                      toMonoidHom :=
                                        {
                                          toOneHom :=
                                            { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                              map_one' := (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (a a_1 : A),
                                                { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                  { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                    { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                                      map_zero' :=
                                        (_ :
                                          OneHom.toFun
                                              (↑{
                                                  toOneHom :=
                                                    { toFun := fun x => { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                      map_one' :=
                                                        (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                  map_mul' :=
                                                    (_ :
                                                      ∀ (a a_1 : A),
                                                        { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                              0 =
                                            0),
                                      map_add' :=
                                        (_ :
                                          ∀ (x y : A),
                                            OneHom.toFun
                                                (↑{
                                                    toOneHom :=
                                                      {
                                                        toFun := fun x =>
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                        map_one' :=
                                                          (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                    map_mul' :=
                                                      (_ :
                                                        ∀ (a a_1 : A),
                                                          { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                (x + y) =
                                              OneHom.toFun
                                                  (↑{
                                                      toOneHom :=
                                                        {
                                                          toFun := fun x =>
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                          map_one' :=
                                                            (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                      map_mul' :=
                                                        (_ :
                                                          ∀ (a a_1 : A),
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                  x +
                                                OneHom.toFun
                                                  (↑{
                                                      toOneHom :=
                                                        {
                                                          toFun := fun x =>
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                          map_one' :=
                                                            (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                      map_mul' :=
                                                        (_ :
                                                          ∀ (a a_1 : A),
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                  y) },
                                  commutes' :=
                                    (_ :
                                      ∀ (r : S),
                                        OneHom.toFun
                                            (↑↑{
                                                  toMonoidHom :=
                                                    {
                                                      toOneHom :=
                                                        {
                                                          toFun := fun x =>
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                          map_one' :=
                                                            (_ : { toQuot := Quot.mk (Rel fun x y => s x y) 1 } = 1) },
                                                      map_mul' :=
                                                        (_ :
                                                          ∀ (a a_1 : A),
                                                            { toQuot := Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                              { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                { toQuot := Quot.mk (Rel fun x y => s x y) a_1 }) },
                                                  map_zero' :=
                                                    (_ :
                                                      OneHom.toFun
                                                          (↑{
                                                              toOneHom :=
                                                                {
                                                                  toFun := fun x =>
                                                                    { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                  map_one' :=
                                                                    (_ :
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                        1) },
                                                              map_mul' :=
                                                                (_ :
                                                                  ∀ (a a_1 : A),
                                                                    {
                                                                        toQuot :=
                                                                          Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                        {
                                                                          toQuot :=
                                                                            Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                          0 =
                                                        0),
                                                  map_add' :=
                                                    (_ :
                                                      ∀ (x y : A),
                                                        OneHom.toFun
                                                            (↑{
                                                                toOneHom :=
                                                                  {
                                                                    toFun := fun x =>
                                                                      { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                    map_one' :=
                                                                      (_ :
                                                                        { toQuot := Quot.mk (Rel fun x y => s x y) 1 } =
                                                                          1) },
                                                                map_mul' :=
                                                                  (_ :
                                                                    ∀ (a a_1 : A),
                                                                      {
                                                                          toQuot :=
                                                                            Quot.mk (Rel fun x y => s x y) (a * a_1) } =
                                                                        { toQuot := Quot.mk (Rel fun x y => s x y) a } *
                                                                          {
                                                                            toQuot :=
                                                                              Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                            (x + y) =
                                                          OneHom.toFun
                                                              (↑{
                                                                  toOneHom :=
                                                                    {
                                                                      toFun := fun x =>
                                                                        { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                      map_one' :=
                                                                        (_ :
                                                                          {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) 1 } =
                                                                            1) },
                                                                  map_mul' :=
                                                                    (_ :
                                                                      ∀ (a a_1 : A),
                                                                        {
                                                                            toQuot :=
                                                                              Quot.mk (Rel fun x y => s x y)
                                                                                (a * a_1) } =
                                                                          {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) a } *
                                                                            {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                              x +
                                                            OneHom.toFun
                                                              (↑{
                                                                  toOneHom :=
                                                                    {
                                                                      toFun := fun x =>
                                                                        { toQuot := Quot.mk (Rel fun x y => s x y) x },
                                                                      map_one' :=
                                                                        (_ :
                                                                          {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) 1 } =
                                                                            1) },
                                                                  map_mul' :=
                                                                    (_ :
                                                                      ∀ (a a_1 : A),
                                                                        {
                                                                            toQuot :=
                                                                              Quot.mk (Rel fun x y => s x y)
                                                                                (a * a_1) } =
                                                                          {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) a } *
                                                                            {
                                                                              toQuot :=
                                                                                Quot.mk (Rel fun x y => s x y) a_1 }) })
                                                              y) })
                                            (↑(algebraMap S A) r) =
                                          ↑(algebraMap S (RingQuot fun x y => s x y)) r) })) })
                    fun f' =>
                    {
                      toRingHom :=
                        {
                          toMonoidHom :=
                            {
                              toOneHom :=
                                {
                                  toFun := fun x =>
                                    Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                      x.toQuot,
                                  map_one' :=
                                    (_ :
                                      Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                          1.toQuot =
                                        1) },
                              map_mul' :=
                                (_ :
                                  ∀ (x y : RingQuot fun x y => s x y),
                                    OneHom.toFun
                                        {
                                          toFun := fun x =>
                                            Quot.lift ↑↑f'
                                              (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b) x.toQuot,
                                          map_one' :=
                                            (_ :
                                              Quot.lift ↑↑f'
                                                  (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                  1.toQuot =
                                                1) }
                                        (x * y) =
                                      OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f'
                                                (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f'
                                                    (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                    1.toQuot =
                                                  1) }
                                          x *
                                        OneHom.toFun
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f'
                                                (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f'
                                                    (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                    1.toQuot =
                                                  1) }
                                          y) },
                          map_zero' :=
                            (_ :
                              Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b) 0.toQuot =
                                0),
                          map_add' :=
                            (_ :
                              ∀ (x y : RingQuot fun x y => s x y),
                                OneHom.toFun
                                    (↑{
                                        toOneHom :=
                                          {
                                            toFun := fun x =>
                                              Quot.lift ↑↑f'
                                                (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                x.toQuot,
                                            map_one' :=
                                              (_ :
                                                Quot.lift ↑↑f'
                                                    (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                    1.toQuot =
                                                  1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (x y : RingQuot fun x y => s x y),
                                              OneHom.toFun
                                                  {
                                                    toFun := fun x =>
                                                      Quot.lift ↑↑f'
                                                        (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                        x.toQuot,
                                                    map_one' :=
                                                      (_ :
                                                        Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            1.toQuot =
                                                          1) }
                                                  (x * y) =
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f'
                                                              (_ :
                                                                ∀ (a b : A),
                                                                  Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                              1.toQuot =
                                                            1) }
                                                    x *
                                                  OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f'
                                                              (_ :
                                                                ∀ (a b : A),
                                                                  Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                              1.toQuot =
                                                            1) }
                                                    y) })
                                    (x + y) =
                                  OneHom.toFun
                                      (↑{
                                          toOneHom :=
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f'
                                                  (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f'
                                                      (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                      1.toQuot =
                                                    1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : RingQuot fun x y => s x y),
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f'
                                                              (_ :
                                                                ∀ (a b : A),
                                                                  Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                              1.toQuot =
                                                            1) }
                                                    (x * y) =
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f'
                                                                (_ :
                                                                  ∀ (a b : A),
                                                                    Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                                1.toQuot =
                                                              1) }
                                                      x *
                                                    OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f'
                                                                (_ :
                                                                  ∀ (a b : A),
                                                                    Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                                1.toQuot =
                                                              1) }
                                                      y) })
                                      x +
                                    OneHom.toFun
                                      (↑{
                                          toOneHom :=
                                            {
                                              toFun := fun x =>
                                                Quot.lift ↑↑f'
                                                  (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                  x.toQuot,
                                              map_one' :=
                                                (_ :
                                                  Quot.lift ↑↑f'
                                                      (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                      1.toQuot =
                                                    1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (x y : RingQuot fun x y => s x y),
                                                OneHom.toFun
                                                    {
                                                      toFun := fun x =>
                                                        Quot.lift ↑↑f'
                                                          (_ :
                                                            ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                          x.toQuot,
                                                      map_one' :=
                                                        (_ :
                                                          Quot.lift ↑↑f'
                                                              (_ :
                                                                ∀ (a b : A),
                                                                  Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                              1.toQuot =
                                                            1) }
                                                    (x * y) =
                                                  OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f'
                                                                (_ :
                                                                  ∀ (a b : A),
                                                                    Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                                1.toQuot =
                                                              1) }
                                                      x *
                                                    OneHom.toFun
                                                      {
                                                        toFun := fun x =>
                                                          Quot.lift ↑↑f'
                                                            (_ :
                                                              ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                            x.toQuot,
                                                        map_one' :=
                                                          (_ :
                                                            Quot.lift ↑↑f'
                                                                (_ :
                                                                  ∀ (a b : A),
                                                                    Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                                                1.toQuot =
                                                              1) }
                                                      y) })
                                      y) },
                      commutes' :=
                        (_ :
                          ∀ (x : S),
                            Quot.lift ↑↑f' (_ : ∀ (a b : A), Rel (fun x y => s x y) a b → ↑↑f' a = ↑↑f' b)
                                (↑(algebraMap S (RingQuot fun x y => s x y)) x).toQuot =
                              ↑(algebraMap S B) x) }) }
          { val := f, property := w })
      (↑{
            toRingHom :=
              {
                toMonoidHom :=
                  {
                    toOneHom :=
                      { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                        map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                    map_mul' :=
                      (_ :
                        ∀ (a a_1 : A),
                          { toQuot := Quot.mk (Rel s) (a * a_1) } =
                            { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) },
                map_zero' :=
                  (_ :
                    OneHom.toFun
                        (↑{
                            toOneHom :=
                              { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (a a_1 : A),
                                  { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                    { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                        0 =
                      0),
                map_add' :=
                  (_ :
                    ∀ (x y : A),
                      OneHom.toFun
                          (↑{
                              toOneHom :=
                                { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                  map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                              map_mul' :=
                                (_ :
                                  ∀ (a a_1 : A),
                                    { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                      { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                          (x + y) =
                        OneHom.toFun
                            (↑{
                                toOneHom :=
                                  { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                    map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (a a_1 : A),
                                      { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                        { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                            x +
                          OneHom.toFun
                            (↑{
                                toOneHom :=
                                  { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                    map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (a a_1 : A),
                                      { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                        { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                            y) },
            commutes' :=
              (_ :
                ∀ (r : S),
                  OneHom.toFun
                      (↑↑{
                            toMonoidHom :=
                              {
                                toOneHom :=
                                  { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                    map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                                map_mul' :=
                                  (_ :
                                    ∀ (a a_1 : A),
                                      { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                        { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) },
                            map_zero' :=
                              (_ :
                                OneHom.toFun
                                    (↑{
                                        toOneHom :=
                                          { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                            map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                                        map_mul' :=
                                          (_ :
                                            ∀ (a a_1 : A),
                                              { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                                { toQuot := Quot.mk (Rel s) a } * { toQuot := Quot.mk (Rel s) a_1 }) })
                                    0 =
                                  0),
                            map_add' :=
                              (_ :
                                ∀ (x y : A),
                                  OneHom.toFun
                                      (↑{
                                          toOneHom :=
                                            { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                              map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                                          map_mul' :=
                                            (_ :
                                              ∀ (a a_1 : A),
                                                { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                                  { toQuot := Quot.mk (Rel s) a } *
                                                    { toQuot := Quot.mk (Rel s) a_1 }) })
                                      (x + y) =
                                    OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                                map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (a a_1 : A),
                                                  { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                                    { toQuot := Quot.mk (Rel s) a } *
                                                      { toQuot := Quot.mk (Rel s) a_1 }) })
                                        x +
                                      OneHom.toFun
                                        (↑{
                                            toOneHom :=
                                              { toFun := fun x => { toQuot := Quot.mk (Rel s) x },
                                                map_one' := (_ : { toQuot := Quot.mk (Rel s) 1 } = 1) },
                                            map_mul' :=
                                              (_ :
                                                ∀ (a a_1 : A),
                                                  { toQuot := Quot.mk (Rel s) (a * a_1) } =
                                                    { toQuot := Quot.mk (Rel s) a } *
                                                      { toQuot := Quot.mk (Rel s) a_1 }) })
                                        y) })
                      (↑(algebraMap S A) r) =
                    ↑(algebraMap S (RingQuot s)) r) }
        x) =
    ↑f x
[PROOFSTEP]
rfl
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
f : A →ₐ[S] B
s : A → A → Prop
w : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
g : RingQuot s →ₐ[S] B
h : AlgHom.comp g (mkAlgHom S s) = f
⊢ g = ↑(liftAlgHom S) { val := f, property := w }
[PROOFSTEP]
ext
[GOAL]
case w.H
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
f : A →ₐ[S] B
s : A → A → Prop
w : ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y
g : RingQuot s →ₐ[S] B
h : AlgHom.comp g (mkAlgHom S s) = f
x✝ : A
⊢ ↑(AlgHom.comp g (mkAlgHom S s)) x✝ = ↑(AlgHom.comp (↑(liftAlgHom S) { val := f, property := w }) (mkAlgHom S s)) x✝
[PROOFSTEP]
simp [h]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : RingQuot s →ₐ[S] B
⊢ f =
    ↑(liftAlgHom S)
      { val := AlgHom.comp f (mkAlgHom S s),
        property := (_ : ∀ (x y : A), s x y → ↑f (↑↑(mkAlgHom S s) x) = ↑f (↑↑(mkAlgHom S s) y)) }
[PROOFSTEP]
conv_lhs => rw [← (liftAlgHom S).apply_symm_apply f]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : RingQuot s →ₐ[S] B
| f
[PROOFSTEP]
rw [← (liftAlgHom S).apply_symm_apply f]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : RingQuot s →ₐ[S] B
| f
[PROOFSTEP]
rw [← (liftAlgHom S).apply_symm_apply f]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : RingQuot s →ₐ[S] B
| f
[PROOFSTEP]
rw [← (liftAlgHom S).apply_symm_apply f]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : RingQuot s →ₐ[S] B
⊢ ↑(liftAlgHom S) (↑(liftAlgHom S).symm f) =
    ↑(liftAlgHom S)
      { val := AlgHom.comp f (mkAlgHom S s),
        property := (_ : ∀ (x y : A), s x y → ↑f (↑↑(mkAlgHom S s) x) = ↑f (↑↑(mkAlgHom S s) y)) }
[PROOFSTEP]
rw [liftAlgHom]
[GOAL]
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✝² : Semiring T
B : Type u₄
inst✝¹ : Semiring B
inst✝ : Algebra S B
s : A → A → Prop
f : RingQuot s →ₐ[S] B
⊢ ↑{ toFun := fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y),
          invFun := fun F =>
            { val := AlgHom.comp F (mkAlgHom S s),
              property := (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) },
          left_inv :=
            (_ :
              ∀ (f : { f // ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y }),
                (fun F =>
                      { val := AlgHom.comp F (mkAlgHom S s),
                        property :=
                          (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) })
                    ((fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y)) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (F : RingQuot s →ₐ[S] B),
                (fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y))
                    ((fun F =>
                        { val := AlgHom.comp F (mkAlgHom S s),
                          property :=
                            (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) })
                      F) =
                  F) }
      (↑{ toFun := fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y),
              invFun := fun F =>
                { val := AlgHom.comp F (mkAlgHom S s),
                  property := (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) },
              left_inv :=
                (_ :
                  ∀ (f : { f // ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y }),
                    (fun F =>
                          { val := AlgHom.comp F (mkAlgHom S s),
                            property :=
                              (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) })
                        ((fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y)) f) =
                      f),
              right_inv :=
                (_ :
                  ∀ (F : RingQuot s →ₐ[S] B),
                    (fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y))
                        ((fun F =>
                            { val := AlgHom.comp F (mkAlgHom S s),
                              property :=
                                (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) })
                          F) =
                      F) }.symm
        f) =
    ↑{ toFun := fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y),
          invFun := fun F =>
            { val := AlgHom.comp F (mkAlgHom S s),
              property := (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) },
          left_inv :=
            (_ :
              ∀ (f : { f // ∀ ⦃x y : A⦄, s x y → ↑f x = ↑f y }),
                (fun F =>
                      { val := AlgHom.comp F (mkAlgHom S s),
                        property :=
                          (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) })
                    ((fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y)) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (F : RingQuot s →ₐ[S] B),
                (fun f' => preLiftAlgHom S (_ : ∀ ⦃x y : A⦄, s x y → ↑↑f' x = ↑↑f' y))
                    ((fun F =>
                        { val := AlgHom.comp F (mkAlgHom S s),
                          property :=
                            (_ : ∀ (x x_1 : A), s x x_1 → ↑F (↑↑(mkAlgHom S s) x) = ↑F (↑↑(mkAlgHom S s) x_1)) })
                      F) =
                  F) }
      { val := AlgHom.comp f (mkAlgHom S s),
        property := (_ : ∀ (x y : A), s x y → ↑f (↑↑(mkAlgHom S s) x) = ↑f (↑↑(mkAlgHom S s) y)) }
[PROOFSTEP]
rfl