English
Construct a NonUnitalNonAssocSemiring on S by pulling back 0, addition and multiplication from R along an injective map.
Русский
Через инъекцию восстанавливаем ненулевой без единицы полугруппный полугруппа через инъекцию.
LaTeX
$$NonUnitalNonAssocSemiring S obtained by pullback of f with zero, add, mul preserving structure.$$
Lean4
/-- A type endowed with `0`, `1` and `+` is an additive commutative group with one, if it admits an
injective map that preserves `0`, `1` and `+` to an additive commutative group with one.
See note [reducible non-instances]. -/
protected abbrev addCommGroupWithOne {S} [Zero S] [One S] [Add S] [SMul ℕ S] [Neg S] [Sub S] [SMul ℤ S] [NatCast S]
[IntCast S] [AddCommGroupWithOne R] (f : S → R) (hf : Injective f) (zero : f 0 = 0) (one : f 1 = 1)
(add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x) (sub : ∀ x y, f (x - y) = f x - f y)
(nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x) (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x)
(natCast : ∀ n : ℕ, f n = n) (intCast : ∀ n : ℤ, f n = n) : AddCommGroupWithOne S :=
{ hf.addGroupWithOne f zero one add neg sub nsmul zsmul natCast intCast,
hf.addCommMonoid _ zero add (swap nsmul) with }