(***********************************************************************)


Inductive equiv_del (key : Int) (t0 t : avl_tree) : Prop :=
    equiv_del_intro :
      (forall k : Int, Equal k key -> forall d : B, lookup k t d -> False) ->
      (forall (k : Int) (data : B),
       ~ Equal k key -> lookup k t0 data -> lookup k t data) ->
      (forall (k : Int) (data : B),
       ~ Equal k key -> lookup k t data -> lookup k t0 data) ->
      equiv_del key t0 t.(***********************************************************************)


Inductive equiv_del (key : Int) (t0 t : avl_tree) : Prop :=
    equiv_del_intro :
      (forall k : Int, Equal k key -> forall d : B, lookup k t d -> False) ->
      (forall (k : Int) (data : B),
       ~ Equal k key -> lookup k t0 data -> lookup k t data) ->
      (forall (k : Int) (data : B),
       ~ Equal k key -> lookup k t data -> lookup k t0 data) ->
      equiv_del key t0 t.

(* Specifications: *)
Lemma inv_equiv_del_equal : forall (key : Int) (t0 t : avl_tree) (k : Int) (d : B), equiv_del key t0 t -> Equal k key -> lookup k t d -> False.
Lemma inv_equiv_del_notequal0 : forall (key : Int) (t0 t : avl_tree) (k : Int) (d : B), equiv_del key t0 t -> ~ Equal k key -> lookup k t0 d -> lookup k t d.
Lemma inv_equiv_del_notequal1 : forall (key : Int) (t0 t : avl_tree) (k : Int) (d : B), equiv_del key t0 t -> ~ Equal k key -> lookup k t d -> lookup k t0 d.
Lemma equiv_del_equiv_equiv_del : forall (key : Int) (t0 t1 t2 : avl_tree), equiv_del key t0 t1 -> equiv t1 t2 -> equiv_del key t0 t2.
Lemma equiv_del_semi_leave : forall (k : Int) (d : B) (l : avl_tree) (b : bal), is_avl (Avl_Node k d l Avl_Nil b) -> equiv_del k (Avl_Node k d l Avl_Nil b) l.
Lemma equiv_del_above : forall (key : Int) (t0 t : avl_tree) (k0 : Int), equiv_del key t0 t -> Less k0 key -> is_above t0 k0 -> is_above t k0.
Lemma equiv_del_right : forall (key k0 : Int) (d0 : B) (l0 r0 : avl_tree) (b0 : bal) (r : avl_tree) (b : bal), is_avl (Avl_Node k0 d0 l0 r0 b0) -> Less k0 key -> equiv_del key r0 r -> equiv_del key (Avl_Node k0 d0 l0 r0 b0) (Avl_Node k0 d0 l0 r b).
Lemma below_equiv_below : forall (k : Int) (t0 t : avl_tree), is_below t0 k -> equiv t t0 -> is_below t k.
Lemma Balanced_shrunk_left_balanced_shift : forall (l0 r r0 : avl_tree) (b0 : bal), is_balanced_avl l0 r0 b0 -> height_avl r0 = S (height_avl r) -> is_balanced_avl_left_shift l0 r b0.
Lemma below_equiv_del_below : forall (t0 t : avl_tree) (k key : Int), is_below t0 k -> equiv_del key t0 t -> is_below t k.
Lemma above_equiv_del_above : forall (t0 t : avl_tree) (k key : Int), is_above t0 k -> equiv_del key t0 t -> is_above t k.