α : 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)
α : 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))
unfold del
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)

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))

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)
α : 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)
split
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)

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)
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)
split
no goals
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)
exact ha.del.balLeft ay.del yb hb
no goals
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)
exact ⟨ay.del, yb, ha.del, hb⟩
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))

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))
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))
split
no goals
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))
exact ha.balRight ay yb.del hb.del
no goals
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))
exact ⟨ay, yb.del, ha, hb.del⟩
no goals
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)
exact ha.append ay yb hb