Theorem: Std.RBNode.Ordered.del
File: Std/Data/RBMap/WF.lean

tactic: unfold del
state_before: α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
c✝ : RBColor
a : RBNode α
y : α
b : RBNode α
ay : All (fun x => cmpLT cmp x y) a
yb : All (fun x => cmpLT cmp y x) b
ha : Ordered cmp a
hb : Ordered cmp b
⊢ Ordered cmp (del cut (node c✝ a y b))

tactic: split
state_before: α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
c✝ : RBColor
a : RBNode α
y : α
b : RBNode α
ay : All (fun x => cmpLT cmp x y) a
yb : All (fun x => cmpLT cmp y x) b
ha : Ordered cmp a
hb : Ordered cmp b
⊢ Ordered cmp
    (match cut y with
    | Ordering.lt =>
      match isBlack a with
      | black => balLeft (del cut a) y b
      | red => node red (del cut a) y b
    | Ordering.gt =>
      match isBlack b with
      | black => balRight a y (del cut b)
      | red => node red a y (del cut b)
    | Ordering.eq => append a b)

tactic: split
state_before: case h_1
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
c✝ : RBColor
a : RBNode α
y : α
b : RBNode α
ay : All (fun x => cmpLT cmp x y) a
yb : All (fun x => cmpLT cmp y x) b
ha : Ordered cmp a
hb : Ordered cmp b
x✝ : Ordering
heq✝ : cut y = Ordering.lt
⊢ Ordered cmp
    (match isBlack a with
    | black => balLeft (del cut a) y b
    | red => node red (del cut a) y b)

tactic: exact ha.del.balLeft ay.del yb hb
state_before: case h_1.h_1
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
c✝ : RBColor
a : RBNode α
y : α
b : RBNode α
ay : All (fun x => cmpLT cmp x y) a
yb : All (fun x => cmpLT cmp y x) b
ha : Ordered cmp a
hb : Ordered cmp b
x✝¹ : Ordering
heq✝¹ : cut y = Ordering.lt
x✝ : RBColor
heq✝ : isBlack a = black
⊢ Ordered cmp (balLeft (del cut a) y b)

tactic: exact ⟨ay.del, yb, ha.del, hb⟩
state_before: case h_1.h_2
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
c✝ : RBColor
a : RBNode α
y : α
b : RBNode α
ay : All (fun x => cmpLT cmp x y) a
yb : All (fun x => cmpLT cmp y x) b
ha : Ordered cmp a
hb : Ordered cmp b
x✝¹ : Ordering
heq✝¹ : cut y = Ordering.lt
x✝ : RBColor
heq✝ : isBlack a = red
⊢ Ordered cmp (node red (del cut a) y b)

tactic: split
state_before: case h_2
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
c✝ : RBColor
a : RBNode α
y : α
b : RBNode α
ay : All (fun x => cmpLT cmp x y) a
yb : All (fun x => cmpLT cmp y x) b
ha : Ordered cmp a
hb : Ordered cmp b
x✝ : Ordering
heq✝ : cut y = Ordering.gt
⊢ Ordered cmp
    (match isBlack b with
    | black => balRight a y (del cut b)
    | red => node red a y (del cut b))

tactic: exact ha.balRight ay yb.del hb.del
state_before: case h_2.h_1
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
c✝ : RBColor
a : RBNode α
y : α
b : RBNode α
ay : All (fun x => cmpLT cmp x y) a
yb : All (fun x => cmpLT cmp y x) b
ha : Ordered cmp a
hb : Ordered cmp b
x✝¹ : Ordering
heq✝¹ : cut y = Ordering.gt
x✝ : RBColor
heq✝ : isBlack b = black
⊢ Ordered cmp (balRight a y (del cut b))

tactic: exact ⟨ay, yb.del, ha, hb.del⟩
state_before: case h_2.h_2
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
c✝ : RBColor
a : RBNode α
y : α
b : RBNode α
ay : All (fun x => cmpLT cmp x y) a
yb : All (fun x => cmpLT cmp y x) b
ha : Ordered cmp a
hb : Ordered cmp b
x✝¹ : Ordering
heq✝¹ : cut y = Ordering.gt
x✝ : RBColor
heq✝ : isBlack b = red
⊢ Ordered cmp (node red a y (del cut b))

tactic: exact ha.append ay yb hb
state_before: case h_3
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
c✝ : RBColor
a : RBNode α
y : α
b : RBNode α
ay : All (fun x => cmpLT cmp x y) a
yb : All (fun x => cmpLT cmp y x) b
ha : Ordered cmp a
hb : Ordered cmp b
x✝ : Ordering
heq✝ : cut y = Ordering.eq
⊢ Ordered cmp (append a b)