Definition Perm_pre_rmap (A: Type): Perm_alg (pre_rmap A) :=
    Perm_prop _ _ (Perm_fun address _ _ _) _ (pre_rmap_sa_valid_join _).Definition Sep_pre_rmap (A: Type): Sep_alg (pre_rmap A) :=
    Sep_prop _ _ (Perm_fun address _ _ _) _ (pre_rmap_sa_valid_join _)  _ (pre_rmap_sa_valid_core _).Definition Canc_pre_rmap (A: Type): Canc_alg (pre_rmap A) :=
    @Canc_prop _ _ _ (Canc_fun address _ _ _).Definition Disj_pre_rmap (A: Type): Disj_alg (pre_rmap A) :=
    @Disj_prop _ _ _ (Disj_fun address _ _ _).Module AV:=AV'.Module SM := StratModel(AV).(* <: TY_FUNCTOR_PROP. *)
    Definition F := pre_rmap.Definition f_F := f_pre_rmap.Definition other := unit.(* <: TY_FUNCTOR_SA_PROP with Module TF:=TyF. *)
    Module TF := TyF.Instance Join_F: forall A, Join (F A) := _.Definition Perm_F : Perm_paf f_F Join_F := fun A _ _ => Perm_pre_rmap A.Definition Sep_F : Sep_paf f_F Join_F := fun (A : Type) (JA : Join A) _ _ => Sep_pre_rmap A.Definition Canc_F : Canc_paf f_F Join_F := fun (A : Type) (JA : Join A) _ _ => Canc_pre_rmap A.Definition Disj_F : Disj_paf f_F Join_F := fun (A : Type) (JA : Join A) _ _ => Disj_pre_rmap A.Definition paf_F := paf_pre_rmap.Module K := KnotHered(TyF).Module KL := KnotHered_Lemmas(K).Module KSa := KnotHeredSa(TyFSA)(K).Definition rmap := K.knot.Instance Join_rmap: Join rmap := KSa.Join_knot.Instance Perm_rmap : Perm_alg rmap:= KSa.Perm_knot.Instance Sep_rmap : Sep_alg rmap:= KSa.Sep_knot Sep_pre_rmap.Instance Canc_rmap : Canc_alg rmap:= KSa.Canc_knot Canc_pre_rmap.Instance Disj_rmap : Disj_alg rmap:= KSa.Disj_knot Disj_pre_rmap.Instance ag_rmap : ageable rmap := KSa.K.ag_knot.Instance Age_rmap: Age_alg rmap := KSa.asa_knot.Inductive preds : Type :=
    SomeP : forall A : list Type, (listprod A -> pred rmap) -> preds.Inductive preds : Type :=
    SomeP : forall A : list Type, (listprod A -> pred rmap) -> preds.Definition NoneP := SomeP ((Void:Type)::nil) (fun _ => FF).Definition hair := preds.Inductive resource : Type :=
    | NO
    | YES: pshare -> kind -> preds -> resource
    | PURE : kind -> preds -> resource.Inductive resource : Type :=
    | NO
    | YES: pshare -> kind -> preds -> resource
    | PURE : kind -> preds -> resource.Inductive resource : Type :=
    | NO
    | YES: pshare -> kind -> preds -> resource
    | PURE : kind -> preds -> resource.Inductive resource : Type :=
    | NO
    | YES: pshare -> kind -> preds -> resource
    | PURE : kind -> preds -> resource.Definition resource2res (r: resource): res (pred rmap) :=
    match r with
      | NO => NO' (pred rmap)
      | YES p k (SomeP A l) => YES' (pred rmap) p k (existT _ A l)
      | PURE k (SomeP A l) => PURE' (pred rmap) k (existT _ A l)
    end.Definition res2resource (r: res (pred rmap)) : resource :=
    match r with
      | NO' => NO
      | YES' p k (existT A l) => YES p k (SomeP A l)
      | PURE' k (existT A l) => PURE k (SomeP A l)
    end.

Lemma res2resource2res: forall x, resource2res (res2resource x) = x.