DEV Community

0xc0Der
0xc0Der

Posted on Edited 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:A→Bf: A \to B .

from these definitions we can find that:

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

  2. f(A)={f(a)∣a∈A} f(A) = \lbrace f(a) \mid a \in A \rbrace is the set of all images of elments of AA .

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

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

two examples.

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

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

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

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

a∈{x∈X∣f(x)∈f(X)}=f−1(f(X))a \in \lbrace x \in X \mid f(x) \in f(X) \rbrace = f^{-1}(f(X))

proving that X⊆f−1(f(X))X \subseteq f^{-1}(f(X)) .

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 f−1(f(x))⊆Xf^{-1}(f(x)) \subseteq X ?

Suppose that a∈f−1(f(X))a \in f^{-1}(f(X)) then a∈{x∈X∣f(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)∣x∈X}f(a) \in F(X) = \lbrace f(x) \mid x \in X \rbrace , then there exists x∈Xx \in X such that f(x)=f(a)f(x) = f(a) .

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

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

A function is one-to-one if ∀a∈A∀b∈A(f(a)=f(b)→a=b)\forall a \in A \forall b \in A (f(a) = f(b) \rightarrow a = b) . which read, for any elements a∈A,b∈Aa \in A, b \in A , if have the same image, then they must be tha same.

assuming that ff is a one-to-one function and applying the definition above,

f(x)=f(a)→a=xf(x) = f(a) \rightarrow a = x
which means a∈Xa \in X .

proving that f−1(f(x))⊆Xf^{-1}(f(x)) \subseteq X .

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

Following the same procedure as the previous example.

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

Suppose that a∈f(f−1(Y))a \in f(f^{-1}(Y)) , there exists x∈f−1(Y)={x∈A∣f(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 a∈Ya \in Y .

provin that f(f−1(Y))⊆Yf(f^{-1}(Y)) \subseteq 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 Y⊆f(f−1(Y))Y \subseteq f(f^{-1}(Y)) ?

First, suppose that a∈Ya \in Y , then, can we choose an x∈Ax \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 xx such that x=f−1(a)∈f−1(Y)x = f^{-1}(a) \in f^{-1}(Y) .

After that, we find a=f(x)∈f(f−1(Y))a = f(x) \in f(f^{-1}(Y)) . 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 😄.

Top comments (0)