2

Hi,

I'm a programmer who is looking for help on some terminology in order to do some further research. I hope this is an appropriate place to ask.

What I'm looking for is the name of functions that picks a "canonical representative" on a set $Y$ in the following way.

Let $f :: X \rightarrow Y$ and $g :: Y \rightarrow X$ for some sets $X$ and $Y$ such that $f$ and $g$ form "almost an isomorphism", by which I mean something like the following

$$ \begin{align} f & \text{ is an injection}\\ g & \text{ is a surjection}\\ g \circ f & = id :: X \rightarrow X \\ f \circ g' & = id :: f^{-1}(X) \rightarrow f^{-1}(X) \\ \end{align} $$

Where $g'$ is the restriction of $g$ to the domain $f^{-1}(X)$.

By $f^{-1}(X)$ I mean the subset of $Y$ defined by $\{ y \in Y \mid f(x) = y \text{ for some } x \in X \}$

The function $f \circ g :: Y \rightarrow Y$ should then be such that it picks a "canonical element" on $Y$ "through" the injection $f$.

What I'm looking for is simply the terminology to describe this type of pair of functions.

Intuition

In case my definition above is not quite correct, a simple example of the type of pair of functions I'm looking for would be e.g. toString :: Float -> String and fromString :: String -> Float.

Let's ignore that fromString is partial and assume it's input is always a string describing a valid number.

Then fromString is an surjection String -> Float. toString is an injection Float -> String*. By defining

canonicalString :: String -> String 
  = toString . fromString

we can get a "canonical" string representation of a particular number. E.g. if toString(2) = "2.0" then

canonicalString("2") 
  == canonicalString("2e0") 
  == canonicalString("2.") 
  == canonicalString("2.0") 
  == canonicalString("2.0000") 
  == "2.0"

* At least conceptually - ignoring any problems with floating point numbers that may make this not true in corner cases.

0 Answers0