Theorem: Batteries.RBNode.Ordered.del
File: .lake/packages/batteries/Batteries/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))
state_after: α : 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 a.isBlack with
      | black => (del cut a).balLeft y b
      | red => node red (del cut a) y b
    | Ordering.gt =>
      match b.isBlack with
      | black => a.balRight y (del cut b)
      | red => node red a y (del cut b)
    | Ordering.eq => a.append 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 a.isBlack with
      | black => (del cut a).balLeft y b
      | red => node red (del cut a) y b
    | Ordering.gt =>
      match b.isBlack with
      | black => a.balRight y (del cut b)
      | red => node red a y (del cut b)
    | Ordering.eq => a.append b)
state_after: 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 a.isBlack with
    | black => (del cut a).balLeft y b
    | red => node red (del cut a) y b)

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 b.isBlack with
    | black => a.balRight y (del cut b)
    | red => node red a y (del cut b))

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 (a.append 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 a.isBlack with
    | black => (del cut a).balLeft y b
    | red => node red (del cut a) y b)
state_after: 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✝ : a.isBlack = black
⊢ Ordered cmp ((del cut a).balLeft y b)

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✝ : a.isBlack = red
⊢ Ordered cmp (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✝ : a.isBlack = black
⊢ Ordered cmp ((del cut a).balLeft y b)
state_after: no goals

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✝ : a.isBlack = red
⊢ Ordered cmp (node red (del cut a) y b)
state_after: no goals

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 b.isBlack with
    | black => a.balRight y (del cut b)
    | red => node red a y (del cut b))
state_after: 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✝ : b.isBlack = black
⊢ Ordered cmp (a.balRight y (del cut b))

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✝ : b.isBlack = red
⊢ Ordered cmp (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✝ : b.isBlack = black
⊢ Ordered cmp (a.balRight y (del cut b))
state_after: no goals

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✝ : b.isBlack = red
⊢ Ordered cmp (node red a y (del cut b))
state_after: no goals

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 (a.append b)
state_after: no goals