Engineers often take for granted that functions have minimums and maximums. In general, the underlying goals of machine learning and optimization are to find the minima and maxima of functions. As things get more complicated and more complex ideas as thrown into the mix of real-world problems, it’s not always clear that a goal of finding these maxima or minima is even attainable. Luckily there is a solid framework from which mathematicians stand in order to know that algorithms are going to achieve their goals, i.e. solutions will be found.
In this series of posts I’m going to try to outline some of the functional analytic tools and ideas and present them in a much more easy-going way than you would normally find them in white papers or textbooks. They focus on outlines of the structures we need to build the framework of optimization. In some cases I will get into the necessary conditions for something to be true.
What type of background do you need to be able to understand this content in this series? Some undergraduate math courses. Maybe none; maybe you’re a keener. I’ll do my best to explain as many things as are necessary, but that will entail skipping out on some ideas. No homework, just examples and solved problems to motivate what’s needed where it’s needed. There won’t be many proofs, but I’ll link to as many as I can if you want/need the rigour.
This is not the precise definition of a function, but it will do for this section. Functions are mappings from (elements of) one set to another. In math we want the sets to be number sets, and additionally we want these number sets to be a field. Step 2 will have a proper definition of a function and more information about it, but for now we are going to look at what sets are.
You’re familiar with these, but we’re going to narrow the view to an optimization standpoint. We need a couple of definitions:
1.1 Definition: a set
A collection of distinct objects is called a set. These objects are referred to as members or elements of the set.
If is a set, and is an element of then we write and we say many different things to denote this: is an element of or belongs to or is in . Ex: If we let , then surely . We also have the notation which means ‘not in’, and for the set , then . Writing something like is wrong. However, we can and do write but there’s a big difference between the two. In the first case we’re misusing the symbol and in the second case, we mean “both 2 and 3 are in the set “. Using the symbol means on the left of it, there needs to be an element and on the right side a set. Sometimes things get tricky when the symbol is flipped, whereby we write ; now the element needs to be on the right and the set needs to be on the left.
There are some subtle rules about sets that are worth mentioning here:
1. The order of elements in a set is unimportant, hence the sets , , and are the same.
2. There is a set that contains no elements called the empty set and it is denoted by the symbols or .
3. Sets are equal if and only if they have the same elements.
4. Sets can have sets as elements. The empty set has no elements. The set has one element, the empty set. The set has two elements, etc.
5. All members of a set must be distinct. Well, sort of. The set is actually the set , but I don’t think anyone would have trouble with you calling a set, it’s just not the ‘proper’ set we want to use here.
6. Sets need to be well defined. You need to be able to tell whether a given object is a member of a given set or not, there is no maybe! Ex: The collection of all “nice” people in Calgary is not a set, since there is no good criteria to define what a nice person is.
Ex: The set has no elements. This is because the equation has no solution in the reals, and it follows that is the empty set, .
Now, above I said you can’t write something like because that’s not how we use , but have no fear, there is another symbol we use to denote such a thing. The symbol is . So we can write since the set of forms a sort of sub-set of . We really should formalize this into a proper definition though:
1.2 Definition: a subset
Let and be sets. The set is a subset of if every element in is also an element of ; we write and say is contained in or is a subset of .
Ex: Let , . Obviously (see point 3 above). You might say “Aha! But what if , then they aren’t the same!” We try not to be that tricky. Sometimes we leave the underlying set that we choose the numbers to be in.
There are some tricky things we can do with this notation. Every set has two obvious subsets, and . Any other subset of is called a proper subset, and we write ; we say is strictly contained in or is a proper subset of . The empty set is a proper subset of every nonempty set.
NOTE: This idea of ‘strictness’ exists a lot in mathematics. If I’m looking for a number that is less than, say, , I can write . But for that same sentence, to add emphasis I can also say that ‘x is strictly less than 5’ and I really mean the same thing. I’m just adding emphasis to outline that . You may have heard someone say “x is less than five” when is written, and it’s because saying “x is less than or equal to five” is much more cumbersome to say. I’m not saying it’s right, I’m just saying it happens.
CAUTION: Not every mathematician uses the symbol . They treat and as one and the same. I don’t know how I feel about this notation style, so in this blog if you see it should always be treated as a proper subset. Above, I said that the empty set is a proper subset of every nonempty set. By that, we have that , , and if and only if . Think of as being English for “could be a proper subset or could be the same set”.
NOTE: If both and then . We can also write this: If both and then . The opposite symbol means exactly what you’d think it means, and is called a superset.
Some examples would now be useful.
- Ex: The set of all vowels is a subset of .
- Ex: The set of natural numbers is a superset of the even positive integers in that .
CAUTION: We really abused some notation here. If you weren’t familiar with the symbols and before, we outlined here that the first one has elements on the left, sets on the right and the second has sets on both sides. You may also see in some literature the symbol used. It basically says, I have this placeholder which is the letter “A”, and from here on I want to use it interchangeably with the set . The second example above could be re-written:
It saves us having to write:
When doing math, we choose our sets have elements that are numbers, not abstract sets like ‘the set of all dog breeds’. We call these sets number sets and there are many different types of number sets to choose from. You may recall that the set of numbers is called the set of natural numbers. There is also a set called the integers , the set of rationals , and the set of real numbers or reals . Indeed, you may also recall that .
Since we’re dealing with numbers, it’s natural to want to have a few operations defined on numbers. The natural ones to want are addition, subtraction, multiplication, and division. We also want some properties to hold for these operations. These extra properties add structure to the elements in the sets we’re interested in: number sets.
Wikipedia does a great job on fields, so I’ll outline the basic things we need. It turns out that all we need are addition and multiplication. Subtraction and division are just inverse operations to addition and multiplication respectively. Here’s what we ask of these so-called fields:
Let be a set. Let addition and subtraction be as we expect them to be. If all of the axioms below hold for a given set , then we call a field.
Closure of addition and multiplication
1. For all , both and are in .
Ex: , then
2. For all , the following equalities hold: and .
3. For all , the following equalities hold: and .
Identity Elements Exist
4. There exists an element of called the additive identity element denoted by 0, so that for all , . Similarly, there exists an element of called the multiplicative identitity and denoted by 1, so that for all , . The additive and multiplicative identities must be separate elements.
Inverse Elements Exist (Definition of Subtraction and Division)
5. For every there exists an element such that . Similarly, for every there exists an element such that . In these ways we define subtraction to be the additive inverse and division to be the multiplicative inverse.
6. For all the following equality holds: .
Of all of the number sets listed above, only the rationals and reals fulfill these criteria. The reals are the only number set we really want to use. The rationals are missing the concept of completeness, which is a term that will be defined in Step 2 and emphasized later on.
Not so hard so far. We gave a name to the number sets that fulfill enough properties to be called a field. We started to think of functions as things that take elements from these number sets and map them to other sets. In this is all very straight forward: a function takes a number as its input and churns out another number. Things do however get harder, so I really just wanted to make sure we have a base set of terminology to move onward and upward from.