lift n (CHN f) =
 case f of
  HNApp muid elr args -> CHN $ HNApp muid lelr (map (\(ClA env x) -> ClA (Lift n : env) x) args)
   where
    lelr = case elr of
            Var i -> Var (i + n)
            Glob g -> Glob g
  HNChoice muid typ qf args -> CHN $ HNChoice muid typ (lift n qf) (map (\(ClA env x) -> ClA (Lift n : env) x) args)
lift n (CHN f) =
 case f of
  HNApp muid elr args -> CHN $ HNApp muid lelr (map (\(ClA env x) -> ClA (Lift n : env) x) args)
   where
    lelr = case elr of
            Var i -> Var (i + n)
            Glob g -> Glob g
  HNChoice muid typ qf args -> CHN $ HNChoice muid typ (lift n qf) (map (\(ClA env x) -> ClA (Lift n : env) x) args)
lift n (CHN f) =
 case f of
  HNApp muid elr args -> CHN $ HNApp muid lelr (map (\(ClA env x) -> ClA (Lift n : env) x) args)
   where
    lelr = case elr of
            Var i -> Var (i + n)
            Glob g -> Glob g
  HNChoice muid typ qf args -> CHN $ HNChoice muid typ (lift n qf) (map (\(ClA env x) -> ClA (Lift n : env) x) args)