"Endomorphism" is not an Elvish word. Although this diary is not about Tolkien nor rings of power it is nevertheless appropriate to subtitle it "There and back again"

In my previous I found the endomorphism of C 4 and named them Null, Identity, Swap, and Shink.

Now I want to turn them into a ring. I'm hoping for some kind of quirky, non-commutative ring to turn up.

The multiplication is by composition of functions. The multiplication table has 4×4=16 entries. Composition with Null is obviously Null, whichever way round you do it, which takes care of seven entries, clearly working like zero, as required. Indentity obviously functions as multiplication by one, so that is another five entries accounted for. Only four left.

Shrink × Shrink = Null 1 and 3 both get taken to 2 and then to 0. This is Null. Bugger! A zero divisor. Zero divisors are bad because they stop you creating a field of fractions. Swap × Swap = Identity 0 and 2 are left alone. 1 and 3 get swapped and swapped back Swap × Shrink = Shrink Since 1 and 3 both get mapped to 2, swapping them first doesn't matter Shrink × Swap = Shrink Swap is too late to do anything, Shrink has already got rid of 1 and 3.

Addition is by point wise addition of functions. For example to calculate Identity+Shrink you go through the set {0,1,2,3} working out what Identity+Shrink does to each of them like this

Identity(0)+Shrink(0)=0+0=0

Identity(1)+Shrink(1)=1+2=3

Identity(2)+Shrink(2)=2+0=2

Identity(3)+Shrink(3)=3+2=5=1

So Identity+Shrink=Swap

As I worked through this table, recognition slowly dawned on me. This was the ring of integers modulo 4.

Null takes 1 to 0 Identity takes 1 to 1 Shrink takes 1 to 2 Swap takes 1 to 3

My four endomorphisms are multiplication by 0,1,2, and 3. With pointwise addition for addition and composition for multiplication, they play exactly the roles of 0,1,2, and 3. I've ended up creating the very ring that I started with. There and back again, indeed!