doc-next-gen

Mathlib.Algebra.Ring.Subsemiring.Defs

Module docstring

{"# Bundled subsemirings

We define bundled subsemirings and some standard constructions: subtype and inclusion ring homomorphisms. "}

AddSubmonoidWithOneClass structure
(S : Type*) (R : outParam Type*) [AddMonoidWithOne R] [SetLike S R] : Prop extends AddSubmonoidClass S R, OneMemClass S R
Full source
/-- `AddSubmonoidWithOneClass S R` says `S` is a type of subsets `s ≤ R` that contain `0`, `1`,
and are closed under `(+)` -/
class AddSubmonoidWithOneClass (S : Type*) (R : outParam Type*) [AddMonoidWithOne R]
  [SetLike S R] : Prop extends AddSubmonoidClass S R, OneMemClass S R
Additive Submonoid with One Class
Informal description
A structure `AddSubmonoidWithOneClass S R` asserts that `S` is a type of subsets of an additive monoid with one `R` that contain the elements `0` and `1`, and are closed under addition. More formally, for a type `S` and an additive monoid with one `R`, if `S` is equipped with a `SetLike` instance (allowing elements of `S` to be viewed as subsets of `R`), then `AddSubmonoidWithOneClass S R` means that: 1. Every subset `s : S` contains `0` and `1`. 2. Every subset `s : S` is closed under addition (i.e., if `x, y ∈ s`, then `x + y ∈ s`). 3. The canonical inclusion of natural numbers into `R` maps every natural number `n` into every subset `s : S` (i.e., `(n : R) ∈ s` for all `n : ℕ`). This structure is used to model subsets of `R` that are additive submonoids containing `0` and `1`.
natCast_mem theorem
[AddSubmonoidWithOneClass S R] (n : ℕ) : (n : R) ∈ s
Full source
@[aesop safe apply (rule_sets := [SetLike])]
theorem natCast_mem [AddSubmonoidWithOneClass S R] (n : ) : (n : R) ∈ s := by
  induction n <;> simp [zero_mem, add_mem, one_mem, *]
Canonical Homomorphism Maps Natural Numbers into Additive Submonoid with One
Informal description
For any additive submonoid with one $S$ of an additive monoid with one $R$, and for any natural number $n$, the canonical homomorphism $\mathbb{N} \to R$ maps $n$ into $S$, i.e., $(n : R) \in S$.
ofNat_mem theorem
[AddSubmonoidWithOneClass S R] (s : S) (n : ℕ) [n.AtLeastTwo] : ofNat(n) ∈ s
Full source
@[aesop safe apply (rule_sets := [SetLike])]
lemma ofNat_mem [AddSubmonoidWithOneClass S R] (s : S) (n : ) [n.AtLeastTwo] :
    ofNat(n)ofNat(n) ∈ s := by
  rw [← Nat.cast_ofNat]; exact natCast_mem s n
Inclusion of Numerals $\geq 2$ in Additive Submonoid with One
Informal description
Let $R$ be an additive monoid with one, and let $S$ be an additive submonoid with one of $R$. For any natural number $n \geq 2$, the element $n$ (interpreted in $R$) belongs to $S$.
AddSubmonoidWithOneClass.toAddMonoidWithOne instance
[AddSubmonoidWithOneClass S R] : AddMonoidWithOne s
Full source
instance (priority := 74) AddSubmonoidWithOneClass.toAddMonoidWithOne
    [AddSubmonoidWithOneClass S R] : AddMonoidWithOne s :=
  { AddSubmonoidClass.toAddMonoid s with
    one := ⟨_, one_mem s⟩
    natCast := fun n => ⟨n, natCast_mem s n⟩
    natCast_zero := Subtype.ext Nat.cast_zero
    natCast_succ := fun _ => Subtype.ext (Nat.cast_succ _) }
Additive Submonoid with One Inherits Additive Monoid with One Structure
Informal description
For any additive submonoid with one $S$ of an additive monoid with one $R$, the subset $S$ inherits an additive monoid with one structure from $R$.
SubsemiringClass structure
(S : Type*) (R : outParam (Type u)) [NonAssocSemiring R] [SetLike S R] : Prop extends SubmonoidClass S R, AddSubmonoidClass S R
Full source
/-- `SubsemiringClass S R` states that `S` is a type of subsets `s ⊆ R` that
are both a multiplicative and an additive submonoid. -/
class SubsemiringClass (S : Type*) (R : outParam (Type u)) [NonAssocSemiring R]
  [SetLike S R] : Prop extends SubmonoidClass S R, AddSubmonoidClass S R
Subsemiring Class
Informal description
A `SubsemiringClass S R` is a type of subsets `s ⊆ R` of a non-associative semiring `R` that are both a multiplicative submonoid and an additive submonoid. This means that: 1. The subset `s` is closed under multiplication and contains the multiplicative identity (1) 2. The subset `s` is closed under addition and contains the additive identity (0) The structure extends both `SubmonoidClass` (for multiplicative properties) and `AddSubmonoidClass` (for additive properties).
SubsemiringClass.addSubmonoidWithOneClass instance
(S : Type*) (R : Type u) {_ : NonAssocSemiring R} [SetLike S R] [h : SubsemiringClass S R] : AddSubmonoidWithOneClass S R
Full source
instance (priority := 100) SubsemiringClass.addSubmonoidWithOneClass (S : Type*)
    (R : Type u) {_ : NonAssocSemiring R} [SetLike S R] [h : SubsemiringClass S R] :
    AddSubmonoidWithOneClass S R :=
  { h with }
Subsemirings as Additive Submonoids with One
Informal description
For any type `S` representing subsets of a non-associative semiring `R`, if `S` has a `SetLike` instance and satisfies the `SubsemiringClass` conditions (i.e., each subset in `S` is both a multiplicative submonoid and an additive submonoid), then `S` also satisfies the `AddSubmonoidWithOneClass` conditions (i.e., each subset contains `0` and `1` and is closed under addition). In other words, every subsemiring of a non-associative semiring is naturally an additive submonoid with one.
SubsemiringClass.nonUnitalSubsemiringClass instance
(S : Type*) (R : Type u) [NonAssocSemiring R] [SetLike S R] [SubsemiringClass S R] : NonUnitalSubsemiringClass S R
Full source
instance (priority := 100) SubsemiringClass.nonUnitalSubsemiringClass (S : Type*)
    (R : Type u) [NonAssocSemiring R] [SetLike S R] [SubsemiringClass S R] :
    NonUnitalSubsemiringClass S R where
  mul_mem := mul_mem
Subsemirings are Non-Unital Subsemirings
Informal description
For any non-associative semiring $R$ and any subset $S \subseteq R$ that forms a subsemiring (i.e., closed under addition, multiplication, and contains both additive and multiplicative identities), $S$ also forms a non-unital subsemiring of $R$.
SubsemiringClass.toNonAssocSemiring instance
: NonAssocSemiring s
Full source
/-- A subsemiring of a `NonAssocSemiring` inherits a `NonAssocSemiring` structure -/
instance (priority := 75) toNonAssocSemiring : NonAssocSemiring s := fast_instance%
  Subtype.coe_injective.nonAssocSemiring Subtype.val rfl rfl (fun _ _ => rfl) (fun _ _ => rfl)
    (fun _ _ => rfl) fun _ => rfl
Non-associative Semiring Structure on Subsemirings
Informal description
For any subsemiring $s$ of a non-associative semiring $R$, the subset $s$ inherits a non-associative semiring structure from $R$. This means $s$ is equipped with addition and multiplication operations that are closed within $s$, and satisfy the axioms of a non-associative semiring (including distributivity and the existence of additive and multiplicative identities).
SubsemiringClass.nontrivial instance
[Nontrivial R] : Nontrivial s
Full source
instance nontrivial [Nontrivial R] : Nontrivial s :=
  nontrivial_of_ne 0 1 fun H => zero_ne_one (congr_arg Subtype.val H)
Nontriviality of Subsemirings in Nontrivial Semirings
Informal description
For any subsemiring $s$ of a nontrivial non-associative semiring $R$, the subsemiring $s$ is also nontrivial.
SubsemiringClass.subtype definition
: s →+* R
Full source
/-- The natural ring hom from a subsemiring of semiring `R` to `R`. -/
def subtype : s →+* R :=
  { SubmonoidClass.subtype s, AddSubmonoidClass.subtype s with toFun := (↑) }
Inclusion homomorphism of a subsemiring
Informal description
The natural inclusion homomorphism from a subsemiring $s$ of a semiring $R$ to $R$, which maps each element of $s$ to itself in $R$. This homomorphism preserves both the additive and multiplicative structures, including the additive identity (0), multiplicative identity (1), addition, and multiplication.
SubsemiringClass.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 Subsemirings
Informal description
The inclusion homomorphism from a subsemiring $s$ of a semiring $R$ to $R$ coincides with the coercion map from $s$ to $R$, i.e., $\text{subtype}_s = (\uparrow) : s \to R$.
SubsemiringClass.subtype_apply theorem
(x : s) : SubsemiringClass.subtype s x = x
Full source
@[simp]
lemma subtype_apply (x : s) :
    SubsemiringClass.subtype s x = x := rfl
Inclusion Homomorphism Acts as Identity on Subsemiring Elements
Informal description
For any element $x$ in a subsemiring $s$ of a non-associative semiring $R$, the inclusion homomorphism $\text{subtype}_s$ maps $x$ to itself when viewed as an element of $R$, i.e., $\text{subtype}_s(x) = x$.
SubsemiringClass.subtype_injective theorem
: Function.Injective (SubsemiringClass.subtype s)
Full source
lemma subtype_injective :
    Function.Injective (SubsemiringClass.subtype s) := fun _ ↦ by
  simp
Injectivity of the Subsemiring Inclusion Homomorphism
Informal description
The inclusion homomorphism from a subsemiring $s$ of a non-associative semiring $R$ to $R$ is injective. That is, for any $x, y \in s$, if $\text{subtype}(x) = \text{subtype}(y)$ in $R$, then $x = y$ in $s$.
SubsemiringClass.toSemiring instance
{R} [Semiring R] [SetLike S R] [SubsemiringClass S R] : Semiring s
Full source
/-- A subsemiring of a `Semiring` is a `Semiring`. -/
instance (priority := 75) toSemiring {R} [Semiring R] [SetLike S R] [SubsemiringClass S R] :
    Semiring s := fast_instance%
  Subtype.coe_injective.semiring Subtype.val rfl rfl (fun _ _ => rfl) (fun _ _ => rfl)
    (fun _ _ => rfl) (fun _ _ => rfl) fun _ => rfl
Semiring Structure on Subsemirings
Informal description
For any subsemiring $s$ of a semiring $R$, the subset $s$ inherits a semiring structure from $R$. This means $s$ is equipped with addition and multiplication operations that are closed within $s$, and satisfy the axioms of a semiring (including associativity, distributivity, and the existence of additive and multiplicative identities).
SubsemiringClass.coe_pow theorem
{R} [Monoid R] [SetLike S R] [SubmonoidClass S R] (x : s) (n : ℕ) : ((x ^ n : s) : R) = (x : R) ^ n
Full source
@[simp, norm_cast]
theorem coe_pow {R} [Monoid R] [SetLike S R] [SubmonoidClass S R] (x : s) (n : ) :
    ((x ^ n : s) : R) = (x : R) ^ n := by
  induction n with
  | zero => simp
  | succ n ih => simp [pow_succ, ih]
Power Coercion Equality in Submonoids: $(x^n)_S = x_R^n$
Informal description
Let $R$ be a monoid and $S$ a set-like structure on $R$ that forms a submonoid. For any element $x \in S$ and natural number $n$, the $n$-th power of $x$ in $S$ (when coerced back to $R$) equals the $n$-th power of $x$ in $R$, i.e., $(x^n)_S = x_R^n$.
SubsemiringClass.toCommSemiring instance
{R} [CommSemiring R] [SetLike S R] [SubsemiringClass S R] : CommSemiring s
Full source
/-- A subsemiring of a `CommSemiring` is a `CommSemiring`. -/
instance toCommSemiring {R} [CommSemiring R] [SetLike S R] [SubsemiringClass S R] :
    CommSemiring s := fast_instance%
  Subtype.coe_injective.commSemiring Subtype.val rfl rfl (fun _ _ => rfl) (fun _ _ => rfl)
    (fun _ _ => rfl) (fun _ _ => rfl) fun _ => rfl
Commutative Semiring Structure on Subsemirings
Informal description
For any subsemiring $s$ of a commutative semiring $R$, the subset $s$ inherits a commutative semiring structure from $R$. This means $s$ is equipped with addition and multiplication operations that are closed within $s$, and satisfy the axioms of a commutative semiring (including commutativity of multiplication, associativity, distributivity, and the existence of additive and multiplicative identities).
Subsemiring structure
(R : Type u) [NonAssocSemiring R] extends Submonoid R, AddSubmonoid R
Full source
/-- A subsemiring of a semiring `R` is a subset `s` that is both a multiplicative and an additive
submonoid. -/
structure Subsemiring (R : Type u) [NonAssocSemiring R] extends Submonoid R, AddSubmonoid R
Subsemiring of a semiring
Informal description
A subsemiring of a semiring $R$ is a subset $s \subseteq R$ that is closed under both addition and multiplication, contains the additive and multiplicative identities (0 and 1), and forms a semiring under the operations inherited from $R$.
Subsemiring.instSetLike instance
: SetLike (Subsemiring R) R
Full source
instance : SetLike (Subsemiring 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 Subsemirings
Informal description
For any non-associative semiring $R$, the type of subsemirings of $R$ has a set-like structure, where each subsemiring can be viewed as a subset of $R$ with the appropriate closure properties.
Subsemiring.ofClass definition
{S R : Type*} [NonAssocSemiring R] [SetLike S R] [SubsemiringClass S R] (s : S) : Subsemiring R
Full source
/-- The actual `Subsemiring` obtained from an element of a `SubsemiringClass`. -/
@[simps]
def ofClass {S R : Type*} [NonAssocSemiring R] [SetLike S R] [SubsemiringClass S R]
    (s : S) : Subsemiring R where
  carrier := s
  add_mem' := add_mem
  zero_mem' := zero_mem _
  mul_mem' := mul_mem
  one_mem' := one_mem _
Construction of a subsemiring from a subsemiring class element
Informal description
Given a non-associative semiring $R$ and a type $S$ with a `SetLike` instance for $R$ that satisfies the `SubsemiringClass` conditions, the function `Subsemiring.ofClass` constructs a `Subsemiring R` from an element $s : S$. The carrier set of the resulting subsemiring is $s$ itself, and it inherits the additive and multiplicative closure properties from the `SubsemiringClass` structure.
Subsemiring.instCanLiftSetCoeAndMemOfNatForallForallForallForallHAddForallForallForallForallHMul instance
: CanLift (Set R) (Subsemiring R) (↑) (fun s ↦ 0 ∈ s ∧ (∀ {x y}, x ∈ s → y ∈ s → x + y ∈ s) ∧ 1 ∈ s ∧ ∀ {x y}, x ∈ s → y ∈ s → x * y ∈ s)
Full source
instance (priority := 100) : CanLift (Set R) (Subsemiring R) (↑)
    (fun s ↦ 0 ∈ s0 ∈ s ∧ (∀ {x y}, x ∈ s → y ∈ s → x + y ∈ s) ∧ 1 ∈ 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
        one_mem' := h.2.2.1
        mul_mem' := h.2.2.2 },
      rfl ⟩
Lifting Condition for Subsemirings
Informal description
For any non-associative semiring $R$, a subset $s$ of $R$ can be lifted to a subsemiring if and only if $s$ contains $0$ and $1$, and is closed under addition and multiplication. That is, $s$ must satisfy: - $0 \in s$ - $\forall x y \in s, x + y \in s$ - $1 \in s$ - $\forall x y \in s, x * y \in s$
Subsemiring.instSubsemiringClass instance
: SubsemiringClass (Subsemiring R) R
Full source
instance : SubsemiringClass (Subsemiring R) R where
  zero_mem := zero_mem'
  add_mem {s} := AddSubsemigroup.add_mem' s.toAddSubmonoid.toAddSubsemigroup
  one_mem {s} := Submonoid.one_mem' s.toSubmonoid
  mul_mem {s} := Subsemigroup.mul_mem' s.toSubmonoid.toSubsemigroup
Subsemirings as Subsemiring Class
Informal description
For any non-associative semiring $R$, the type of subsemirings of $R$ forms a `SubsemiringClass`. This means that every subsemiring $S$ of $R$ is both a multiplicative submonoid and an additive submonoid, containing the multiplicative identity (1) and the additive identity (0), and is closed under both addition and multiplication.
Subsemiring.toNonUnitalSubsemiring definition
(S : Subsemiring R) : NonUnitalSubsemiring R
Full source
/-- Turn a `Subsemiring` into a `NonUnitalSubsemiring` by forgetting that it contains `1`. -/
def toNonUnitalSubsemiring (S : Subsemiring R) : NonUnitalSubsemiring R where __ := S
Forgetful map from subsemiring to non-unital subsemiring
Informal description
Given a subsemiring $S$ of a semiring $R$, this function constructs the underlying non-unital subsemiring by forgetting that $S$ contains the multiplicative identity $1$. The resulting structure maintains closure under addition and multiplication but no longer requires the presence of $1$.
Subsemiring.mem_toSubmonoid theorem
{s : Subsemiring R} {x : R} : x ∈ s.toSubmonoid ↔ x ∈ s
Full source
@[simp]
theorem mem_toSubmonoid {s : Subsemiring R} {x : R} : x ∈ s.toSubmonoidx ∈ s.toSubmonoid ↔ x ∈ s :=
  Iff.rfl
Membership in Subsemiring's Submonoid Characterizes Membership in Subsemiring
Informal description
For any subsemiring $s$ of a non-associative semiring $R$ and any element $x \in R$, $x$ belongs to the underlying submonoid of $s$ if and only if $x$ belongs to $s$.
Subsemiring.mem_toNonUnitalSubsemiring theorem
{S : Subsemiring R} {x : R} : x ∈ S.toNonUnitalSubsemiring ↔ x ∈ S
Full source
@[simp]
lemma mem_toNonUnitalSubsemiring {S : Subsemiring R} {x : R} :
    x ∈ S.toNonUnitalSubsemiringx ∈ S.toNonUnitalSubsemiring ↔ x ∈ S := .rfl
Membership in Subsemiring and its Non-unital Subsemiring Coincide
Informal description
For any subsemiring $S$ of a non-associative semiring $R$ and any element $x \in R$, the element $x$ belongs to the underlying non-unital subsemiring of $S$ if and only if $x$ belongs to $S$.
Subsemiring.mem_carrier theorem
{s : Subsemiring R} {x : R} : x ∈ s.carrier ↔ x ∈ s
Full source
theorem mem_carrier {s : Subsemiring R} {x : R} : x ∈ s.carrierx ∈ s.carrier ↔ x ∈ s :=
  Iff.rfl
Membership in Subsemiring Carrier Set
Informal description
For any subsemiring $s$ of a non-associative semiring $R$ and any element $x \in R$, the element $x$ belongs to the underlying set of $s$ (denoted by $s.\mathrm{carrier}$) if and only if $x$ is a member of the subsemiring $s$.
Subsemiring.coe_toNonUnitalSubsemiring theorem
(S : Subsemiring R) : (S.toNonUnitalSubsemiring : Set R) = S
Full source
@[simp]
lemma coe_toNonUnitalSubsemiring (S : Subsemiring R) : (S.toNonUnitalSubsemiring : Set R) = S := rfl
Subsemiring to Non-unital Subsemiring Set Equality
Informal description
For any subsemiring $S$ of a non-associative semiring $R$, the underlying set of the non-unital subsemiring obtained from $S$ is equal to $S$ itself.
Subsemiring.ext theorem
{S T : Subsemiring R} (h : ∀ x, x ∈ S ↔ x ∈ T) : S = T
Full source
/-- Two subsemirings are equal if they have the same elements. -/
@[ext]
theorem ext {S T : Subsemiring R} (h : ∀ x, x ∈ Sx ∈ S ↔ x ∈ T) : S = T :=
  SetLike.ext h
Extensionality of Subsemirings: $S = T \iff \forall x, x \in S \leftrightarrow x \in T$
Informal description
For any two subsemirings $S$ and $T$ of a non-associative semiring $R$, if $x \in S$ if and only if $x \in T$ for all $x \in R$, then $S = T$.
Subsemiring.copy definition
(S : Subsemiring R) (s : Set R) (hs : s = ↑S) : Subsemiring R
Full source
/-- Copy of a subsemiring with a new `carrier` equal to the old one. Useful to fix definitional
equalities. -/
@[simps coe toSubmonoid]
protected def copy (S : Subsemiring R) (s : Set R) (hs : s = ↑S) : Subsemiring R :=
  { S.toAddSubmonoid.copy s hs, S.toSubmonoid.copy s hs with carrier := s }
Copy of a subsemiring with a specified carrier set
Informal description
Given a subsemiring $S$ of a non-associative semiring $R$ and a subset $s$ of $R$ equal to the underlying set of $S$, the function `Subsemiring.copy` constructs a new subsemiring with $s$ as its underlying set. This new subsemiring has the same additive and multiplicative structures as $S$.
Subsemiring.copy_eq theorem
(S : Subsemiring R) (s : Set R) (hs : s = ↑S) : S.copy s hs = S
Full source
theorem copy_eq (S : Subsemiring R) (s : Set R) (hs : s = ↑S) : S.copy s hs = S :=
  SetLike.coe_injective hs
Equality of Subsemiring Copy with Original
Informal description
For any subsemiring $S$ of a non-associative semiring $R$ and any subset $s$ of $R$ equal to the underlying set of $S$, the copy of $S$ with carrier set $s$ is equal to $S$ itself.
Subsemiring.toSubmonoid_injective theorem
: Function.Injective (toSubmonoid : Subsemiring R → Submonoid R)
Full source
theorem toSubmonoid_injective : Function.Injective (toSubmonoid : Subsemiring R → Submonoid R)
  | _, _, h => ext (SetLike.ext_iff.mp h :)
Injectivity of Subsemiring-to-Submonoid Map
Informal description
For any non-associative semiring $R$, the function that maps a subsemiring $S$ of $R$ to its underlying submonoid is injective. In other words, if two subsemirings $S_1$ and $S_2$ have the same underlying submonoid, then $S_1 = S_2$.
Subsemiring.toAddSubmonoid_injective theorem
: Function.Injective (toAddSubmonoid : Subsemiring R → AddSubmonoid R)
Full source
theorem toAddSubmonoid_injective :
    Function.Injective (toAddSubmonoid : Subsemiring R → AddSubmonoid R)
  | _, _, h => ext (SetLike.ext_iff.mp h :)
Injectivity of the Subsemiring-to-Additive-Submonoid Map
Informal description
The function that maps a subsemiring $S$ of a non-associative semiring $R$ to its underlying additive submonoid is injective. That is, if two subsemirings $S_1$ and $S_2$ have the same underlying additive submonoid, then $S_1 = S_2$.
Subsemiring.toNonUnitalSubsemiring_injective theorem
: Function.Injective (toNonUnitalSubsemiring : Subsemiring R → _)
Full source
lemma toNonUnitalSubsemiring_injective :
    Function.Injective (toNonUnitalSubsemiring : Subsemiring R → _) :=
  fun S₁ S₂ h => SetLike.ext'_iff.2 (
    show (S₁.toNonUnitalSubsemiring : Set R) = S₂ from SetLike.ext'_iff.1 h)
Injectivity of the Subsemiring-to-NonUnitalSubsemiring Map
Informal description
The map from a subsemiring $S$ of a non-associative semiring $R$ to its underlying non-unital subsemiring is injective. That is, if two subsemirings $S_1$ and $S_2$ have the same underlying non-unital subsemiring, then $S_1 = S_2$.
Subsemiring.toNonUnitalSubsemiring_inj theorem
{S₁ S₂ : Subsemiring R} : S₁.toNonUnitalSubsemiring = S₂.toNonUnitalSubsemiring ↔ S₁ = S₂
Full source
@[simp]
lemma toNonUnitalSubsemiring_inj {S₁ S₂ : Subsemiring R} :
    S₁.toNonUnitalSubsemiring = S₂.toNonUnitalSubsemiring ↔ S₁ = S₂ :=
  toNonUnitalSubsemiring_injective.eq_iff
Equality of Subsemirings via Their Non-unital Underlying Structures
Informal description
For any two subsemirings $S_1$ and $S_2$ of a non-associative semiring $R$, the underlying non-unital subsemirings of $S_1$ and $S_2$ are equal if and only if $S_1 = S_2$.
Subsemiring.one_mem_toNonUnitalSubsemiring theorem
(S : Subsemiring R) : (1 : R) ∈ S.toNonUnitalSubsemiring
Full source
lemma one_mem_toNonUnitalSubsemiring (S : Subsemiring R) : (1 : R) ∈ S.toNonUnitalSubsemiring :=
  S.one_mem
Multiplicative Identity Belongs to Underlying Non-unital Subsemiring
Informal description
For any subsemiring $S$ of a semiring $R$, the multiplicative identity $1$ is an element of the underlying non-unital subsemiring $S.\text{toNonUnitalSubsemiring}$.
Subsemiring.mk' definition
(s : Set R) (sm : Submonoid R) (hm : ↑sm = s) (sa : AddSubmonoid R) (ha : ↑sa = s) : Subsemiring R
Full source
/-- Construct a `Subsemiring R` from a set `s`, a submonoid `sm`, and an additive
submonoid `sa` such that `x ∈ s ↔ x ∈ sm ↔ x ∈ sa`. -/
@[simps coe]
protected def mk' (s : Set R) (sm : Submonoid R) (hm : ↑sm = s) (sa : AddSubmonoid R)
    (ha : ↑sa = s) : Subsemiring R where
  carrier := s
  zero_mem' := by exact ha ▸ sa.zero_mem
  one_mem' := by exact hm ▸ sm.one_mem
  add_mem' {x y} := by simpa only [← ha] using sa.add_mem
  mul_mem' {x y} := by simpa only [← hm] using sm.mul_mem
Construction of a subsemiring from matching submonoids
Informal description
Given a set $s$ in a non-associative semiring $R$, a submonoid $sm$ of $R$ with carrier set equal to $s$, and an additive submonoid $sa$ of $R$ with carrier set equal to $s$, construct a subsemiring of $R$ with carrier set $s$ that inherits the additive and multiplicative structures from $sa$ and $sm$ respectively.
Subsemiring.mem_mk' theorem
{s : Set R} {sm : Submonoid R} (hm : ↑sm = s) {sa : AddSubmonoid R} (ha : ↑sa = s) {x : R} : x ∈ Subsemiring.mk' s sm hm sa ha ↔ x ∈ s
Full source
@[simp]
theorem mem_mk' {s : Set R} {sm : Submonoid R} (hm : ↑sm = s) {sa : AddSubmonoid R} (ha : ↑sa = s)
    {x : R} : x ∈ Subsemiring.mk' s sm hm sa hax ∈ Subsemiring.mk' s sm hm sa ha ↔ x ∈ s :=
  Iff.rfl
Membership Criterion for Constructed Subsemiring
Informal description
Let $R$ be a non-associative semiring, $s$ a subset of $R$, $sm$ a submonoid of $R$ with carrier set equal to $s$, and $sa$ an additive submonoid of $R$ with carrier set equal to $s$. For any element $x \in R$, we have $x$ belongs to the subsemiring constructed via `Subsemiring.mk' s sm hm sa ha` if and only if $x$ belongs to $s$.
Subsemiring.mk'_toSubmonoid theorem
{s : Set R} {sm : Submonoid R} (hm : ↑sm = s) {sa : AddSubmonoid R} (ha : ↑sa = s) : (Subsemiring.mk' s sm hm sa ha).toSubmonoid = sm
Full source
@[simp]
theorem mk'_toSubmonoid {s : Set R} {sm : Submonoid R} (hm : ↑sm = s) {sa : AddSubmonoid R}
    (ha : ↑sa = s) : (Subsemiring.mk' s sm hm sa ha).toSubmonoid = sm :=
  SetLike.coe_injective hm.symm
Subsemiring Construction Preserves Multiplicative Submonoid
Informal description
Given a set $s$ in a non-associative semiring $R$, a submonoid $sm$ of $R$ with carrier set equal to $s$, and an additive submonoid $sa$ of $R$ with carrier set equal to $s$, the multiplicative submonoid of the subsemiring constructed from $s$, $sm$, and $sa$ is equal to $sm$.
Subsemiring.mk'_toAddSubmonoid theorem
{s : Set R} {sm : Submonoid R} (hm : ↑sm = s) {sa : AddSubmonoid R} (ha : ↑sa = s) : (Subsemiring.mk' s sm hm sa ha).toAddSubmonoid = sa
Full source
@[simp]
theorem mk'_toAddSubmonoid {s : Set R} {sm : Submonoid R} (hm : ↑sm = s) {sa : AddSubmonoid R}
    (ha : ↑sa = s) : (Subsemiring.mk' s sm hm sa ha).toAddSubmonoid = sa :=
  SetLike.coe_injective ha.symm
Subsemiring Construction Preserves Additive Submonoid
Informal description
Given a set $s$ in a non-associative semiring $R$, a submonoid $sm$ of $R$ with carrier set equal to $s$, and an additive submonoid $sa$ of $R$ with carrier set equal to $s$, the additive submonoid of the subsemiring constructed from $s$, $sm$, and $sa$ is equal to $sa$.
Subsemiring.one_mem theorem
: (1 : R) ∈ s
Full source
/-- A subsemiring contains the semiring's 1. -/
protected theorem one_mem : (1 : R) ∈ s :=
  one_mem s
Subsemiring Contains One
Informal description
For any subsemiring $s$ of a non-associative semiring $R$, the multiplicative identity $1$ is an element of $s$.
Subsemiring.zero_mem theorem
: (0 : R) ∈ s
Full source
/-- A subsemiring contains the semiring's 0. -/
protected theorem zero_mem : (0 : R) ∈ s :=
  zero_mem s
Subsemiring Contains Zero
Informal description
For any subsemiring $s$ of a non-associative semiring $R$, the additive identity $0$ is an element of $s$.
Subsemiring.mul_mem theorem
{x y : R} : x ∈ s → y ∈ s → x * y ∈ s
Full source
/-- A subsemiring is closed under multiplication. -/
protected theorem mul_mem {x y : R} : x ∈ sy ∈ sx * y ∈ s :=
  mul_mem
Closure of Subsemiring under Multiplication
Informal description
For any subsemiring $s$ of a non-associative semiring $R$ and any elements $x, y \in R$, if $x \in s$ and $y \in s$, then their product $x * y$ also belongs to $s$.
Subsemiring.add_mem theorem
{x y : R} : x ∈ s → y ∈ s → x + y ∈ s
Full source
/-- A subsemiring is closed under addition. -/
protected theorem add_mem {x y : R} : x ∈ sy ∈ sx + y ∈ s :=
  add_mem
Closure of Subsemiring under Addition
Informal description
For any subsemiring $s$ of a non-associative semiring $R$, and for any elements $x, y \in R$ that belong to $s$, their sum $x + y$ also belongs to $s$.
Subsemiring.toNonAssocSemiring instance
: NonAssocSemiring s
Full source
/-- A subsemiring of a `NonAssocSemiring` inherits a `NonAssocSemiring` structure -/
instance toNonAssocSemiring : NonAssocSemiring s :=
  SubsemiringClass.toNonAssocSemiring _
Non-associative Semiring Structure on Subsemirings
Informal description
For any subsemiring $s$ of a non-associative semiring $R$, the subset $s$ inherits a non-associative semiring structure from $R$. This means $s$ is equipped with addition and multiplication operations that are closed within $s$, and satisfy the axioms of a non-associative semiring (including distributivity and the existence of additive and multiplicative identities).
Subsemiring.coe_one theorem
: ((1 : s) : R) = (1 : R)
Full source
@[simp, norm_cast]
theorem coe_one : ((1 : s) : R) = (1 : R) :=
  rfl
Inclusion Preserves Multiplicative Identity in Subsemirings
Informal description
For any subsemiring $s$ of a non-associative semiring $R$, the image of the multiplicative identity $1$ in $s$ under the canonical inclusion map into $R$ is equal to the multiplicative identity $1$ in $R$.
Subsemiring.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 Subsemiring Inclusion
Informal description
For any subsemiring $s$ of a non-associative semiring $R$, the image of the zero element of $s$ under the canonical inclusion map into $R$ is equal to the zero element of $R$, i.e., $0_s = 0_R$.
Subsemiring.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
Addition Preservation in Subsemiring Inclusion
Informal description
For any elements $x, y$ in a subsemiring $s$ of a non-associative semiring $R$, the image of their sum in $s$ under the canonical inclusion map into $R$ equals their sum in $R$, i.e., $(x + y)_s = x + y$ in $R$.
Subsemiring.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 Preservation in Subsemiring Inclusion
Informal description
For any elements $x$ and $y$ in a subsemiring $s$ of a non-associative semiring $R$, the image of their product in $s$ under the canonical inclusion map into $R$ equals their product in $R$, i.e., $(x \cdot y)_s = (x \cdot y)_R$.
Subsemiring.nontrivial instance
[Nontrivial R] : Nontrivial s
Full source
instance nontrivial [Nontrivial R] : Nontrivial s :=
  nontrivial_of_ne 0 1 fun H => zero_ne_one (congr_arg Subtype.val H)
Nontriviality of Subsemirings in Nontrivial Semirings
Informal description
For any subsemiring $s$ of a nontrivial non-associative semiring $R$, the subsemiring $s$ is also nontrivial.
Subsemiring.pow_mem theorem
{R : Type*} [Semiring R] (s : Subsemiring R) {x : R} (hx : x ∈ s) (n : ℕ) : x ^ n ∈ s
Full source
protected theorem pow_mem {R : Type*} [Semiring R] (s : Subsemiring R) {x : R} (hx : x ∈ s)
    (n : ) : x ^ n ∈ s :=
  pow_mem hx n
Closure under Powers in Subsemirings
Informal description
Let $R$ be a semiring and $s$ a subsemiring of $R$. For any element $x \in s$ and any natural number $n$, the power $x^n$ belongs to $s$.
Subsemiring.noZeroDivisors instance
[NoZeroDivisors R] : NoZeroDivisors s
Full source
instance noZeroDivisors [NoZeroDivisors R] : NoZeroDivisors s where
  eq_zero_or_eq_zero_of_mul_eq_zero {_ _} h :=
    (eq_zero_or_eq_zero_of_mul_eq_zero <| Subtype.ext_iff.mp h).imp Subtype.eq Subtype.eq
Subsemirings Inherit No Zero Divisors Property
Informal description
For any subsemiring $s$ of a non-associative semiring $R$ with no zero divisors, the subsemiring $s$ also has no zero divisors.
Subsemiring.toSemiring instance
{R} [Semiring R] (s : Subsemiring R) : Semiring s
Full source
/-- A subsemiring of a `Semiring` is a `Semiring`. -/
instance toSemiring {R} [Semiring R] (s : Subsemiring R) : Semiring s :=
  { s.toNonAssocSemiring, s.toSubmonoid.toMonoid with }
Subsemiring Inherits Semiring Structure
Informal description
For any semiring $R$ and any subsemiring $s$ of $R$, the subset $s$ inherits a semiring structure from $R$.
Subsemiring.coe_pow theorem
{R} [Semiring R] (s : Subsemiring R) (x : s) (n : ℕ) : ((x ^ n : s) : R) = (x : R) ^ n
Full source
@[simp, norm_cast]
theorem coe_pow {R} [Semiring R] (s : Subsemiring R) (x : s) (n : ) :
    ((x ^ n : s) : R) = (x : R) ^ n := by
  induction n with
  | zero => simp
  | succ n ih => simp [pow_succ, ih]
Power Operation Commutes with Subsemiring Inclusion: $(x^n)_s = x_R^n$
Informal description
For any semiring $R$ and any subsemiring $s$ of $R$, if $x$ is an element of $s$ and $n$ is a natural number, then the $n$-th power of $x$ in $s$ (viewed as an element of $R$) equals the $n$-th power of $x$ in $R$, i.e., $(x^n)_s = x_R^n$.
Subsemiring.toCommSemiring instance
{R} [CommSemiring R] (s : Subsemiring R) : CommSemiring s
Full source
/-- A subsemiring of a `CommSemiring` is a `CommSemiring`. -/
instance toCommSemiring {R} [CommSemiring R] (s : Subsemiring R) : CommSemiring s :=
  { s.toSemiring with mul_comm := fun _ _ => Subtype.eq <| mul_comm _ _ }
Subsemiring Inherits Commutative Semiring Structure
Informal description
For any commutative semiring $R$ and any subsemiring $s$ of $R$, the subset $s$ inherits a commutative semiring structure from $R$.
Subsemiring.subtype definition
: s →+* R
Full source
/-- The natural ring hom from a subsemiring of semiring `R` to `R`. -/
def subtype : s →+* R :=
  { s.toSubmonoid.subtype, s.toAddSubmonoid.subtype with toFun := (↑) }
Inclusion homomorphism of a subsemiring
Informal description
The natural inclusion homomorphism from a subsemiring \( s \) of a semiring \( R \) to \( R \), mapping each element \( x \in s \) to itself in \( R \). This homomorphism preserves both the additive and multiplicative structures, including the additive and multiplicative identities (0 and 1).
Subsemiring.subtype_apply theorem
(x : s) : s.subtype x = x
Full source
@[simp]
lemma subtype_apply (x : s) :
    s.subtype x = x := rfl
Inclusion Homomorphism Acts as Identity on Subsemiring Elements
Informal description
For any element $x$ in a subsemiring $s$ of a semiring $R$, the inclusion homomorphism $\text{subtype}$ maps $x$ to itself, i.e., $\text{subtype}(x) = x$.
Subsemiring.subtype_injective theorem
: Function.Injective s.subtype
Full source
lemma subtype_injective :
    Function.Injective s.subtype :=
  Subtype.coe_injective
Injectivity of Subsemiring Inclusion Homomorphism
Informal description
The inclusion homomorphism from a subsemiring $s$ of a semiring $R$ to $R$ is injective. That is, for any $x, y \in s$, if $s.\text{subtype}(x) = s.\text{subtype}(y)$ in $R$, then $x = y$ in $s$.
Subsemiring.coe_subtype theorem
: ⇑s.subtype = ((↑) : s → R)
Full source
@[simp]
theorem coe_subtype : ⇑s.subtype = ((↑) : s → R) :=
  rfl
Inclusion Homomorphism Equals Coercion for Subsemirings
Informal description
For a subsemiring $s$ of a non-associative semiring $R$, the underlying function of the inclusion homomorphism $s \to+* R$ is equal to the coercion function from $s$ to $R$.
Subsemiring.nsmul_mem theorem
{x : R} (hx : x ∈ s) (n : ℕ) : n • x ∈ s
Full source
protected theorem nsmul_mem {x : R} (hx : x ∈ s) (n : ) : n • x ∈ s :=
  nsmul_mem hx n
Closure of Subsemiring under Natural Number Scalar Multiplication
Informal description
For any element $x$ in a subsemiring $s$ of a non-associative semiring $R$, and for any natural number $n$, the scalar multiple $n \cdot x$ is also in $s$.
Subsemiring.coe_toSubmonoid theorem
(s : Subsemiring R) : (s.toSubmonoid : Set R) = s
Full source
@[simp]
theorem coe_toSubmonoid (s : Subsemiring R) : (s.toSubmonoid : Set R) = s :=
  rfl
Subsemiring to Submonoid Set Equality
Informal description
For any subsemiring $s$ of a non-associative semiring $R$, the underlying set of the submonoid associated with $s$ is equal to $s$ itself when viewed as a subset of $R$.
Subsemiring.coe_carrier_toSubmonoid theorem
(s : Subsemiring R) : (s.toSubmonoid.carrier : Set R) = s
Full source
@[simp]
theorem coe_carrier_toSubmonoid (s : Subsemiring R) : (s.toSubmonoid.carrier : Set R) = s :=
  rfl
Equality of Subsemiring and its Submonoid Carrier Set
Informal description
For any subsemiring $s$ of a non-associative semiring $R$, the underlying set of the submonoid associated with $s$ is equal to $s$ itself when viewed as a subset of $R$.
Subsemiring.mem_toAddSubmonoid theorem
{s : Subsemiring R} {x : R} : x ∈ s.toAddSubmonoid ↔ x ∈ s
Full source
theorem mem_toAddSubmonoid {s : Subsemiring R} {x : R} : x ∈ s.toAddSubmonoidx ∈ s.toAddSubmonoid ↔ x ∈ s :=
  Iff.rfl
Membership in Subsemiring and its Additive Submonoid Coincide
Informal description
For any subsemiring $s$ of a non-associative semiring $R$ and any element $x \in R$, $x$ belongs to the additive submonoid associated with $s$ if and only if $x$ belongs to $s$.
Subsemiring.coe_toAddSubmonoid theorem
(s : Subsemiring R) : (s.toAddSubmonoid : Set R) = s
Full source
theorem coe_toAddSubmonoid (s : Subsemiring R) : (s.toAddSubmonoid : Set R) = s :=
  rfl
Equality of Subsemiring and its Additive Submonoid Carrier Set
Informal description
For any subsemiring $s$ of a non-associative semiring $R$, the underlying set of the additive submonoid associated with $s$ is equal to $s$ itself when viewed as a subset of $R$.
Subsemiring.mem_top theorem
(x : R) : x ∈ (⊤ : Subsemiring R)
Full source
@[simp]
theorem mem_top (x : R) : x ∈ (⊤ : Subsemiring R) :=
  Set.mem_univ x
Membership in the Full Subsemiring
Informal description
For any element $x$ in a non-associative semiring $R$, $x$ belongs to the top subsemiring of $R$ (which is $R$ itself).
Subsemiring.coe_top theorem
: ((⊤ : Subsemiring R) : Set R) = Set.univ
Full source
@[simp]
theorem coe_top : (( : Subsemiring R) : Set R) = Set.univ :=
  rfl
Top Subsemiring Equals Universal Set
Informal description
The underlying set of the top subsemiring of a non-associative semiring $R$ is equal to the universal set of $R$, i.e., $(\top : \text{Subsemiring } R) = \text{univ}$.
Subsemiring.coe_inf theorem
(p p' : Subsemiring R) : ((p ⊓ p' : Subsemiring R) : Set R) = (p : Set R) ∩ p'
Full source
@[simp]
theorem coe_inf (p p' : Subsemiring R) : ((p ⊓ p' : Subsemiring R) : Set R) = (p : Set R) ∩ p' :=
  rfl
Subsemiring Intersection Equals Set Intersection
Informal description
For any two subsemirings $p$ and $p'$ of a non-associative semiring $R$, the underlying set of their infimum $p \sqcap p'$ is equal to the intersection of their underlying sets, i.e., $(p \sqcap p' : \text{Subsemiring } R) = (p : \text{Set } R) \cap p'$.
Subsemiring.mem_inf theorem
{p p' : Subsemiring R} {x : R} : x ∈ p ⊓ p' ↔ x ∈ p ∧ x ∈ p'
Full source
@[simp]
theorem mem_inf {p p' : Subsemiring R} {x : R} : x ∈ p ⊓ p'x ∈ p ⊓ p' ↔ x ∈ p ∧ x ∈ p' :=
  Iff.rfl
Membership in Intersection of Subsemirings
Informal description
For any subsemirings $p$ and $p'$ of a non-associative 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'$.
RingHom.domRestrict definition
(f : R →+* S) (s : σR) : s →+* S
Full source
/-- Restriction of a ring homomorphism to a subsemiring of the domain. -/
def domRestrict (f : R →+* S) (s : σR) : s →+* S :=
  f.comp <| SubsemiringClass.subtype s
Restriction of a semiring homomorphism to a subsemiring
Informal description
Given a semiring homomorphism \( f \colon R \to S \) and a subsemiring \( s \) of \( R \), the restriction of \( f \) to \( s \) is the composition of \( f \) with the inclusion homomorphism \( s \hookrightarrow R \). This yields a semiring homomorphism from \( s \) to \( S \).
RingHom.restrict_apply theorem
(f : R →+* S) {s : σR} (x : s) : f.domRestrict s x = f x
Full source
@[simp]
theorem restrict_apply (f : R →+* S) {s : σR} (x : s) : f.domRestrict s x = f x :=
  rfl
Restriction of Semiring Homomorphism Preserves Evaluation
Informal description
Let $R$ and $S$ be non-associative semirings, $f \colon R \to S$ a semiring homomorphism, and $s$ a subsemiring of $R$. For any element $x \in s$, the restriction of $f$ to $s$ evaluated at $x$ equals $f(x)$, i.e., $f|_{s}(x) = f(x)$.
RingHom.eqLocusS definition
(f g : R →+* S) : Subsemiring R
Full source
/-- The subsemiring of elements `x : R` such that `f x = g x` -/
def eqLocusS (f g : R →+* S) : Subsemiring R :=
  { (f : R →* S).eqLocusM g, (f : R →+ S).eqLocusM g with carrier := { x | f x = g x } }
Equalizer subsemiring of semiring homomorphisms
Informal description
Given two semiring homomorphisms \( f, g \colon R \to S \), the subsemiring \(\text{eqLocusS}(f, g)\) consists of all elements \( x \in R \) such that \( f(x) = g(x) \). This subsemiring is closed under both addition and multiplication, and contains the additive and multiplicative identities (0 and 1).
RingHom.eqLocusS_same theorem
(f : R →+* S) : f.eqLocusS f = ⊤
Full source
@[simp]
theorem eqLocusS_same (f : R →+* S) : f.eqLocusS f =  :=
  SetLike.ext fun _ => eq_self_iff_true _
Equalizer subsemiring of a homomorphism with itself is the full semiring
Informal description
For any semiring homomorphism $f \colon R \to S$, the equalizer subsemiring of $f$ with itself is the entire semiring $R$, i.e., $\text{eqLocusS}(f, f) = R$.
NonUnitalSubsemiring.toSubsemiring definition
(S : NonUnitalSubsemiring R) (h1 : 1 ∈ S) : Subsemiring R
Full source
/-- Turn a non-unital subsemiring containing `1` into a subsemiring. -/
def NonUnitalSubsemiring.toSubsemiring (S : NonUnitalSubsemiring R) (h1 : 1 ∈ S) :
    Subsemiring R where
  __ := S
  one_mem' := h1
Promotion of non-unital subsemiring to subsemiring when containing 1
Informal description
Given a non-unital subsemiring $S$ of a semiring $R$ that contains the multiplicative identity $1$, the structure $S$ can be promoted to a subsemiring of $R$.
Subsemiring.toNonUnitalSubsemiring_toSubsemiring theorem
(S : Subsemiring R) : S.toNonUnitalSubsemiring.toSubsemiring S.one_mem = S
Full source
lemma Subsemiring.toNonUnitalSubsemiring_toSubsemiring (S : Subsemiring R) :
    S.toNonUnitalSubsemiring.toSubsemiring S.one_mem = S := rfl
Subsemiring Identity under Forget-Promote Composition
Informal description
For any subsemiring $S$ of a non-associative semiring $R$, the composition of the forgetful map from $S$ to a non-unital subsemiring followed by the promotion back to a subsemiring (using the fact that $1 \in S$) yields $S$ itself. In other words, $(S.\text{toNonUnitalSubsemiring}).\text{toSubsemiring} = S$.
NonUnitalSubsemiring.toSubsemiring_toNonUnitalSubsemiring theorem
(S : NonUnitalSubsemiring R) (h1) : (NonUnitalSubsemiring.toSubsemiring S h1).toNonUnitalSubsemiring = S
Full source
lemma NonUnitalSubsemiring.toSubsemiring_toNonUnitalSubsemiring (S : NonUnitalSubsemiring R) (h1) :
    (NonUnitalSubsemiring.toSubsemiring S h1).toNonUnitalSubsemiring = S := rfl
Recovery of Non-unital Subsemiring through Promotion and Forgetful Map
Informal description
Let $R$ be a non-unital non-associative semiring and $S$ be a non-unital subsemiring of $R$. If $S$ contains the multiplicative identity $1$, then the forgetful map from the subsemiring back to a non-unital subsemiring recovers $S$. That is, if we first promote $S$ to a subsemiring (using the fact that $1 \in S$) and then forget the multiplicative identity, we obtain $S$ again.