mathematical folding