Description
The pullback functor in the category of rings. Given ring maps $f : A \to B$ and $g : C \to B$, this tries to compute the pullback of $\{A \to B \leftarrow C\}$ in the category of rings. It requires that $A \to B$ is a surjective map of rings (otherwise it will give an error) and it requires that $C \to B$ is finite (otherwise it will never terminate). Currently, it requires that the variable names of the rings $A$ and $C$ are distinct and that the variable names of $A$ are variable names of $B$ and those variables get sent to one another. If the Verbose option is turned on, then certain steps in the process will be specified.We begin by doing a pullback which glues two lines together.
i1 : A = QQ[x];

i2 : I = ideal(x);
o2 : Ideal of A

i3 : B = A/I;

i4 : C = QQ[y];

i5 : f = map(B, A);
o5 : RingMap B < A

i6 : g = map(B, C, {0});
o6 : RingMap B < C

i7 : (pullback(f,g))#0
QQ[IGen1, CGensInA1]
o7 = 
IGen1*CGensInA1
o7 : QuotientRing

We next construct the pinch point, otherwise known as Whitneys umbrella, by gluing.
i8 : A = QQ[x,y];

i9 : I = ideal(x);
o9 : Ideal of A

i10 : B = A/I;

i11 : C = QQ[u];

i12 : f = map(B, A);
o12 : RingMap B < A

i13 : g = map(B, C, {y^2});
o13 : RingMap B < C

i14 : (pullback(f,g))#0
QQ[IGen1, CGensInA1, KGens1]
o14 = 
2 2
IGen1 CGensInA1  KGens1
o14 : QuotientRing

We include a final example showing how to create a cusp.
i15 : A = QQ[x];

i16 : I = ideal(x^2);
o16 : Ideal of A

i17 : B = A/I;

i18 : C = QQ[];

i19 : f = map(B, A);
o19 : RingMap B < A

i20 : g = map(B, C, {});
o20 : RingMap B < C

i21 : (pullback(f,g))#0
QQ[IGen1, KGens1]
o21 = 
3 2
IGen1  KGens1
o21 : QuotientRing
