/-- The functor `X ↦ FreeLieAlgebra R X` from the category of types to the category of Lie
algebras over `R` is adjoint to the forgetful functor in the other direction. -/
def lift : (X → L) ≃ (FreeLieAlgebra R X →ₗ⁅R⁆ L) where
  toFun f :=
    { toFun := fun c => Quot.liftOn c (liftAux R f) (liftAux_spec R f)
      map_add' := by rintro ⟨a⟩ ⟨b⟩; rw [← liftAux_map_add]; rfl
      map_smul' := by rintro t ⟨a⟩; rw [← liftAux_map_smul]; rfl
      map_lie' := by rintro ⟨a⟩ ⟨b⟩; rw [← liftAux_map_mul]; rfl }
  invFun F := F ∘ of R
  left_inv f := by
    ext x;
    

Proof state:
case h
R : Type u
X : Type v
inst✝² : CommRing R
L : Type w
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
f : X → L
x : X
⊢ (fun F => ⇑F ∘ of R)
      ((fun f =>
          {
            toLinearMap :=
              {
                toAddHom :=
                  {
                    toFun := fun c =>
                      Quot.liftOn c ⇑(liftAux R f)
                        (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                    map_add' :=
                      (_ :
                        ∀ (x y : FreeLieAlgebra R X),
                          (fun c =>
                                Quot.liftOn c ⇑(liftAux R f)
                                  (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                              (x + y) =
                            (fun c =>
                                  Quot.liftOn c ⇑(liftAux R f)
                                    (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                x +
                              (fun c =>
                                  Quot.liftOn c ⇑(liftAux R f)
                                    (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                y) },
                map_smul' :=
                  (_ :
                    ∀ (t : R) (x : FreeLieAlgebra R X),
                      AddHom.toFun
                          {
                            toFun := fun c =>
                              Quot.liftOn c ⇑(liftAux R f)
                                (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                            map_add' :=
                              (_ :
                                ∀ (x y : FreeLieAlgebra R X),
                                  (fun c =>
                                        Quot.liftOn c ⇑(liftAux R f)
                                          (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                      (x + y) =
                                    (fun c =>
                                          Quot.liftOn c ⇑(liftAux R f)
                                            (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                        x +
                                      (fun c =>
                                          Quot.liftOn c ⇑(liftAux R f)
                                            (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                        y) }
                          (t • x) =
                        (RingHom.id R) t •
                          AddHom.toFun
                            {
                              toFun := fun c =>
                                Quot.liftOn c ⇑(liftAux R f)
                                  (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                              map_add' :=
                                (_ :
                                  ∀ (x y : FreeLieAlgebra R X),
                                    (fun c =>
                                          Quot.liftOn c ⇑(liftAux R f)
                                            (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                        (x + y) =
                                      (fun c =>
                                            Quot.liftOn c ⇑(liftAux R f)
                                              (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                          x +
                                        (fun c =>
                                            Quot.liftOn c ⇑(liftAux R f)
                                              (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                          y) }
                            x) },
            map_lie' :=
              (_ :
                ∀ {x y : FreeLieAlgebra R X},
                  AddHom.toFun
                      {
                          toAddHom :=
                            {
                              toFun := fun c =>
                                Quot.liftOn c ⇑(liftAux R f)
                                  (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                              map_add' :=
                                (_ :
                                  ∀ (x y : FreeLieAlgebra R X),
                                    (fun c =>
                                          Quot.liftOn c ⇑(liftAux R f)
                                            (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                        (x + y) =
                                      (fun c =>
                                            Quot.liftOn c ⇑(liftAux R f)
                                              (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                          x +
                                        (fun c =>
                                            Quot.liftOn c ⇑(liftAux R f)
                                              (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                          y) },
                          map_smul' :=
                            (_ :
                              ∀ (t : R) (x : FreeLieAlgebra R X),
                                AddHom.toFun
                                    {
                                      toFun := fun c =>
                                        Quot.liftOn c ⇑(liftAux R f)
                                          (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                                      map_add' :=
                                        (_ :
                                          ∀ (x y : FreeLieAlgebra R X),
                                            (fun c =>
                                                  Quot.liftOn c ⇑(liftAux R f)
                                                    (_ :
                                                      ∀ (a b : lib R X),
                                                        Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                (x + y) =
                                              (fun c =>
                                                    Quot.liftOn c ⇑(liftAux R f)
                                                      (_ :
                                                        ∀ (a b : lib R X),
                                                          Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                  x +
                                                (fun c =>
                                                    Quot.liftOn c ⇑(liftAux R f)
                                                      (_ :
                                                        ∀ (a b : lib R X),
                                                          Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                  y) }
                                    (t • x) =
                                  (RingHom.id R) t •
                                    AddHom.toFun
                                      {
                                        toFun := fun c =>
                                          Quot.liftOn c ⇑(liftAux R f)
                                            (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                                        map_add' :=
                                          (_ :
                                            ∀ (x y : FreeLieAlgebra R X),
                                              (fun c =>
                                                    Quot.liftOn c ⇑(liftAux R f)
                                                      (_ :
                                                        ∀ (a b : lib R X),
                                                          Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                  (x + y) =
                                                (fun c =>
                                                      Quot.liftOn c ⇑(liftAux R f)
                                                        (_ :
                                                          ∀ (a b : lib R X),
                                                            Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                    x +
                                                  (fun c =>
                                                      Quot.liftOn c ⇑(liftAux R f)
                                                        (_ :
                                                          ∀ (a b : lib R X),
                                                            Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                    y) }
                                      x) }.toAddHom
                      ⁅x, y⁆ =
                    ⁅AddHom.toFun
                        {
                            toAddHom :=
                              {
                                toFun := fun c =>
                                  Quot.liftOn c ⇑(liftAux R f)
                                    (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : FreeLieAlgebra R X),
                                      (fun c =>
                                            Quot.liftOn c ⇑(liftAux R f)
                                              (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                          (x + y) =
                                        (fun c =>
                                              Quot.liftOn c ⇑(liftAux R f)
                                                (_ :
                                                  ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                            x +
                                          (fun c =>
                                              Quot.liftOn c ⇑(liftAux R f)
                                                (_ :
                                                  ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                            y) },
                            map_smul' :=
                              (_ :
                                ∀ (t : R) (x : FreeLieAlgebra R X),
                                  AddHom.toFun
                                      {
                                        toFun := fun c =>
                                          Quot.liftOn c ⇑(liftAux R f)
                                            (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                                        map_add' :=
                                          (_ :
                                            ∀ (x y : FreeLieAlgebra R X),
                                              (fun c =>
                                                    Quot.liftOn c ⇑(liftAux R f)
                                                      (_ :
                                                        ∀ (a b : lib R X),
                                                          Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                  (x + y) =
                                                (fun c =>
                                                      Quot.liftOn c ⇑(liftAux R f)
                                                        (_ :
                                                          ∀ (a b : lib R X),
                                                            Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                    x +
                                                  (fun c =>
                                                      Quot.liftOn c ⇑(liftAux R f)
                                                        (_ :
                                                          ∀ (a b : lib R X),
                                                            Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                    y) }
                                      (t • x) =
                                    (RingHom.id R) t •
                                      AddHom.toFun
                                        {
                                          toFun := fun c =>
                                            Quot.liftOn c ⇑(liftAux R f)
                                              (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                                          map_add' :=
                                            (_ :
                                              ∀ (x y : FreeLieAlgebra R X),
                                                (fun c =>
                                                      Quot.liftOn c ⇑(liftAux R f)
                                                        (_ :
                                                          ∀ (a b : lib R X),
                                                            Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                    (x + y) =
                                                  (fun c =>
                                                        Quot.liftOn c ⇑(liftAux R f)
                                                          (_ :
                                                            ∀ (a b : lib R X),
                                                              Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                      x +
                                                    (fun c =>
                                                        Quot.liftOn c ⇑(liftAux R f)
                                                          (_ :
                                                            ∀ (a b : lib R X),
                                                              Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                      y) }
                                        x) }.toAddHom
                        x,
                      AddHom.toFun
                        {
                            toAddHom :=
                              {
                                toFun := fun c =>
                                  Quot.liftOn c ⇑(liftAux R f)
                                    (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : FreeLieAlgebra R X),
                                      (fun c =>
                                            Quot.liftOn c ⇑(liftAux R f)
                                              (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                          (x + y) =
                                        (fun c =>
                                              Quot.liftOn c ⇑(liftAux R f)
                                                (_ :
                                                  ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                            x +
                                          (fun c =>
                                              Quot.liftOn c ⇑(liftAux R f)
                                                (_ :
                                                  ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                            y) },
                            map_smul' :=
                              (_ :
                                ∀ (t : R) (x : FreeLieAlgebra R X),
                                  AddHom.toFun
                                      {
                                        toFun := fun c =>
                                          Quot.liftOn c ⇑(liftAux R f)
                                            (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                                        map_add' :=
                                          (_ :
                                            ∀ (x y : FreeLieAlgebra R X),
                                              (fun c =>
                                                    Quot.liftOn c ⇑(liftAux R f)
                                                      (_ :
                                                        ∀ (a b : lib R X),
                                                          Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                  (x + y) =
                                                (fun c =>
                                                      Quot.liftOn c ⇑(liftAux R f)
                                                        (_ :
                                                          ∀ (a b : lib R X),
                                                            Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                    x +
                                                  (fun c =>
                                                      Quot.liftOn c ⇑(liftAux R f)
                                                        (_ :
                                                          ∀ (a b : lib R X),
                                                            Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                    y) }
                                      (t • x) =
                                    (RingHom.id R) t •
                                      AddHom.toFun
                                        {
                                          toFun := fun c =>
                                            Quot.liftOn c ⇑(liftAux R f)
                                              (_ : ∀ (a b : lib R X), Rel R X a b → (liftAux R f) a = (liftAux R f) b),
                                          map_add' :=
                                            (_ :
                                              ∀ (x y : FreeLieAlgebra R X),
                                                (fun c =>
                                                      Quot.liftOn c ⇑(liftAux R f)
                                                        (_ :
                                                          ∀ (a b : lib R X),
                                                            Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                    (x + y) =
                                                  (fun c =>
                                                        Quot.liftOn c ⇑(liftAux R f)
                                                          (_ :
                                                            ∀ (a b : lib R X),
                                                              Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                      x +
                                                    (fun c =>
                                                        Quot.liftOn c ⇑(liftAux R f)
                                                          (_ :
                                                            ∀ (a b : lib R X),
                                                              Rel R X a b → (liftAux R f) a = (liftAux R f) b))
                                                      y) }
                                        x) }.toAddHom
                        y⁆) })
        f)
      x =
    f x

Next tactic:
simp only [liftAux, of, Quot.liftOn_mk, LieHom.coe_mk, Function.comp_apply, lib.lift_of_apply]