Units (i.e., invertible elements) of a monoid #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
An element of a monoid
is a unit if it has a two-sided inverse.
Main declarations #
units M
: the group of units (i.e., invertible elements) of a monoid.is_unit x
: a predicate asserting thatx
is a unit (i.e., invertible element) of a monoid.
For both declarations, there is an additive counterpart: add_units
and is_add_unit
.
Notation #
We provide Mˣ
as notation for units M
,
resembling the notation $R^{\times}$ for the units of a ring, which is common in mathematics.
Units of a monoid
, bundled version. Notation: αˣ
.
An element of a monoid
is a unit if it has a two-sided inverse.
This version bundles the inverse element so that it can be computed.
For a predicate see is_unit
.
Instances for units
- units.has_sizeof_inst
- units.has_coe
- units.has_inv
- units.mul_one_class
- units.group
- units.comm_group
- units.inhabited
- units.has_repr
- is_unit.can_lift
- units.unique
- units.has_smul
- units.has_faithful_smul
- units.mul_action
- units.smul_zero_class
- units.distrib_smul
- units.distrib_mul_action
- units.mul_distrib_mul_action
- units.smul_comm_class_left
- units.smul_comm_class_right
- units.is_scalar_tower
- units.mul_action'
- units.smul_comm_class'
- units.is_scalar_tower'
- units.is_scalar_tower'_left
- units.mul_distrib_mul_action'
- units.has_neg
- units.has_distrib_neg
- units.preorder
- units.partial_order
- units.linear_order
- units.ordered_comm_group
- nat.unique_units
- units.star_semigroup
- units.star_module
- linear_map.compatible_smul.units
- associates.unique_units
- tensor_product.compatible_smul.unit
- ideal.unique_units
- linear_map.general_linear_group.has_coe_to_fun
- units.topological_space
- units.has_continuous_const_smul
- units.has_continuous_smul
- units.has_continuous_mul
- units.topological_group
- units.has_continuous_star
- units.has_isometric_smul
- units_int.fintype
- units.fintype
- units.finite
- zmod.subsingleton_units
- matrix.special_linear_group.has_coe_to_general_linear_group
- matrix.general_linear_group.has_coe_to_fun
- _private.2022024685.has_smul.units_matrix_ne_zero
Units of an add_monoid
, bundled version.
An element of an add_monoid
is a unit if it has a two-sided additive inverse.
This version bundles the inverse element so that it can be computed.
For a predicate see is_add_unit
.
Instances for add_units
- add_units.has_sizeof_inst
- add_units.has_coe
- add_units.has_neg
- add_units.add_zero_class
- add_units.add_group
- add_units.add_comm_group
- add_units.inhabited
- add_units.has_repr
- is_add_unit.can_lift
- add_units.unique
- add_units.has_vadd
- add_units.has_faithful_vadd
- add_units.add_action
- add_units.preorder
- add_units.partial_order
- add_units.linear_order
- add_units.ordered_add_comm_group
- nat.unique_add_units
- add_units.topological_space
- add_units.has_continuous_const_vadd
- add_units.has_continuous_vadd
- add_units.has_continuous_add
- add_units.topological_add_group
- ennreal.add_units.unique
- add_units.has_isometric_vadd
Equations
- add_units.has_coe = {coe := add_units.val _inst_1}
See Note [custom simps projection]
Equations
- units.simps.coe u = ↑u
See Note [custom simps projection]
Equations
See Note [custom simps projection]
Equations
See Note [custom simps projection]
Equations
Equations
- add_units.decidable_eq = λ (a b : add_units α), decidable_of_iff' (↑a = ↑b) add_units.ext_iff
Equations
- units.decidable_eq = λ (a b : αˣ), decidable_of_iff' (↑a = ↑b) units.ext_iff
Units of a monoid form a group.
Equations
- units.group = {mul := has_mul.mul (mul_one_class.to_has_mul αˣ), mul_assoc := _, one := 1, one_mul := _, mul_one := _, npow := div_inv_monoid.npow._default 1 has_mul.mul units.group._proof_4 units.group._proof_5, npow_zero' := _, npow_succ' := _, inv := has_inv.inv units.has_inv, div := div_inv_monoid.div._default has_mul.mul units.group._proof_8 1 units.group._proof_9 units.group._proof_10 (div_inv_monoid.npow._default 1 has_mul.mul units.group._proof_4 units.group._proof_5) units.group._proof_11 units.group._proof_12 has_inv.inv, div_eq_mul_inv := _, zpow := div_inv_monoid.zpow._default has_mul.mul units.group._proof_14 1 units.group._proof_15 units.group._proof_16 (div_inv_monoid.npow._default 1 has_mul.mul units.group._proof_4 units.group._proof_5) units.group._proof_17 units.group._proof_18 has_inv.inv, zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, mul_left_inv := _}
Additive units of an additive monoid form an additive group.
Equations
- add_units.add_group = {add := has_add.add (add_zero_class.to_has_add (add_units α)), add_assoc := _, zero := 0, zero_add := _, add_zero := _, nsmul := sub_neg_monoid.nsmul._default 0 has_add.add add_units.add_group._proof_4 add_units.add_group._proof_5, nsmul_zero' := _, nsmul_succ' := _, neg := has_neg.neg add_units.has_neg, sub := sub_neg_monoid.sub._default has_add.add add_units.add_group._proof_8 0 add_units.add_group._proof_9 add_units.add_group._proof_10 (sub_neg_monoid.nsmul._default 0 has_add.add add_units.add_group._proof_4 add_units.add_group._proof_5) add_units.add_group._proof_11 add_units.add_group._proof_12 has_neg.neg, sub_eq_add_neg := _, zsmul := sub_neg_monoid.zsmul._default has_add.add add_units.add_group._proof_14 0 add_units.add_group._proof_15 add_units.add_group._proof_16 (sub_neg_monoid.nsmul._default 0 has_add.add add_units.add_group._proof_4 add_units.add_group._proof_5) add_units.add_group._proof_17 add_units.add_group._proof_18 has_neg.neg, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _}
Equations
- add_units.add_comm_group = {add := add_group.add add_units.add_group, add_assoc := _, zero := add_group.zero add_units.add_group, zero_add := _, add_zero := _, nsmul := add_group.nsmul add_units.add_group, nsmul_zero' := _, nsmul_succ' := _, neg := add_group.neg add_units.add_group, sub := add_group.sub add_units.add_group, sub_eq_add_neg := _, zsmul := add_group.zsmul add_units.add_group, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _}
Equations
- units.comm_group = {mul := group.mul units.group, mul_assoc := _, one := group.one units.group, one_mul := _, mul_one := _, npow := group.npow units.group, npow_zero' := _, npow_succ' := _, inv := group.inv units.group, div := group.div units.group, div_eq_mul_inv := _, zpow := group.zpow units.group, zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, mul_left_inv := _, mul_comm := _}
Equations
- units.inhabited = {default := 1}
Equations
- add_units.inhabited = {default := 0}
Equations
For a, b
in an add_comm_monoid
such that a + b = 0
, makes an add_unit
out of a
.
For a, b
in a comm_monoid
such that a * b = 1
, makes a unit out of a
.
Used for field_simp
to deal with inverses of units. This form of the lemma
is essential since field_simp
likes to use inv_eq_one_div
to rewrite
↑u⁻¹ = ↑(1 / u)
.
is_unit
predicate #
In this file we define the is_unit
predicate on a monoid
, and
prove a few basic properties. For the bundled version see units
. See
also prime
, associated
, and irreducible
in algebra/associated
.
An element a : M
of a monoid is a unit if it has a two-sided inverse.
The actual definition says that a
is equal to some u : Mˣ
, where
Mˣ
is a bundled version of is_unit
.
Instances for is_unit
An element a : M
of an add_monoid is an add_unit
if it has
a two-sided additive inverse. The actual definition says that a
is equal to some
u : add_units M
, where add_units M
is a bundled version of is_add_unit
.
Instances for is_add_unit
Equations
- is_add_unit.can_lift = {prf := _}
Equations
- units.unique = {to_inhabited := {default := 1}, uniq := _}
Equations
- add_units.unique = {to_inhabited := {default := 0}, uniq := _}
Addition of a u : add_units M
on the right doesn't
affect is_add_unit
.
Addition of a u : add_units M
on the left doesn't affect is_add_unit
.
The element of the additive group of additive units, corresponding to an element of
an additive monoid which is an additive unit. When α
is a subtraction_monoid
, use
is_add_unit.add_unit'
instead.
Equations
- h.add_unit = (classical.some h).copy a _ (↑-classical.some h) _
The element of the group of units, corresponding to an element of a monoid which is a unit. When
α
is a division_monoid
, use is_unit.unit'
instead.
Equations
- h.unit = (classical.some h).copy a _ ↑(classical.some h)⁻¹ _
is_add_unit x
is decidable if we can decide if x
comes from `add_units M
Equations
Constructs a group
structure on a monoid
consisting only of units.
Equations
- group_of_is_unit h = {mul := monoid.mul hM, mul_assoc := _, one := monoid.one hM, one_mul := _, mul_one := _, npow := monoid.npow hM, npow_zero' := _, npow_succ' := _, inv := λ (a : M), ↑(_.unit)⁻¹, div := div_inv_monoid.div._default monoid.mul monoid.mul_assoc monoid.one monoid.one_mul monoid.mul_one monoid.npow monoid.npow_zero' monoid.npow_succ' (λ (a : M), ↑(_.unit)⁻¹), div_eq_mul_inv := _, zpow := div_inv_monoid.zpow._default monoid.mul monoid.mul_assoc monoid.one monoid.one_mul monoid.mul_one monoid.npow monoid.npow_zero' monoid.npow_succ' (λ (a : M), ↑(_.unit)⁻¹), zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, mul_left_inv := _}
Constructs a comm_group
structure on a comm_monoid
consisting only of units.
Equations
- comm_group_of_is_unit h = {mul := comm_monoid.mul hM, mul_assoc := _, one := comm_monoid.one hM, one_mul := _, mul_one := _, npow := comm_monoid.npow hM, npow_zero' := _, npow_succ' := _, inv := λ (a : M), ↑(_.unit)⁻¹, div := group.div._default comm_monoid.mul comm_monoid.mul_assoc comm_monoid.one comm_monoid.one_mul comm_monoid.mul_one comm_monoid.npow comm_monoid.npow_zero' comm_monoid.npow_succ' (λ (a : M), ↑(_.unit)⁻¹), div_eq_mul_inv := _, zpow := group.zpow._default comm_monoid.mul comm_monoid.mul_assoc comm_monoid.one comm_monoid.one_mul comm_monoid.mul_one comm_monoid.npow comm_monoid.npow_zero' comm_monoid.npow_succ' (λ (a : M), ↑(_.unit)⁻¹), zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, mul_left_inv := _, mul_comm := _}