I'm trying to write a function to verify that a "multiplication" table is a group, but I don't know how to start. The function should output True or False after checking all the axioms. Example of an input, which I believe is not a group:
* | a b c
a | b c a
b | c b a
c | b a c
I know the 4 axioms that I have to check through, and I think I'll read the table row-by-row as
What confuses me is the function should work for a general n x n sized table, and I'm used to the C-programming style where I have to know the exact size of a table to do the testing (so I can specify and test each element one by one).
I'm thinking for closure, I'll check the elements from the 2nd element and onwards in the 2nd sublist and compare them to see if they belong to any one of the elements in the 1st sublist, except the 1st element which is *. Then I'll do that for the 3rd, 4th sublist etc. I'm not sure how to implement that without knowing the size of the table though.
I really have problems with checking the associativity, identity and inverse axioms, as I would have to "jump around" the table multiplying different elements. How do I do that if I don't know the size of the table for me to access specific elements directly?