Subrings #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Let R
be a ring. This file defines the "bundled" subring type subring R
, a type
whose terms correspond to subrings of R
. This is the preferred way to talk
about subrings in mathlib. Unbundled subrings (s : set R
and is_subring s
)
are not in this file, and they will ultimately be deprecated.
We prove that subrings are a complete lattice, and that you can map
(pushforward) and
comap
(pull back) them along ring homomorphisms.
We define the closure
construction from set R
to subring R
, sending a subset of R
to the subring it generates, and prove that it is a Galois insertion.
Main definitions #
Notation used here:
(R : Type u) [ring R] (S : Type u) [ring S] (f g : R →+* S)
(A : subring R) (B : subring S) (s : set R)
-
subring R
: the type of subrings of a ringR
. -
instance : complete_lattice (subring R)
: the complete lattice structure on the subrings. -
subring.center
: the center of a ringR
. -
subring.closure
: subring closure of a set, i.e., the smallest subring that includes the set. -
subring.gi
:closure : set M → subring M
and coercioncoe : subring M → set M
form agalois_insertion
. -
comap f B : subring A
: the preimage of a subringB
along the ring homomorphismf
-
map f A : subring B
: the image of a subringA
along the ring homomorphismf
. -
f.range : subring B
: the range of the ring homomorphismf
. -
eq_locus f g : subring R
: given ring homomorphismsf g : R →+* S
, the subring ofR
wheref x = g x
Implementation notes #
A subring is implemented as a subsemiring which is also an additive subgroup. The initial PR was as a submonoid which is also an additive subgroup.
Lattice inclusion (e.g. ≤
and ⊓
) is used rather than set notation (⊆
and ∩
), although
∈
is defined as membership of a subring's underlying set.
Tags #
subring, subrings
- to_subsemiring_class : subsemiring_class S R
- to_neg_mem_class : neg_mem_class S R
subring_class S R
states that S
is a type of subsets s ⊆ R
that
are both a multiplicative submonoid and an additive subgroup.
A subring of a ring inherits a ring structure
Equations
- subring_class.to_ring s = function.injective.ring coe _ _ _ _ _ _ _ _ _ _ _ _
A subring of a comm_ring
is a comm_ring
.
Equations
- subring_class.to_comm_ring s = function.injective.comm_ring coe _ _ _ _ _ _ _ _ _ _ _ _
A subring of a domain is a domain.
A subring of an ordered_ring
is an ordered_ring
.
Equations
- subring_class.to_ordered_ring s = function.injective.ordered_ring coe _ _ _ _ _ _ _ _ _ _ _ _
A subring of an ordered_comm_ring
is an ordered_comm_ring
.
Equations
- subring_class.to_ordered_comm_ring s = function.injective.ordered_comm_ring coe _ _ _ _ _ _ _ _ _ _ _ _
A subring of a linear_ordered_ring
is a linear_ordered_ring
.
Equations
- subring_class.to_linear_ordered_ring s = function.injective.linear_ordered_ring coe _ _ _ _ _ _ _ _ _ _ _ _ _ _
A subring of a linear_ordered_comm_ring
is a linear_ordered_comm_ring
.
Equations
- subring_class.to_linear_ordered_comm_ring s = function.injective.linear_ordered_comm_ring coe _ _ _ _ _ _ _ _ _ _ _ _ _ _
The natural ring hom from a subring of ring R
to R
.
Equations
- subring_class.subtype s = {to_fun := coe coe_to_lift, map_one' := _, map_mul' := _, map_zero' := _, map_add' := _}
Reinterpret a subring
as an add_subgroup
.
- carrier : set R
- mul_mem' : ∀ {a b : R}, a ∈ self.carrier → b ∈ self.carrier → a * b ∈ self.carrier
- one_mem' : 1 ∈ self.carrier
- add_mem' : ∀ {a b : R}, a ∈ self.carrier → b ∈ self.carrier → a + b ∈ self.carrier
- zero_mem' : 0 ∈ self.carrier
- neg_mem' : ∀ {x : R}, x ∈ self.carrier → -x ∈ self.carrier
subring R
is the type of subrings of R
. A subring of R
is a subset s
that is a
multiplicative submonoid and an additive subgroup. Note in particular that it shares the
same 0 and 1 as R.
Instances for subring
Reinterpret a subring
as a subsemiring
.
Equations
- subring.set_like = {coe := subring.carrier _inst_1, coe_injective' := _}
Copy of a subring with a new carrier
equal to the old one. Useful to fix definitional
equalities.
A subsemiring
containing -1 is a subring
.
A subring of a comm_ring
is a comm_ring
.
Equations
- s.to_comm_ring = function.injective.comm_ring coe _ _ _ _ _ _ _ _ _ _ _ _
A subring of a non-trivial ring is non-trivial.
A subring of a ring with no zero divisors has no zero divisors.
A subring of an ordered_ring
is an ordered_ring
.
Equations
- s.to_ordered_ring = function.injective.ordered_ring coe _ _ _ _ _ _ _ _ _ _ _ _
A subring of an ordered_comm_ring
is an ordered_comm_ring
.
Equations
- s.to_ordered_comm_ring = function.injective.ordered_comm_ring coe _ _ _ _ _ _ _ _ _ _ _ _
A subring of a linear_ordered_ring
is a linear_ordered_ring
.
Equations
- s.to_linear_ordered_ring = function.injective.linear_ordered_ring coe _ _ _ _ _ _ _ _ _ _ _ _ _ _
A subring of a linear_ordered_comm_ring
is a linear_ordered_comm_ring
.
Equations
- s.to_linear_ordered_comm_ring = function.injective.linear_ordered_comm_ring coe _ _ _ _ _ _ _ _ _ _ _ _ _ _
Partial order #
top #
The ring equiv between the top element of subring R
and R
.
Equations
comap #
map #
A subring is isomorphic to its image under an injective function
range #
The range of a ring homomorphism, as a subring of the target. See Note [range copy pattern].
Instances for ↥ring_hom.range
The range of a ring homomorphism is a fintype, if the domain is a fintype.
Note: this instance can form a diamond with subtype.fintype
in the
presence of fintype S
.
Equations
bot #
Equations
- subring.has_bot = {bot := (int.cast_ring_hom R).range}
inf #
Subrings of a ring form a complete lattice.
Equations
- subring.complete_lattice = {sup := complete_lattice.sup (complete_lattice_of_Inf (subring R) subring.complete_lattice._proof_1), le := complete_lattice.le (complete_lattice_of_Inf (subring R) subring.complete_lattice._proof_1), lt := complete_lattice.lt (complete_lattice_of_Inf (subring R) subring.complete_lattice._proof_1), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := has_inf.inf subring.has_inf, inf_le_left := _, inf_le_right := _, le_inf := _, Sup := complete_lattice.Sup (complete_lattice_of_Inf (subring R) subring.complete_lattice._proof_1), le_Sup := _, Sup_le := _, Inf := complete_lattice.Inf (complete_lattice_of_Inf (subring R) subring.complete_lattice._proof_1), Inf_le := _, le_Inf := _, top := ⊤, bot := ⊥, le_top := _, bot_le := _}
Center of a ring #
The center of a ring R
is the set of elements that commute with everything in R
Equations
- subring.center R = {carrier := set.center R (distrib.to_has_mul R), mul_mem' := _, one_mem' := _, add_mem' := _, zero_mem' := _, neg_mem' := _}
Instances for ↥subring.center
Equations
- subring.decidable_mem_center = λ (_x : R), decidable_of_iff' (∀ (g : R), g * _x = _x * g) subring.mem_center_iff
The center is commutative.
Equations
- subring.center.comm_ring = {add := comm_semiring.add subsemiring.center.comm_semiring, add_assoc := _, zero := comm_semiring.zero subsemiring.center.comm_semiring, zero_add := _, add_zero := _, nsmul := comm_semiring.nsmul subsemiring.center.comm_semiring, nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg (subring.center R).to_ring, sub := ring.sub (subring.center R).to_ring, sub_eq_add_neg := _, zsmul := ring.zsmul (subring.center R).to_ring, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, int_cast := ring.int_cast (subring.center R).to_ring, nat_cast := comm_semiring.nat_cast subsemiring.center.comm_semiring, one := comm_semiring.one subsemiring.center.comm_semiring, nat_cast_zero := _, nat_cast_succ := _, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _, mul := comm_semiring.mul subsemiring.center.comm_semiring, mul_assoc := _, one_mul := _, mul_one := _, npow := comm_semiring.npow subsemiring.center.comm_semiring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _}
Equations
- subring.center.field = {add := comm_ring.add subring.center.comm_ring, add_assoc := _, zero := comm_ring.zero subring.center.comm_ring, zero_add := _, add_zero := _, nsmul := comm_ring.nsmul subring.center.comm_ring, nsmul_zero' := _, nsmul_succ' := _, neg := comm_ring.neg subring.center.comm_ring, sub := comm_ring.sub subring.center.comm_ring, sub_eq_add_neg := _, zsmul := comm_ring.zsmul subring.center.comm_ring, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, int_cast := comm_ring.int_cast subring.center.comm_ring, nat_cast := comm_ring.nat_cast subring.center.comm_ring, one := comm_ring.one subring.center.comm_ring, nat_cast_zero := _, nat_cast_succ := _, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _, mul := comm_ring.mul subring.center.comm_ring, mul_assoc := _, one_mul := _, mul_one := _, npow := comm_ring.npow subring.center.comm_ring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _, inv := λ (a : ↥(subring.center K)), ⟨(↑a)⁻¹, _⟩, div := λ (a b : ↥(subring.center K)), ⟨↑a / ↑b, _⟩, div_eq_mul_inv := _, zpow := division_ring.zpow._default comm_ring.mul subring.center.field._proof_27 comm_ring.one subring.center.field._proof_28 subring.center.field._proof_29 comm_ring.npow subring.center.field._proof_30 subring.center.field._proof_31 (λ (a : ↥(subring.center K)), ⟨(↑a)⁻¹, _⟩), zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, exists_pair_ne := _, rat_cast := division_ring.rat_cast._default comm_ring.add subring.center.field._proof_36 comm_ring.zero subring.center.field._proof_37 subring.center.field._proof_38 comm_ring.nsmul subring.center.field._proof_39 subring.center.field._proof_40 comm_ring.neg comm_ring.sub subring.center.field._proof_41 comm_ring.zsmul subring.center.field._proof_42 subring.center.field._proof_43 subring.center.field._proof_44 subring.center.field._proof_45 subring.center.field._proof_46 comm_ring.int_cast comm_ring.nat_cast comm_ring.one subring.center.field._proof_47 subring.center.field._proof_48 subring.center.field._proof_49 subring.center.field._proof_50 comm_ring.mul subring.center.field._proof_51 subring.center.field._proof_52 subring.center.field._proof_53 comm_ring.npow subring.center.field._proof_54 subring.center.field._proof_55 subring.center.field._proof_56 subring.center.field._proof_57 (λ (a : ↥(subring.center K)), ⟨(↑a)⁻¹, _⟩) (λ (a b : ↥(subring.center K)), ⟨↑a / ↑b, _⟩) subring.center.field._proof_58 (division_ring.zpow._default comm_ring.mul subring.center.field._proof_27 comm_ring.one subring.center.field._proof_28 subring.center.field._proof_29 comm_ring.npow subring.center.field._proof_30 subring.center.field._proof_31 (λ (a : ↥(subring.center K)), ⟨(↑a)⁻¹, _⟩)) subring.center.field._proof_59 subring.center.field._proof_60 subring.center.field._proof_61, mul_inv_cancel := _, inv_zero := _, rat_cast_mk := _, qsmul := division_ring.qsmul._default (… subring.center.field._proof_42 subring.center.field._proof_43 subring.center.field._proof_44 subring.center.field._proof_45 subring.center.field._proof_46 comm_ring.int_cast comm_ring.nat_cast comm_ring.one subring.center.field._proof_47 subring.center.field._proof_48 subring.center.field._proof_49 subring.center.field._proof_50 comm_ring.mul subring.center.field._proof_51 subring.center.field._proof_52 subring.center.field._proof_53 comm_ring.npow subring.center.field._proof_54 subring.center.field._proof_55 subring.center.field._proof_56 subring.center.field._proof_57 (λ (a : ↥(subring.center K)), ⟨(↑a)⁻¹, _⟩) (λ (a b : ↥(subring.center K)), ⟨↑a / ↑b, _⟩) subring.center.field._proof_58 (division_ring.zpow._default comm_ring.mul subring.center.field._proof_27 comm_ring.one subring.center.field._proof_28 subring.center.field._proof_29 comm_ring.npow subring.center.field._proof_30 subring.center.field._proof_31 (λ (a : ↥(subring.center K)), ⟨(↑a)⁻¹, _⟩)) subring.center.field._proof_59 subring.center.field._proof_60 subring.center.field._proof_61) comm_ring.add subring.center.field._proof_65 comm_ring.zero subring.center.field._proof_66 subring.center.field._proof_67 comm_ring.nsmul subring.center.field._proof_68 subring.center.field._proof_69 comm_ring.neg comm_ring.sub subring.center.field._proof_70 comm_ring.zsmul subring.center.field._proof_71 subring.center.field._proof_72 subring.center.field._proof_73 subring.center.field._proof_74 subring.center.field._proof_75 comm_ring.int_cast comm_ring.nat_cast comm_ring.one subring.center.field._proof_76 subring.center.field._proof_77 subring.center.field._proof_78 subring.center.field._proof_79 comm_ring.mul subring.center.field._proof_80 subring.center.field._proof_81 subring.center.field._proof_82 comm_ring.npow subring.center.field._proof_83 subring.center.field._proof_84 subring.center.field._proof_85 subring.center.field._proof_86, qsmul_eq_mul' := _}
subring closure of a subset #
The subring
generated by a set.
Equations
- subring.closure s = has_Inf.Inf {S : subring R | s ⊆ ↑S}
The subring generated by a set includes the set.
An induction principle for closure membership. If p
holds for 0
, 1
, and all elements
of s
, and is preserved under addition, negation, and multiplication, then p
holds for all
elements of the closure of s
.
An induction principle for closure membership, for predicates with two arguments.
If all elements of s : set A
commute pairwise, then closure s
is a commutative ring.
Equations
- subring.closure_comm_ring_of_comm hcomm = {add := ring.add (subring.closure s).to_ring, add_assoc := _, zero := ring.zero (subring.closure s).to_ring, zero_add := _, add_zero := _, nsmul := ring.nsmul (subring.closure s).to_ring, nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg (subring.closure s).to_ring, sub := ring.sub (subring.closure s).to_ring, sub_eq_add_neg := _, zsmul := ring.zsmul (subring.closure s).to_ring, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, int_cast := ring.int_cast (subring.closure s).to_ring, nat_cast := ring.nat_cast (subring.closure s).to_ring, one := ring.one (subring.closure s).to_ring, nat_cast_zero := _, nat_cast_succ := _, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _, mul := ring.mul (subring.closure s).to_ring, mul_assoc := _, one_mul := _, mul_one := _, npow := ring.npow (subring.closure s).to_ring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _}
closure
forms a Galois insertion with the coercion to set.
Equations
- subring.gi R = {choice := λ (s : set R) (_x : ↑(subring.closure s) ≤ s), subring.closure s, gc := _, le_l_u := _, choice_eq := _}
Closure of a subring S
equals S
.
The underlying set of a non-empty directed Sup of subrings is just a union of the subrings. Note that this fails without the directedness assumption (the union of two subrings is typically not a subring)
Restriction of a ring homomorphism to its range interpreted as a subsemiring.
This is the bundled version of set.range_factorization
.
Equations
- f.range_restrict = f.cod_restrict f.range _
The subring of elements x : R
such that f x = g x
, i.e.,
the equalizer of f and g as a subring of R
The image under a ring homomorphism of the subring generated by a set equals the subring generated by the image of the set.
The ring homomorphism associated to an inclusion of subrings.
Equations
- subring.inclusion h = S.subtype.cod_restrict T _
Makes the identity isomorphism from a proof two subrings of a multiplicative monoid are equal.
Equations
- ring_equiv.subring_congr h = {to_fun := (equiv.set_congr _).to_fun, inv_fun := (equiv.set_congr _).inv_fun, left_inv := _, right_inv := _, map_mul' := _, map_add' := _}
Restrict a ring homomorphism with a left inverse to a ring isomorphism to its
ring_hom.range
.
Given an equivalence e : R ≃+* S
of rings and a subring s
of R
,
subring_equiv_map e s
is the induced equivalence between s
and s.map e
Equations
Actions by subring
s #
These are just copies of the definitions about subsemiring
starting from
subsemiring.mul_action
.
When R
is commutative, algebra.of_subring
provides a stronger result than those found in
this file, which uses the same scalar action.
Note that this provides is_scalar_tower S R R
which is needed by smul_mul_assoc
.
The action by a subring is the action by the underlying ring.
Equations
The action by a subring is the action by the underlying ring.
Equations
The action by a subring is the action by the underlying ring.
Equations
The action by a subring is the action by the underlying ring.
Equations
The action by a subring is the action by the underlying ring.
Equations
The action by a subring is the action by the underlying ring.
Equations
- S.module = S.to_subsemiring.module
The action by a subsemiring is the action by the underlying ring.
Equations
The center of a semiring acts commutatively on that semiring.
The center of a semiring acts commutatively on that semiring.