The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V05. Groups

Mathlib.Algebra.Group.Invertible.Defs

47 declarations. Mathlib docs · Source

Invertible elements

This file defines a typeclass Invertible a for elements a with a two-sided multiplicative inverse.

The intent of the typeclass is to provide a way to write e.g. ⅟2 in a ring like ℤ[1/2] where some inverses exist but there is no general ⁻¹ operator; or to specify that a field has characteristic ≠ 2. It is the Type-valued analogue to the Prop-valued IsUnit.

For constructions of the invertible element given a characteristic, see Algebra/CharP/Invertible and other lemmas in that file.

Notation

  • ⅟a is Invertible.invOf a, the inverse of a

Implementation notes

The Invertible class lives in Type, not Prop, to make computation easier. If multiplication is associative, Invertible is a subsingleton anyway.

The simp normal form tries to normalize ⅟a to a ⁻¹. Otherwise, it pushes ⅟ inside the expression as much as possible.

Since Invertible a is not a Prop (but it is a Subsingleton), we have to be careful about coherence issues: we should avoid having multiple non-defeq instances for Invertible a in the same context. This file plays it safe and uses def rather than instance for most definitions, users can choose which instances to use at the point of use.

For example, here's how you can use an Invertible 1 instance:

variable {α : Type*} [Monoid α]

def something_that_needs_inverses (x : α) [Invertible x] := sorry

section
attribute [local instance] invertibleOne
def something_one := something_that_needs_inverses 1
end

Typeclass search vs. unification for simp lemmas

Note that since typeclass search searches the local context first, an instance argument like [Invertible a] might sometimes be filled by a different term than the one we'd find by unification (i.e., the one that's used as an implicit argument to ⅟).

This can cause issues with simp. Therefore, some lemmas are duplicated, with the @[simp] versions using unification and the user-facing ones using typeclass search.

Since unification can make backwards rewriting (e.g. rw [← mylemma]) impractical, we still want the instance-argument versions; therefore the user-facing versions retain the instance arguments and the original lemma name, whereas the @[simp]/unification ones acquire a ' at the end of their name.

We modify this file according to the above pattern only as needed; therefore, most @[simp] lemmas here are not part of such a duplicate pair. This is not (yet) intended as a permanent solution.

See Zulip: [https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Invertible.201.20simps/near/320558233]

Tags

invertible, inverse element, invOf, a half, one half, a third, one third, ½, ⅓

def Invertible.ctorIdx E1 #

{α : Type u} → {inst : Mul α} → {inst_1 : One α} → {a : α} → Invertible a → ℕ

class Invertible E3 #

{α : Type u} → [Mul α] → [One α] → α → Type u

Invertible a gives a two-sided multiplicative inverse of a.

ctor Invertible.mk E0 #

{α : Type u} → [inst : Mul α] → [inst_1 : One α] → {a : α} → (invOf : α) → invOf * a = 1 → a * invOf = 1 → Invertible a

abbrev Invertible.invOf E1 #

{α : Type u} → {inst : Mul α} → {inst_1 : One α} → (a : α) → [self : Invertible a] → α

The inverse of an Invertible element

theorem Invertible.invOf_mul_self E1 #

∀ {α : Type u} {inst : Mul α} {inst_1 : One α} {a : α} [self : Invertible a], ⅟a * a = 1

invOf a is a left inverse of a

theorem Invertible.mul_invOf_self E1 #

∀ {α : Type u} {inst : Mul α} {inst_1 : One α} {a : α} [self : Invertible a], a * ⅟a = 1

invOf a is a right inverse of a

def «term⅟_» E1 #

Lean.ParserDescr

The inverse of an Invertible element

theorem invOf_mul_self' E0 #

∀ {α : Type u} [inst : Mul α] [inst_1 : One α] (a : α) {x : Invertible a}, ⅟a * a = 1

theorem invOf_mul_self E1 #

∀ {α : Type u} [inst : Mul α] [inst_1 : One α] (a : α) [inst_2 : Invertible a], ⅟a * a = 1

theorem mul_invOf_self' E0 #

∀ {α : Type u} [inst : Mul α] [inst_1 : One α] (a : α) {x : Invertible a}, a * ⅟a = 1

theorem mul_invOf_self E1 #

∀ {α : Type u} [inst : Mul α] [inst_1 : One α] (a : α) [inst_2 : Invertible a], a * ⅟a = 1

theorem invOf_mul_cancel_left' E0 #

∀ {α : Type u} [inst : Monoid α] (a b : α) {x : Invertible a}, ⅟a * (a * b) = b

theorem invOf_mul_cancel_left E1 #

∀ {α : Type u} [inst : Monoid α] (a b : α) [inst_1 : Invertible a], ⅟a * (a * b) = b

theorem mul_invOf_cancel_left' E0 #

∀ {α : Type u} [inst : Monoid α] (a b : α) {x : Invertible a}, a * (⅟a * b) = b

theorem mul_invOf_cancel_left E1 #

∀ {α : Type u} [inst : Monoid α] (a b : α) [inst_1 : Invertible a], a * (⅟a * b) = b

theorem invOf_mul_cancel_right' E0 #

∀ {α : Type u} [inst : Monoid α] (a b : α) {x : Invertible b}, a * ⅟b * b = a

theorem invOf_mul_cancel_right E1 #

∀ {α : Type u} [inst : Monoid α] (a b : α) [inst_1 : Invertible b], a * ⅟b * b = a

theorem mul_invOf_cancel_right' E0 #

∀ {α : Type u} [inst : Monoid α] (a b : α) {x : Invertible b}, a * b * ⅟b = a

theorem mul_invOf_cancel_right E1 #

∀ {α : Type u} [inst : Monoid α] (a b : α) [inst_1 : Invertible b], a * b * ⅟b = a

theorem invOf_eq_right_inv E1 #

∀ {α : Type u} [inst : Monoid α] {a b : α} [inst_1 : Invertible a], a * b = 1 → ⅟a = b

theorem invOf_eq_left_inv E1 #

∀ {α : Type u} [inst : Monoid α] {a b : α} [inst_1 : Invertible a], b * a = 1 → ⅟a = b

theorem invOf_eq_iff_right E1 #

∀ {α : Type u} [inst : Monoid α] {a b : α} [inst_1 : Invertible a], ⅟a = b ↔ a * b = 1

theorem invOf_eq_iff_left E1 #

∀ {α : Type u} [inst : Monoid α] {a b : α} [inst_1 : Invertible a], ⅟a = b ↔ b * a = 1

theorem invertible_unique E1 #

∀ {α : Type u} [inst : Monoid α] (a b : α) [inst_1 : Invertible a] [inst_2 : Invertible b], a = b → ⅟a = ⅟b

instance Invertible.subsingleton E0 #

∀ {α : Type u} [inst : Monoid α] (a : α), Subsingleton (Invertible a)

theorem Invertible.congr E1 #

∀ {α : Type u} [inst : Monoid α] (a b : α) [inst_1 : Invertible a] [inst_2 : Invertible b], a = b → ⅟a = ⅟b

If a is invertible and a = b, then ⅟a = ⅟b.

def Invertible.copy' E1 #

{α : Type u} → [inst : MulOneClass α] → {r : α} → (hr : Invertible r) → (s si : α) → s = r → si = ⅟r → Invertible s

If r is invertible and s = r and si = ⅟r, then s is invertible with ⅟s = si.

abbrev Invertible.copy E1 #

{α : Type u} → [inst : MulOneClass α] → {r : α} → Invertible r → (s : α) → s = r → Invertible s

If r is invertible and s = r, then s is invertible.

def invertibleOfGroup E1 #

{α : Type u} → [inst : Group α] → (a : α) → Invertible a

Each element of a group is invertible.

theorem invOf_eq_group_inv E0 #

∀ {α : Type u} [inst : Group α] (a : α) [inst_1 : Invertible a], ⅟a = a⁻¹

def invertibleOne E1 #

{α : Type u} → [inst : Monoid α] → Invertible 1

1 is the inverse of itself

theorem invOf_one' E0 #

∀ {α : Type u} [inst : Monoid α] {x : Invertible 1}, ⅟1 = 1

theorem invOf_one E1 #

∀ {α : Type u} [inst : Monoid α] [inst_1 : Invertible 1], ⅟1 = 1

instance invertibleInvOf E0 #

{α : Type u} → [inst : One α] → [inst_1 : Mul α] → {a : α} → [inst_2 : Invertible a] → Invertible ⅟a

a is the inverse of ⅟a.

theorem invOf_invOf E0 #

∀ {α : Type u} [inst : Monoid α] (a : α) [inst_1 : Invertible a] [inst_2 : Invertible ⅟a], ⅟⅟a = a

theorem invOf_inj E0 #

∀ {α : Type u} [inst : Monoid α] {a b : α} [inst_1 : Invertible a] [inst_2 : Invertible b], ⅟a = ⅟b ↔ a = b

def invertibleMul E1 #

{α : Type u} → [inst : Monoid α] → (a b : α) → [Invertible a] → [Invertible b] → Invertible (a * b)

⅟b * ⅟a is the inverse of a * b

theorem invOf_mul E0 #

∀ {α : Type u} [inst : Monoid α] (a b : α) [inst_1 : Invertible a] [inst_2 : Invertible b]
  [inst_3 : Invertible (a * b)], ⅟(a * b) = ⅟b * ⅟a

abbrev Invertible.mul E1 #

{α : Type u} → [inst : Monoid α] → {a b : α} → Invertible a → Invertible b → Invertible (a * b)

A copy of invertibleMul for dot notation.

theorem mul_left_inj_of_invertible E1 #

∀ {α : Type u} [inst : Monoid α] {a b : α} (c : α) [Invertible c], a * c = b * c ↔ a = b

theorem mul_right_inj_of_invertible E1 #

∀ {α : Type u} [inst : Monoid α] {a b : α} (c : α) [Invertible c], c * a = c * b ↔ a = b

theorem invOf_mul_eq_iff_eq_mul_left E1 #

∀ {α : Type u} [inst : Monoid α] {a b c : α} [inst_1 : Invertible c], ⅟c * a = b ↔ a = c * b

theorem mul_left_eq_iff_eq_invOf_mul E1 #

∀ {α : Type u} [inst : Monoid α] {a b c : α} [inst_1 : Invertible c], c * a = b ↔ a = ⅟c * b

theorem mul_invOf_eq_iff_eq_mul_right E1 #

∀ {α : Type u} [inst : Monoid α] {a b c : α} [inst_1 : Invertible c], a * ⅟c = b ↔ a = b * c

theorem mul_right_eq_iff_eq_mul_invOf E1 #

∀ {α : Type u} [inst : Monoid α] {a b c : α} [inst_1 : Invertible c], a * c = b ↔ a = b * ⅟c

def invertibleOfLeftInverse E1 #

{α : Type u} → [inst : Monoid α] → [IsDedekindFiniteMonoid α] → (a b : α) → b * a = 1 → Invertible a

An element in a Dedekind-finite monoid is invertible if it has a left inverse.

def invertibleOfRightInverse E1 #

{α : Type u} → [inst : Monoid α] → [IsDedekindFiniteMonoid α] → (a b : α) → a * b = 1 → Invertible a

An element in a Dedekind-finite monoid is invertible if it has a right inverse.