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 #
A type endowed with +
is an additive semigroup, if it admits an
injective map that preserves +
to an additive semigroup.
Equations
- Function.Injective.addSemigroup f hf mul = AddSemigroup.mk ⋯
Instances For
A type endowed with *
is a semigroup, if it admits an injective map that preserves *
to
a semigroup. See note [reducible non-instances].
Equations
- Function.Injective.semigroup f hf mul = Semigroup.mk ⋯
Instances For
A type endowed with +
is an additive commutative semigroup, if it admits
a surjective map that preserves +
from an additive commutative semigroup.
Equations
- Function.Injective.addCommMagma f hf mul = AddCommMagma.mk ⋯
Instances For
A type endowed with *
is a commutative magma, if it admits a surjective map that preserves
*
from a commutative magma.
Equations
- Function.Injective.commMagma f hf mul = CommMagma.mk ⋯
Instances For
A type endowed with +
is an additive commutative semigroup,if it admits
an injective map that preserves +
to an additive commutative semigroup.
Equations
Instances For
A type endowed with *
is a commutative semigroup, if it admits an injective map that
preserves *
to a commutative semigroup. See note [reducible non-instances].
Equations
- Function.Injective.commSemigroup f hf mul = CommSemigroup.mk ⋯
Instances For
A type endowed with +
is an additive left cancel
semigroup, if it admits an injective map that preserves +
to an additive left cancel semigroup.
Equations
Instances For
A type endowed with *
is a left cancel semigroup, if it admits an injective map that
preserves *
to a left cancel semigroup. See note [reducible non-instances].
Equations
Instances For
A type endowed with +
is an additive right
cancel semigroup, if it admits an injective map that preserves +
to an additive right cancel
semigroup.
Equations
Instances For
A type endowed with *
is a right cancel semigroup, if it admits an injective map that
preserves *
to a right cancel semigroup. See note [reducible non-instances].
Equations
Instances For
A type endowed with 0
and +
is an AddZeroClass
, if it admits an
injective map that preserves 0
and +
to an AddZeroClass
.
Equations
- Function.Injective.addZeroClass f hf one mul = AddZeroClass.mk ⋯ ⋯
Instances For
A type endowed with 1
and *
is a MulOneClass
, if it admits an injective map that
preserves 1
and *
to a MulOneClass
. See note [reducible non-instances].
Equations
- Function.Injective.mulOneClass f hf one mul = MulOneClass.mk ⋯ ⋯
Instances For
A type endowed with 0
and +
is an additive monoid, if it admits an
injective map that preserves 0
and +
to an additive monoid. See note
[reducible non-instances].
Equations
- Function.Injective.addMonoid f hf one mul npow = AddMonoid.mk ⋯ ⋯ (fun (n : ℕ) (x : M₁) => n • x) ⋯ ⋯
Instances For
A type endowed with 1
and *
is a monoid, if it admits an injective map that preserves 1
and *
to a monoid. See note [reducible non-instances].
Equations
- Function.Injective.monoid f hf one mul npow = Monoid.mk ⋯ ⋯ (fun (n : ℕ) (x : M₁) => x ^ n) ⋯ ⋯
Instances For
A type endowed with 0
, 1
and +
is an additive monoid with one,
if it admits an injective map that preserves 0
, 1
and +
to an additive monoid with one.
See note [reducible non-instances].
Equations
- Function.Injective.addMonoidWithOne f hf zero one add nsmul natCast = AddMonoidWithOne.mk ⋯ ⋯
Instances For
A type endowed with 0
and +
is an additive left cancel monoid, if it
admits an injective map that preserves 0
and +
to an additive left cancel monoid.
Equations
- Function.Injective.addLeftCancelMonoid f hf one mul npow = AddLeftCancelMonoid.mk ⋯
Instances For
A type endowed with 1
and *
is a left cancel monoid, if it admits an injective map that
preserves 1
and *
to a left cancel monoid. See note [reducible non-instances].
Equations
- Function.Injective.leftCancelMonoid f hf one mul npow = LeftCancelMonoid.mk ⋯
Instances For
A type endowed with 0
and +
is an additive left cancel monoid,if it
admits an injective map that preserves 0
and +
to an additive left cancel monoid.
Equations
- Function.Injective.addRightCancelMonoid f hf one mul npow = AddRightCancelMonoid.mk ⋯
Instances For
A type endowed with 1
and *
is a right cancel monoid, if it admits an injective map that
preserves 1
and *
to a right cancel monoid. See note [reducible non-instances].
Equations
- Function.Injective.rightCancelMonoid f hf one mul npow = RightCancelMonoid.mk ⋯
Instances For
A type endowed with 0
and +
is an additive left cancel monoid,if it
admits an injective map that preserves 0
and +
to an additive left cancel monoid.
Equations
- Function.Injective.addCancelMonoid f hf one mul npow = AddCancelMonoid.mk ⋯
Instances For
A type endowed with 1
and *
is a cancel monoid, if it admits an injective map that preserves
1
and *
to a cancel monoid. See note [reducible non-instances].
Equations
- Function.Injective.cancelMonoid f hf one mul npow = CancelMonoid.mk ⋯
Instances For
A type endowed with 0
and +
is an additive commutative monoid, if it
admits an injective map that preserves 0
and +
to an additive commutative monoid.
Equations
- Function.Injective.addCommMonoid f hf one mul npow = AddCommMonoid.mk ⋯
Instances For
A type endowed with 1
and *
is a commutative monoid, if it admits an injective map that
preserves 1
and *
to a commutative monoid. See note [reducible non-instances].
Equations
- Function.Injective.commMonoid f hf one mul npow = CommMonoid.mk ⋯
Instances For
A type endowed with 0
, 1
and +
is an additive commutative monoid with one, if it admits an
injective map that preserves 0
, 1
and +
to an additive commutative monoid with one.
See note [reducible non-instances].
Equations
- Function.Injective.addCommMonoidWithOne f hf zero one add nsmul natCast = AddCommMonoidWithOne.mk ⋯
Instances For
A type endowed with 0
and +
is an additive cancel commutative monoid,
if it admits an injective map that preserves 0
and +
to an additive cancel commutative monoid.
Equations
- Function.Injective.addCancelCommMonoid f hf one mul npow = AddCancelCommMonoid.mk ⋯
Instances For
A type endowed with 1
and *
is a cancel commutative monoid, if it admits an injective map
that preserves 1
and *
to a cancel commutative monoid. See note [reducible non-instances].
Equations
- Function.Injective.cancelCommMonoid f hf one mul npow = CancelCommMonoid.mk ⋯
Instances For
A type has an involutive negation if it admits a surjective map that
preserves -
to a type which has an involutive negation.
Equations
- Function.Injective.involutiveNeg f hf inv = InvolutiveNeg.mk ⋯
Instances For
A type has an involutive inversion if it admits a surjective map that preserves ⁻¹
to a type
which has an involutive inversion. See note [reducible non-instances]
Equations
- Function.Injective.involutiveInv f hf inv = InvolutiveInv.mk ⋯
Instances For
A type endowed with 0
and unary -
is an NegZeroClass
, if it admits an
injective map that preserves 0
and unary -
to an NegZeroClass
.
Equations
- Function.Injective.negZeroClass f hf one inv = NegZeroClass.mk ⋯
Instances For
A type endowed with 1
and ⁻¹
is a InvOneClass
, if it admits an injective map that
preserves 1
and ⁻¹
to a InvOneClass
. See note [reducible non-instances].
Equations
- Function.Injective.invOneClass f hf one inv = InvOneClass.mk ⋯
Instances For
A type endowed with 0
, +
, unary -
, and binary -
is a
SubNegMonoid
if it admits an injective map that preserves 0
, +
, unary -
, and binary -
to
a SubNegMonoid
. This version takes custom nsmul
and zsmul
as [SMul ℕ M₁]
and [SMul ℤ M₁]
arguments.
Equations
- Function.Injective.subNegMonoid f hf one mul inv div npow zpow = SubNegMonoid.mk ⋯ (fun (n : ℤ) (x : M₁) => n • x) ⋯ ⋯ ⋯
Instances For
A type endowed with 1
, *
, ⁻¹
, and /
is a DivInvMonoid
if it admits an injective map
that preserves 1
, *
, ⁻¹
, and /
to a DivInvMonoid
. See note [reducible non-instances].
Equations
- Function.Injective.divInvMonoid f hf one mul inv div npow zpow = DivInvMonoid.mk ⋯ (fun (n : ℤ) (x : M₁) => x ^ n) ⋯ ⋯ ⋯
Instances For
A type endowed with 0
, +
, unary -
, and binary -
is a
SubNegZeroMonoid
if it admits an injective map that preserves 0
, +
, unary -
, and binary
-
to a SubNegZeroMonoid
. This version takes custom nsmul
and zsmul
as [SMul ℕ M₁]
and
[SMul ℤ M₁]
arguments.
Equations
- Function.Injective.subNegZeroMonoid f hf one mul inv div npow zpow = SubNegZeroMonoid.mk ⋯
Instances For
A type endowed with 1
, *
, ⁻¹
, and /
is a DivInvOneMonoid
if it admits an injective
map that preserves 1
, *
, ⁻¹
, and /
to a DivInvOneMonoid
. See note
[reducible non-instances].
Equations
- Function.Injective.divInvOneMonoid f hf one mul inv div npow zpow = DivInvOneMonoid.mk ⋯
Instances For
A type endowed with 0
, +
, unary -
, and binary -
is a SubtractionMonoid
if it admits an injective map that preserves 0
, +
, unary -
, and
binary -
to a SubtractionMonoid
. This version takes custom nsmul
and zsmul
as [SMul ℕ M₁]
and [SMul ℤ M₁]
arguments.
Equations
- Function.Injective.subtractionMonoid f hf one mul inv div npow zpow = SubtractionMonoid.mk ⋯ ⋯ ⋯
Instances For
A type endowed with 1
, *
, ⁻¹
, and /
is a DivisionMonoid
if it admits an injective map
that preserves 1
, *
, ⁻¹
, and /
to a DivisionMonoid
. See note [reducible non-instances]
Equations
- Function.Injective.divisionMonoid f hf one mul inv div npow zpow = DivisionMonoid.mk ⋯ ⋯ ⋯
Instances For
A type endowed with 0
, +
, unary -
, and binary
-
is a SubtractionCommMonoid
if it admits an injective map that preserves 0
, +
, unary -
,
and binary -
to a SubtractionCommMonoid
. This version takes custom nsmul
and zsmul
as
[SMul ℕ M₁]
and [SMul ℤ M₁]
arguments.
Equations
- Function.Injective.subtractionCommMonoid f hf one mul inv div npow zpow = SubtractionCommMonoid.mk ⋯
Instances For
A type endowed with 1
, *
, ⁻¹
, and /
is a DivisionCommMonoid
if it admits an
injective map that preserves 1
, *
, ⁻¹
, and /
to a DivisionCommMonoid
.
See note [reducible non-instances].
Equations
- Function.Injective.divisionCommMonoid f hf one mul inv div npow zpow = DivisionCommMonoid.mk ⋯
Instances For
A type endowed with 0
and +
is an additive group, if it admits an
injective map that preserves 0
and +
to an additive group.
Equations
- Function.Injective.addGroup f hf one mul inv div npow zpow = AddGroup.mk ⋯
Instances For
A type endowed with 1
, *
and ⁻¹
is a group, if it admits an injective map that preserves
1
, *
and ⁻¹
to a group. See note [reducible non-instances].
Equations
- Function.Injective.group f hf one mul inv div npow zpow = Group.mk ⋯
Instances For
A type endowed with 0
, 1
and +
is an additive group with one, if it admits an injective
map that preserves 0
, 1
and +
to an additive group with one. See note
[reducible non-instances].
Equations
- Function.Injective.addGroupWithOne f hf zero one add neg sub nsmul zsmul natCast intCast = AddGroupWithOne.mk ⋯ SubNegMonoid.zsmul ⋯ ⋯ ⋯ ⋯ ⋯ ⋯
Instances For
A type endowed with 0
and +
is an additive commutative group, if it
admits an injective map that preserves 0
and +
to an additive commutative group.
Equations
- Function.Injective.addCommGroup f hf one mul inv div npow zpow = AddCommGroup.mk ⋯
Instances For
A type endowed with 1
, *
and ⁻¹
is a commutative group, if it admits an injective map that
preserves 1
, *
and ⁻¹
to a commutative group. See note [reducible non-instances].
Equations
- Function.Injective.commGroup f hf one mul inv div npow zpow = CommGroup.mk ⋯
Instances For
A type endowed with 0
, 1
and +
is an additive commutative group with one, if it admits an
injective map that preserves 0
, 1
and +
to an additive commutative group with one.
See note [reducible non-instances].
Equations
- Function.Injective.addCommGroupWithOne f hf zero one add neg sub nsmul zsmul natCast intCast = AddCommGroupWithOne.mk ⋯ ⋯ ⋯ ⋯
Instances For
Surjective #
A type endowed with +
is an additive semigroup, if it admits a
surjective map that preserves +
from an additive semigroup.
Equations
- Function.Surjective.addSemigroup f hf mul = AddSemigroup.mk ⋯
Instances For
A type endowed with *
is a semigroup, if it admits a surjective map that preserves *
from a
semigroup. See note [reducible non-instances].
Equations
- Function.Surjective.semigroup f hf mul = Semigroup.mk ⋯
Instances For
A type endowed with +
is an additive commutative semigroup, if it admits
a surjective map that preserves +
from an additive commutative semigroup.
Equations
- Function.Surjective.addCommMagma f hf mul = AddCommMagma.mk ⋯
Instances For
A type endowed with *
is a commutative semigroup, if it admits a surjective map that preserves
*
from a commutative semigroup. See note [reducible non-instances].
Equations
- Function.Surjective.commMagma f hf mul = CommMagma.mk ⋯
Instances For
A type endowed with +
is an additive commutative semigroup, if it admits
a surjective map that preserves +
from an additive commutative semigroup.
Equations
Instances For
A type endowed with *
is a commutative semigroup, if it admits a surjective map that preserves
*
from a commutative semigroup. See note [reducible non-instances].
Equations
- Function.Surjective.commSemigroup f hf mul = CommSemigroup.mk ⋯
Instances For
A type endowed with 0
and +
is an AddZeroClass
, if it admits a
surjective map that preserves 0
and +
to an AddZeroClass
.
Equations
- Function.Surjective.addZeroClass f hf one mul = AddZeroClass.mk ⋯ ⋯
Instances For
A type endowed with 1
and *
is a MulOneClass
, if it admits a surjective map that preserves
1
and *
from a MulOneClass
. See note [reducible non-instances].
Equations
- Function.Surjective.mulOneClass f hf one mul = MulOneClass.mk ⋯ ⋯
Instances For
A type endowed with 0
and +
is an additive monoid, if it admits a
surjective map that preserves 0
and +
to an additive monoid. This version takes a custom nsmul
as a [SMul ℕ M₂]
argument.
Equations
- Function.Surjective.addMonoid f hf one mul npow = AddMonoid.mk ⋯ ⋯ (fun (n : ℕ) (x : M₂) => n • x) ⋯ ⋯
Instances For
A type endowed with 1
and *
is a monoid, if it admits a surjective map that preserves 1
and *
to a monoid. See note [reducible non-instances].
Equations
- Function.Surjective.monoid f hf one mul npow = Monoid.mk ⋯ ⋯ (fun (n : ℕ) (x : M₂) => x ^ n) ⋯ ⋯
Instances For
A type endowed with 0
, 1
and +
is an additive monoid with one, if it admits a surjective
map that preserves 0
, 1
and *
from an additive monoid with one. See note
[reducible non-instances].
Equations
- Function.Surjective.addMonoidWithOne f hf zero one add nsmul natCast = AddMonoidWithOne.mk ⋯ ⋯
Instances For
A type endowed with 0
and +
is an additive commutative monoid, if it
admits a surjective map that preserves 0
and +
to an additive commutative monoid.
Equations
- Function.Surjective.addCommMonoid f hf one mul npow = AddCommMonoid.mk ⋯
Instances For
A type endowed with 1
and *
is a commutative monoid, if it admits a surjective map that
preserves 1
and *
from a commutative monoid. See note [reducible non-instances].
Equations
- Function.Surjective.commMonoid f hf one mul npow = CommMonoid.mk ⋯
Instances For
A type endowed with 0
, 1
and +
is an additive monoid with one,
if it admits a surjective map that preserves 0
, 1
and *
from an additive monoid with one.
See note [reducible non-instances].
Equations
- Function.Surjective.addCommMonoidWithOne f hf zero one add nsmul natCast = AddCommMonoidWithOne.mk ⋯
Instances For
A type has an involutive negation if it admits a surjective map that
preserves -
to a type which has an involutive negation.
Equations
- Function.Surjective.involutiveNeg f hf inv = InvolutiveNeg.mk ⋯
Instances For
A type has an involutive inversion if it admits a surjective map that preserves ⁻¹
to a type
which has an involutive inversion. See note [reducible non-instances]
Equations
- Function.Surjective.involutiveInv f hf inv = InvolutiveInv.mk ⋯
Instances For
A type endowed with 0
, +
, unary -
, and binary -
is a
SubNegMonoid
if it admits a surjective map that preserves 0
, +
, unary -
, and binary -
to
a SubNegMonoid
.
Equations
- Function.Surjective.subNegMonoid f hf one mul inv div npow zpow = SubNegMonoid.mk ⋯ (fun (n : ℤ) (x : M₂) => n • x) ⋯ ⋯ ⋯
Instances For
A type endowed with 1
, *
, ⁻¹
, and /
is a DivInvMonoid
if it admits a surjective map
that preserves 1
, *
, ⁻¹
, and /
to a DivInvMonoid
. See note [reducible non-instances].
Equations
- Function.Surjective.divInvMonoid f hf one mul inv div npow zpow = DivInvMonoid.mk ⋯ (fun (n : ℤ) (x : M₂) => x ^ n) ⋯ ⋯ ⋯
Instances For
A type endowed with 0
and +
is an additive group, if it admits a
surjective map that preserves 0
and +
to an additive group.
Equations
- Function.Surjective.addGroup f hf one mul inv div npow zpow = AddGroup.mk ⋯
Instances For
A type endowed with 1
, *
and ⁻¹
is a group, if it admits a surjective map that preserves
1
, *
and ⁻¹
to a group. See note [reducible non-instances].
Equations
- Function.Surjective.group f hf one mul inv div npow zpow = Group.mk ⋯
Instances For
A type endowed with 0
, 1
, +
is an additive group with one,
if it admits a surjective map that preserves 0
, 1
, and +
to an additive group with one.
See note [reducible non-instances].
Equations
- Function.Surjective.addGroupWithOne f hf zero one add neg sub nsmul zsmul natCast intCast = AddGroupWithOne.mk ⋯ SubNegMonoid.zsmul ⋯ ⋯ ⋯ ⋯ ⋯ ⋯
Instances For
A type endowed with 0
and +
is an additive commutative group, if it
admits a surjective map that preserves 0
and +
to an additive commutative group.
Equations
- Function.Surjective.addCommGroup f hf one mul inv div npow zpow = AddCommGroup.mk ⋯
Instances For
A type endowed with 1
, *
, ⁻¹
, and /
is a commutative group, if it admits a surjective
map that preserves 1
, *
, ⁻¹
, and /
from a commutative group. See note
[reducible non-instances].
Equations
- Function.Surjective.commGroup f hf one mul inv div npow zpow = CommGroup.mk ⋯
Instances For
A type endowed with 0
, 1
, +
is an additive commutative group with one, if it admits a
surjective map that preserves 0
, 1
, and +
to an additive commutative group with one.
See note [reducible non-instances].
Equations
- Function.Surjective.addCommGroupWithOne f hf zero one add neg sub nsmul zsmul natCast intCast = AddCommGroupWithOne.mk ⋯ ⋯ ⋯ ⋯