/-- 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;
    simp only [liftAux, of, Quot.liftOn_mk, LieHom.coe_mk, Function.comp_apply, lib.lift_of_apply]
  right_inv F := by
    ext ⟨a⟩
    let F' := F.toNonUnitalAlgHom.comp (mk R)
    

Proof state:
case h.mk
R : Type u
X : Type v
inst✝² : CommRing R
L : Type w
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
F : FreeLieAlgebra R X →ₗ⁅R⁆ L
x✝ : FreeLieAlgebra R X
a : lib R X
F' : lib R X →ₙₐ[R] CommutatorRing L := NonUnitalAlgHom.comp (LieHom.toNonUnitalAlgHom F) (mk 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⁆) })
        ((fun F => ⇑F ∘ of R) F))
      (Quot.mk (Rel R X) a) =
    F (Quot.mk (Rel R X) a)

Next tactic:
exact NonUnitalAlgHom.congr_fun (lib.lift_comp_of R F') a