Module docstring
{"# Lifting algebraic data classes along injective/surjective maps
This file provides definitions that are meant to deal with situations such as the following:
Suppose that G is a group, and H is a type endowed with
One H, Mul H, and Inv H.
Suppose furthermore, that f : G → H is a surjective map
that respects the multiplication, and the unit elements.
Then H satisfies the group axioms.
The relevant definition in this case is Function.Surjective.group.
Dually, there is also Function.Injective.group.
And there are versions for (additive) (commutative) semigroups/monoids.
Implementation note
The nsmul and zsmul assumptions on any transfer definition for an algebraic structure involving
both addition and multiplication (eg AddMonoidWithOne) is ∀ n x, f (n • x) = n • f x, which is
what we would expect.
However, we cannot do the same for transfer definitions built using to_additive (eg AddMonoid)
as we want the multiplicative versions to be ∀ x n, f (x ^ n) = f x ^ n.
As a result, we must use Function.swap when using additivised transfer definitions in
non-additivised ones.
","### Injective
","### Surjective
"}