doc-next-gen

Mathlib.RingTheory.NonUnitalSubsemiring.Defs

Module docstring

{"# Bundled non-unital subsemirings

We define bundled non-unital subsemirings and some standard constructions: subtype and inclusion ring homomorphisms. ","Note: currently, there are no ordered versions of non-unital rings. ","Note: currently, there are no ordered versions of non-unital rings. "}

NonUnitalSubsemiringClass structure
(S : Type*) (R : outParam (Type u)) [NonUnitalNonAssocSemiring R] [SetLike S R] : Prop extends AddSubmonoidClass S R
Full source
/-- `NonUnitalSubsemiringClass S R` states that `S` is a type of subsets `s ⊆ R` that
are both an additive submonoid and also a multiplicative subsemigroup. -/
class NonUnitalSubsemiringClass (S : Type*) (R : outParam (Type u)) [NonUnitalNonAssocSemiring R]
    [SetLike S R] : Prop
  extends AddSubmonoidClass S R where
  mul_mem : ∀ {s : S} {a b : R}, a ∈ sb ∈ sa * b ∈ s
Non-unital subsemiring class
Informal description
A type `S` is said to be a `NonUnitalSubsemiringClass` of a non-unital non-associative semiring `R` if it represents a collection of subsets of `R` that are both additive submonoids and multiplicative subsemigroups. This means that for any subset `s : S`, `s` is closed under addition and contains the additive identity (from `AddSubmonoidClass`), and is also closed under multiplication (from `MulMemClass`).
NonUnitalSubsemiringClass.mulMemClass instance
(S : Type*) (R : Type u) [NonUnitalNonAssocSemiring R] [SetLike S R] [h : NonUnitalSubsemiringClass S R] : MulMemClass S R
Full source
instance (priority := 100) NonUnitalSubsemiringClass.mulMemClass (S : Type*) (R : Type u)
    [NonUnitalNonAssocSemiring R] [SetLike S R] [h : NonUnitalSubsemiringClass S R] :
    MulMemClass S R :=
  { h with }
Non-unital subsemirings are multiplicative subsemigroups
Informal description
For any type `S` representing a collection of subsets of a non-unital non-associative semiring `R`, if `S` is a `NonUnitalSubsemiringClass` of `R`, then `S` is also a `MulMemClass` of `R`. This means that every subset in `S` is closed under multiplication.
NonUnitalSubsemiringClass.toNonUnitalNonAssocSemiring instance
: NonUnitalNonAssocSemiring s
Full source
/-- A non-unital subsemiring of a `NonUnitalNonAssocSemiring` inherits a
`NonUnitalNonAssocSemiring` structure -/
instance (priority := 75) toNonUnitalNonAssocSemiring :
    NonUnitalNonAssocSemiring s := fast_instance%
  Subtype.coe_injective.nonUnitalNonAssocSemiring Subtype.val rfl (by simp) (fun _ _ => rfl)
    fun _ _ => rfl
Non-unital Non-associative Semiring Structure on Subsemirings
Informal description
For any non-unital subsemiring $s$ of a non-unital non-associative semiring $R$, the subset $s$ inherits a non-unital non-associative semiring structure from $R$. This means that $s$ is equipped with addition and multiplication operations that are closed within $s$, and satisfy the axioms of a non-unital non-associative semiring.
NonUnitalSubsemiringClass.subtype definition
: s →ₙ+* R
Full source
/-- The natural non-unital ring hom from a non-unital subsemiring of a non-unital semiring `R` to
`R`. -/
def subtype : s →ₙ+* R :=
  { AddSubmonoidClass.subtype s, MulMemClass.subtype s with toFun := (↑) }
Inclusion homomorphism from a non-unital subsemiring to its ambient semiring
Informal description
The natural non-unital ring homomorphism from a non-unital subsemiring $s$ of a non-unital semiring $R$ to $R$ itself. This homomorphism maps each element of $s$ to its corresponding element in $R$ via the inclusion map.
NonUnitalSubsemiringClass.subtype_apply theorem
(x : s) : subtype s x = x
Full source
@[simp]
theorem subtype_apply (x : s) : subtype s x = x :=
  rfl
Inclusion Homomorphism Acts as Identity on Elements of Non-unital Subsemiring
Informal description
For any element $x$ of a non-unital subsemiring $s$, the inclusion homomorphism $\text{subtype}(s)$ evaluated at $x$ equals $x$ itself, i.e., $\text{subtype}(s)(x) = x$.
NonUnitalSubsemiringClass.subtype_injective theorem
: Function.Injective (subtype s)
Full source
theorem subtype_injective : Function.Injective (subtype s) :=
  Subtype.coe_injective
Injectivity of the Inclusion Homomorphism for Non-Unital Subsemirings
Informal description
The inclusion homomorphism from a non-unital subsemiring $s$ to its ambient non-unital semiring $R$ is injective. That is, if two elements of $s$ are mapped to the same element in $R$ under the inclusion, then they must be equal in $s$.
NonUnitalSubsemiringClass.coe_subtype theorem
: (subtype s : s → R) = ((↑) : s → R)
Full source
@[simp]
theorem coe_subtype : (subtype s : s → R) = ((↑) : s → R) :=
  rfl
Inclusion Homomorphism Equals Coercion for Non-unital Subsemirings
Informal description
The inclusion homomorphism from a non-unital subsemiring $s$ to its ambient non-unital semiring $R$ is equal to the coercion map from $s$ to $R$. In other words, the function `subtype s` coincides with the natural embedding $\uparrow : s \to R$.
NonUnitalSubsemiringClass.toNonUnitalSemiring instance
{R} [NonUnitalSemiring R] [SetLike S R] [NonUnitalSubsemiringClass S R] : NonUnitalSemiring s
Full source
/-- A non-unital subsemiring of a `NonUnitalSemiring` is a `NonUnitalSemiring`. -/
instance toNonUnitalSemiring {R} [NonUnitalSemiring R] [SetLike S R]
    [NonUnitalSubsemiringClass S R] : NonUnitalSemiring s := fast_instance%
  Subtype.coe_injective.nonUnitalSemiring Subtype.val rfl (by simp) (fun _ _ => rfl) fun _ _ => rfl
Non-unital Semiring Structure on Subsemirings
Informal description
For any non-unital subsemiring $s$ of a non-unital semiring $R$, the subset $s$ inherits a non-unital semiring structure from $R$.
NonUnitalSubsemiringClass.toNonUnitalCommSemiring instance
{R} [NonUnitalCommSemiring R] [SetLike S R] [NonUnitalSubsemiringClass S R] : NonUnitalCommSemiring s
Full source
/-- A non-unital subsemiring of a `NonUnitalCommSemiring` is a `NonUnitalCommSemiring`. -/
instance toNonUnitalCommSemiring {R} [NonUnitalCommSemiring R] [SetLike S R]
    [NonUnitalSubsemiringClass S R] : NonUnitalCommSemiring s := fast_instance%
  Subtype.coe_injective.nonUnitalCommSemiring Subtype.val rfl (by simp) (fun _ _ => rfl)
    fun _ _ => rfl
Non-unital Commutative Semiring Structure on Subsemirings
Informal description
For any non-unital commutative semiring $R$ and any non-unital subsemiring $s$ of $R$, the subset $s$ inherits a non-unital commutative semiring structure from $R$.
NonUnitalSubsemiring structure
(R : Type u) [NonUnitalNonAssocSemiring R] extends AddSubmonoid R, Subsemigroup R
Full source
/-- A non-unital subsemiring of a non-unital semiring `R` is a subset `s` that is both an additive
submonoid and a semigroup. -/
structure NonUnitalSubsemiring (R : Type u) [NonUnitalNonAssocSemiring R] extends AddSubmonoid R,
  Subsemigroup R
Non-unital subsemiring
Informal description
A non-unital subsemiring of a non-unital semiring $R$ is a subset $s$ of $R$ that is closed under addition, multiplication, and contains the additive identity (zero). It forms both an additive submonoid and a multiplicative semigroup within $R$.
NonUnitalSubsemiring.instSetLike instance
: SetLike (NonUnitalSubsemiring R) R
Full source
instance : SetLike (NonUnitalSubsemiring R) R where
  coe s := s.carrier
  coe_injective' p q h := by cases p; cases q; congr; exact SetLike.coe_injective' h
Set-like Structure for Non-unital Subsemirings
Informal description
For any non-unital non-associative semiring $R$, the type of non-unital subsemirings of $R$ can be treated as a set-like structure, where each subsemiring is viewed as a subset of $R$ with the usual membership relation.
NonUnitalSubsemiring.ofClass definition
{S R : Type*} [NonUnitalNonAssocSemiring R] [SetLike S R] [NonUnitalSubsemiringClass S R] (s : S) : NonUnitalSubsemiring R
Full source
/-- The actual `NonUnitalSubsemiring` obtained from an element of a `NonUnitalSubsemiringClass`. -/
@[simps]
def ofClass {S R : Type*} [NonUnitalNonAssocSemiring R] [SetLike S R]
    [NonUnitalSubsemiringClass S R] (s : S) : NonUnitalSubsemiring R where
  carrier := s
  add_mem' := add_mem
  zero_mem' := zero_mem _
  mul_mem' := mul_mem
Construction of a non-unital subsemiring from a set-like class element
Informal description
Given a type `S` with a `SetLike` instance for a non-unital non-associative semiring `R`, and a `NonUnitalSubsemiringClass` instance for `S`, the function `NonUnitalSubsemiring.ofClass` constructs a `NonUnitalSubsemiring R` from an element `s : S`. The carrier set of the resulting subsemiring is `s`, and it inherits the additive and multiplicative closure properties from the `NonUnitalSubsemiringClass` instance.
NonUnitalSubsemiring.instCanLiftSetCoeAndMemOfNatForallForallForallForallHAddForallForallForallForallHMul instance
: CanLift (Set R) (NonUnitalSubsemiring R) (↑) (fun s ↦ 0 ∈ s ∧ (∀ {x y}, x ∈ s → y ∈ s → x + y ∈ s) ∧ ∀ {x y}, x ∈ s → y ∈ s → x * y ∈ s)
Full source
instance (priority := 100) : CanLift (Set R) (NonUnitalSubsemiring R) (↑)
    (fun s ↦ 0 ∈ s0 ∈ s ∧ (∀ {x y}, x ∈ s → y ∈ s → x + y ∈ s) ∧ ∀ {x y}, x ∈ s → y ∈ s → x * y ∈ s)
    where
  prf s h :=
    ⟨ { carrier := s
        zero_mem' := h.1
        add_mem' := h.2.1
        mul_mem' := h.2.2 },
      rfl ⟩
Lifting Condition for Non-unital Subsemirings
Informal description
For any non-unital non-associative semiring $R$, a subset $s$ of $R$ can be lifted to a non-unital subsemiring if and only if $s$ contains $0$ and is closed under addition and multiplication. That is, $0 \in s$, and for all $x, y \in s$, both $x + y \in s$ and $x * y \in s$.
NonUnitalSubsemiring.instNonUnitalSubsemiringClass instance
: NonUnitalSubsemiringClass (NonUnitalSubsemiring R) R
Full source
instance : NonUnitalSubsemiringClass (NonUnitalSubsemiring R) R where
  zero_mem {s} := AddSubmonoid.zero_mem' s.toAddSubmonoid
  add_mem {s} := AddSubsemigroup.add_mem' s.toAddSubmonoid.toAddSubsemigroup
  mul_mem {s} := mul_mem' s
Non-unital Subsemirings as a NonUnitalSubsemiringClass
Informal description
For any non-unital non-associative semiring $R$, the type of non-unital subsemirings of $R$ forms a `NonUnitalSubsemiringClass`. This means that every non-unital subsemiring of $R$ is both an additive submonoid and a multiplicative subsemigroup of $R$.
NonUnitalSubsemiring.mem_carrier theorem
{s : NonUnitalSubsemiring R} {x : R} : x ∈ s.carrier ↔ x ∈ s
Full source
theorem mem_carrier {s : NonUnitalSubsemiring R} {x : R} : x ∈ s.carrierx ∈ s.carrier ↔ x ∈ s :=
  Iff.rfl
Membership in Non-unital Subsemiring Carrier Set
Informal description
For any non-unital subsemiring $s$ of a non-unital non-associative semiring $R$ and any element $x \in R$, the element $x$ belongs to the underlying set (carrier) of $s$ if and only if $x$ is a member of $s$ as a subsemiring. In other words, $x \in s.\text{carrier} \leftrightarrow x \in s$.
NonUnitalSubsemiring.ext theorem
{S T : NonUnitalSubsemiring R} (h : ∀ x, x ∈ S ↔ x ∈ T) : S = T
Full source
/-- Two non-unital subsemirings are equal if they have the same elements. -/
@[ext]
theorem ext {S T : NonUnitalSubsemiring R} (h : ∀ x, x ∈ Sx ∈ S ↔ x ∈ T) : S = T :=
  SetLike.ext h
Extensionality of Non-unital Subsemirings: $S = T \iff \forall x, x \in S \leftrightarrow x \in T$
Informal description
Two non-unital subsemirings $S$ and $T$ of a non-unital semiring $R$ are equal if and only if they contain the same elements, i.e., for all $x \in R$, $x \in S \leftrightarrow x \in T$ implies $S = T$.
NonUnitalSubsemiring.copy definition
(S : NonUnitalSubsemiring R) (s : Set R) (hs : s = ↑S) : NonUnitalSubsemiring R
Full source
/-- Copy of a non-unital subsemiring with a new `carrier` equal to the old one. Useful to fix
definitional equalities. -/
protected def copy (S : NonUnitalSubsemiring R) (s : Set R) (hs : s = ↑S) :
    NonUnitalSubsemiring R :=
  { S.toAddSubmonoid.copy s hs, S.toSubsemigroup.copy s hs with carrier := s }
Copy of a non-unital subsemiring with a specified carrier set
Informal description
Given a non-unital subsemiring $S$ of a non-unital non-associative semiring $R$ and a subset $s$ of $R$ that is equal to the underlying set of $S$, the function `NonUnitalSubsemiring.copy` constructs a new non-unital subsemiring with carrier set $s$. This is useful for fixing definitional equalities while maintaining the same algebraic structure as $S$.
NonUnitalSubsemiring.coe_copy theorem
(S : NonUnitalSubsemiring R) (s : Set R) (hs : s = ↑S) : (S.copy s hs : Set R) = s
Full source
@[simp]
theorem coe_copy (S : NonUnitalSubsemiring R) (s : Set R) (hs : s = ↑S) :
    (S.copy s hs : Set R) = s :=
  rfl
Underlying Set Equality for Copied Non-unital Subsemiring
Informal description
For any non-unital subsemiring $S$ of a non-unital non-associative semiring $R$, and any subset $s$ of $R$ such that $s$ equals the underlying set of $S$, the underlying set of the copied subsemiring $S.copy\ s\ hs$ is equal to $s$.
NonUnitalSubsemiring.copy_eq theorem
(S : NonUnitalSubsemiring R) (s : Set R) (hs : s = ↑S) : S.copy s hs = S
Full source
theorem copy_eq (S : NonUnitalSubsemiring R) (s : Set R) (hs : s = ↑S) : S.copy s hs = S :=
  SetLike.coe_injective hs
Equality of Non-unital Subsemiring Copy with Original
Informal description
For any non-unital subsemiring $S$ of a non-unital non-associative semiring $R$ and any subset $s$ of $R$ such that $s$ equals the underlying set of $S$, the copy of $S$ with carrier set $s$ is equal to $S$ itself.
NonUnitalSubsemiring.toSubsemigroup_injective theorem
: Function.Injective (toSubsemigroup : NonUnitalSubsemiring R → Subsemigroup R)
Full source
theorem toSubsemigroup_injective :
    Function.Injective (toSubsemigroup : NonUnitalSubsemiring R → Subsemigroup R)
  | _, _, h => ext (SetLike.ext_iff.mp h :)
Injectivity of the Subsemigroup Projection for Non-unital Subsemirings
Informal description
The function that maps a non-unital subsemiring $S$ of a non-unital semiring $R$ to its underlying multiplicative subsemigroup is injective. In other words, if two non-unital subsemirings $S$ and $T$ have the same underlying multiplicative subsemigroup, then $S = T$.
NonUnitalSubsemiring.toAddSubmonoid_injective theorem
: Function.Injective (toAddSubmonoid : NonUnitalSubsemiring R → AddSubmonoid R)
Full source
theorem toAddSubmonoid_injective :
    Function.Injective (toAddSubmonoid : NonUnitalSubsemiring R → AddSubmonoid R)
  | _, _, h => ext (SetLike.ext_iff.mp h :)
Injectivity of the Additive Submonoid Projection for Non-unital Subsemirings
Informal description
The function that maps a non-unital subsemiring of a non-unital semiring $R$ to its underlying additive submonoid is injective. That is, for any two non-unital subsemirings $S$ and $T$ of $R$, if their underlying additive submonoids are equal, then $S = T$.
NonUnitalSubsemiring.mk' definition
(s : Set R) (sg : Subsemigroup R) (hg : ↑sg = s) (sa : AddSubmonoid R) (ha : ↑sa = s) : NonUnitalSubsemiring R
Full source
/-- Construct a `NonUnitalSubsemiring R` from a set `s`, a subsemigroup `sg`, and an additive
submonoid `sa` such that `x ∈ s ↔ x ∈ sg ↔ x ∈ sa`. -/
protected def mk' (s : Set R) (sg : Subsemigroup R) (hg : ↑sg = s) (sa : AddSubmonoid R)
    (ha : ↑sa = s) : NonUnitalSubsemiring R where
  carrier := s
  zero_mem' := by subst ha; exact sa.zero_mem
  add_mem' := by subst ha; exact sa.add_mem
  mul_mem' := by subst hg; exact sg.mul_mem
Construction of a non-unital subsemiring from matching subsemigroup and additive submonoid
Informal description
Given a set $s$ in a non-unital non-associative semiring $R$, a subsemigroup $sg$ of $R$ with carrier equal to $s$, and an additive submonoid $sa$ of $R$ with carrier equal to $s$, the function `NonUnitalSubsemiring.mk'` constructs a non-unital subsemiring of $R$ with carrier $s$, where the additive and multiplicative structures are inherited from $sa$ and $sg$ respectively.
NonUnitalSubsemiring.coe_mk' theorem
{s : Set R} {sg : Subsemigroup R} (hg : ↑sg = s) {sa : AddSubmonoid R} (ha : ↑sa = s) : (NonUnitalSubsemiring.mk' s sg hg sa ha : Set R) = s
Full source
@[simp]
theorem coe_mk' {s : Set R} {sg : Subsemigroup R} (hg : ↑sg = s) {sa : AddSubmonoid R}
    (ha : ↑sa = s) : (NonUnitalSubsemiring.mk' s sg hg sa ha : Set R) = s :=
  rfl
Underlying Set of Constructed Non-unital Subsemiring Equals Input Set
Informal description
Given a set $s$ in a non-unital non-associative semiring $R$, a subsemigroup $sg$ of $R$ with carrier equal to $s$, and an additive submonoid $sa$ of $R$ with carrier equal to $s$, the underlying set of the non-unital subsemiring constructed via `NonUnitalSubsemiring.mk'` is equal to $s$. In other words, if $sg$ and $sa$ are structures on $R$ with carrier set $s$, then the subsemiring formed by combining these structures has $s$ as its underlying set.
NonUnitalSubsemiring.mem_mk' theorem
{s : Set R} {sg : Subsemigroup R} (hg : ↑sg = s) {sa : AddSubmonoid R} (ha : ↑sa = s) {x : R} : x ∈ NonUnitalSubsemiring.mk' s sg hg sa ha ↔ x ∈ s
Full source
@[simp]
theorem mem_mk' {s : Set R} {sg : Subsemigroup R} (hg : ↑sg = s) {sa : AddSubmonoid R}
    (ha : ↑sa = s) {x : R} : x ∈ NonUnitalSubsemiring.mk' s sg hg sa hax ∈ NonUnitalSubsemiring.mk' s sg hg sa ha ↔ x ∈ s :=
  Iff.rfl
Membership in Constructed Non-unital Subsemiring
Informal description
Let $R$ be a non-unital non-associative semiring, $s$ a subset of $R$, $sg$ a subsemigroup of $R$ with carrier set $s$, and $sa$ an additive submonoid of $R$ with carrier set $s$. For any element $x \in R$, we have $x$ belongs to the non-unital subsemiring constructed from $s$, $sg$, and $sa$ if and only if $x \in s$.
NonUnitalSubsemiring.mk'_toSubsemigroup theorem
{s : Set R} {sg : Subsemigroup R} (hg : ↑sg = s) {sa : AddSubmonoid R} (ha : ↑sa = s) : (NonUnitalSubsemiring.mk' s sg hg sa ha).toSubsemigroup = sg
Full source
@[simp]
theorem mk'_toSubsemigroup {s : Set R} {sg : Subsemigroup R} (hg : ↑sg = s) {sa : AddSubmonoid R}
    (ha : ↑sa = s) : (NonUnitalSubsemiring.mk' s sg hg sa ha).toSubsemigroup = sg :=
  SetLike.coe_injective hg.symm
Subsemigroup Component of Constructed Non-Unital Subsemiring
Informal description
Given a set $s$ in a non-unital non-associative semiring $R$, a subsemigroup $sg$ of $R$ with carrier equal to $s$, and an additive submonoid $sa$ of $R$ with carrier equal to $s$, the subsemigroup component of the non-unital subsemiring constructed via `NonUnitalSubsemiring.mk'` is equal to $sg$.
NonUnitalSubsemiring.mk'_toAddSubmonoid theorem
{s : Set R} {sg : Subsemigroup R} (hg : ↑sg = s) {sa : AddSubmonoid R} (ha : ↑sa = s) : (NonUnitalSubsemiring.mk' s sg hg sa ha).toAddSubmonoid = sa
Full source
@[simp]
theorem mk'_toAddSubmonoid {s : Set R} {sg : Subsemigroup R} (hg : ↑sg = s) {sa : AddSubmonoid R}
    (ha : ↑sa = s) : (NonUnitalSubsemiring.mk' s sg hg sa ha).toAddSubmonoid = sa :=
  SetLike.coe_injective ha.symm
Additive Submonoid Component of Constructed Non-Unital Subsemiring
Informal description
Given a set $s$ in a non-unital non-associative semiring $R$, a subsemigroup $sg$ of $R$ with carrier equal to $s$, and an additive submonoid $sa$ of $R$ with carrier equal to $s$, the additive submonoid component of the non-unital subsemiring constructed via `NonUnitalSubsemiring.mk'` is equal to $sa$.
NonUnitalSubsemiring.coe_zero theorem
: ((0 : s) : R) = (0 : R)
Full source
@[simp, norm_cast]
theorem coe_zero : ((0 : s) : R) = (0 : R) :=
  rfl
Zero Element Preservation in Non-Unital Subsemirings
Informal description
For any non-unital subsemiring $s$ of a non-unital non-associative semiring $R$, the zero element of $s$ (when viewed as an element of $R$) is equal to the zero element of $R$, i.e., $(0 : s) = (0 : R)$.
NonUnitalSubsemiring.coe_add theorem
(x y : s) : ((x + y : s) : R) = (x + y : R)
Full source
@[simp, norm_cast]
theorem coe_add (x y : s) : ((x + y : s) : R) = (x + y : R) :=
  rfl
Canonical Inclusion Preserves Addition in Non-unital Subsemirings
Informal description
For any elements $x$ and $y$ in a non-unital subsemiring $s$ of a non-unital non-associative semiring $R$, the image of their sum under the canonical inclusion map from $s$ to $R$ is equal to the sum of their images, i.e., $(x + y : s) = (x + y : R)$.
NonUnitalSubsemiring.coe_mul theorem
(x y : s) : ((x * y : s) : R) = (x * y : R)
Full source
@[simp, norm_cast]
theorem coe_mul (x y : s) : ((x * y : s) : R) = (x * y : R) :=
  rfl
Multiplication in Non-unital Subsemiring Coincides with Parent Ring
Informal description
For any elements $x$ and $y$ in a non-unital subsemiring $s$ of a non-unital non-associative semiring $R$, the multiplication of $x$ and $y$ in $s$ (denoted as $x * y : s$) coincides with their multiplication in $R$ (denoted as $x * y : R$). In other words, the inclusion map from $s$ to $R$ preserves multiplication.
NonUnitalSubsemiring.mem_toSubsemigroup theorem
{s : NonUnitalSubsemiring R} {x : R} : x ∈ s.toSubsemigroup ↔ x ∈ s
Full source
@[simp high]
theorem mem_toSubsemigroup {s : NonUnitalSubsemiring R} {x : R} : x ∈ s.toSubsemigroupx ∈ s.toSubsemigroup ↔ x ∈ s :=
  Iff.rfl
Membership in Multiplicative Subsemigroup of Non-Unital Subsemiring
Informal description
For any non-unital subsemiring $s$ of a non-unital semiring $R$ and any element $x \in R$, we have $x \in s.\text{toSubsemigroup}$ if and only if $x \in s$.
NonUnitalSubsemiring.coe_toSubsemigroup theorem
(s : NonUnitalSubsemiring R) : (s.toSubsemigroup : Set R) = s
Full source
@[simp high]
theorem coe_toSubsemigroup (s : NonUnitalSubsemiring R) : (s.toSubsemigroup : Set R) = s :=
  rfl
Equality of Non-Unital Subsemiring and its Multiplicative Subsemigroup Carrier Set
Informal description
For any non-unital subsemiring $s$ of a non-unital semiring $R$, the underlying set of the multiplicative subsemigroup associated with $s$ is equal to $s$ itself, i.e., $(s.\text{toSubsemigroup} : \text{Set } R) = s$.
NonUnitalSubsemiring.mem_toAddSubmonoid theorem
{s : NonUnitalSubsemiring R} {x : R} : x ∈ s.toAddSubmonoid ↔ x ∈ s
Full source
@[simp]
theorem mem_toAddSubmonoid {s : NonUnitalSubsemiring R} {x : R} : x ∈ s.toAddSubmonoidx ∈ s.toAddSubmonoid ↔ x ∈ s :=
  Iff.rfl
Membership in Additive Submonoid of Non-Unital Subsemiring
Informal description
For any non-unital subsemiring $s$ of a non-unital semiring $R$ and any element $x \in R$, we have $x \in s.\text{toAddSubmonoid}$ if and only if $x \in s$.
NonUnitalSubsemiring.coe_toAddSubmonoid theorem
(s : NonUnitalSubsemiring R) : (s.toAddSubmonoid : Set R) = s
Full source
@[simp]
theorem coe_toAddSubmonoid (s : NonUnitalSubsemiring R) : (s.toAddSubmonoid : Set R) = s :=
  rfl
Equality of Non-Unital Subsemiring and its Additive Submonoid Carrier Set
Informal description
For any non-unital subsemiring $s$ of a non-unital semiring $R$, the underlying set of the additive submonoid associated with $s$ is equal to $s$ itself, i.e., $(s.\text{toAddSubmonoid} : \text{Set } R) = s$.
NonUnitalSubsemiring.instTop instance
: Top (NonUnitalSubsemiring R)
Full source
/-- The non-unital subsemiring `R` of the non-unital semiring `R`. -/
instance : Top (NonUnitalSubsemiring R) :=
  ⟨{ (⊤ : Subsemigroup R), (⊤ : AddSubmonoid R) with }⟩
The Whole Semiring as a Non-Unital Subsemiring
Informal description
For any non-unital semiring $R$, the entire semiring $R$ itself forms a non-unital subsemiring, which is the top element in the lattice of non-unital subsemirings of $R$.
NonUnitalSubsemiring.mem_top theorem
(x : R) : x ∈ (⊤ : NonUnitalSubsemiring R)
Full source
@[simp]
theorem mem_top (x : R) : x ∈ (⊤ : NonUnitalSubsemiring R) :=
  Set.mem_univ x
Membership in the Top Non-Unital Subsemiring is Universal
Informal description
For any element $x$ in a non-unital semiring $R$, $x$ belongs to the top non-unital subsemiring of $R$ (which is $R$ itself).
NonUnitalSubsemiring.coe_top theorem
: ((⊤ : NonUnitalSubsemiring R) : Set R) = Set.univ
Full source
@[simp]
theorem coe_top : (( : NonUnitalSubsemiring R) : Set R) = Set.univ :=
  rfl
Top Non-unital Subsemiring Equals Universal Set
Informal description
The underlying set of the top non-unital subsemiring of a non-unital semiring $R$ is equal to the universal set of $R$, i.e., $(\top : \text{NonUnitalSubsemiring } R) = \text{Set.univ}$.
NonUnitalSubsemiring.instBot instance
: Bot (NonUnitalSubsemiring R)
Full source
instance : Bot (NonUnitalSubsemiring R) :=
  ⟨{  carrier := {0}
      add_mem' := fun _ _ => by simp_all
      zero_mem' := Set.mem_singleton 0
      mul_mem' := fun _ _ => by simp_all }⟩
Bottom Non-unital Subsemiring is the Zero Subsemiring
Informal description
For any non-unital semiring $R$, the collection of non-unital subsemirings of $R$ has a bottom element, which is the subsemiring consisting of only the zero element $\{0\}$.
NonUnitalSubsemiring.instInhabited instance
: Inhabited (NonUnitalSubsemiring R)
Full source
instance : Inhabited (NonUnitalSubsemiring R) :=
  ⟨⊥⟩
Non-unital Subsemirings are Inhabited
Informal description
For any non-unital semiring $R$, the collection of non-unital subsemirings of $R$ is inhabited.
NonUnitalSubsemiring.coe_bot theorem
: ((⊥ : NonUnitalSubsemiring R) : Set R) = {0}
Full source
theorem coe_bot : (( : NonUnitalSubsemiring R) : Set R) = {0} :=
  rfl
Bottom Non-unital Subsemiring as Singleton Zero Set
Informal description
The underlying set of the bottom non-unital subsemiring of a non-unital semiring $R$ is the singleton set $\{0\}$.
NonUnitalSubsemiring.instMin instance
: Min (NonUnitalSubsemiring R)
Full source
/-- The inf of two non-unital subsemirings is their intersection. -/
instance : Min (NonUnitalSubsemiring R) :=
  ⟨fun s t =>
    { s.toSubsemigroup ⊓ t.toSubsemigroup, s.toAddSubmonoid ⊓ t.toAddSubmonoid with
      carrier := s ∩ t }⟩
Intersection as Minimal Non-unital Subsemiring
Informal description
For any non-unital semiring $R$, the collection of non-unital subsemirings of $R$ has a minimal element with respect to inclusion, which is the intersection of two subsemirings.
NonUnitalSubsemiring.coe_inf theorem
(p p' : NonUnitalSubsemiring R) : ((p ⊓ p' : NonUnitalSubsemiring R) : Set R) = (p : Set R) ∩ p'
Full source
@[simp]
theorem coe_inf (p p' : NonUnitalSubsemiring R) :
    ((p ⊓ p' : NonUnitalSubsemiring R) : Set R) = (p : Set R) ∩ p' :=
  rfl
Infimum of Non-unital Subsemirings as Set Intersection
Informal description
For any two non-unital subsemirings $p$ and $p'$ of a non-unital semiring $R$, the underlying set of their infimum $p \sqcap p'$ (as non-unital subsemirings) is equal to the intersection $p \cap p'$ of their underlying sets.
NonUnitalSubsemiring.mem_inf theorem
{p p' : NonUnitalSubsemiring R} {x : R} : x ∈ p ⊓ p' ↔ x ∈ p ∧ x ∈ p'
Full source
@[simp]
theorem mem_inf {p p' : NonUnitalSubsemiring R} {x : R} : x ∈ p ⊓ p'x ∈ p ⊓ p' ↔ x ∈ p ∧ x ∈ p' :=
  Iff.rfl
Membership in Intersection of Non-unital Subsemirings
Informal description
For any non-unital subsemirings $p$ and $p'$ of a non-unital semiring $R$, and any element $x \in R$, we have $x \in p \sqcap p'$ if and only if $x \in p$ and $x \in p'$.
NonUnitalRingHom.codRestrict definition
(f : F) (s : S') (h : ∀ x, f x ∈ s) : R →ₙ+* s
Full source
/-- Restriction of a non-unital ring homomorphism to a non-unital subsemiring of the codomain. -/
def codRestrict (f : F) (s : S') (h : ∀ x, f x ∈ s) : R →ₙ+* s where
  toFun n := ⟨f n, h n⟩
  map_mul' x y := Subtype.eq (map_mul f x y)
  map_add' x y := Subtype.eq (map_add f x y)
  map_zero' := Subtype.eq (map_zero f)
Codomain restriction of a non-unital ring homomorphism to a subsemiring
Informal description
Given a non-unital ring homomorphism $f : R \to S$ and a non-unital subsemiring $s$ of $S$ such that for every $x \in R$, $f(x) \in s$, the function `codRestrict` returns the restricted homomorphism $R \to s$ where each element $x \in R$ is mapped to $\langle f(x), h(x) \rangle \in s$, with $h(x)$ being the proof that $f(x) \in s$. This restricted homomorphism preserves multiplication and addition, and maps zero to zero.
NonUnitalRingHom.eqSlocus definition
(f g : F) : NonUnitalSubsemiring R
Full source
/-- The non-unital subsemiring of elements `x : R` such that `f x = g x` -/
def eqSlocus (f g : F) : NonUnitalSubsemiring R :=
  { (f : R →ₙ* S).eqLocus (g : R →ₙ* S), (f : R →+ S).eqLocusM g with
    carrier := { x | f x = g x } }
Equalizer subsemiring of non-unital ring homomorphisms
Informal description
Given two non-unital ring homomorphisms $f$ and $g$ from $R$ to $S$, the non-unital subsemiring $\text{eqSlocus}(f, g)$ consists of all elements $x \in R$ such that $f(x) = g(x)$. This subsemiring is formed by taking the intersection of the multiplicative equalizer (elements where $f$ and $g$ agree multiplicatively) and the additive equalizer (elements where $f$ and $g$ agree additively).
NonUnitalSubsemiring.inclusion definition
{S T : NonUnitalSubsemiring R} (h : S ≤ T) : S →ₙ+* T
Full source
/-- The non-unital ring homomorphism associated to an inclusion of
non-unital subsemirings. -/
def inclusion {S T : NonUnitalSubsemiring R} (h : S ≤ T) : S →ₙ+* T :=
  codRestrict (subtype S) _ fun x => h x.2
Inclusion homomorphism between non-unital subsemirings
Informal description
Given two non-unital subsemirings \( S \) and \( T \) of a non-unital semiring \( R \) such that \( S \) is contained in \( T \) (i.e., \( S \leq T \)), the function `inclusion` returns the non-unital ring homomorphism from \( S \) to \( T \) that maps each element \( x \in S \) to its corresponding element in \( T \). This homomorphism preserves addition and multiplication.