Subrings #
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
- neg_mem : ∀ {s : S} {a : R}, a ∈ s → -a ∈ s
subring_class S R
states that S
is a type of subsets s ⊆ R
that
are both a multiplicative submonoid and an additive subgroup.
Equations
- subring_class.add_subgroup_class S R = {to_add_submonoid_class := {to_add_mem_class := {add_mem := _}, zero_mem := _}, neg_mem := _}
A subring of a ring inherits a ring structure
Equations
- subring_class.to_ring s = {add := add_comm_group.add (add_subgroup_class.to_add_comm_group s), add_assoc := _, zero := add_comm_group.zero (add_subgroup_class.to_add_comm_group s), zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul (add_subgroup_class.to_add_comm_group s), nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg (add_subgroup_class.to_add_comm_group s), sub := add_comm_group.sub (add_subgroup_class.to_add_comm_group s), sub_eq_add_neg := _, zsmul := add_comm_group.zsmul (add_subgroup_class.to_add_comm_group s), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := monoid.mul (submonoid_class.to_monoid s), mul_assoc := _, one := monoid.one (submonoid_class.to_monoid s), one_mul := _, mul_one := _, npow := monoid.npow (submonoid_class.to_monoid s), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _}
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.
Reinterpret a subring
as a subsemiring
.
Equations
- subring.set_like = {coe := subring.carrier _inst_1, coe_injective' := _}
Equations
- subring.subring_class = {to_subsemiring_class := {to_submonoid_class := {to_mul_mem_class := {mul_mem := _}, one_mem := _}, add_mem := _, zero_mem := _}, neg_mem := _}
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 contains the ring's 1.
A subring contains the ring's 0.
A subring of a ring inherits a ring structure
Equations
- s.to_ring = {add := add_comm_group.add s.to_add_subgroup.to_add_comm_group, add_assoc := _, zero := add_comm_group.zero s.to_add_subgroup.to_add_comm_group, zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul s.to_add_subgroup.to_add_comm_group, nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg s.to_add_subgroup.to_add_comm_group, sub := add_comm_group.sub s.to_add_subgroup.to_add_comm_group, sub_eq_add_neg := _, zsmul := add_comm_group.zsmul s.to_add_subgroup.to_add_comm_group, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := monoid.mul s.to_submonoid.to_monoid, mul_assoc := _, one := monoid.one s.to_submonoid.to_monoid, one_mul := _, mul_one := _, npow := monoid.npow s.to_submonoid.to_monoid, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _}
A subring of a comm_ring
is a comm_ring
.
Equations
- s.to_comm_ring = {add := ring.add s.to_ring, add_assoc := _, zero := ring.zero s.to_ring, zero_add := _, add_zero := _, nsmul := ring.nsmul s.to_ring, nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg s.to_ring, sub := ring.sub s.to_ring, sub_eq_add_neg := _, zsmul := ring.zsmul s.to_ring, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ring.mul s.to_ring, mul_assoc := _, one := ring.one s.to_ring, one_mul := _, mul_one := _, npow := ring.npow s.to_ring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _}
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 #
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].
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}
Equations
- subring.inhabited = {default := ⊥}
inf #
Equations
- subring.has_Inf = {Inf := λ (s : set (subring R)), subring.mk' (⋂ (t : subring R) (H : t ∈ s), ↑t) (⨅ (t : subring R) (H : t ∈ s), t.to_submonoid) (⨅ (t : subring R) (H : t ∈ s), t.to_add_subgroup) _ _}
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' := _}
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 := _, mul := comm_semiring.mul subsemiring.center.comm_semiring, mul_assoc := _, one := comm_semiring.one subsemiring.center.comm_semiring, 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 := _, mul := comm_ring.mul subring.center.comm_ring, mul_assoc := _, one := comm_ring.one subring.center.comm_ring, 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 := div_inv_monoid.zpow._default comm_ring.mul subring.center.field._proof_23 comm_ring.one subring.center.field._proof_24 subring.center.field._proof_25 comm_ring.npow subring.center.field._proof_26 subring.center.field._proof_27 (λ (a : ↥(subring.center K)), ⟨(↑a)⁻¹, _⟩), zpow_zero' := _, zpow_succ' := _, zpow_neg' := _, exists_pair_ne := _, mul_inv_cancel := _, inv_zero := _}
subring closure of a subset #
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 := _, mul := ring.mul (subring.closure s).to_ring, mul_assoc := _, one := ring.one (subring.closure s).to_ring, 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
.
Product of subrings is isomorphic to their product as rings.
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 range of a surjective ring homomorphism is the whole of the codomain.
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.
The action by a subring is the action by the underlying ring.
Equations
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 subgroup of positive units of a linear ordered semiring.