Section FG.
(* We tie it together *)
Fixpoint fg (n : nat) {struct n} : ((K1.knot -> K2.knot) * (K2.knot -> K1.knot)) :=
match n with
| 0 => (f_Z, g_Z)
| S n => match fg n with (fn, gn) => (f_Sn gn, g_Sn fn) end
end.
End FG.
(* Now for the main definitions and theorems *)
Definition f (k : K1.knot) : K2.knot := fst (fg (level k)) k.
Definition g (k : K2.knot) : K1.knot := snd (fg (level k)) k.
Definition fF : TF.F K1.predicate -> TF.F K2.predicate :=
f_F' g.
Definition gF : TF.F K2.predicate -> TF.F K1.predicate :=
g_F' f.

Lemma f_unsquash : forall k1 U1,
U1 = K1.unsquash k1 ->
K2.unsquash (f k1) = (fst U1, fF (snd U1)).