Theorem: RingQuot.ringQuotToIdealQuotient_apply
File: Mathlib/Algebra/RingQuot.lean

tactic: simp_rw [ringQuotToIdealQuotient, lift_def, preLift_def, mkRingHom_def]
state_before: R : Type u₁
inst✝⁵ : Semiring R
S : Type u₂
inst✝⁴ : CommSemiring S
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra S A
r✝ : R → R → Prop
T : Type u₄
inst✝¹ : Semiring T
B : Type u₁
inst✝ : CommRing B
r : B → B → Prop
x : B
⊢ ↑(ringQuotToIdealQuotient r) (↑(mkRingHom r) x) = ↑(Ideal.Quotient.mk (Ideal.ofRel r)) x

tactic: rfl
state_before: R : Type u₁
inst✝⁵ : Semiring R
S : Type u₂
inst✝⁴ : CommSemiring S
A : Type u₃
inst✝³ : Semiring A
inst✝² : Algebra S A
r✝ : R → R → Prop
T : Type u₄
inst✝¹ : Semiring T
B : Type u₁
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