intros.
simpl.
rewrite (space_denote_permute _ _ H).
trivial.
Qed.

Lemma exorcize_sound_Lseg:
forall (e : expr) (pnatoms : list pn_atom) (e0 e1 : expr)
(sigma : list space_atom) (nextv : var) (nextv2 : var)
(sigma0 : list space_atom) (l : list assertion),
fresh freshmax_expr e nextv ->
Ident.lt nextv nextv2 ->
fresh freshmax_assertion
(Assertion pnatoms (rev (Lseg e0 e1 :: sigma0) ++ sigma)) nextv ->
entailment_denote
(Entailment (Assertion pnatoms (rev (Lseg e0 e1 :: sigma0) ++ sigma))
(Assertion [Equ e e0] (rev (Lseg e0 e1 :: sigma0) ++ sigma))) ->
(assertion_denote
(Assertion (Equ e0 e1 :: pnatoms) (rev (Lseg e0 e1 :: sigma0) ++ sigma))
|-- fold_right
(fun P => orp (existsv nextv (assertion_denote P))) FF l) /\
(forall (Q : assertion),
In Q l ->
match Q with
|Assertion _ (Next e0 _ :: _) => e=e0
| _ => False
end /\
fresh freshmax_assertion Q nextv2) ->
(assertion_denote (Assertion pnatoms (rev (Lseg e0 e1 :: sigma0) ++ sigma))
|-- fold_right
(fun P => orp (existsv nextv (assertion_denote P))) FF
(Assertion pnatoms (Next e (Var nextv) :: Lseg (Var nextv) e1 :: rev sigma0 ++ sigma) :: l)) /\
(forall Q,
In Q (Assertion pnatoms (Next e (Var nextv) :: Lseg (Var nextv) e1 :: rev sigma0 ++ sigma) :: l) ->
match Q with
|Assertion _ (Next e0 _ :: _) => e=e0
| _ => False
end /\
fresh freshmax_assertion Q nextv2).