Real Analysis/Metric Spaces

Often "d" is omitted and one just writes "X" for a metric space if it is clear from the context what metric is being used.
We already know a few examples of metric spaces. The most familiar is the real numbers with the usual absolute value. That is, we take "X" = R and we let "d"("x", "y") = |"x" − "y"|. To see this is a metric space we need to check that "d" satisfies the four properties given above. Let's check and see.
 Another familiar example is the plane. That is we take "X" = R2. In order to define the metric, let's recall how we usually measure the distance between two points "x" = ("x"1, "x"2) and "y" = ("y"1, "y"2) in the plane. We simply use the Pythagorean theorem,
to see that we should define formula_2. First notice that this is always defined, because we are squaring the terms inside the square root we are never in danger of attempting to take the square root of a negative number, so "d" : R2×R2 → R. Now we need to check that it is a metric.
Other examples are abundant. As alluded to above we could take "X" = R"n" with the usual metric formula_3. Or instead, we could keep "X" = R"n", and simply take a different metric. This would be a different metric space, because a metric space is the "pair" ("X","d"), so a change in "d" changes the metric space. Some very interesting metrics occur if you take the metric formula_4, or formula_5. Notice the first metric we defined on R"n" corresponds to taking "p" = 2. This metric is often called the Euclidean (or usual) metric, because it is the metric that is suggested by Euclidean geometry, and it is the most common metric used on R"n". 
Metric spaces could also have a much more complex set as its set of points as well. For example, we let "X" = C([a,b]), that is "X" consists of all continuous function "f" : [a,b] → R. And we could let formula_6. Part of the Beauty of the study of metric spaces is that the definitions, theorems, and ideas we develop are applicable to many many situations. 
Of course most of our intuition for metric spaces comes from our understanding of distances in R2, so we should think about what an open ball looks like in R2. It is hopefully a familiar fact from calculus that the equation ("x" − "x"0)2 + ("y" − "y"0)2 = "r"2 describes a circle of radius "r". The points such that formula_7 is just the set of points inside this circle. None of on the boundary of the circle are contained in the set, which is why choice to call this set an "open" ball.
It is also instructive to examine what this definition is when "X" = R, and "d"("x", "y")=|"x" − "y"|. Following the definition we have that 
"B""r"("x") = {y∈R | |"x" − "y"|&lt;r}. Thus, "B""r"("x") is the open interval ("x" − "r", "x" + "r").
Once we have defined an open ball, the next definition we need is that of an open and close sets.
Before we move on to closed sets, we first must clean up one potentially awkward situation. We have just given a general definition of what it means for any set to be open, but we have been using the phrase previously been talking about "open balls." But nothing guarantees us ahead of time that our open balls are in fact open in the sense of the definition above. This could leave us in a position where we mean two different things with the expression "open ball". Thankfully it turns out that the open ball is in fact open in the sense of the definition above, but this is still a theorem and requires proof. 
One important point needs to made about the definition of open. Consider the empty set, it is certainly a subset of the metric space "X". Is it open? Well for every point "x" in the empty set we need to find a ball around it. This is easy because there are no points in the empty set. That is, for the empty set, the condition is vacuously true. Informally speaking, a statement that requires some property hold under various conditions is said to be vacuously true when the conditions are never met. For example, the statement "Every time I stand on the sun, I break dance" is a vacuously true statement. It may not be possible to break dance on the sun, but the statement remains true. For the statement to be false, there would have to be a time when I was standing on the sun, but I did not break dance. But since I have never stood on the sun, there is nothing to check. 
Another very use, and very simple example of an open set is the whole space. For every point "x"∈"X", we may simply take the open ball "B"1("x"), by definition this ball is a subset of "X", so there is an open ball around "x" that remains inside of "X".
Now we again have two easy examples of closed sets. First let's consider the whole space "X", the complement of "X" is "X" \ "X" = ∅. Similarly, if we consider the empty set ∅, then "X" \ ∅ = "X". Since the set "X" is open, it follows that ∅ a is closed set. An important point here is that we already see that there are sets which are both open and closed. Even though the definitions involve complements, this does not mean that the two types of sets are disjoint. There are cases, depending on the metric space, when many sets are both open and closed. Even more, in every metric space the whole space and the empty set are always "both" open and closed, because our arguments above did not make use to the metric in any essential way.
Basic definitions.
Let "X" be a metric space. Here we give some basic definitions of properties that are often discussed for subsets "E" of "X"
Basic proofs.
1. "Every neighborhood is an open set"
2. "If p is a limit point of a set E, then every neighborhood of p contains infinitely many points of E"
3. "A finite set has no limit points" 
4. "A set is open if and only if its complement is closed."
5. "A set is closed if and only if its complement is open."