Question about proof of lemma V.1.3 in Robin Hartshorne's Algebraic Geometry on page 358. Let $X$ be surface. That's for us a nonsingular projective surface over an algebraically closed field $k$ and for any divisor $D \subset X$ (that's a curve) we call $\mathcal{L}(D)$ the related invertible sheaf of $D$ on $X$.
Lemma 1.3. Let $C$ be an irreducible nonsingular curve on $X$, and let $D$ be any curve meeting $C$ transversally. Then $$\#(C \cap D) = \operatorname{deg}_C(\mathcal{L}(D) \otimes_{O_X} \mathcal{O}_C)$$.
PROOF. Here, of course, $\mathcal{L}(D)$ is the invertible sheaf on $X$ corresponding to curve $D$ ($II, §7$), and $\operatorname{deg}_C$ denotes the degree of the invertible sheaf $\mathcal{L}(D) \otimes \mathcal{O}_C$ on $C$ ($IV, §1$). We use the fact $(II, 6.18)$ that $\mathcal{L}(-D)$ is the ideal sheaf of $D$ on $X$. Therefore, tensoring
$$ 0 \to \mathcal{L}(-D) \to \mathcal{O}_X \to \mathcal{O}_D \to 0 $$
with $\mathcal{O}_C$, we have an exact sequence
$$ 0 \to \mathcal{L}(D) \otimes \mathcal{O}_C \to \mathcal{O}_C \to \mathcal{O}_{C \cap D} $$
where now $C \cap D$ denotes the scheme-theoretic intersection. Thus $\mathcal{L}(D) \otimes \mathcal{O}_C$ is the invertible sheaf on $C$ corresponding to the divisor $C \cap D$.
This proof has a part I not understand. Why if we tensor the injection $0 \to \mathcal{L}(-D) \to \mathcal{O}_X$ on the left with $\mathcal{O}_C$ the induced $\mathcal{L}(D) \otimes \mathcal{O}_C$ is still injective?
The only assumption on $C$ and $D$ we use is that are transversally. This means (page 357) that for every point $P \in C \cap D$ the local equations $f,g \in \mathcal{O}_{X,P}$ of $C,D$ at $P$ generate the maximal $\mathfrak{m}_P$ of $\mathcal{O}_{X,P}$. This implies also that $C$ and $D$ are each nonsingular at $P$, because $f$ will generate the maximal ideal of $P$ in $\mathcal{O}_{D,P} = \mathcal{O}_{X,P}/(g)$ and vice versa.
Why this assumption is sufficient to get the injectivity? Let's discuss it locally, set $A:= \mathcal{O}_{X,P}$, $f, g \in A$ are local equations of $C$ and $D$ at $P$ and we tensor the canonical injection
$$ 0 \to g \cdot A \to A $$
with $A/(f)$ and obtain
$$g \cdot A \otimes_A A/(f) \to A/(f) $$
and I want to check that it's injective. Note that that's the canonical map given by $g \cdot a \otimes b \mapsto g \cdot a \cdot b$ where $a \in A$ and $b \in A/(f)$. Assume the map is not injetive, then there exist $a \in A$ and $b \in A \backslash (f)$ with $g \cdot ab \in (f)$. Transversallity says that $g \notin (f) $ but the regular local ring $A= \mathcal{O}_{X,P}$ is not assumed to be unique factorization domain, therefore it is in general not possible to conclude that $b \in (f)$, which would contradict to assumption. This not helps to prove injectivity of the map $g \cdot A \otimes_A A/(f) \to A/(f)$. Any other idea to give a formally correct argument?