There is no clear definition of invention. The term has been used by composers for different types of compositions. Here we will refer to the inventions of Johann Sebastian Bach, which are an excellent example of simple - yet complex - compositions using contrapuntal techniques.
Originally, Bach called the two-part inventions preambulum and the three-part inventions fantasia and later sinfonia. Today we usually refer to both as two and three-part inventions. Some of the two-part inventions follow a structure similar to fugues, which are described here using fugue terminology:
Exposition | The subject or theme, usually very short, is imitated by the second voice. |
First episode | After the exposition, a transition - called an episode in fugal terminology - using material from the subject leads to the key of the dominant or, in the case of a minor invention, to the relative major. |
Second subject presentation | Once in the new key, the subject is presented often changing the roles of the voices. |
Second episode | Another episode leads to a new closely related key. The relative minor in the case of major inventions, or the dominant in the case of minor inventions. |
Third subject presentation | This presentation is not as clear as the previous one and often seems more like an episode. |
Third episode | This episode brings us back to the main key. |
Last subject presentation | Finally the subject or a variation is presented in the main key to conclude the invention. |
An example of an invention using this structure is the C Major Invention BWV 772. You can read here a detailed analysis. Other inventions like the C minor and F major make extensive use of the canon. The E major and A major have longer themes that make use of the invertible counterpoint technique.