Functions

Intuition

Defining "functions"

Traditionally, math defines only unary functions.

Esp. in CS, convenient to define functions of other arities.

Total vs. partial functions

Math functions vs. Programming language functions


Defining specific functions

Class might skim or even skip this, depending on time.

You have lots of experience with this. But, here's a few CS-useful specifics you might not be familiar with.


Some properties of functions

Draw diagrams of mapping. For each, consider f:X→Y.

Example proof: If f is bijective, then f is invertable.

Given that f is bijective, we'll construct a function g:Y→X. Then we show that this particular g is f's inverse.

Define g: For all y0∈Y, we define g(y0) as the element x0 such that f maps x0 to y0.

Weird wording. Is g well-defined?

g sounds like the inverse of f, but is it really?