intro h.
intros H0 H1 H2 H3 H4.
generalize (inj_left_syn h H0 H1 H2 H3).
intro H4bis.
unfold injective_left in H0.
unfold enc_synthesis_left in H1.
unfold op_synthesis_left in H2.
unfold pair_free_left in H3.
unfold injective_inv_left in H4.
unfold injective_left in H4bis.
unfold injective_inv_left in |- *.
intros M N H5.
induction  H5
as
[M
N
H|
M
N
K
L
H5_1
HrecH5_1
H5_0
HrecH5_0|
M1
N1
M2
N2
H5_1
HrecH5_1
H5_0
HrecH5_0|
o
M
N
H5
HrecH5]; intros M' N' H6;
[ induction  H6
as
[M0
N0
H5|
M0
N0
K
L
H6_1
HrecH6_1
H6_0
HrecH6_0|
M1
N1
M2
N2
H6_1
HrecH6_1
H6_0
HrecH6_0|
o
M0
N0
H6
HrecH6]
| induction  H6
as
[M0
N0
H|
M0
N0
K0
L0
H6_1
HrecH6_1
H6_0
HrecH6_0|
M1
N1
M2
N2
H6_1
HrecH6_1
H6_0
HrecH6_0|
o
M0
N0
H6
HrecH6]
| induction  H6
as
[M
N
H|
M
N
K
L
H6_1
HrecH6_1
H6_0
HrecH6_0|
M0
N0
M3
N3
H6_1
HrecH6_1
H6_0
HrecH6_0|
o
M
N
H6
HrecH6]
| induction  H6
as
[M0
N0
H|
M0
N0
K
L
H6_1
HrecH6_1
H6_0
HrecH6_0|
M1
N1
M2
N2
H6_1
HrecH6_1
H6_0
HrecH6_0|
o0
M0
N0
H6
HrecH6] ].
intro.
apply (H4 M N H M0 N0 H5 H6).
intro.
cut (M = inv (MEnc M0 K)).
simpl in |- *.
intro.
case (H1 M N H M0 K H6 N0 L); intro; tauto.
rewrite H5.
symmetry  in |- *.
apply inv_invol.
intro.
cut (M = inv (MPair M1 M2)).
simpl in |- *.
intro.
rewrite H6 in H.
generalize (H3 M1 M2 N).
tauto.
rewrite H5.
symmetry  in |- *.
apply inv_invol.
intro.
cut (M = inv (Mop o M0)).
simpl in |- *.
intro.
generalize (H2 (inv_op o) M N H M0 H7 N0).
tauto.
rewrite H5.
symmetry  in |- *.
apply inv_invol.
simpl in |- *.
cut (synthesis h M0 N0).
intro.
intro.
cut (synthesis h (MEnc M K) (MEnc N L)).
intro.
apply (H4bis M0 N0 H5 (MEnc M K) (MEnc N L) H7 H6).
apply SynEnc; trivial.
apply SynInc; trivial.
simpl in |- *.
intro.
inversion H.
cut (synthesis h (MEnc M0 K0) (MEnc N0 L0)); try (apply SynEnc; trivial).
intro.
cut (synthesis h (MEnc M K) (MEnc N L)); try (apply SynEnc; trivial).
intro.
apply (H4bis (MEnc M0 K0) (MEnc N0 L0) H5 (MEnc M K) (MEnc N L) H8 H).
simpl in |- *.
intro.
inversion H.
simpl in |- *.
intro.
inversion H.
simpl in |- *.
cut (synthesis h M N); try (apply SynInc; trivial).
intro.
cut (synthesis h (MPair M1 M2) (MPair N1 N2)); try (apply SynPair; trivial).
intro.
intro.
apply (H4bis M N H5 (MPair M1 M2) (MPair N1 N2) H6 H7).
simpl in |- *.
intro.
inversion H.
simpl in |- *.
intro.
cut (synthesis h (MPair M1 M2) (MPair N1 N2)); try (apply SynPair; trivial).
intro.
cut (synthesis h (MPair M0 M3) (MPair N0 N3)); try (apply SynPair; trivial).
intro.
apply (H4bis (MPair M0 M3) (MPair N0 N3) H6 (MPair M1 M2) (MPair N1 N2) H5 H).
simpl in |- *.
intro.
inversion H.
simpl in |- *.
cut (synthesis h M0 N0); try (apply SynInc; trivial).
intro.
cut (synthesis h (Mop (inv_op o) M) (Mop (inv_op o) N));
try (apply SynOp; trivial).
intro.
intro.
apply (H4bis M0 N0 H6 (Mop (inv_op o) M) (Mop (inv_op o) N) H7 H8).
simpl in |- *.
intro.
inversion H.
simpl in |- *.
intro.
inversion H.
simpl in |- *.
intro.
inversion H.
cut (N0 = N).
intro.
rewrite H7; trivial.
apply (H4bis M0 N0 H6 M N H5 H9).
Qed.
(** the transposition of h is the hedge where all the pairs (M,N) are reversed in (N,M) *)
Definition transpose (h : hedge) (M N : Msg) := h N M.
(** h is consistent if h is left consistent and if (transpose h) is left consistent (h is right consistent) *)
Definition is_consistent (h : hedge) :=
is_left_consistent h /\ is_left_consistent (transpose h).
Definition no_pairs (h : hedge) :=
forall M1 M2 N1 N2 : Msg, ~ h (MPair M1 M2) (MPair N1 N2).
Definition no_syn_ops (h : hedge) :=
forall (o : op) (M N : Msg), h (Mop o M) (Mop o N) -> ~ synthesis h M N.
Definition no_syn_cyph (h : hedge) :=
forall M N K L : Msg,
h (MEnc M K) (MEnc N L) -> ~ synthesis h M N \/ ~ synthesis h K L.
Definition cyph_dec (h : hedge) :=
forall M N K L : Msg,
h (MEnc M K) (MEnc N L) -> synthesis h (inv K) (inv L) -> synthesis h M N.
(** we show in the following that a hedge is irreducible iff it satisfies these conditions *)
Definition cond_irr (h : hedge) :=
no_pairs h /\ no_syn_ops h /\ no_syn_cyph h /\ cyph_dec h.

Lemma left_consistent_impl_cond_irr_strong :
forall h : hedge,
name_left_name h /\
injective_left h /\
op_synthesis_left h /\
pair_free_left h /\ enc_synthesis_left h /\ enc_analysis_left h ->
cond_irr h.