Exercise 5, Section 13 of Munkres’ Topology 
Show that if $\mathscr{A}$ is a basis for a topology on $X$, then the topology generated by $\mathscr{A}$ equals the intersection of all topologies on $X$ that contain $\mathscr{A}$. Prove the same if $\mathscr{A}$ is a subbasis.

I would first rephrase the problem:

If $\mathscr{A}$ is a basis for a topology on $X$, then $\mathscr{I}_\mathscr{A}=\cap_{\alpha \in A} \mathscr{T}_{\alpha}$, where each  $\mathscr{T}_{\alpha}$ is topology on $X$, $\mathscr{A} \subseteq \mathscr{T}_{\alpha}$

My attempt: let $\mathscr{I}_\mathscr{A}$ denotes topology generated by basis $\mathscr{A}$. To show $\cap_ {\alpha \in A} \mathscr{T}_{\alpha} \subseteq \mathscr{I}_{\mathscr{A}}$.Proof: If $U\in \cap_ {\alpha \in A} \mathscr{T}_{\alpha}$, then $U\in \mathscr{T}_{\alpha}, \forall \alpha \in A$. Since $\mathscr{A}$ is basis, $\forall x\in X, \exists \mathcal{A} \in \mathscr{A}$ such that $x \in \mathcal{A}$. So, $\forall x \in U, \exists \mathcal{A}_{x}\in \mathscr{A}$ such that $x\in \mathcal{A}_{x}$. Thus, $U \subseteq \cup_{x \in U} \mathcal{A}_{x}$. If $y \in \cup_{x \in U} \mathcal{A}_{x}$, then $y\in \mathcal{A}_{j}$, for some $j\in U$. Since $\mathcal{A}_{j}\in \mathscr{A}$, $\mathcal{A}_{j} \subseteq X$. So, $y\in \mathcal{A}_{j} \subseteq X$[Edit: next step/claim is complete garbage]. Thus, $\cup_{x \in U} \mathcal{A}_{x} \subseteq U$. Hence $U = \cup_{x \in U} \mathcal{A}_{x}$. By lemma 13.1, $U\in \mathscr{T}_{\mathscr{A}}$. Is this proof correct?
The way I proved this inclusion, I don’t think it’s correct, because it shows any subset of $X$ can be written as unions of elements of $\mathscr{A}$. Maybe somewhere in the proof I did something wrong.
The ideal solution to this problem is here: Prob. 5, Sec. 13 in Munkres' TOPOLOGY, 2nd ed: How to distinguish between a basis and a subbasis?
 A: We want
$$\mathcal{T}_{\mathcal{A}} = \bigcap\{\mathcal{T}\mid \mathcal{T} \text{ a topology on } X \text{ and } \mathcal{A} \subseteq \mathcal{T}\}\tag{1}$$
As by definition $\mathcal{T}_{\mathcal{A}}$ is a topology that contains $\mathcal{A}$ we have immediately that the right hand intersection is a subset of $\mathcal{T}_{\mathcal{A}}$ in both the base and the subbase case. So $\supseteq$ is trivial (any intersection is a subset of all its constituent sets).
The other inclusion follows from how we construct $\mathcal{T}_{\mathcal{A}}$. If $\mathcal{A}$ is a base, then any $O \in \mathcal{T}_{\mathcal{A}}$ is by definition a union $O = \bigcup \mathcal{A}'$ for some $\mathcal{A}' \subseteq \mathcal{A}$. If $\mathcal{T}$ is any topology containing $\mathcal{A}$ it must contain $O$ by the union axiom. So $O \in \mathcal{T}$ and as $\mathcal{T}$ was arbitrary, $O$ is in the right hand intersection. Hence $\subseteq$ for the base case.
The subbase case is similar: we first construct the base $\mathcal{B}_{\mathcal{A}}$ from the subbase (the finite intersections) and any topology $\mathcal{T}$ containing $\mathcal{A}$ contains this base by the intersection axiom. Then we apply the union axiom again to conclude that any $O \in \mathcal{T}_{\mathcal{A}}$ also is in such a $\mathcal{T}$ etc. So $\subseteq $ holds once more.
Looking at it from a higher standpoint: the intersection in $(1)$ is by definition the topology generated by a subfamily $\mathcal{A}$; it's always well-defined because the set of topologies always includes the discrete topology (the power set) and any intersection of topologies on a set is a topology on that set (topologies form a complete lattice). The point of the Munkres exercise is to show that the internal way to generate a topology from a base or a subbase actually coincides with the aforementioned abstract view in both cases.
