Universal property of tensor product and fibre product - how to convert the diagrams We have two diagrams for the universal property of tensor product of rings and the fibre product for schemes. See here for fibre product, which is a square, and here for tensor product, which is a triangle (this is the "for any $R$-bilinear map ..." diagram).
However, I also know that the tensor product is a "fibre coproduct", so they should have diagrams in the same shape.
How can I convert the triangular diagram for tensor product into a square? Where does the bilinear map go?
 A: The triangular definition in your link defines the tensor product of modules. The definition you were hoping for, a cocartesian square, defines the tensor product of algebras.  The two definitions are connected by a theorem (or maybe just a proposition) saying that the underlying module of the algebra-tensor-product of two algebras is the module-tensor-product of their underlying modules. Once one knows this theorem, it's safe to be sloppy and use the same name, "tensor product", for both the algebra version and the module version, because they agree (sufficiently)
whenever both are defined.
A: Given a commutative unital ring $A$, consider the category of $A$-algebras. For two $A$-algebras $B,C$ we can form their tensor product as $A$-modules $B\otimes_A C$. One can check that the map $B\otimes_AC \times B\otimes_AC \to B\otimes_AC$ given by $(b\otimes c,b'\otimes c') \mapsto bb'\otimes cc'$ gives $B\otimes_AC$ a ring structure.
The maps $B \to B\otimes_AC$, $C \to B\otimes_AC$ given by $b \mapsto b \otimes 1$ and $c \mapsto 1\otimes c$ realize the tensor product of algebras as a coproduct in the category of $A$-algebras, that is, for each $A$-algebra $D$ and maps $B \to D, C \to D$ there is a unique map $B\otimes_A C \to D$ making the corresponding diagram commute.
Now, there is an anti-equivalence of categories between the category of affine schemes and the category of commutative rings with unit. The fibre-product $X \times_S Y$ of two affine schemes over an affine scheme $S$ is just the product in the relative setting, i.e. $X \times_S Y$ is the product of $X,Y$ in the category of affine $S$-schemes, i.e. there are projections (which are $S$-morphisms) $X \times_S Y \to X$ and $X \times_S Y \to Y$ and for each affine $S$-scheme $Z$ and $S$-morphisms $Z \to X,Z\to Y$ there is a unique $S$-morphism $Z\to X \times_S Y$ making the corresponding diagram commute.
Writing $S=\text{Spec }A$ this category is anti-equivalent to the category of $A$-algebras. The anti-equivalence preserves limits, hence coproducts and products, but reverses arrows, hence the product in the category of affine $S$-schemes (the fibre-product over $S$) corresponds to the coproduct in the category of $A$-algebras (the tensor product of algebras over $A$). More precisely, if $X= \text{Spec }B, Y= \text{Spec }C$, then $X \times_S Y= \text{Spec }(B\otimes_A C)$ and $B\otimes_A C \cong \Gamma(\mathscr{O},X \times_S Y)$, where $\mathscr{O}$ is the structure sheaf on $X \times_S Y$ and $\Gamma$ is the global sections functor. This is how the squares are related.
P.S. I'm sorry I tried adding the diagrams, but they always ended up looking wonky. If anyone has an idea how to do this, let me know.
A: Question: "How can I convert the triangular diagram for tensor product into a square? Where does the bilinear map go?"
Answer: The diagram (in the case of rings and tensor products) is the following diagram:
$$
\require{AMScd} \begin{CD} C @<<< B  \\ @AAA @VVV\\ A @> >> A\otimes_R B \end{CD}
$$
Give any pair of maps $\phi: B\rightarrow C,\psi: A \rightarrow C$ commuting over $R$, there is a unique map $\rho: A\otimes_R B \rightarrow C$ commuting with the canonical maps from $A,B$. The map $\rho$ is defined by
$$\rho(a\otimes b):=\psi(a)\phi(b)$$
for any $a\otimes b \in A\otimes_R B$
When you "pass to affine schemes" you get a similar diagram with arrows reversed.
This proves the "universal property" for fiber products of affine schemes. The general case follows from a "glueing procedure" (Hartshorne Theorem II.3.3).
