(** The synthesis S(h) of h : it contains all the messages
    that can be synthetised by the hedge. *)
Inductive synthesis (h : hedge) : hedge :=
  | SynInc : forall M N : Msg, h M N -> synthesis h M N
  | SynEnc :
      forall M N K L : Msg,
      synthesis h M N -> synthesis h K L -> synthesis h (MEnc M K) (MEnc N L)
  | SynPair :
      forall M1 N1 M2 N2 : Msg,
      synthesis h M1 N1 ->
      synthesis h M2 N2 -> synthesis h (MPair M1 M2) (MPair N1 N2)
  | SynOp :
      forall (o : op) (M N : Msg),
      synthesis h M N -> synthesis h (Mop o M) (Mop o N).(** The synthesis S(h) of h : it contains all the messages
    that can be synthetised by the hedge. *)
Inductive synthesis (h : hedge) : hedge :=
  | SynInc : forall M N : Msg, h M N -> synthesis h M N
  | SynEnc :
      forall M N K L : Msg,
      synthesis h M N -> synthesis h K L -> synthesis h (MEnc M K) (MEnc N L)
  | SynPair :
      forall M1 N1 M2 N2 : Msg,
      synthesis h M1 N1 ->
      synthesis h M2 N2 -> synthesis h (MPair M1 M2) (MPair N1 N2)
  | SynOp :
      forall (o : op) (M N : Msg),
      synthesis h M N -> synthesis h (Mop o M) (Mop o N).(** The synthesis S(h) of h : it contains all the messages
    that can be synthetised by the hedge. *)
Inductive synthesis (h : hedge) : hedge :=
  | SynInc : forall M N : Msg, h M N -> synthesis h M N
  | SynEnc :
      forall M N K L : Msg,
      synthesis h M N -> synthesis h K L -> synthesis h (MEnc M K) (MEnc N L)
  | SynPair :
      forall M1 N1 M2 N2 : Msg,
      synthesis h M1 N1 ->
      synthesis h M2 N2 -> synthesis h (MPair M1 M2) (MPair N1 N2)
  | SynOp :
      forall (o : op) (M N : Msg),
      synthesis h M N -> synthesis h (Mop o M) (Mop o N).(** The synthesis S(h) of h : it contains all the messages
    that can be synthetised by the hedge. *)
Inductive synthesis (h : hedge) : hedge :=
  | SynInc : forall M N : Msg, h M N -> synthesis h M N
  | SynEnc :
      forall M N K L : Msg,
      synthesis h M N -> synthesis h K L -> synthesis h (MEnc M K) (MEnc N L)
  | SynPair :
      forall M1 N1 M2 N2 : Msg,
      synthesis h M1 N1 ->
      synthesis h M2 N2 -> synthesis h (MPair M1 M2) (MPair N1 N2)
  | SynOp :
      forall (o : op) (M N : Msg),
      synthesis h M N -> synthesis h (Mop o M) (Mop o N).(** The synthesis S(h) of h : it contains all the messages
    that can be synthetised by the hedge. *)
Inductive synthesis (h : hedge) : hedge :=
  | SynInc : forall M N : Msg, h M N -> synthesis h M N
  | SynEnc :
      forall M N K L : Msg,
      synthesis h M N -> synthesis h K L -> synthesis h (MEnc M K) (MEnc N L)
  | SynPair :
      forall M1 N1 M2 N2 : Msg,
      synthesis h M1 N1 ->
      synthesis h M2 N2 -> synthesis h (MPair M1 M2) (MPair N1 N2)
  | SynOp :
      forall (o : op) (M N : Msg),
      synthesis h M N -> synthesis h (Mop o M) (Mop o N).

Theorem nam_right_syn : forall (h : hedge) (M : Msg) (b : Nam), synthesis h M (MNam b) -> h M (MNam b).