I'm writing a library that I want to use in my GPL3 main project and I wonder if I can license the library using the MIT license.
Yes, you can use an MIT-licensed library in an GPL-licensed application.
The MIT license is a permissive license that is compatible with the GPL license, so there is no problem at all.
When the library is used in the context of the GPL application, the GPL terms and conditions also apply to the library, but when the library is used independently from the GPL code, the MIT license is in full effect.