(* ---------------------------------------------------------------------- *)
(** **** Properties of img *)

(* Specifications: *)
(** Img builds a list. *)
Axiom img_empty : forall A,
img (@empty A) = nil.
Axiom img_empty_inv : forall A (E : gen_env A),
img (E) = nil ->
E = (@empty A).
Axiom img_single : forall A x (v : A),
img (x ∶ v) = v :: nil.
Axiom img_singles : forall A xs (vs : list A),
length xs = length vs ->
img (xs ∷ vs) = vs.
Axiom img_singles_incl : forall A xs (vs : list A),
List.incl (img (xs ∷ vs)) vs.
Axiom img_concat : forall A (E F : gen_env A),
img (E & F) = List.app (img F) (img E).
(** Dom and img builds identity. *)
Axiom dom_img_id : forall A (E : gen_env A),
(dom E) ∷ (img E) = E.
Axiom length_dom_img_eq : forall A (E : gen_env A),
length (dom E) = length (img E).
Lemma img_empty :
img (@empty A) = nil.
Lemma img_singles_incl : forall xs vs,
List.incl (img (xs ∷ vs)) vs.
Lemma img_concat : forall E F,
img (E & F) = List.app (img F) (img E).
Lemma dom_img_id : forall E,
(dom E) ∷ (img E) = E.
Lemma length_dom_img_eq : forall E,
length (dom E) = length (img E).
Lemma belongs_singles : forall x xs vs,
length xs = length vs ->
List.In x xs ->
x ∈ (xs ∷ vs).
Lemma belongs_singles_inv : forall x xs vs,
length xs = length vs ->
x ∈ (xs ∷ vs) ->
List.In x xs.
Lemma belongs_concat_l : forall x F G,
x ∈ F ->
x ∈ (F & G).
Lemma belongs_concat_r : forall x F G,
x ∈ F ->
x ∈ (G & F).
Lemma belongs_concat_inv : forall x F G,
x ∈ (F & G) ->
x ∈ F ∨ x ∈ G.
Lemma belongs_dom : forall x E,
x ∈ E ->
List.In x (dom E).
Lemma belongs_all_belongs : forall x xs E,
x ∈ E ∧ xs ⊂ E ->
(x :: xs) ⊂ E.
Lemma all_belongs_empty : forall xs,
xs ⊂ (@empty A) ->
xs = nil.
Lemma all_belongs_nil : forall E,
nil ⊂ E.
Lemma all_belongs_single_inv : forall xs y v,
length xs = 1 ->
xs ⊂ (y ∶ v) ->
xs = y :: nil.
Lemma all_belongs_singles : forall xs ys vs,
length ys = length vs ->
List.incl xs ys ->
xs ⊂ (ys ∷ vs).
Lemma all_belongs_singles_inv : forall xs ys vs,
xs ⊂ (ys ∷ vs) ->
List.incl xs ys.
Lemma all_belongs_concat_l : forall xs F G,
xs ⊂ F ->
xs ⊂ (F & G).
Lemma all_belongs_concat_r : forall xs F G,
xs ⊂ F ->
xs ⊂ (G & F).
Lemma all_belongs_dom : forall xs E,
xs ⊂ E ->
List.incl xs (dom E).
Lemma notin_single_inv : forall x y v,
x ∉ (y ∶ v) ->
x <> y.
Lemma notin_singles : forall x xs vs,
¬ List.In x xs ->
x ∉ (xs ∷ vs).
Lemma notin_singles_inv : forall x xs vs,
length xs = length vs ->
x ∉ (xs ∷ vs) ->
¬ List.In x xs.
Lemma notin_concat : forall x F G,
x ∉ F -> x ∉ G ->
x ∉ (F & G).
Lemma notin_concat_inv : forall x F G,
x ∉ (F & G) ->
x ∉ F ∧ x ∉ G.
Lemma notin_dom : forall x E,
x ∉ E ->
¬ List.In x (dom E).
Lemma notin_all_notin : forall x xs E,
x ∉ E ∧ xs ⊄ E ->
(x :: xs) ⊄ E.
Lemma all_notin_belongs_neq : forall x ys E,
x ∈ E -> ys ⊄ E ->
¬ List.In x ys.
Lemma all_notin_empty_r : forall xs,
xs ⊄ (@empty A).
Lemma all_notin_nil : forall E,
nil ⊄ E.
Lemma all_notin_single_inv : forall xs y v,
xs ⊄ (y ∶ v) ->
¬ List.In y xs.
Lemma all_notin_singles : forall xs ys vs,
List.Forall (fun x => ¬ List.In x ys) xs ->
xs ⊄ (ys ∷ vs).
Lemma all_notin_singles_inv : forall xs ys vs,
length ys = length vs ->
xs ⊄ (ys ∷ vs) ->
List.Forall (fun x => ¬ List.In x ys) xs.
Lemma all_notin_concat : forall xs F G,
xs ⊄ F -> xs ⊄ G ->
xs ⊄ (F & G).
Lemma all_notin_concat_inv : forall xs F G,
xs ⊄ (F & G) ->
xs ⊄ F ∧ xs ⊄ G.
Lemma all_notin_dom : forall xs E,
xs ⊄ E ->
List.Forall (fun x => ¬ List.In x (dom E)) xs.
Lemma all_notin_dom_inv : forall xs E,
List.Forall (fun x => ¬ List.In x (dom E)) xs ->
xs ⊄ E.