User:Tpulkki/Sandbox

Pullbacks

A pullback is a equation f(x)=g(y). To solve this equation, the following functions are required:


 * f : X -> R
 * g : Y -> R
 * t : R -> (X,Y)
 * 1) pa : (X,Y) -> X
 * 2) pb : (X,Y) -> Y
 * m : (R,R) -> R
 * d : R -> (R,R)

f(x)=g(y) is the same as f(x)-g(y)=0, so m is ordinary minus operation. This reduces our problem to k(x,y)=0 form, where k(x,y) = f(x)-g(y).

Next we need to package the parameters of k to a tuple (x,y). So we get k((x,y)) =0. Then use t function to create this tuple. We get k(t(r)) = 0. Now t can only choose a single path from 2d space (x,y). This is ok because we can freely choose all functions.

Then next stop is to use function composition for two paths:


 * 1) f(pa(t(r))) : R->R
 * 2) g(pb(t(r))) : R->R

Lets simplify this slightly and invent new names for them: h(r) = f(pa(t(r))). s(r)=g(pb(t(r))). Now it looks like this:


 * 1) h(r) :: R->R
 * 2) s(r) :: R->R

Now, next we need to use diagonal function d(r) = (r,r) to distribute single r to both paths. And then again use m(r1,r2)=r1-r2 to combine the two paths. Now we start to have all the pieces.

Then we just need a root-finding algorithm that takes w : R->R as parameter and returns single number R as a result of root-finding algorithm. The root-finding algorithm will go nearer to the root, while never reaching it. Several times doing this and we'll get better and better approximations of the root. Now once we have root r : R, we can use the existing functions to find the remaining values:


 * 1) t(r) will provide (x,y) pairs
 * 2) pa(t(r)) will provide x : X
 * 3) pb(t(r)) will provide y : Y

These are the most wanted values from solving the equation.

Now there is some remaining important things still left. The pullback has a property of "unique-up-to-isomorphism". Our algorithm only found a single root for the equation. The other roots lie in the same equivalence class. When we had h(r) and s(r), we can create a pair (h(r),s(r)) and similar pair is available for any value of r, including the root. These pairs form an equivalence relation on R. There is a pair (R,R) for any value r : R.