The term "invention" is being used loosely here. "Invention" refers to the style of two-part counterpoint that J. S. Bach used in his 15 Inventions for keyboard. I play Bach's Invention No. 1 on the piano, and that inspired the structure of this piece, even though it is different in some places.
Thanks to
@flat.io_earther for helping me choose between D# minor and Eb minor (it's almost always better to use Eb minor, since you will end up using less double sharps/flats)!