Fields and division rings #
This file introduces fields and division rings (also known as skewfields) and proves some basic
statements about them. For a more extensive theory of fields, see the field_theory
folder.
Main definitions #
division_ring
: introduces the notion of a division ring as aring
such that0 ≠ 1
anda * a⁻¹ = 1
fora ≠ 0
field
: a division ring which is also a commutative ring.is_field
: a predicate on a ring that it is a field, i.e. that the multiplication is commutative, that it has more than one element and that all non-zero elements have a multiplicative inverse. In contrast tofield
, which contains the data of a function associating to an element of the field its multiplicative inverse, this predicate only assumes the existence and can therefore more easily be used to e.g. transfer along ring isomorphisms.
Implementation details #
By convention 0⁻¹ = 0
in a field or division ring. This is due to the fact that working with total
functions has the advantage of not constantly having to check that x ≠ 0
when writing x⁻¹
. With
this convention in place, some statements like (a + b) * c⁻¹ = a * c⁻¹ + b * c⁻¹
still remain
true, while others like the defining property a * a⁻¹ = 1
need the assumption a ≠ 0
. If you are
a beginner in using Lean and are confused by that, you can read more about why this convention is
taken in Kevin Buzzard's
blogpost
A division ring or field is an example of a group_with_zero
. If you cannot find
a division ring / field lemma that does not involve +
, you can try looking for
a group_with_zero
lemma instead.
Tags #
field, division ring, skew field, skew-field, skewfield
- add : K → K → K
- add_assoc : ∀ (a b c : K), a + b + c = a + (b + c)
- zero : K
- zero_add : ∀ (a : K), 0 + a = a
- add_zero : ∀ (a : K), a + 0 = a
- nsmul : ℕ → K → K
- nsmul_zero' : (∀ (x : K), division_ring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : K), division_ring.nsmul n.succ x = x + division_ring.nsmul n x) . "try_refl_tac"
- neg : K → K
- sub : K → K → K
- sub_eq_add_neg : (∀ (a b : K), a - b = a + -b) . "try_refl_tac"
- zsmul : ℤ → K → K
- zsmul_zero' : (∀ (a : K), division_ring.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : K), division_ring.zsmul (int.of_nat n.succ) a = a + division_ring.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : K), division_ring.zsmul -[1+ n] a = -division_ring.zsmul ↑(n.succ) a) . "try_refl_tac"
- add_left_neg : ∀ (a : K), -a + a = 0
- add_comm : ∀ (a b : K), a + b = b + a
- mul : K → K → K
- mul_assoc : ∀ (a b c : K), (a * b) * c = a * b * c
- one : K
- one_mul : ∀ (a : K), 1 * a = a
- mul_one : ∀ (a : K), a * 1 = a
- npow : ℕ → K → K
- npow_zero' : (∀ (x : K), division_ring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : K), division_ring.npow n.succ x = x * division_ring.npow n x) . "try_refl_tac"
- left_distrib : ∀ (a b c : K), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : K), (a + b) * c = a * c + b * c
- inv : K → K
- div : K → K → K
- div_eq_mul_inv : (∀ (a b : K), a / b = a * b⁻¹) . "try_refl_tac"
- zpow : ℤ → K → K
- zpow_zero' : (∀ (a : K), division_ring.zpow 0 a = 1) . "try_refl_tac"
- zpow_succ' : (∀ (n : ℕ) (a : K), division_ring.zpow (int.of_nat n.succ) a = a * division_ring.zpow (int.of_nat n) a) . "try_refl_tac"
- zpow_neg' : (∀ (n : ℕ) (a : K), division_ring.zpow -[1+ n] a = (division_ring.zpow ↑(n.succ) a)⁻¹) . "try_refl_tac"
- exists_pair_ne : ∃ (x y : K), x ≠ y
- mul_inv_cancel : ∀ {a : K}, a ≠ 0 → a * a⁻¹ = 1
- inv_zero : 0⁻¹ = 0
A division_ring
is a ring
with multiplicative inverses for nonzero elements
Every division ring is a group_with_zero
.
Equations
- division_ring.to_group_with_zero = {mul := division_ring.mul _inst_1, mul_assoc := _, one := division_ring.one _inst_1, one_mul := _, mul_one := _, npow := division_ring.npow _inst_1, npow_zero' := _, npow_succ' := _, zero := division_ring.zero _inst_1, zero_mul := _, mul_zero := _, inv := division_ring.inv _inst_1, div := division_ring.div _inst_1, div_eq_mul_inv := _, zpow := division_ring.zpow _inst_1, zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, exists_pair_ne := _, inv_zero := _, mul_inv_cancel := _}
- add : K → K → K
- add_assoc : ∀ (a b c : K), a + b + c = a + (b + c)
- zero : K
- zero_add : ∀ (a : K), 0 + a = a
- add_zero : ∀ (a : K), a + 0 = a
- nsmul : ℕ → K → K
- nsmul_zero' : (∀ (x : K), field.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : K), field.nsmul n.succ x = x + field.nsmul n x) . "try_refl_tac"
- neg : K → K
- sub : K → K → K
- sub_eq_add_neg : (∀ (a b : K), a - b = a + -b) . "try_refl_tac"
- zsmul : ℤ → K → K
- zsmul_zero' : (∀ (a : K), field.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : K), field.zsmul (int.of_nat n.succ) a = a + field.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : K), field.zsmul -[1+ n] a = -field.zsmul ↑(n.succ) a) . "try_refl_tac"
- add_left_neg : ∀ (a : K), -a + a = 0
- add_comm : ∀ (a b : K), a + b = b + a
- mul : K → K → K
- mul_assoc : ∀ (a b c : K), (a * b) * c = a * b * c
- one : K
- one_mul : ∀ (a : K), 1 * a = a
- mul_one : ∀ (a : K), a * 1 = a
- npow : ℕ → K → K
- npow_zero' : (∀ (x : K), field.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : K), field.npow n.succ x = x * field.npow n x) . "try_refl_tac"
- left_distrib : ∀ (a b c : K), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : K), (a + b) * c = a * c + b * c
- mul_comm : ∀ (a b : K), a * b = b * a
- inv : K → K
- div : K → K → K
- div_eq_mul_inv : (∀ (a b : K), a / b = a * b⁻¹) . "try_refl_tac"
- zpow : ℤ → K → K
- zpow_zero' : (∀ (a : K), field.zpow 0 a = 1) . "try_refl_tac"
- zpow_succ' : (∀ (n : ℕ) (a : K), field.zpow (int.of_nat n.succ) a = a * field.zpow (int.of_nat n) a) . "try_refl_tac"
- zpow_neg' : (∀ (n : ℕ) (a : K), field.zpow -[1+ n] a = (field.zpow ↑(n.succ) a)⁻¹) . "try_refl_tac"
- exists_pair_ne : ∃ (x y : K), x ≠ y
- mul_inv_cancel : ∀ {a : K}, a ≠ 0 → a * a⁻¹ = 1
- inv_zero : 0⁻¹ = 0
A field
is a comm_ring
with multiplicative inverses for nonzero elements
Instances
- subfield_class.to_field
- linear_ordered_field.to_field
- rat.field
- mul_opposite.field
- subring.center.field
- local_ring.residue_field.field
- fraction_ring.field
- field_completion
- maximal_spectrum.adic_completion.field
- real.field
- hahn_series.field
- ratfunc.field
- zmod.field
- adjoin_root.field
- polynomial.splitting_field_aux.field
- polynomial.splitting_field.field
- perfect_closure.field
- algebraic_closure.adjoin_monic.field
- algebraic_closure.step.field
- algebraic_closure.field
- subfield.to_field
- intermediate_field.to_field
- function_field.Fqt_infty.field
- kt_infty.field
- complex.field
Equations
- field.to_division_ring = {add := field.add (show field K, from _inst_1), add_assoc := _, zero := field.zero (show field K, from _inst_1), zero_add := _, add_zero := _, nsmul := field.nsmul (show field K, from _inst_1), nsmul_zero' := _, nsmul_succ' := _, neg := field.neg (show field K, from _inst_1), sub := field.sub (show field K, from _inst_1), sub_eq_add_neg := _, zsmul := field.zsmul (show field K, from _inst_1), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := field.mul (show field K, from _inst_1), mul_assoc := _, one := field.one (show field K, from _inst_1), one_mul := _, mul_one := _, npow := field.npow (show field K, from _inst_1), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, inv := field.inv (show field K, from _inst_1), div := field.div (show field K, from _inst_1), div_eq_mul_inv := _, zpow := field.zpow (show field K, from _inst_1), zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, exists_pair_ne := _, mul_inv_cancel := _, inv_zero := _}
Every field is a comm_group_with_zero
.
Equations
- field.to_comm_group_with_zero = {mul := group_with_zero.mul division_ring.to_group_with_zero, mul_assoc := _, one := group_with_zero.one division_ring.to_group_with_zero, one_mul := _, mul_one := _, npow := group_with_zero.npow division_ring.to_group_with_zero, npow_zero' := _, npow_succ' := _, mul_comm := _, zero := group_with_zero.zero division_ring.to_group_with_zero, zero_mul := _, mul_zero := _, inv := group_with_zero.inv division_ring.to_group_with_zero, div := group_with_zero.div division_ring.to_group_with_zero, div_eq_mul_inv := _, zpow := group_with_zero.zpow division_ring.to_group_with_zero, zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, exists_pair_ne := _, inv_zero := _, mul_inv_cancel := _}
- exists_pair_ne : ∃ (x y : R), x ≠ y
- mul_comm : ∀ (x y : R), x * y = y * x
- mul_inv_cancel : ∀ {a : R}, a ≠ 0 → (∃ (b : R), a * b = 1)
A predicate to express that a ring is a field.
This is mainly useful because such a predicate does not contain data, and can therefore be easily transported along ring isomorphisms. Additionaly, this is useful when trying to prove that a particular ring structure extends to a field.
Transferring from field to is_field
Transferring from is_field to field
Equations
- h.to_field = {add := ring.add _inst_1, add_assoc := _, zero := ring.zero _inst_1, zero_add := _, add_zero := _, nsmul := ring.nsmul _inst_1, nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg _inst_1, sub := ring.sub _inst_1, sub_eq_add_neg := _, zsmul := ring.zsmul _inst_1, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ring.mul _inst_1, mul_assoc := _, one := ring.one _inst_1, one_mul := _, mul_one := _, npow := ring.npow _inst_1, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _, inv := λ (a : R), dite (a = 0) (λ (ha : a = 0), 0) (λ (ha : ¬a = 0), classical.some _), div := div_inv_monoid.div._default ring.mul ring.mul_assoc ring.one ring.one_mul ring.mul_one ring.npow ring.npow_zero' ring.npow_succ' (λ (a : R), dite (a = 0) (λ (ha : a = 0), 0) (λ (ha : ¬a = 0), classical.some _)), div_eq_mul_inv := _, zpow := div_inv_monoid.zpow._default ring.mul ring.mul_assoc ring.one ring.one_mul ring.mul_one ring.npow ring.npow_zero' ring.npow_succ' (λ (a : R), dite (a = 0) (λ (ha : a = 0), 0) (λ (ha : ¬a = 0), classical.some _)), zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, exists_pair_ne := _, mul_inv_cancel := _, inv_zero := _}
For each field, and for each nonzero element of said field, there is a unique inverse.
Since is_field
doesn't remember the data of an inv
function and as such,
a lemma that there is a unique inverse could be useful.
Constructs a division_ring
structure on a ring
consisting only of units and 0.
Equations
- division_ring_of_is_unit_or_eq_zero h = {add := ring.add hR, add_assoc := _, zero := group_with_zero.zero (group_with_zero_of_is_unit_or_eq_zero h), zero_add := _, add_zero := _, nsmul := ring.nsmul hR, nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg hR, sub := ring.sub hR, sub_eq_add_neg := _, zsmul := ring.zsmul hR, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, 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' := _, left_distrib := _, right_distrib := _, 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 := _, mul_inv_cancel := _, inv_zero := _}
Constructs a field
structure on a comm_ring
consisting only of units and 0.
See note [reducible non-instances].
Equations
- field_of_is_unit_or_eq_zero h = {add := comm_ring.add hR, add_assoc := _, zero := group_with_zero.zero (group_with_zero_of_is_unit_or_eq_zero h), zero_add := _, add_zero := _, nsmul := comm_ring.nsmul hR, nsmul_zero' := _, nsmul_succ' := _, neg := comm_ring.neg hR, sub := comm_ring.sub hR, sub_eq_add_neg := _, zsmul := comm_ring.zsmul hR, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, 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' := _, left_distrib := _, right_distrib := _, mul_comm := _, 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 := _, mul_inv_cancel := _, inv_zero := _}
Pullback a division_ring
along an injective function.
See note [reducible non-instances].
Equations
- function.injective.division_ring f hf zero one add mul neg sub inv div nsmul zsmul npow zpow = {add := ring.add (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), add_assoc := _, zero := group_with_zero.zero (function.injective.group_with_zero f hf zero one mul inv div npow zpow), zero_add := _, add_zero := _, nsmul := ring.nsmul (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), sub := ring.sub (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), sub_eq_add_neg := _, zsmul := ring.zsmul (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := group_with_zero.mul (function.injective.group_with_zero f hf zero one mul inv div npow zpow), mul_assoc := _, one := group_with_zero.one (function.injective.group_with_zero f hf zero one mul inv div npow zpow), one_mul := _, mul_one := _, npow := group_with_zero.npow (function.injective.group_with_zero f hf zero one mul inv div npow zpow), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, inv := group_with_zero.inv (function.injective.group_with_zero f hf zero one mul inv div npow zpow), div := group_with_zero.div (function.injective.group_with_zero f hf zero one mul inv div npow zpow), div_eq_mul_inv := _, zpow := group_with_zero.zpow (function.injective.group_with_zero f hf zero one mul inv div npow zpow), zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, exists_pair_ne := _, mul_inv_cancel := _, inv_zero := _}
Pullback a field
along an injective function.
See note [reducible non-instances].
Equations
- function.injective.field f hf zero one add mul neg sub inv div nsmul zsmul npow zpow = {add := comm_ring.add (function.injective.comm_ring f hf zero one add mul neg sub nsmul zsmul npow), add_assoc := _, zero := comm_group_with_zero.zero (function.injective.comm_group_with_zero f hf zero one mul inv div npow zpow), zero_add := _, add_zero := _, nsmul := comm_ring.nsmul (function.injective.comm_ring f hf zero one add mul neg sub nsmul zsmul npow), nsmul_zero' := _, nsmul_succ' := _, neg := comm_ring.neg (function.injective.comm_ring f hf zero one add mul neg sub nsmul zsmul npow), sub := comm_ring.sub (function.injective.comm_ring f hf zero one add mul neg sub nsmul zsmul npow), sub_eq_add_neg := _, zsmul := comm_ring.zsmul (function.injective.comm_ring f hf zero one add mul neg sub nsmul zsmul npow), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := comm_group_with_zero.mul (function.injective.comm_group_with_zero f hf zero one mul inv div npow zpow), mul_assoc := _, one := comm_group_with_zero.one (function.injective.comm_group_with_zero f hf zero one mul inv div npow zpow), one_mul := _, mul_one := _, npow := comm_group_with_zero.npow (function.injective.comm_group_with_zero f hf zero one mul inv div npow zpow), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _, inv := comm_group_with_zero.inv (function.injective.comm_group_with_zero f hf zero one mul inv div npow zpow), div := comm_group_with_zero.div (function.injective.comm_group_with_zero f hf zero one mul inv div npow zpow), div_eq_mul_inv := _, zpow := comm_group_with_zero.zpow (function.injective.comm_group_with_zero f hf zero one mul inv div npow zpow), zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, exists_pair_ne := _, mul_inv_cancel := _, inv_zero := _}