English
Two Semiring structures on R are equal if their non-unital and monoid-with-zero parts agree and the multiplicative part agrees.
Русский
Две структуры Semiring на R равны, если согласованы не-ударные части и через единицы.
LaTeX
$$$\\\\forall A,B \\,\\in \\, \\text{Semiring}(R), \\\\ A{\\\\:}\\\\text{toNonUnitalSemiring} = B{\\\\:}\\\\text{toNonUnitalSemiring} \\\\land A{\\\\:}\\\\text{toMonoidWithZero} = B{\\\\:}\\\\text{toMonoidWithZero} \\\\Rightarrow A=B.$$$
Lean4
theorem toNonAssocSemiring_injective : Function.Injective (@toNonAssocSemiring R) :=
by
intro _ _ h
ext x y
· exact congrArg (·.toAdd.add x y) h
· exact congrArg (·.toMul.mul x y) h