What is isomorphism and homomorphism?

I tried to understand isomorphism and homomorphisms in the context of programming and needed some help.

The FPiS book explains:

enter image description here enter image description here

Let's start with the homomorphisms:

"foo".length + "bar".length == ("foo" + "bar").length

Here, length is a function of String to Int, which preserves the monoid structure.

  • Why are these homomorphisms?

  • Why does it maintain a monoid structure?

  • Is, for example, mapon lista homomorphism function?

On isomorphism, I explain that I took it from a book:

A monoid isomorphism between M and N has two homomorphisms f and g, where both f and Then g and g, and f is an identity function. For example, the monoids String and List [Char] with concatenation are isomorphic. Two Boolean monoids (false, ||) and (true, &) are also isomorphic, through! (negation).

Why (false, ||), (true, &&)and String and List[Char] monoids with concatenationis an isomorphism?

+4
2

?

.

?

- == .

, , ?

. "foo" "bar" .length .map(f). ( ), .

(false, ||), (true, & &) String List [ Char] ?

. , . (: , , , )


: , :

  • : , . f: A → B, A B * , f(x * y) = f(x) * f(y).

  • : . (M, *, id) iff (a * b) * c == a * (b * c) && a * id == a && id * a == a for all a, b, c in M.

+4
"foo".length + "bar".length == ("foo" + "bar").length

, , length . , , , .

length , , "".length = 0 x.length ⊕ y.length = (x ⊗ y).length. , , length vs length, , , , + .

: , .

, , (A, ⊕, a) (B, ⊗, b), A B - , ⊕: A × A → A ⊗: B × B → B - , a ∈ A b ∈ B - . f: A → B :

  • f (a) = b, .. f A, B
  • f (x ⊕ y) = f (x) ⊗ f (y), .. f A , , , A , B.

, ( , homomorphism: , , " " ).

, , !

  • : length (A, ·, ε) * to (ℕ, +, 0)
  • - (Bool, ∨, false) (Bool, ∧, true) .
  • exp - (ℝ, +, 0) (ℝ\{0}, *, 1)
  • , , , .
+2

Source: https://habr.com/ru/post/1678184/


All Articles