DEV Community

0xc0Der
0xc0Der

Posted on

functions and their inverses: 2 insightful examples.

Math is often considered hard. But, that is not true. Math is about logic. Following what you know to reach an understanding of what you don't. That we can do naturally. Our brains are wired to think.

The diagnosis in my opinion to most of the problems with math is.

  • lack of foundation.

  • unwillingness to give the required mental effort.

In this series of posts, I'll try to dive a little deeper in what looks simple, But, is very foundational. In a easy to digest #mathpills, I'll discuss fundamentals in quick pieces of elementary mathematics.

Like a logic puzzle. starting from the fundamentals you can build your way up to a very advanced an complicated structures.

So lets start with one of the most fundamental building blocks of math. functions.

basic definitions.

Let's define the function f:ABf: A \to B .

from these definitions we can find that:

  1. any element aAa \in A its image f(a)f(a) must belong to BB

  2. f(A)={f(a)aA} f(A) = \lbrace f(a) \mid a \in A \rbrace

Let g:BAg: B \to A be a function that does the inverse of what ff does then:

g(B)=f1(B)={aAf(a)B} g(B) = f^{-1}(B) = \lbrace a \in A \mid f(a) \in B \rbrace

two examples.

First Example: suppose that XAX \subseteq A . does f1(f(X))=Xf^{-1}(f(X)) = X .

To prove that these two sets are equal we must do that in two steps.

  • first, is Xf1(f(X))X \subseteq f^{-1}(f(X)) ?

Suppose that aXa \in X , then from the above definition f(a)f(X)f(a) \in f(X) , then

af1(f(X))={xXf(x)f(X)}a \in f^{-1}(f(X)) = \lbrace x \in X \mid f(x) \in f(X) \rbrace

Easy, isn't it. Just following simple definitions we were able to prove the first part, but the second will need extra assumptions to work.

  • is f1(f(x))Xf^{-1}(f(x)) \subseteq X ?

Suppose that af1(f(X))a \in f^{-1}(f(X)) then a{xXf(x)F(X)}a \in \lbrace x \in X \mid f(x) \in F(X) \rbrace , which means that f(a)F(X)={f(x)xX}f(a) \in F(X) = \lbrace f(x) \mid x \in X \rbrace , then there exists xXx \in X such that f(x)=f(a)f(x) = f(a) .

If we can prove that a=xa = x , then xXx \in X . which prove the second part.

This is easy if ff is a one-to-one function.

A function is one-to-one if aAbAf(a)=f(b)a=b\forall a \in A \forall b \in A \quad f(a) = f(b) \rightarrow a = b . which read, for all elements, if two elements have the same image, then they must be tha same.

Second Example: suppose that YBY \subseteq B . does f(f1(Y))=Yf(f^{-1}(Y)) = Y .

Following the same procedure as the previous example.

  • first, is f(f1(Y))Yf(f^{-1}(Y)) \subseteq Y ?

Suppose that af(f1(Y))a \in f(f^{-1}(Y)) , there exists xinf1(Y)={xAf(x)Y}x in f^{-1}(Y) = \lbrace x \in A \mid f(x) \in Y \rbrace such that a=f(x)a = f(x) , then aYa \in Y .

For the second part, we are going to follow the logic as always, from what we know (the definitions) to what we don't (the results).

  • is Yf(f1(Y))Y \subseteq f(f^{-1}(Y)) ?

First, suppose that aYa \in Y , then, can we choose an xAx \in A such that f(x)=af(x) = a ? yes, if and only if the function is onto.

a function is onto if f(A)=Bf(A) = B .

In other words all the elemens in BB are an image of some element in AA .

With that property we can guarantee that our chosen element aa is a reverse image of some element, x=f1(a)f1(Y)x = f^{-1}(a) \in f^{-1}(Y) .

After that, we find a=f(x)f(f1(Y))a = f(x) \in f(f^{-1}(Y)) . Finishing our proof.

That, finishes this pill. I hope you enjoyed it. If you have any questions leave them in the comments.

Thank you for reading 😄.

Top comments (0)