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.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
Reinterpret a subring
as an add_subgroup
.
- carrier : set R
- one_mem' : 1 ∈ c.carrier
- mul_mem' : ∀ {a b : R}, a ∈ c.carrier → b ∈ c.carrier → a * b ∈ c.carrier
- zero_mem' : 0 ∈ c.carrier
- add_mem' : ∀ {a b : R}, a ∈ c.carrier → b ∈ c.carrier → a + b ∈ c.carrier
- neg_mem' : ∀ {x : R}, x ∈ c.carrier → -x ∈ c.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' := _}
Copy of a subring with a new carrier
equal to the old one. Useful to fix definitional
equalities.
Construct a subring
from a set satisfying is_subring
.
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 := _, gsmul := add_comm_group.gsmul s.to_add_subgroup.to_add_comm_group, gsmul_zero' := _, gsmul_succ' := _, gsmul_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 := 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 := _, gsmul := ring.gsmul s.to_ring, gsmul_zero' := _, gsmul_succ' := _, gsmul_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 integral domain is an integral domain.
Equations
- s.integral_domain = {add := comm_ring.add s.to_comm_ring, add_assoc := _, zero := comm_ring.zero s.to_comm_ring, zero_add := _, add_zero := _, nsmul := comm_ring.nsmul s.to_comm_ring, nsmul_zero' := _, nsmul_succ' := _, neg := comm_ring.neg s.to_comm_ring, sub := comm_ring.sub s.to_comm_ring, sub_eq_add_neg := _, gsmul := comm_ring.gsmul s.to_comm_ring, gsmul_zero' := _, gsmul_succ' := _, gsmul_neg' := _, add_left_neg := _, add_comm := _, mul := comm_ring.mul s.to_comm_ring, mul_assoc := _, one := comm_ring.one s.to_comm_ring, one_mul := _, mul_one := _, npow := comm_ring.npow s.to_comm_ring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _, exists_pair_ne := _, eq_zero_or_eq_zero_of_mul_eq_zero := _}
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 #
range #
The range of a ring homomorphism, as a subring of the target. See Note [range copy pattern].
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 := _, top := ⊤, le_top := _, bot := ⊥, bot_le := _, 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 := _}
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
.
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
.