(* 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.

(* Specifications: *)
Lemma iso1 : f oo g = id K2.knot.
Lemma iso2 : g oo f = id K1.knot.
Lemma fpred_gpred : f_pred' g oo g_pred' f = id (K2.predicate).
Lemma gpred_fpred : g_pred' f oo f_pred' g = id (K1.predicate).
Lemma Fiso1 : fF oo gF = id (F K2.predicate).
Lemma Fiso2 : gF oo fF = id (F K1.predicate).
Lemma f_level : forall k, level k = level (f k).
Lemma g_level : forall k, level k = level (g k).
Lemma f_unsquash : forall k1 U1, U1 = K1.unsquash k1 -> K2.unsquash (f k1) = (fst U1, fF (snd U1)).
Lemma g_unsquash : forall k2 U2, U2 = K2.unsquash k2 -> K1.unsquash (g k2) = (fst U2, gF (snd U2)).
Lemma fF_approx : forall n, fF oo (fmap F (K1.approx n)) = (fmap F (K2.approx n)) oo fF.
Lemma gF_approx : forall n, gF oo (fmap F (K2.approx n)) = (fmap F (K1.approx n)) oo gF.
Lemma f_squash : forall n F1, f (K1.squash (n, F1)) = K2.squash (n, fF F1).
Lemma g_squash : forall n F2, g (K2.squash (n, F2)) = K1.squash (n, gF F2).