Lecture notes


Injective functions

Definition

A function is injective if two different elements have different function values (Funzione iniettiva, every element of the domain is mapped to a different value of the codomain)

Formal definition: A function is injective if Contrapositive:

Proving that a function is injective:

β†’ prove that it is injective

  • Let
    • β†’ Injective βœ…

β†’ prove that it is not injective

  • Not injective, since ❌

β†’ this is injective βœ…

Surjective functions

Definition

A function is surjective if every element of B is the image of an element of A β†’ the range is equal to the codomain (each element of the codomain has been mapped from at least an element of the domain)

Formal definition: A function is surjective if

Proving that a function is surjective

Warning

We can usually prove that a function is not surjective by finding a counterexample

Example 1

  • ❌

Example 2

We use one of the definitions, for example the definition of f(x) when x is even

  • Let
    • , so x is even
    • with x even,

We can also use the other definition:

  • Let
    • so x is odd

Example 3

  • take detailed notes of this example

Bijections

Definition

A function is a bijection if it is injective and surjective (Each element of the domain is mapped to exactly 1 element of the codomain)

Proving a function is bijective

Example 1

  • Not a properly defined function!
  • Since (domain), but (co-domain)

Example 2

  • Check if it is injective: (def)
    • Let
    • then
    • so β†’ Injective βœ…
  • Check if it is surjective: (def)
    • Disproof by counter example
    • (co-domain) β†’
    • β†’ x is not in the domain, f is not surjective ❌

The function is not bijective ❌

Example 3

Check if it is injective

  • Let
    • then
    • so β†’ Injective βœ…

Check if it is surjective

  • Let (co-domain)
    • choose an
    • ( )
    • and β†’ Surjective βœ…

Then the function is bijective βœ…


Inverse functions

Definition

The inverse of a function reverses the function (inverting all the arrows). A function needs to be bijective for the inverse function to be properly defined

Example

Calculating the inverse

  1. We start by calculating the inverse function
    1. so
  2. Is is defined on domain (co-domain of )?
    1. No, it is defined for
  3. We adjust the domain of so that they are both inverse functions of one another, making them bijective

Checking the inverse function

\left( 2\right) f^{-1}\left( f\left( x\right) \right) ,x\in \mathbb{R} -\left\{ 2\right\} \end{aligned}$$ ## Key takeaways - Do you know what injective, surjective means? - ο»Ώο»ΏCan you prove that a function is injective? - ο»Ώο»ΏCan you prove that a function is surjective? - ο»Ώο»ΏDo you know what a bijection is? - ο»Ώο»ΏDo you understand that only bijective functions are invertible? - ο»Ώο»ΏDo you know how to check that a function is the inverse? - - - ## Lecture slides ![[Attachments/DM-L9 Discrete Mathematics.pdf]]