This approach is strongly reminiscent of abstract algebra; for example, the Map-Reduce Transformation example seems to be(?) justified exactly when f is an isomorphism over r.<p>I&#x27;ve been thinking along somewhat similar lines but I&#x27;ve been looking at it from the perspective of introduction and elimination rules, as found in type theory. If your compiler can find a transformation that brings an intro form and an elim form together, then you can apply the computation rule to remove both from the program. My motivation is to remove allocations that aren&#x27;t really essential. (I do have a functional language compiler that I work on but it doesn&#x27;t implement any optimizations yet).<p>Another interesting idea that seems related is from a Philip Wadler talk[1] I saw which discusses how normalization can be used to achieve something like your &quot;hypothetical inverses&quot;, which should always be eliminated from the final result.<p>&gt; These transformations might only be useful in obvious optimization scenarios (cases that no programmer would intentionally create).<p>I would be surprised if that turned out to be the case.<p>[1] &quot;Everything Old is New Again: Quoted Domain Specific Languages&quot; <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=DlBwJ4rvz5c" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=DlBwJ4rvz5c</a>