mathlib3 documentation

algebra.group_with_zero.units.basic

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.

@[simp]
theorem units.ne_zero {M₀ : Type u_2} [monoid_with_zero M₀] [nontrivial M₀] (u : M₀ˣ) :
u 0

An element of the unit group of a nonzero monoid with zero represented as an element of the monoid is nonzero.

@[simp]
theorem units.mul_left_eq_zero {M₀ : Type u_2} [monoid_with_zero M₀] (u : M₀ˣ) {a : M₀} :
a * u = 0 a = 0
@[simp]
theorem units.mul_right_eq_zero {M₀ : Type u_2} [monoid_with_zero M₀] (u : M₀ˣ) {a : M₀} :
u * a = 0 a = 0
theorem is_unit.ne_zero {M₀ : Type u_2} [monoid_with_zero M₀] [nontrivial M₀] {a : M₀} (ha : is_unit a) :
a 0
theorem is_unit.mul_right_eq_zero {M₀ : Type u_2} [monoid_with_zero M₀] {a b : M₀} (ha : is_unit a) :
a * b = 0 b = 0
theorem is_unit.mul_left_eq_zero {M₀ : Type u_2} [monoid_with_zero M₀] {a b : M₀} (hb : is_unit b) :
a * b = 0 a = 0
@[simp]
theorem is_unit_zero_iff {M₀ : Type u_2} [monoid_with_zero M₀] :
is_unit 0 0 = 1
@[simp]
theorem not_is_unit_zero {M₀ : Type u_2} [monoid_with_zero M₀] [nontrivial M₀] :
noncomputable def ring.inverse {M₀ : Type u_2} [monoid_with_zero M₀] :
M₀ M₀

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₀.

Equations
@[simp]
theorem ring.inverse_unit {M₀ : Type u_2} [monoid_with_zero M₀] (u : M₀ˣ) :

By definition, if x is invertible then inverse x = x⁻¹.

@[simp]
theorem ring.inverse_non_unit {M₀ : Type u_2} [monoid_with_zero M₀] (x : M₀) (h : ¬is_unit x) :

By definition, if x is not invertible then inverse x = 0.

theorem ring.mul_inverse_cancel {M₀ : Type u_2} [monoid_with_zero M₀] (x : M₀) (h : is_unit x) :
theorem ring.inverse_mul_cancel {M₀ : Type u_2} [monoid_with_zero M₀] (x : M₀) (h : is_unit x) :
theorem ring.mul_inverse_cancel_right {M₀ : Type u_2} [monoid_with_zero M₀] (x y : M₀) (h : is_unit x) :
y * x * ring.inverse x = y
theorem ring.inverse_mul_cancel_right {M₀ : Type u_2} [monoid_with_zero M₀] (x y : M₀) (h : is_unit x) :
y * ring.inverse x * x = y
theorem ring.mul_inverse_cancel_left {M₀ : Type u_2} [monoid_with_zero M₀] (x y : M₀) (h : is_unit x) :
x * (ring.inverse x * y) = y
theorem ring.inverse_mul_cancel_left {M₀ : Type u_2} [monoid_with_zero M₀] (x y : M₀) (h : is_unit x) :
ring.inverse x * (x * y) = y
theorem ring.inverse_mul_eq_iff_eq_mul {M₀ : Type u_2} [monoid_with_zero M₀] (x y z : M₀) (h : is_unit x) :
ring.inverse x * y = z y = x * z
theorem ring.eq_mul_inverse_iff_mul_eq {M₀ : Type u_2} [monoid_with_zero M₀] (x y z : M₀) (h : is_unit z) :
x = y * ring.inverse z x * z = y
@[simp]
theorem ring.inverse_one (M₀ : Type u_2) [monoid_with_zero M₀] :
@[simp]
theorem ring.inverse_zero (M₀ : Type u_2) [monoid_with_zero M₀] :
theorem is_unit.ring_inverse {M₀ : Type u_2} [monoid_with_zero M₀] {a : M₀} :
@[simp]
theorem is_unit_ring_inverse {M₀ : Type u_2} [monoid_with_zero M₀] {a : M₀} :
def units.mk0 {G₀ : Type u_3} [group_with_zero G₀] (a : G₀) (ha : a 0) :
G₀ˣ

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.

Equations
@[simp]
theorem units.mk0_one {G₀ : Type u_3} [group_with_zero G₀] (h : 1 0 := one_ne_zero) :
units.mk0 1 h = 1
@[simp]
theorem units.coe_mk0 {G₀ : Type u_3} [group_with_zero G₀] {a : G₀} (h : a 0) :
(units.mk0 a h) = a
@[simp]
theorem units.mk0_coe {G₀ : Type u_3} [group_with_zero G₀] (u : G₀ˣ) (h : u 0) :
@[simp]
theorem units.mul_inv' {G₀ : Type u_3} [group_with_zero G₀] (u : G₀ˣ) :
u * (u)⁻¹ = 1
@[simp]
theorem units.inv_mul' {G₀ : Type u_3} [group_with_zero G₀] (u : G₀ˣ) :
(u)⁻¹ * u = 1
@[simp]
theorem units.mk0_inj {G₀ : Type u_3} [group_with_zero G₀] {a b : G₀} (ha : a 0) (hb : b 0) :
units.mk0 a ha = units.mk0 b hb a = b
theorem units.exists0 {G₀ : Type u_3} [group_with_zero G₀] {p : G₀ˣ Prop} :
( (g : G₀ˣ), p g) (g : G₀) (hg : g 0), p (units.mk0 g hg)

In a group with zero, an existential over a unit can be rewritten in terms of units.mk0.

theorem units.exists0' {G₀ : Type u_3} [group_with_zero G₀] {p : Π (g : G₀), g 0 Prop} :
( (g : G₀) (hg : g 0), p g hg) (g : G₀ˣ), p g _

An alternative version of units.exists0. This one is useful if Lean cannot figure out p when using units.exists0 from right to left.

@[simp]
theorem units.exists_iff_ne_zero {G₀ : Type u_3} [group_with_zero G₀] {x : G₀} :
( (u : G₀ˣ), u = x) x 0
theorem group_with_zero.eq_zero_or_unit {G₀ : Type u_3} [group_with_zero G₀] (a : G₀) :
a = 0 (u : G₀ˣ), a = u
theorem is_unit.mk0 {G₀ : Type u_3} [group_with_zero G₀] (x : G₀) (hx : x 0) :
theorem is_unit_iff_ne_zero {G₀ : Type u_3} [group_with_zero G₀] {a : G₀} :
@[protected]
theorem ne.is_unit {G₀ : Type u_3} [group_with_zero G₀] {a : G₀} :

Alias of the reverse direction of is_unit_iff_ne_zero.

@[protected, instance]
@[simp]
theorem units.mk0_mul {G₀ : Type u_3} [group_with_zero G₀] (x y : G₀) (hxy : x * y 0) :
units.mk0 (x * y) hxy = units.mk0 x _ * units.mk0 y _
theorem div_ne_zero {G₀ : Type u_3} [group_with_zero G₀] {a b : G₀} (ha : a 0) (hb : b 0) :
a / b 0
@[simp]
theorem div_eq_zero_iff {G₀ : Type u_3} [group_with_zero G₀] {a b : G₀} :
a / b = 0 a = 0 b = 0
theorem div_ne_zero_iff {G₀ : Type u_3} [group_with_zero G₀] {a b : G₀} :
a / b 0 a 0 b 0
theorem ring.inverse_eq_inv {G₀ : Type u_3} [group_with_zero G₀] (a : G₀) :
@[simp]