Function: TwistedTensorProduct(R,S,n,EhomG,GmapE,NhomE,NEhomN,EltsE,Mult,InvE)

Description:
This function constructs the first n terms of a smallish free ZE-resolution F of Z for a group E using a known ZG-resolution R for a quotient group G=E/N, and a known free ZN-resolution S. The function inputs:

- a free ZN-resolution S (which must have a contracting homotopy),
- a free ZG-resolution R (which only requires a contracting homotopy if F requires one),
- a positive integer n,
- a function EhomG(i) which returns the position in G of the quotient of the i-th element in E,
- a function GmapE(i) satisfying EhomG(GmapE(i))=i,
- a function NhomE(i) which returns the position in E of the inclusion of the i-th element in N,
- a function NEhomN(i) satisfying NEhomE(NhomE(i)) =i,
- a (possibly partial) listing EltsE of the elements of E,
- a function Mult(i,j) representing multiplication in E (so k=Mult(i,j) means EltsE[i]*EltsE[j]=EltsE[k]),
- a function InvE(i) which returns the position in E of the inverse of the i-th element of E.

The output is a list [Dimension,Boundary,Homotopy,Elts] of three functions and a list.

- Dimension(k) gives the ZE-rank of the k-th module in F.
- Boundary(k,j) gives the boundary of the j-th free generator of dimension k.
- Homotopy(k,[i,g]) gives the image in F_{k+1} under a contracting homotopy of the element [[i,g]] in F_k. (This is not yet implemented.)
- Elts is a (possibly partial) list of the elements of E with Elts[g] the element represented by integer g in the preceding two functions.

Here i,j,k,g are non-negative integers. The groups N,G,E could conceivably be infinite. Only finitely many elements in EltsE are ever used in the construction.

Mathematical background:

- C.T.C. Wall, "Resolutions for extensions of groups", Proc. Cambridge Philos. Soc., 57 (1961), 251-255.
- G. Ellis, J. Harris, E. Sköldberg, "Polytopal resolutions for finite groups", J. Reine Angewandte Math., to appear.

Documentation: For notes on the code see here.