í semigroup(A)) }
</code></pre>
<h2>Why so complicated</h2>
<ul>
<li>In Lean, all the structures are given as inductive types with a single introduction rule <code>mk</code>.</li>
<li>To form the semigroup, we give to make a multiplication <code>m</code> and a proof of associativity of <code>m</code>.</li>
<li>The multiplication is recursively defined, forgetting many parts of the structure.</li>
<li>On the other hand, the associativity depends on the group structure (via <code>m</code>), so needs to be de