Lemmas about units in a monoid_with_zero
or a group_with_zero
. #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
We also define ring.inverse
, a globally defined function on any ring
(in fact any monoid_with_zero
), which inverts units and sends non-units to zero.
An element of the unit group of a nonzero monoid with zero represented as an element of the monoid is nonzero.
Introduce a function inverse
on a monoid with zero M₀
, which sends x
to x⁻¹
if x
is
invertible and to 0
otherwise. This definition is somewhat ad hoc, but one needs a fully (rather
than partially) defined inverse function for some purposes, including for calculus.
Note that while this is in the ring
namespace for brevity, it requires the weaker assumption
monoid_with_zero M₀
instead of ring M₀
.
By definition, if x
is invertible then inverse x = x⁻¹
.
By definition, if x
is not invertible then inverse x = 0
.
Embed a non-zero element of a group_with_zero
into the unit group.
By combining this function with the operations on units,
or the /ₚ
operation, it is possible to write a division
as a partial function with three arguments.
An alternative version of units.exists0
. This one is useful if Lean cannot
figure out p
when using units.exists0
from right to left.
Alias of the reverse direction of is_unit_iff_ne_zero
.
Equations
- comm_group_with_zero.to_cancel_comm_monoid_with_zero = {mul := cancel_monoid_with_zero.mul group_with_zero.to_cancel_monoid_with_zero, mul_assoc := _, one := cancel_monoid_with_zero.one group_with_zero.to_cancel_monoid_with_zero, one_mul := _, mul_one := _, npow := cancel_monoid_with_zero.npow group_with_zero.to_cancel_monoid_with_zero, npow_zero' := _, npow_succ' := _, mul_comm := _, zero := cancel_monoid_with_zero.zero group_with_zero.to_cancel_monoid_with_zero, zero_mul := _, mul_zero := _, mul_left_cancel_of_ne_zero := _}
Equations
- comm_group_with_zero.to_division_comm_monoid = {mul := comm_group_with_zero.mul _inst_2, mul_assoc := _, one := comm_group_with_zero.one _inst_2, one_mul := _, mul_one := _, npow := comm_group_with_zero.npow _inst_2, npow_zero' := _, npow_succ' := _, inv := comm_group_with_zero.inv _inst_2, div := comm_group_with_zero.div _inst_2, div_eq_mul_inv := _, zpow := comm_group_with_zero.zpow _inst_2, zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, inv_inv := _, mul_inv_rev := _, inv_eq_of_mul := _, mul_comm := _}
Constructs a group_with_zero
structure on a monoid_with_zero
consisting only of units and 0.
Equations
- group_with_zero_of_is_unit_or_eq_zero h = {mul := monoid_with_zero.mul hM, mul_assoc := _, one := monoid_with_zero.one hM, one_mul := _, mul_one := _, npow := monoid_with_zero.npow hM, npow_zero' := _, npow_succ' := _, zero := monoid_with_zero.zero hM, zero_mul := _, mul_zero := _, inv := λ (a : M), dite (a = 0) (λ (h0 : a = 0), 0) (λ (h0 : ¬a = 0), ↑(_.unit)⁻¹), div := div_inv_monoid.div._default monoid_with_zero.mul monoid_with_zero.mul_assoc monoid_with_zero.one monoid_with_zero.one_mul monoid_with_zero.mul_one monoid_with_zero.npow monoid_with_zero.npow_zero' monoid_with_zero.npow_succ' (λ (a : M), dite (a = 0) (λ (h0 : a = 0), 0) (λ (h0 : ¬a = 0), ↑(_.unit)⁻¹)), div_eq_mul_inv := _, zpow := div_inv_monoid.zpow._default monoid_with_zero.mul monoid_with_zero.mul_assoc monoid_with_zero.one monoid_with_zero.one_mul monoid_with_zero.mul_one monoid_with_zero.npow monoid_with_zero.npow_zero' monoid_with_zero.npow_succ' (λ (a : M), dite (a = 0) (λ (h0 : a = 0), 0) (λ (h0 : ¬a = 0), ↑(_.unit)⁻¹)), zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, exists_pair_ne := _, inv_zero := _, mul_inv_cancel := _}
Constructs a comm_group_with_zero
structure on a comm_monoid_with_zero
consisting only of units and 0.
Equations
- comm_group_with_zero_of_is_unit_or_eq_zero h = {mul := group_with_zero.mul (group_with_zero_of_is_unit_or_eq_zero h), mul_assoc := _, one := group_with_zero.one (group_with_zero_of_is_unit_or_eq_zero h), one_mul := _, mul_one := _, npow := group_with_zero.npow (group_with_zero_of_is_unit_or_eq_zero h), npow_zero' := _, npow_succ' := _, mul_comm := _, zero := group_with_zero.zero (group_with_zero_of_is_unit_or_eq_zero h), zero_mul := _, mul_zero := _, inv := group_with_zero.inv (group_with_zero_of_is_unit_or_eq_zero h), div := group_with_zero.div (group_with_zero_of_is_unit_or_eq_zero h), div_eq_mul_inv := _, zpow := group_with_zero.zpow (group_with_zero_of_is_unit_or_eq_zero h), zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, exists_pair_ne := _, inv_zero := _, mul_inv_cancel := _}