Do these two definitions of "open set" consist? I am new to topology and have just encountered a definition of open sets:

Let $T$ be a topology on a set $X$, any element in $T$ is called an open subset.

But in the earlier analysis course, the definition of open set is:

For E as a subset of a metric space $X,d$, E is open if for all $x$ belongs to $E$, exists $\epsilon&gt;0$ such that $B_\epsilon(x)$ is a subset of $E$.

I cannot see the connection between these two definitions so far. 
As both of them define the concept of open sets, I think they should be equivalent or at least consistent. So could someone tell me to see if they consists?

Thanks so much!
One way in which math advances is that we create new generalizations that allow us to apply old ideas into new contexts.

This process requires us to create a new definition that extracts some key properties of the old definition in the old context, show how that definition can match the old definition in the old context, prove results from those properties, and then apply them to new contexts.

As you learned in analysis, the idea of open sets comes from metric spaces.  And notions such as "continuity" come from what the open sets on the metric space are.  You can change the metric a lot, but as long as the open sets remain the same, a lot remains the same.

So our generalization is to declare the set of open sets to be something called a topology.  We then write down a set of axioms that the set of open sets in a metric space satisfy.  And we call the set of open sets in a metric space to be the topology induced by that metric.  In the case of metric spaces, "open set" still means the same thing that it used to, and all of the old results apply.  But now we can apply the idea in new contexts, and get new results of interest.
They are consistent in a metric space where the topology is generated by the distance function. 

Given some set $X$ and $T$ a family of subsets of $X$, we'll say $(X,T)$ is a topological space if it satisfices:

$\emptyset,X\in T$

$\forall U,V\in T,U\cap V\in T$

$\forall \lbrace U_i\rbrace_{i\in I}\subset T,\bigcup_{i\in I}U_i\in T$

Also we define, given some family $B$ that satisfices $\forall U,V\in B,\forall x\in U\cap V,\exists W\in B:x\in W\subset (U\cap V)$ and $\bigcup_{U\in B}U=X$, the topology spanned by $B$ as $T=\lbrace \bigcup_{i\in I}U_i:\lbrace U_i\rbrace_{i\in I}\subset B\rbrace$. We say $B$ is a base of $T$.

Given these definitions, we can prove that $\mathcal{B}=\lbrace B(x,r):x\in X,r\geq0\rbrace$ is the base of the family of open sets, as you defined in your previous course of analysis, wich is a topology (since satisfices the three properties above). In other words the topology spanned by $\mathcal{B}$ coincides with the family of open sets in a metric space.