fix(frontends/lean/structure_cmd): modify coercion generation

The previous coercion was more efficient, but the computation was
getting stuck when processing algebraic structures