functions and their inverses: 2 insightful examples.
Tags: math, tutorial, learning, mathpills
Published: 2024-06-30 13:53:18

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 {% katex inline %} f: A \to B {% endkatex %}.

from these definitions we can find that:

1. any element {% katex inline %} a \in A {% endkatex %} its **image** {% katex inline %} f(a) {% endkatex %} must belong to {% katex inline %} B {% endkatex %}

2. {% katex inline %}
    f(A) = \lbrace f(a) \mid a \in A \rbrace
{% endkatex %} is the set of all images of elments of {% katex inline %} A {% endkatex %}.

Let {% katex inline %} g: B \to A {% endkatex %} be a function that does the inverse of what {% katex inline %} f {% endkatex %} does then:

{% katex %}
    g(B) = f^{-1}(B) = \lbrace a \in A \mid f(a) \in B \rbrace
{% endkatex %} where {% katex inline %} f^{-1}(x) {% endkatex %} is a special notation to write the inverse function.

## two examples.

**First Example**: suppose that {% katex inline %} X \subseteq A {% endkatex %}. does {% katex inline %} f^{-1}(f(X)) = X {% endkatex %}.

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

- first, is {% katex inline %} X \subseteq f^{-1}(f(X)) {% endkatex %}?

Suppose that {% katex inline %} a \in X {% endkatex %}, then from the above definition {% katex inline %} f(a) \in f(X) {% endkatex %}, then {% katex %} a \in \lbrace x \in X \mid f(x) \in f(X) \rbrace = f^{-1}(f(X)) {% endkatex %}

proving that {% katex inline %} X \subseteq f^{-1}(f(X)) {% endkatex %}.

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 {% katex inline %} f^{-1}(f(x)) \subseteq X {% endkatex %}?

Suppose that {% katex inline %} a \in f^{-1}(f(X)) {% endkatex %} then {% katex inline %} a \in \lbrace x \in X \mid f(x) \in F(X) \rbrace {% endkatex %}, which means that {% katex inline %} f(a) \in F(X) = \lbrace f(x) \mid x \in X \rbrace {% endkatex %}, then there exists {% katex inline %} x \in X {% endkatex %} such that {% katex inline %} f(x) = f(a) {% endkatex %}.

If we can prove that {% katex inline %} a = x {% endkatex %}, then {% katex inline %} x \in X {% endkatex %}. which proves the second part.

This is easy if {% katex inline %} f {% endkatex %} is a **one-to-one** function.

A function is **one-to-one** if {% katex inline %} \forall a \in A \forall b \in A (f(a) = f(b) \rightarrow a = b) {% endkatex %}. which read, for any elements {% katex inline %} a \in A, b  \in A {% endkatex %}, if have the same image, then they must be tha same.

assuming that {% katex inline %} f {% endkatex %} is a one-to-one function and applying the definition above, {% katex %} f(x) = f(a) \rightarrow a = x {% endkatex%} which means {% katex inline %} a \in X {% endkatex %}.

proving that {% katex inline %} f^{-1}(f(x)) \subseteq X {% endkatex %}.

**Second Example**: suppose that {% katex inline %} Y \subseteq B {% endkatex %}. does {% katex inline %} f(f^{-1}(Y)) = Y {% endkatex %}.

Following the same procedure as the previous example.

- first, is {% katex inline %} f(f^{-1}(Y)) \subseteq Y {% endkatex %}?

Suppose that {% katex inline %} a \in f(f^{-1}(Y)) {% endkatex %}, there exists {% katex inline %} x \in f^{-1}(Y) = \lbrace x \in A \mid f(x) \in Y \rbrace {% endkatex %} such that {% katex inline %} a = f(x) {% endkatex %}, then {% katex inline %} a \in Y {% endkatex %}.

provin that {% katex inline %} f(f^{-1}(Y)) \subseteq Y {% endkatex %}.

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 {% katex inline %} Y \subseteq f(f^{-1}(Y)) {% endkatex %}?

First, suppose that {% katex inline %} a \in Y {% endkatex %}, then, can we choose an {% katex inline %} x \in A {% endkatex %} such that {% katex inline %} f(x) = a {% endkatex %}? yes, if and only if the function is onto.

a function is **onto** if {% katex inline %} f(A) = B {% endkatex %}.

In other words all the elemens in {% katex inline %} B {% endkatex %} are an image of some element in {% katex inline %} A {% endkatex %}.

With that property we can guarantee that our chosen element {% katex inline %} a {% endkatex %} is a reverse image of some element {% katex inline %} x {% endkatex %} such that {% katex inline %} x = f^{-1}(a) \in f^{-1}(Y){% endkatex %}.

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


That concludes this pill. I hope you enjoyed it. If you have any questions leave them in the comments, I'd be happy to answer them.

Thank you for reading :smile:.