Documentation

Mathlib.Algebra.Ring.Ext

Extensionality lemmas for rings and similar structures #

In this file we prove extensionality lemmas for the ring-like structures defined in Mathlib/Algebra/Ring/Defs.lean, ranging from NonUnitalNonAssocSemiring to CommRing. These extensionality lemmas take the form of asserting that two algebraic structures on a type are equal whenever the addition and multiplication defined by them are both the same.

Implementation details #

We follow Mathlib/Algebra/Group/Ext.lean in using the term (letI := i; HMul.hMul : R → R → R) to refer to the multiplication specified by a typeclass instance i on a type R (and similarly for addition). We abbreviate these using some local notations.

Since Mathlib/Algebra/Group/Ext.lean proved several injectivity lemmas, we do so as well — even if sometimes we don't need them to prove extensionality.

Tags #

semiring, ring, extensionality

Distrib #

theorem Distrib.ext {R : Type u} inst₁ inst₂ : Distrib R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂
theorem Distrib.ext_iff {R : Type u} {inst₁ inst₂ : Distrib R} :

NonUnitalNonAssocSemiring #

theorem NonUnitalNonAssocSemiring.ext {R : Type u} inst₁ inst₂ : NonUnitalNonAssocSemiring R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂

NonUnitalSemiring #

theorem NonUnitalSemiring.ext {R : Type u} inst₁ inst₂ : NonUnitalSemiring R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂
theorem NonUnitalSemiring.ext_iff {R : Type u} {inst₁ inst₂ : NonUnitalSemiring R} :

NonAssocSemiring and its ancestors #

This section also includes results for AddMonoidWithOne, AddCommMonoidWithOne, etc. as these are considered implementation detail of the ring classes. TODO consider relocating these lemmas.

theorem AddMonoidWithOne.ext {R : Type u} inst₁ inst₂ : AddMonoidWithOne R (h_add : HAdd.hAdd = HAdd.hAdd) (h_one : One.one = One.one) :
inst₁ = inst₂
theorem AddMonoidWithOne.ext_iff {R : Type u} {inst₁ inst₂ : AddMonoidWithOne R} :
theorem AddCommMonoidWithOne.ext {R : Type u} inst₁ inst₂ : AddCommMonoidWithOne R (h_add : HAdd.hAdd = HAdd.hAdd) (h_one : One.one = One.one) :
inst₁ = inst₂
theorem AddCommMonoidWithOne.ext_iff {R : Type u} {inst₁ inst₂ : AddCommMonoidWithOne R} :
theorem NonAssocSemiring.ext {R : Type u} inst₁ inst₂ : NonAssocSemiring R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂
theorem NonAssocSemiring.ext_iff {R : Type u} {inst₁ inst₂ : NonAssocSemiring R} :

NonUnitalNonAssocRing #

theorem NonUnitalNonAssocRing.ext {R : Type u} inst₁ inst₂ : NonUnitalNonAssocRing R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂

NonUnitalRing #

theorem NonUnitalRing.ext {R : Type u} inst₁ inst₂ : NonUnitalRing R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂
theorem NonUnitalRing.ext_iff {R : Type u} {inst₁ inst₂ : NonUnitalRing R} :

NonAssocRing and its ancestors #

This section also includes results for AddGroupWithOne, AddCommGroupWithOne, etc. as these are considered implementation detail of the ring classes. TODO consider relocating these lemmas.

theorem AddGroupWithOne.ext {R : Type u} inst₁ inst₂ : AddGroupWithOne R (h_add : HAdd.hAdd = HAdd.hAdd) (h_one : One.one = One.one) :
inst₁ = inst₂
theorem AddGroupWithOne.ext_iff {R : Type u} {inst₁ inst₂ : AddGroupWithOne R} :
theorem AddCommGroupWithOne.ext {R : Type u} inst₁ inst₂ : AddCommGroupWithOne R (h_add : HAdd.hAdd = HAdd.hAdd) (h_one : One.one = One.one) :
inst₁ = inst₂
theorem AddCommGroupWithOne.ext_iff {R : Type u} {inst₁ inst₂ : AddCommGroupWithOne R} :
theorem NonAssocRing.ext {R : Type u} inst₁ inst₂ : NonAssocRing R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂
theorem NonAssocRing.ext_iff {R : Type u} {inst₁ inst₂ : NonAssocRing R} :

Semiring #

theorem Semiring.ext {R : Type u} inst₁ inst₂ : Semiring R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂
theorem Semiring.ext_iff {R : Type u} {inst₁ inst₂ : Semiring R} :

Ring #

theorem Ring.ext {R : Type u} inst₁ inst₂ : Ring R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂
theorem Ring.ext_iff {R : Type u} {inst₁ inst₂ : Ring R} :

NonUnitalNonAssocCommSemiring #

theorem NonUnitalNonAssocCommSemiring.ext {R : Type u} inst₁ inst₂ : NonUnitalNonAssocCommSemiring R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂

NonUnitalCommSemiring #

theorem NonUnitalCommSemiring.ext {R : Type u} inst₁ inst₂ : NonUnitalCommSemiring R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂

NonUnitalNonAssocCommRing #

theorem NonUnitalNonAssocCommRing.ext {R : Type u} inst₁ inst₂ : NonUnitalNonAssocCommRing R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂

NonUnitalCommRing #

theorem NonUnitalCommRing.ext {R : Type u} inst₁ inst₂ : NonUnitalCommRing R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂
theorem NonUnitalCommRing.ext_iff {R : Type u} {inst₁ inst₂ : NonUnitalCommRing R} :

CommSemiring #

theorem CommSemiring.ext {R : Type u} inst₁ inst₂ : CommSemiring R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂
theorem CommSemiring.ext_iff {R : Type u} {inst₁ inst₂ : CommSemiring R} :

CommRing #

theorem CommRing.ext {R : Type u} inst₁ inst₂ : CommRing R (h_add : HAdd.hAdd = HAdd.hAdd) (h_mul : HMul.hMul = HMul.hMul) :
inst₁ = inst₂
theorem CommRing.ext_iff {R : Type u} {inst₁ inst₂ : CommRing R} :