Skip to content

Instantly share code, notes, and snippets.

@voronoipotato
Last active January 19, 2024 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voronoipotato/124d05fce3a1f7275ae7c39406168cef to your computer and use it in GitHub Desktop.
Save voronoipotato/124d05fce3a1f7275ae7c39406168cef to your computer and use it in GitHub Desktop.

Totality

all operations are 'T -> 'T
counter example: for rational numbers sqrt(2) produces an irrational number

Associativity

(a * b) * c = a * (b * c)
counter example: (a - b) - c <> a - (b - c)

Identity

there exists some data where the operation does nothing
counter example: 
addition for the natural numbers. 
There is no zero for natural numbers so there is no identity for addition there.

Divisibility

there exists some opration and data that can "undo" a previous operation
(a + b) - b = a

Commutativity

a * b = b * a
graph 
    pm[partial magma]
    sgd(semigroupoid)
    c(category)
    gd(groupoid)
    m(magma)
    qg(quasigroup)
    um(unital magma)
    l(loop)
    sg(semigroup)
    aq(associative quasigroup)
    mo(monoid)
    cm(commutative monoid)
    g(group)
    ag(abelian group)
    pm -- associativity --> sgd
    sgd -- identity --> c
    c -- divisibility --> gd
    pm -- totality --> m 
    m -- divisibility --> qg
    qg -- identity --> l
    m -- identity --> um
    m -- associativity --> sg
    sg -- divisibility --> aq
    sg -- identity --> mo
    mo -- commutativity --> cm
    mo -- divisibility --> g
    g -- commutativity --> ag
    linkStyle default stroke:red
    linkStyle 1 stroke:orange
    linkStyle 2 stroke:green
    linkStyle 3 stroke:cyan
    linkStyle 4 stroke:green
    linkStyle 5 stroke:orange
    linkStyle 6 stroke:orange
    linkStyle 8 stroke:green
    linkStyle 9 stroke:orange
    linkStyle 10 stroke:violet
    linkStyle 11 stroke:green
    linkStyle 12 stroke:violet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment