/-- Internal definition used to define `lift` -/
private def liftAux (f : X → A) : FreeAlgebra R X →ₐ[R] A where
  toFun a :=
    Quot.liftOn a (liftFun _ _ f) fun a b h ↦ by
      induction' h
      · exact (algebraMap R A).map_add _ _
      · exact (algebraMap R A).map_mul _ _
      · apply Algebra.commutes
      · change _ + _ + _ = _ + (_ + _)
        rw [add_assoc]
      · change _ + _ = _ + _
        rw [add_comm]
      · change algebraMap _ _ _ + liftFun R X f _ = liftFun R X f _
        simp
      · change _ * _ * _ = _ * (_ * _)
        rw [mul_assoc]
      · change algebraMap _ _ _ * liftFun R X f _ = liftFun R X f _
        simp
      · change liftFun R X f _ * algebraMap _ _ _ = liftFun R X f _
        simp
      · change _ * (_ + _) = _ * _ + _ * _
        rw [left_distrib]
      · change (_ + _) * _ = _ * _ + _ * _
        rw [right_distrib]
      · change algebraMap _ _ _ * _ = algebraMap _ _ _
        simp
      · change _ * algebraMap _ _ _ = algebraMap _ _ _
        simp
      repeat
        change liftFun R X f _ + liftFun R X f _ = _
        simp only [*]
        rfl
      repeat
        change liftFun R X f _ * liftFun R X f _ = _
        simp only [*]
        rfl
  map_one' := by
    change algebraMap _ _ _ = _
    simp
  map_mul' := by
    rintro ⟨⟩ ⟨⟩
    rfl
  map_zero' := by
    dsimp
    change algebraMap _ _ _ = _
    simp
  map_add' := by
    rintro ⟨⟩ ⟨⟩
    

Proof state:
case mk.mk
R : Type u_1
inst✝² : CommSemiring R
X : Type u_2
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
f : X → A
x✝ : FreeAlgebra R X
a✝¹ : Pre R X
y✝ : FreeAlgebra R X
a✝ : Pre R X
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            {
              toFun := fun a =>
                Quot.liftOn a (liftFun R X f) (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
              map_one' := (_ : (algebraMap R A) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : FreeAlgebra R X),
                OneHom.toFun
                    {
                      toFun := fun a =>
                        Quot.liftOn a (liftFun R X f)
                          (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
                      map_one' := (_ : (algebraMap R A) 1 = 1) }
                    (x * y) =
                  OneHom.toFun
                      {
                        toFun := fun a =>
                          Quot.liftOn a (liftFun R X f)
                            (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
                        map_one' := (_ : (algebraMap R A) 1 = 1) }
                      x *
                    OneHom.toFun
                      {
                        toFun := fun a =>
                          Quot.liftOn a (liftFun R X f)
                            (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
                        map_one' := (_ : (algebraMap R A) 1 = 1) }
                      y) })
      (Quot.mk (Rel R X) a✝¹ + Quot.mk (Rel R X) a✝) =
    OneHom.toFun
        (↑{
            toOneHom :=
              {
                toFun := fun a =>
                  Quot.liftOn a (liftFun R X f)
                    (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
                map_one' := (_ : (algebraMap R A) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : FreeAlgebra R X),
                  OneHom.toFun
                      {
                        toFun := fun a =>
                          Quot.liftOn a (liftFun R X f)
                            (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
                        map_one' := (_ : (algebraMap R A) 1 = 1) }
                      (x * y) =
                    OneHom.toFun
                        {
                          toFun := fun a =>
                            Quot.liftOn a (liftFun R X f)
                              (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
                          map_one' := (_ : (algebraMap R A) 1 = 1) }
                        x *
                      OneHom.toFun
                        {
                          toFun := fun a =>
                            Quot.liftOn a (liftFun R X f)
                              (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
                          map_one' := (_ : (algebraMap R A) 1 = 1) }
                        y) })
        (Quot.mk (Rel R X) a✝¹) +
      OneHom.toFun
        (↑{
            toOneHom :=
              {
                toFun := fun a =>
                  Quot.liftOn a (liftFun R X f)
                    (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
                map_one' := (_ : (algebraMap R A) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : FreeAlgebra R X),
                  OneHom.toFun
                      {
                        toFun := fun a =>
                          Quot.liftOn a (liftFun R X f)
                            (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
                        map_one' := (_ : (algebraMap R A) 1 = 1) }
                      (x * y) =
                    OneHom.toFun
                        {
                          toFun := fun a =>
                            Quot.liftOn a (liftFun R X f)
                              (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
                          map_one' := (_ : (algebraMap R A) 1 = 1) }
                        x *
                      OneHom.toFun
                        {
                          toFun := fun a =>
                            Quot.liftOn a (liftFun R X f)
                              (_ : ∀ (a b : Pre R X), Rel R X a b → liftFun R X f a = liftFun R X f b),
                          map_one' := (_ : (algebraMap R A) 1 = 1) }
                        y) })
        (Quot.mk (Rel R X) a✝)

Next tactic:
rfl