English
Let f: S → R be injective. If R is a Semiring, and f preserves 0, 1, +, ×, and natural-number scalar action, then S inherits a Semiring structure pulled back along f, making f a Semiring-homomorphism.
Русский
Пусть f: S → R инъективна. Если R — полугруппа с единицей и умножением, и f сохраняет 0, 1, сложение, умножение, а также умножение на n-числа, тогда S получает структуру Semiring, переносимую по f, так что f — гомоморфизм Semiring.
LaTeX
$$$\\exists\\, \\mathcal{S}: \\text{Semiring}(S),\\quad f(0)=0,\\quad f(1)=1,\\quad \\forall x,y\\,(f(x+y)=f(x)+f(y)),\\quad \\forall x,y\\,(f(xy)=f(x)f(y)),\\quad \\forall n\\,(f(n\\cdot x)=n\\cdot f(x)).$$$
Lean4
/-- Pullback a `Semiring` instance along an injective function. -/
-- See note [reducible non-instances]
protected abbrev semiring [Semiring R] (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y)
(mul : ∀ x y, f (x * y) = f x * f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
(npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) (natCast : ∀ n : ℕ, f n = n) : Semiring S
where
toNonUnitalSemiring := hf.nonUnitalSemiring f zero add mul nsmul
__ := hf.nonAssocSemiring f zero one add mul nsmul natCast
__ := hf.monoidWithZero f zero one mul npow