Topology generated by a basis or subbasis is the intersection of all topologies containing it I am self studying Munkres' Topology and was struck on this exercise question of section 13. I don't have any help from teacher or friends.  So, I am asking for any explanation here.
The question is

Show that if $A$ is a basis for a topology on $X$, then the topology generated by $A$ equals the intersection of all topologies on $X$ that contain $A$.
  Prove the same if $A$ is a subbasis.

The intuition is clear to me but I don't know how to write a proper proof. 
Can you please tell me for both parts.
 A: Suppose $\mathcal{B}$ is a base for a topology $\mathcal{T}$.
We want to show $$\mathcal{T} = \bigcap \{ \mathcal{T}': \mathcal{T}' \text{ is a topology on } X; \mathcal{B} \subseteq \mathcal{T}'\}$$
So let $O$ be in $\mathcal{T}$, and we want to show it is in the intersection, so let $\mathcal{T}'$ be any topology that contains $\mathcal{B}$ as a subset. Then $O$ in $\mathcal{T}$ means that $O = \bigcup \mathcal{B'}$ where $\mathcal{B}' \subseteq \mathcal{B}$, because the topology generated by a base is the set of unions of subfamilies of that base (!). But so $$\mathcal{B}' \subseteq \mathcal{B} \subseteq \mathcal{T}'$$ and as $\mathcal{T}'$ is closed under unions (being a topology), $O \in \mathcal{T}'$.
As $\mathcal{T}'$ was an arbitary topology that makes up the intersection we have that $O$ is in the right hand intersection of topologies. This shows one inclusion.
One minor modification is needed for the subbase case: if $\mathcal{S}$ is a subbase for that same topology $\mathcal{T}$, then we can define a base $\mathcal{B}$ from it by taking all intersections of finite subfamilies of $\mathcal{S}$ and $\mathcal{T}$ is then also the topology generated by $\mathcal{B}$, and any topology $\mathcal{T}'$ that contains $\mathcal{S}$ will also contain $\mathcal{B}$, as all topologies are closed under finite intersections, so the subbase case reduces to the base case.
The other, reverse inclusion is trivial, in both cases. $\mathcal{T}$ (the set of unions of base subfamilies) is itself one of the topologies that contains $\mathcal{B}$ (as each member $B \in \mathcal{B}$ is trivially the union of $\{B\} \subseteq \mathcal{B}$ and by previous results we know the set of unions is a topology) and so trivially, if $O$ is in the intersection it is in $\mathcal{T}$ in particular. 
So we have equality of topologies. In all pedantic detail...
A: In lemma 13.1 in Munkres it is proved that - if $\mathcal A$ is a basis for a topology $\tau$ on $X$ - this topology is the collection of all unions of elements of $\mathcal A$.
Now let it be that $\rho$ is a topology on $X$ with $\mathcal A\subseteq\rho$.
Then - because $\rho$ is closed under arbitrary unions - it is immediate that also $\tau\subseteq\rho$.
So if $\mathcal T:=\{\rho\mid \rho\text{ is a topology on }X\text{ with }\mathcal A\subseteq\rho\}$ then $\tau\subseteq\bigcap\mathcal T$.
Next to that we have $\tau\in\mathcal T$ so that also $\bigcap\mathcal T\subseteq\tau$.
This together proves that $$\tau=\bigcap \mathcal T$$

For a subbase $\mathcal S$ you can reason likewise. Use the fact that by definition the topology generated by $\mathcal S$ is the collection of all unions of finite intersections of elements of $\mathcal S$.
A: Let $\tau$ be the topology generated by $A$.  Clearly $\tau$ contains $A$.  Thus one direction is obvious. 
But the other is also easy, because by definition $\tau$ is the coarsest topology containing $A$.  This means $\tau\subset\rho$ for every topology $\rho$ containing $A$.
This reasoning works if $A$ is a basis or sub-basis. 
