4 ms·
A ring forms an Abelian group with just its additive operation, so you basically have subtraction there. As far I can tell the structure we have formed by thes
by eigenket 2y ago
A ring forms an Abelian group with just its additive operation, so you basically have subtraction there. As far I can tell the structure we have formed by these datatypes is a semiring.
- sakras 2y agoAh also the multiplication operation isn't commutative, since struct { int A; float B; } is different from struct { float A; int B; }. So maybe it's a "noncommutative semiring".
- Sharlin 2y agoRing don’t require multiplication to commute, only addition. (Square) matrices make just fine rings despite noncommutativity. But the semiring of types does have commutative multiplication (only a semiring, or "rig", because the lack of additive inverses). Those two structs are equivalent (isomorphic) in the algebraic sense – names don’t matter, and order (indices are just a kind of names) doesn’t either. (a, b) = a x b = b x a = (b, a).
- eigenket 2y agoTechnically yeah but there is a natural isomorphism between struct { int A; float B; } and struct { float B; int A; } so if you're willing to do everything up to isomorphism (which is usually completely fine and standard) then you get a commutative semiring. You have to work up to isomorphism anyway even to get a noncomutative semiring because technically the multiplication isn't exactly associative only associative up to an isomorphism.