Proof with simpl; auto; try solve [congruence
| left; simpl; unfold var_eq, expr_denote, stack_get; rewrite H;
solve [unfold expr_denote, stack_get; rewrite Heq, Heq'; auto]].
intros A1 A2 B1 B2 C.
cut (stk s1 = stk s1'); [ intro Heq; rewrite Heq in * | ].
cut (stk s = stk s1'); [ intro Heq'; rewrite <- Heq' in * | ].
inversion A1; inversion A2; subst...
right; simpl; unfold var_eq, expr_denote, stack_get; rewrite H7.
solve [unfold expr_denote, stack_get; rewrite <- Heq'; auto].
cut (x' = x'0); [ intro Heqx; rewrite <- Heqx in *; clear Heqx | ].
exfalso. clear - H1 H3 H9 H11 B1 B2 C.
assert (D : joins s2 s2') by (apply (join_joins C)).
assert (E : join_sub h2 (hp s2')).
destruct B2 as [sx1 [_ B2]]; destruct (join_assoc H11 B2) as [q [Q1 Q2]].
solve [exists q; auto].
assert (F : join_sub h0 (hp s2)).
destruct B1 as [sx1 [_ B1]]; destruct (join_assoc H3 B1) as [q [Q1 Q2]].
solve [exists q; auto].
apply (next_next_join_False _ _ _ _ _ _ _ H1 F H9 E).
solve [destruct C as [_ C]; exists (hp s); auto].
solve [rewrite H8 in H0; inversion H0; auto].
destruct B2 as [sx B2]; destruct (join_assoc B2 (join_comm C)) as [q [Q1 Q2]].
destruct (join_stacks_eq _ _ _ Q2)...
destruct B1 as [sx1 B1]; destruct B2 as [sx2 B2].
destruct (join_assoc B1 C) as [q [Q1 Q2]].
destruct (join_assoc B2 (join_comm C)) as [q' [Q1' Q2']].
inversion Q2 as [[H1 H2] _]; inversion Q2' as [[H3 H4] _]...
Qed.

(* Specifications: *)
Lemma ll_lseg_in_sound x y sigma s1 s2 s :
space_atom_denote (Lseg (Var x) y) s1 ->
space_denote sigma s2 ->
join s1 s2 s ->
listd (listd pure_atom_denote un FF) inter TT (map (fun a0 =>
[Eqv (Var x) y, a0]) (lseg_in_dom_atoms x sigma)) s.