Variables and Equations
Variables and Equations
We're going to introduce a bit more logic in this chapter, and define in a logical manner what equations are, along with introducing the concept of relationships. This is usually not how the concept is introduced, but I feel like to go in a structured manner, we need to tackle a lot of logical foundations, that otherwise we just take for granted.
First of all, some extra set and logical notation
We talked about sets a little. We extend the number of "operators" we know by introducing the following "contained in" symbol . This symbol looks a bit similar to , and rather than meaning that a single element is contained in the set (e.g. ), we are meaning that a set is fully contained within another. That is, in the expression we are saying that "Every element of A is also an element of B". B could contain more elements, but all of the ones in A are represented. This relation symbol is called subset of.
In logical form:
The above can also be represented with the form:
The symbol means "implies". In the statement , the whole statement is always True, except in the case where A is True but B is False. So it gives us a guarantee that if that implication holds, we're sure "B holds if A holds (at least)".
F | F | T |
F | T | T |
T | F | F |
T | T | T |
Of course, in this formulation, the set "B" doesn't have to be equal to the set "A", the important thing is that it contains at least all the elements of "A". If we instead want to declare it strictly bigger, we use the symbol , and declaring implies B strictly bigger. What that logically means is this:
That is, the previous statement about B containing every element of A is kept, but we add the constraint (by adding it with a "logical and" ) that exists an element in B that is not in A (that's what means).
For convenience, the two symbols have a mirrored version in , which is just the same operators, but with the two sets inverted.
and
. I had to use rather than there, because I am comparing differing statements, rather than values. The operator behaves like the symbol, but only works on logical statements, making sure those are basically equal ways of expressing the same concept.
Relations and equality
Now we have to truly tackle the issue of, what really is the operator ? On numbers, it was a bit self evident that it would be comparing values, rather than expressions, but why does it not make sense to do things like ?
The answer to the previous questions is that we have to talk about relations. And to talk about that, we introduce something seemingly unrelated first.
Tuples
Right now, we've assumed that mathematical values are just statements with a truth values, or numbers. The true answer here is that anything that is an element of a set, is a value that we can manipulate, independent of how it's structured. As long as we define operators that work on those elements, we can build any expression we want out of all the values we want.
If we defined set and an operation working as such:
We can now express writings as:
Simplify:
Simplify:
So, no matter our "elements", as long as we define operations on them, we can write out any kind of expression we want.
So, we introduce a new kind of element, written as such:
This is an "ordered pair"/"tuple", where both "x" and "y" are going to be elements from other sets, but the important thing here is that "x" comes before "y". Since we have not defined anything about them, we cannot do yet operations such as
But we could define them to be pairwise for example, the important thing is the definition of our operators. Also, of course, these are not "sets", because in sets, the element ordering does not matter.
Also when I talk about elements, elements could technically be sets themselves, or tuples. That's why when we specify "x" and "y", we always declare what sets "x" and "y" are picking values from.
And now we define what we call cartesian product. When talking about a tuple, we need to be clear where the elements come from. So we define a set where our tuple (in its entirety), can take values from.
Let's say set and set . A possible value could take the form but not as we said order is important. All the possible values are:
Even though we started with only 2 elements per set, we end up with 4 in total. This is the reason why it's called product, as it's multiplying the set cardinalities (how many elements each set has) together. In mathematical notation:
So and in our case, therefore the cardinality of the product is 4.
Relations
We can now define what a relation is. A relation is an operator of the form , where it outputs a "logical statment" with a truth value, depending on whether the tuple is in , where "R" is defined as:
That is, a relation is a subset of the cartesian product of the two sets "A" and "B" that we choose.
Let's be a bit more concrete and have an example. Let's look at equality over the lenses of naturals only.
So, when writing , we're testing whether . Ergo there's a subset of the cartesian product of naturals with themselves, formed by tuples like or , but not with . Ergo, the relationship shown here is simply testing that both sides of the "=" operator are actually the same value.
To get back to a previous article, if we were testing to see if , we could technically multiply both sides by zero, we end up with , and therefore , which does test True, but does not get us any closer to finding out what values of "x" make the previous equation correct.
Therefore we have that the tuple has to be in the relation Eq. Also, this relation Eq, can be extended to different sets, and not just . As a foreshadowing to the future, we could have equations that are satisfied for multiple values of "x", and therefore produce multiple tuples of that are in the Eq relationship. Conversely, we could find out that there are some equations that produce no possible result of "x" that satisfies the constraint of equality, so they produce no tuple that is in the relation.
An example of the latter is if we were only checking the sets of natural numbers:
We now have the tuple , which while possible, is not part of (denoting equality only in the sets of natural numbers).
We'll look a bit more in depth at what relations are in the next article, and some examples apart from just equality. For now, you can think of equality as an binary (two arguments) operator , where the two arguments have the same exact "value". Concatenating such as
is to denote the tuples and . Of course, both of these simplify to the same form of . When looking at inequalities, we'll see what properties these relations have, in the same manner as we did for operators and their laws.