theorem eq_liftAlgHom_comp_mkAlgHom {s : A → A → Prop} (f : RingQuot s →ₐ[S] B) :
    f = liftAlgHom S ⟨f.comp (mkAlgHom S s), fun x y h ↦ congr_arg f (mkAlgHom_rel S h)⟩ := by
  conv_lhs => rw [← (liftAlgHom S).apply_symm_apply f]
  rw [liftAlgHom]
  

Proof state:
R : Type uR
inst✝⁶ : Semiring R
S : Type uS
inst✝⁵ : CommSemiring S
T : Type uT
A : Type uA
inst✝⁴ : Semiring A
inst✝³ : Algebra S A
r : R → R → Prop
inst✝² : 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)) }

Next tactic:
rfl