Documentation

Mathlib.Algebra.GroupWithZero.Basic

Groups with an adjoined zero element #

This file describes structures that are not usually studied on their own right in mathematics, namely a special sort of monoid: apart from a distinguished “zero element” they form a group, or in other words, they are groups with an adjoined zero element.

Examples are:

Main definitions #

Various lemmas about GroupWithZero and CommGroupWithZero. To reduce import dependencies, the type-classes themselves are in Algebra.GroupWithZero.Defs.

Implementation details #

As is usual in mathlib, we extend the inverse function to the zero element, and require 0⁻¹ = 0.

theorem left_ne_zero_of_mul {M₀ : Type u_2} [MulZeroClass M₀] {a : M₀} {b : M₀} :
a * b 0a 0
theorem right_ne_zero_of_mul {M₀ : Type u_2} [MulZeroClass M₀] {a : M₀} {b : M₀} :
a * b 0b 0
theorem ne_zero_and_ne_zero_of_mul {M₀ : Type u_2} [MulZeroClass M₀] {a : M₀} {b : M₀} (h : a * b 0) :
a 0 b 0
theorem mul_eq_zero_of_ne_zero_imp_eq_zero {M₀ : Type u_2} [MulZeroClass M₀] {a : M₀} {b : M₀} (h : a 0b = 0) :
a * b = 0
theorem zero_mul_eq_const {M₀ : Type u_2} [MulZeroClass M₀] :
(fun (x : M₀) => 0 * x) = Function.const M₀ 0

To match one_mul_eq_id.

theorem mul_zero_eq_const {M₀ : Type u_2} [MulZeroClass M₀] :
(fun (x : M₀) => x * 0) = Function.const M₀ 0

To match mul_one_eq_id.

theorem eq_zero_of_mul_self_eq_zero {M₀ : Type u_2} [Mul M₀] [Zero M₀] [NoZeroDivisors M₀] {a : M₀} (h : a * a = 0) :
a = 0
theorem mul_ne_zero {M₀ : Type u_2} [Mul M₀] [Zero M₀] [NoZeroDivisors M₀] {a : M₀} {b : M₀} (ha : a 0) (hb : b 0) :
a * b 0
instance NeZero.mul {M₀ : Type u_2} [Zero M₀] [Mul M₀] [NoZeroDivisors M₀] {x : M₀} {y : M₀} [NeZero x] [NeZero y] :
NeZero (x * y)
Equations
  • =
theorem eq_zero_of_zero_eq_one {M₀ : Type u_2} [MulZeroOneClass M₀] (h : 0 = 1) (a : M₀) :
a = 0

In a monoid with zero, if zero equals one, then zero is the only element.

def uniqueOfZeroEqOne {M₀ : Type u_2} [MulZeroOneClass M₀] (h : 0 = 1) :
Unique M₀

In a monoid with zero, if zero equals one, then zero is the unique element.

Somewhat arbitrarily, we define the default element to be 0. All other elements will be provably equal to it, but not necessarily definitionally equal.

Equations
Instances For
    theorem subsingleton_iff_zero_eq_one {M₀ : Type u_2} [MulZeroOneClass M₀] :
    0 = 1 Subsingleton M₀

    In a monoid with zero, zero equals one if and only if all elements of that semiring are equal.

    theorem subsingleton_of_zero_eq_one {M₀ : Type u_2} [MulZeroOneClass M₀] :
    0 = 1Subsingleton M₀

    Alias of the forward direction of subsingleton_iff_zero_eq_one.


    In a monoid with zero, zero equals one if and only if all elements of that semiring are equal.

    theorem eq_of_zero_eq_one {M₀ : Type u_2} [MulZeroOneClass M₀] (h : 0 = 1) (a : M₀) (b : M₀) :
    a = b
    theorem zero_ne_one_or_forall_eq_0 {M₀ : Type u_2} [MulZeroOneClass M₀] :
    0 1 ∀ (a : M₀), a = 0

    In a monoid with zero, either zero and one are nonequal, or zero is the only element.

    theorem left_ne_zero_of_mul_eq_one {M₀ : Type u_2} [MulZeroOneClass M₀] [Nontrivial M₀] {a : M₀} {b : M₀} (h : a * b = 1) :
    a 0
    theorem right_ne_zero_of_mul_eq_one {M₀ : Type u_2} [MulZeroOneClass M₀] [Nontrivial M₀] {a : M₀} {b : M₀} (h : a * b = 1) :
    b 0
    @[simp]
    theorem zero_pow {M₀ : Type u_2} [MonoidWithZero M₀] {n : } :
    n 00 ^ n = 0
    theorem zero_pow_eq {M₀ : Type u_2} [MonoidWithZero M₀] (n : ) :
    0 ^ n = if n = 0 then 1 else 0
    theorem pow_eq_zero_of_le {M₀ : Type u_2} [MonoidWithZero M₀] {a : M₀} {m : } {n : } (hmn : m n) (ha : a ^ m = 0) :
    a ^ n = 0
    theorem ne_zero_pow {M₀ : Type u_2} [MonoidWithZero M₀] {a : M₀} {n : } (hn : n 0) (ha : a ^ n 0) :
    a 0
    @[simp]
    theorem zero_pow_eq_zero {M₀ : Type u_2} [MonoidWithZero M₀] {n : } [Nontrivial M₀] :
    0 ^ n = 0 n 0
    theorem pow_eq_zero {M₀ : Type u_2} [MonoidWithZero M₀] {a : M₀} [NoZeroDivisors M₀] {n : } :
    a ^ n = 0a = 0
    @[simp]
    theorem pow_eq_zero_iff {M₀ : Type u_2} [MonoidWithZero M₀] {a : M₀} {n : } [NoZeroDivisors M₀] (hn : n 0) :
    a ^ n = 0 a = 0
    theorem pow_ne_zero_iff {M₀ : Type u_2} [MonoidWithZero M₀] {a : M₀} {n : } [NoZeroDivisors M₀] (hn : n 0) :
    a ^ n 0 a 0
    theorem pow_ne_zero {M₀ : Type u_2} [MonoidWithZero M₀] {a : M₀} [NoZeroDivisors M₀] (n : ) (h : a 0) :
    a ^ n 0
    instance NeZero.pow {M₀ : Type u_2} [MonoidWithZero M₀] {a : M₀} {n : } [NoZeroDivisors M₀] [NeZero a] :
    NeZero (a ^ n)
    Equations
    • =
    theorem sq_eq_zero_iff {M₀ : Type u_2} [MonoidWithZero M₀] {a : M₀} [NoZeroDivisors M₀] :
    a ^ 2 = 0 a = 0
    @[simp]
    theorem pow_eq_zero_iff' {M₀ : Type u_2} [MonoidWithZero M₀] {a : M₀} {n : } [NoZeroDivisors M₀] [Nontrivial M₀] :
    a ^ n = 0 a = 0 n 0
    @[simp]
    theorem mul_eq_mul_right_iff {M₀ : Type u_2} [CancelMonoidWithZero M₀] {a : M₀} {b : M₀} {c : M₀} :
    a * c = b * c a = b c = 0
    @[simp]
    theorem mul_eq_mul_left_iff {M₀ : Type u_2} [CancelMonoidWithZero M₀] {a : M₀} {b : M₀} {c : M₀} :
    a * b = a * c b = c a = 0
    theorem mul_right_eq_self₀ {M₀ : Type u_2} [CancelMonoidWithZero M₀] {a : M₀} {b : M₀} :
    a * b = a b = 1 a = 0
    theorem mul_left_eq_self₀ {M₀ : Type u_2} [CancelMonoidWithZero M₀] {a : M₀} {b : M₀} :
    a * b = b a = 1 b = 0
    @[simp]
    theorem mul_eq_left₀ {M₀ : Type u_2} [CancelMonoidWithZero M₀] {a : M₀} {b : M₀} (ha : a 0) :
    a * b = a b = 1
    @[simp]
    theorem mul_eq_right₀ {M₀ : Type u_2} [CancelMonoidWithZero M₀] {a : M₀} {b : M₀} (hb : b 0) :
    a * b = b a = 1
    @[simp]
    theorem left_eq_mul₀ {M₀ : Type u_2} [CancelMonoidWithZero M₀] {a : M₀} {b : M₀} (ha : a 0) :
    a = a * b b = 1
    @[simp]
    theorem right_eq_mul₀ {M₀ : Type u_2} [CancelMonoidWithZero M₀] {a : M₀} {b : M₀} (hb : b 0) :
    b = a * b a = 1
    theorem eq_zero_of_mul_eq_self_right {M₀ : Type u_2} [CancelMonoidWithZero M₀] {a : M₀} {b : M₀} (h₁ : b 1) (h₂ : a * b = a) :
    a = 0

    An element of a CancelMonoidWithZero fixed by right multiplication by an element other than one must be zero.

    theorem eq_zero_of_mul_eq_self_left {M₀ : Type u_2} [CancelMonoidWithZero M₀] {a : M₀} {b : M₀} (h₁ : b 1) (h₂ : b * a = a) :
    a = 0

    An element of a CancelMonoidWithZero fixed by left multiplication by an element other than one must be zero.

    theorem GroupWithZero.mul_left_injective {G₀ : Type u_3} [GroupWithZero G₀] {x : G₀} (h : x 0) :
    Function.Injective fun (y : G₀) => x * y
    theorem GroupWithZero.mul_right_injective {G₀ : Type u_3} [GroupWithZero G₀] {x : G₀} (h : x 0) :
    Function.Injective fun (y : G₀) => y * x
    @[simp]
    theorem inv_mul_cancel_right₀ {G₀ : Type u_3} [GroupWithZero G₀] {b : G₀} (h : b 0) (a : G₀) :
    a * b⁻¹ * b = a
    @[simp]
    theorem inv_mul_cancel_left₀ {G₀ : Type u_3} [GroupWithZero G₀] {a : G₀} (h : a 0) (b : G₀) :
    a⁻¹ * (a * b) = b
    Equations
    Equations
    • GroupWithZero.toCancelMonoidWithZero = let __src := inst; CancelMonoidWithZero.mk
    @[simp]
    theorem zero_div {G₀ : Type u_3} [GroupWithZero G₀] (a : G₀) :
    0 / a = 0
    @[simp]
    theorem div_zero {G₀ : Type u_3} [GroupWithZero G₀] (a : G₀) :
    a / 0 = 0
    @[simp]
    theorem mul_self_mul_inv {G₀ : Type u_3} [GroupWithZero G₀] (a : G₀) :
    a * a * a⁻¹ = a

    Multiplying a by itself and then by its inverse results in a (whether or not a is zero).

    @[simp]
    theorem mul_inv_mul_self {G₀ : Type u_3} [GroupWithZero G₀] (a : G₀) :
    a * a⁻¹ * a = a

    Multiplying a by its inverse and then by itself results in a (whether or not a is zero).

    @[simp]
    theorem inv_mul_mul_self {G₀ : Type u_3} [GroupWithZero G₀] (a : G₀) :
    a⁻¹ * a * a = a

    Multiplying a⁻¹ by a twice results in a (whether or not a is zero).

    @[simp]
    theorem mul_self_div_self {G₀ : Type u_3} [GroupWithZero G₀] (a : G₀) :
    a * a / a = a

    Multiplying a by itself and then dividing by itself results in a, whether or not a is zero.

    @[simp]
    theorem div_self_mul_self {G₀ : Type u_3} [GroupWithZero G₀] (a : G₀) :
    a / a * a = a

    Dividing a by itself and then multiplying by itself results in a, whether or not a is zero.

    @[simp]
    theorem div_self_mul_self' {G₀ : Type u_3} [GroupWithZero G₀] (a : G₀) :
    a / (a * a) = a⁻¹
    theorem one_div_ne_zero {G₀ : Type u_3} [GroupWithZero G₀] {a : G₀} (h : a 0) :
    1 / a 0
    @[simp]
    theorem inv_eq_zero {G₀ : Type u_3} [GroupWithZero G₀] {a : G₀} :
    a⁻¹ = 0 a = 0
    @[simp]
    theorem zero_eq_inv {G₀ : Type u_3} [GroupWithZero G₀] {a : G₀} :
    0 = a⁻¹ 0 = a
    @[simp]
    theorem div_div_self {G₀ : Type u_3} [GroupWithZero G₀] (a : G₀) :
    a / (a / a) = a

    Dividing a by the result of dividing a by itself results in a (whether or not a is zero).

    theorem ne_zero_of_one_div_ne_zero {G₀ : Type u_3} [GroupWithZero G₀] {a : G₀} (h : 1 / a 0) :
    a 0
    theorem eq_zero_of_one_div_eq_zero {G₀ : Type u_3} [GroupWithZero G₀] {a : G₀} (h : 1 / a = 0) :
    a = 0
    theorem mul_left_surjective₀ {G₀ : Type u_3} [GroupWithZero G₀] {a : G₀} (h : a 0) :
    Function.Surjective fun (g : G₀) => a * g
    theorem mul_right_surjective₀ {G₀ : Type u_3} [GroupWithZero G₀] {a : G₀} (h : a 0) :
    Function.Surjective fun (g : G₀) => g * a
    theorem div_mul_eq_mul_div₀ {G₀ : Type u_3} [CommGroupWithZero G₀] (a : G₀) (b : G₀) (c : G₀) :
    a / c * b = a * b / c

    Order dual #

    Equations
    • instMulZeroClassOrderDual = h
    Equations
    • instMulZeroOneClassOrderDual = h
    Equations
    • instSemigroupWithZeroOrderDual = h
    Equations
    • instMonoidWithZeroOrderDual = h
    Equations
    • instCancelMonoidWithZeroOrderDual = h
    Equations
    • instCommMonoidWithZeroOrderDual = h
    Equations
    • instCancelCommMonoidWithZeroOrderDual = h
    Equations
    • instGroupWithZeroOrderDual = h
    Equations
    • instCommGroupWithZeroOrderDual = h

    Lexicographic order #

    instance instMulZeroClassLex {α : Type u_1} [h : MulZeroClass α] :
    Equations
    • instMulZeroClassLex = h
    Equations
    • instMulZeroOneClassLex = h
    Equations
    • = h
    Equations
    • instSemigroupWithZeroLex = h
    instance instMonoidWithZeroLex {α : Type u_1} [h : MonoidWithZero α] :
    Equations
    • instMonoidWithZeroLex = h
    Equations
    • instCancelMonoidWithZeroLex = h
    Equations
    • instCommMonoidWithZeroLex = h
    Equations
    • instCancelCommMonoidWithZeroLex = h
    instance instGroupWithZeroLex {α : Type u_1} [h : GroupWithZero α] :
    Equations
    • instGroupWithZeroLex = h
    Equations
    • instCommGroupWithZeroLex = h