I'm formalizing this useful algebraic method. In simple words: we have algebras $A,B$ (not necessarily commutative) over a field $F$. we define a function $\varphi:A \rightarrow B$ on a set of generators (of $A$ (as an $F$-module) $v_1,...,v_n$. we manually check that on these generators $\varphi$ obeys: $\varphi (a+b) = \varphi (a) + \varphi(b), \varphi (ab) = \varphi (a) \varphi (b)$ (if the generators are linearly independent, we don't have to check the addition condition). we extend it linearly by definition to an $F$-module homomorphism (this is well defined), and we amazingly also get an $F$-algebras homomorphism:
$\varphi ((\sum a_iv_i)(\sum b_jv_j)) = \varphi (\sum a_ib_jv_iv_j) = \sum \varphi(a_ib_jv_iv_j) = \sum a_ib_j \varphi (v_i) \varphi (v_j) = (\sum a_i \varphi (v_i))(\sum b_j \varphi (v_j))$
since for every $a \in F$ we get $\varphi (a) = a$.
My questions are: is this really a an F-algebras homomorphism, and is this proof valid in general? (since its my own formalization I'm not sure), and do you know any book which should contain such useful lemmas, or a graduate/bachelor's math course usually deals with such? haven't seen this on any of the textbooks I've used so far / courses I took.