α : Type u_1
cmp : α → α → Ordering
l : RBNode α
v : α
r : RBNode α
lv : All (fun x => cmpLT cmp x v) l
vr : All (fun x => cmpLT cmp v x) r
hl : Ordered cmp l
hr : Ordered cmp r
⊢ Ordered cmp
    (match l, r with
    | nil, x => x
    | x, nil => x
    | node red a x b, node red c y d =>
      match append b c with
      | node red b' z c' => node red (node red a x b') z (node red c' y d)
      | bc => node red a x (node red bc y d)
    | node black a x b, node black c y d =>
      match append b c with
      | node red b' z c' => node red (node black a x b') z (node black c' y d)
      | bc => balLeft a x (node black bc y d)
    | a@h:(node black l v r), node red b x c => node red (append a b) x c
    | node red a x b, c@h:(node black l v r) => node red a x (append b c))
α : Type u_1
cmp : α → α → Ordering
l : RBNode α
v : α
r : RBNode α
lv : All (fun x => cmpLT cmp x v) l
vr : All (fun x => cmpLT cmp v x) r
hl : Ordered cmp l
hr : Ordered cmp r
⊢ Ordered cmp (append l r)
unfold append
case h_1
α : Type u_1
cmp : α → α → Ordering
v : α
r : RBNode α
vr : All (fun x => cmpLT cmp v x) r
hr : Ordered cmp r
x✝¹ x✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) nil
hl : Ordered cmp nil
⊢ Ordered cmp r

case h_2
α : Type u_1
cmp : α → α → Ordering
l : RBNode α
v : α
lv : All (fun x => cmpLT cmp x v) l
hl : Ordered cmp l
x✝² x✝¹ : RBNode α
x✝ : l = nil → False
vr : All (fun x => cmpLT cmp v x) nil
hr : Ordered cmp nil
⊢ Ordered cmp l

case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))

case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))

case h_5
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ l✝ : RBNode α
v✝ : α
r✝ b✝ : RBNode α
x✝ : α
c✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black l✝ v✝ r✝)
hl : Ordered cmp (node black l✝ v✝ r✝)
vr : All (fun x => cmpLT cmp v x) (node red b✝ x✝ c✝)
hr : Ordered cmp (node red b✝ x✝ c✝)
⊢ Ordered cmp (node red (append (node black l✝ v✝ r✝) b✝) x✝ c✝)

case h_6
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ l✝ : RBNode α
v✝ : α
r✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black l✝ v✝ r✝)
hr : Ordered cmp (node black l✝ v✝ r✝)
⊢ Ordered cmp (node red a✝ x✝ (append b✝ (node black l✝ v✝ r✝)))
α : Type u_1
cmp : α → α → Ordering
l : RBNode α
v : α
r : RBNode α
lv : All (fun x => cmpLT cmp x v) l
vr : All (fun x => cmpLT cmp v x) r
hl : Ordered cmp l
hr : Ordered cmp r
⊢ Ordered cmp
    (match l, r with
    | nil, x => x
    | x, nil => x
    | node red a x b, node red c y d =>
      match append b c with
      | node red b' z c' => node red (node red a x b') z (node red c' y d)
      | bc => node red a x (node red bc y d)
    | node black a x b, node black c y d =>
      match append b c with
      | node red b' z c' => node red (node black a x b') z (node black c' y d)
      | bc => balLeft a x (node black bc y d)
    | a@h:(node black l v r), node red b x c => node red (append a b) x c
    | node red a x b, c@h:(node black l v r) => node red a x (append b c))
split
no goals
case h_1
α : Type u_1
cmp : α → α → Ordering
v : α
r : RBNode α
vr : All (fun x => cmpLT cmp v x) r
hr : Ordered cmp r
x✝¹ x✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) nil
hl : Ordered cmp nil
⊢ Ordered cmp r
exact hr
no goals
case h_2
α : Type u_1
cmp : α → α → Ordering
l : RBNode α
v : α
lv : All (fun x => cmpLT cmp x v) l
hl : Ordered cmp l
x✝² x✝¹ : RBNode α
x✝ : l = nil → False
vr : All (fun x => cmpLT cmp v x) nil
hr : Ordered cmp nil
⊢ Ordered cmp l
exact hl
case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))
case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))
have ⟨xv, _, bv⟩ := lv
case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))
case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))
have ⟨ax, xb, ha, hb⟩ := hl
case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))
case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))
have ⟨vy, vc, _⟩ := vr
case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))
case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))
have ⟨cy, yd, hc, hd⟩ := hr
case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))
case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))
have : _ ∧ _ ∧ _ := ⟨hb.append bv vc hc, xb.append (xv.trans_l vc), (vy.trans_r bv).append cy⟩
case h_3.h_1
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node red a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
heq✝ : append b✝¹ c✝ = node red a✝ x✝ b✝
⊢ Ordered cmp (node red (node red a✝¹ x✝¹ a✝) x✝ (node red b✝ y✝ d✝))

case h_3.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝¹ b✝)
hl : Ordered cmp (node red a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
⊢ Ordered cmp (node red a✝ x✝¹ (node red (append b✝ c✝) y✝ d✝))
case h_3
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node red a✝ x✝ b') z (node red c' y✝ d✝)
    | bc => node red a✝ x✝ (node red bc y✝ d✝))
split
no goals
case h_3.h_1
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node red a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
heq✝ : append b✝¹ c✝ = node red a✝ x✝ b✝
⊢ Ordered cmp (node red (node red a✝¹ x✝¹ a✝) x✝ (node red b✝ y✝ d✝))
next H =>
have ⟨⟨b'z, c'z, hb', hc'⟩, ⟨xz, xb', _⟩, zy, _, c'y⟩ := H ▸ this
have az := xz.trans_r ax; have zd := zy.trans_l yd
exact ⟨⟨xz, az, b'z⟩, ⟨zy, c'z, zd⟩, ⟨ax, xb', ha, hb'⟩, c'y, yd, hc', hd⟩
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node red a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
⊢ Ordered cmp (node red (node red a✝¹ x✝¹ a✝) x✝ (node red b✝ y✝ d✝))
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node red a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
⊢ Ordered cmp (node red (node red a✝¹ x✝¹ a✝) x✝ (node red b✝ y✝ d✝))
have ⟨⟨b'z, c'z, hb', hc'⟩, ⟨xz, xb', _⟩, zy, _, c'y⟩ := H ▸ this
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node red a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
az : All (fun x => cmpLT cmp x x✝) a✝¹
⊢ Ordered cmp (node red (node red a✝¹ x✝¹ a✝) x✝ (node red b✝ y✝ d✝))
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node red a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
⊢ Ordered cmp (node red (node red a✝¹ x✝¹ a✝) x✝ (node red b✝ y✝ d✝))
have az := xz.trans_r ax
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node red a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
az : All (fun x => cmpLT cmp x x✝) a✝¹
zd : All (fun x => cmpLT cmp x✝ x) d✝
⊢ Ordered cmp (node red (node red a✝¹ x✝¹ a✝) x✝ (node red b✝ y✝ d✝))
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node red a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
az : All (fun x => cmpLT cmp x x✝) a✝¹
⊢ Ordered cmp (node red (node red a✝¹ x✝¹ a✝) x✝ (node red b✝ y✝ d✝))
have zd := zy.trans_l yd
no goals
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node red a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
az : All (fun x => cmpLT cmp x x✝) a✝¹
zd : All (fun x => cmpLT cmp x✝ x) d✝
⊢ Ordered cmp (node red (node red a✝¹ x✝¹ a✝) x✝ (node red b✝ y✝ d✝))
exact ⟨⟨xz, az, b'z⟩, ⟨zy, c'z, zd⟩, ⟨ax, xb', ha, hb'⟩, c'y, yd, hc', hd⟩
case h_3.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝¹ b✝)
hl : Ordered cmp (node red a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
hbc : Ordered cmp (append b✝ c✝)
xbc : All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝)
bcy : All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
⊢ Ordered cmp (node red a✝ x✝¹ (node red (append b✝ c✝) y✝ d✝))
case h_3.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝¹ b✝)
hl : Ordered cmp (node red a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
⊢ Ordered cmp (node red a✝ x✝¹ (node red (append b✝ c✝) y✝ d✝))
have ⟨hbc, xbc, bcy⟩ := this
case h_3.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝¹ b✝)
hl : Ordered cmp (node red a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
hbc : Ordered cmp (append b✝ c✝)
xbc : All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝)
bcy : All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
xy : cmpLT cmp x✝¹ y✝
⊢ Ordered cmp (node red a✝ x✝¹ (node red (append b✝ c✝) y✝ d✝))
case h_3.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝¹ b✝)
hl : Ordered cmp (node red a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
hbc : Ordered cmp (append b✝ c✝)
xbc : All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝)
bcy : All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
⊢ Ordered cmp (node red a✝ x✝¹ (node red (append b✝ c✝) y✝ d✝))
have xy := xv.trans vy
no goals
case h_3.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝¹ b✝)
hl : Ordered cmp (node red a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node red c✝ y✝ d✝)
hr : Ordered cmp (node red c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
hbc : Ordered cmp (append b✝ c✝)
xbc : All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝)
bcy : All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
xy : cmpLT cmp x✝¹ y✝
⊢ Ordered cmp (node red a✝ x✝¹ (node red (append b✝ c✝) y✝ d✝))
exact ⟨ax, ⟨xy, xbc, xy.trans_l yd⟩, ha, bcy, yd, hbc, hd⟩
case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))
case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))
have ⟨xv, _, bv⟩ := lv
case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))
case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))
have ⟨ax, xb, ha, hb⟩ := hl
case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))
case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))
have ⟨vy, vc, _⟩ := vr
case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))
case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))
have ⟨cy, yd, hc, hd⟩ := hr
case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))
case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))
have : _ ∧ _ ∧ _ := ⟨hb.append bv vc hc, xb.append (xv.trans_l vc), (vy.trans_r bv).append cy⟩
case h_4.h_1
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node black a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
heq✝ : append b✝¹ c✝ = node red a✝ x✝ b✝
⊢ Ordered cmp (node red (node black a✝¹ x✝¹ a✝) x✝ (node black b✝ y✝ d✝))

case h_4.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝¹ b✝)
hl : Ordered cmp (node black a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
⊢ Ordered cmp (balLeft a✝ x✝¹ (node black (append b✝ c✝) y✝ d✝))
case h_4
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝ b✝)
hl : Ordered cmp (node black a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
⊢ Ordered cmp
    (match append b✝ c✝ with
    | node red b' z c' => node red (node black a✝ x✝ b') z (node black c' y✝ d✝)
    | bc => balLeft a✝ x✝ (node black bc y✝ d✝))
split
no goals
case h_4.h_1
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node black a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
heq✝ : append b✝¹ c✝ = node red a✝ x✝ b✝
⊢ Ordered cmp (node red (node black a✝¹ x✝¹ a✝) x✝ (node black b✝ y✝ d✝))
next H =>
have ⟨⟨b'z, c'z, hb', hc'⟩, ⟨xz, xb', _⟩, zy, _, c'y⟩ := H ▸ this
have az := xz.trans_r ax; have zd := zy.trans_l yd
exact ⟨⟨xz, az, b'z⟩, ⟨zy, c'z, zd⟩, ⟨ax, xb', ha, hb'⟩, c'y, yd, hc', hd⟩
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node black a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
⊢ Ordered cmp (node red (node black a✝¹ x✝¹ a✝) x✝ (node black b✝ y✝ d✝))
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node black a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
⊢ Ordered cmp (node red (node black a✝¹ x✝¹ a✝) x✝ (node black b✝ y✝ d✝))
have ⟨⟨b'z, c'z, hb', hc'⟩, ⟨xz, xb', _⟩, zy, _, c'y⟩ := H ▸ this
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node black a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
az : All (fun x => cmpLT cmp x x✝) a✝¹
⊢ Ordered cmp (node red (node black a✝¹ x✝¹ a✝) x✝ (node black b✝ y✝ d✝))
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node black a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
⊢ Ordered cmp (node red (node black a✝¹ x✝¹ a✝) x✝ (node black b✝ y✝ d✝))
have az := xz.trans_r ax
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node black a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
az : All (fun x => cmpLT cmp x x✝) a✝¹
zd : All (fun x => cmpLT cmp x✝ x) d✝
⊢ Ordered cmp (node red (node black a✝¹ x✝¹ a✝) x✝ (node black b✝ y✝ d✝))
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node black a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
az : All (fun x => cmpLT cmp x x✝) a✝¹
⊢ Ordered cmp (node red (node black a✝¹ x✝¹ a✝) x✝ (node black b✝ y✝ d✝))
have zd := zy.trans_l yd
no goals
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝¹ : RBNode α
x✝¹ : α
b✝¹ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝¹ x✝¹ b✝¹)
hl : Ordered cmp (node black a✝¹ x✝¹ b✝¹)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝¹ : All (fun x => cmpLT cmp x v) a✝¹
bv : All (fun x => cmpLT cmp x v) b✝¹
ax : All (fun x => cmpLT cmp x x✝¹) a✝¹
xb : All (fun x => cmpLT cmp x✝¹ x) b✝¹
ha : Ordered cmp a✝¹
hb : Ordered cmp b✝¹
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝¹ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝¹ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝¹ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝¹ c✝)
l✝ a✝ : RBNode α
x✝ : α
b✝ : RBNode α
H : append b✝¹ c✝ = node red a✝ x✝ b✝
b'z : All (fun x => cmpLT cmp x x✝) a✝
c'z : All (fun x => cmpLT cmp x✝ x) b✝
hb' : Ordered cmp a✝
hc' : Ordered cmp b✝
xz : (fun x => cmpLT cmp x✝¹ x) x✝
xb' : All (fun x => cmpLT cmp x✝¹ x) a✝
right✝ : All (fun x => cmpLT cmp x✝¹ x) b✝
zy : (fun x => cmpLT cmp x y✝) x✝
left✝ : All (fun x => cmpLT cmp x y✝) a✝
c'y : All (fun x => cmpLT cmp x y✝) b✝
az : All (fun x => cmpLT cmp x x✝) a✝¹
zd : All (fun x => cmpLT cmp x✝ x) d✝
⊢ Ordered cmp (node red (node black a✝¹ x✝¹ a✝) x✝ (node black b✝ y✝ d✝))
exact ⟨⟨xz, az, b'z⟩, ⟨zy, c'z, zd⟩, ⟨ax, xb', ha, hb'⟩, c'y, yd, hc', hd⟩
case h_4.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝¹ b✝)
hl : Ordered cmp (node black a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
hbc : Ordered cmp (append b✝ c✝)
xbc : All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝)
bcy : All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
⊢ Ordered cmp (balLeft a✝ x✝¹ (node black (append b✝ c✝) y✝ d✝))
case h_4.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝¹ b✝)
hl : Ordered cmp (node black a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
⊢ Ordered cmp (balLeft a✝ x✝¹ (node black (append b✝ c✝) y✝ d✝))
have ⟨hbc, xbc, bcy⟩ := this
case h_4.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝¹ b✝)
hl : Ordered cmp (node black a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
hbc : Ordered cmp (append b✝ c✝)
xbc : All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝)
bcy : All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
xy : cmpLT cmp x✝¹ y✝
⊢ Ordered cmp (balLeft a✝ x✝¹ (node black (append b✝ c✝) y✝ d✝))
case h_4.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝¹ b✝)
hl : Ordered cmp (node black a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
hbc : Ordered cmp (append b✝ c✝)
xbc : All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝)
bcy : All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
⊢ Ordered cmp (balLeft a✝ x✝¹ (node black (append b✝ c✝) y✝ d✝))
have xy := xv.trans vy
no goals
case h_4.h_2
α : Type u_1
cmp : α → α → Ordering
v : α
x✝³ x✝² a✝ : RBNode α
x✝¹ : α
b✝ c✝ : RBNode α
y✝ : α
d✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black a✝ x✝¹ b✝)
hl : Ordered cmp (node black a✝ x✝¹ b✝)
vr : All (fun x => cmpLT cmp v x) (node black c✝ y✝ d✝)
hr : Ordered cmp (node black c✝ y✝ d✝)
xv : (fun x => cmpLT cmp x v) x✝¹
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝¹) a✝
xb : All (fun x => cmpLT cmp x✝¹ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
vy : (fun x => cmpLT cmp v x) y✝
vc : All (fun x => cmpLT cmp v x) c✝
right✝ : All (fun x => cmpLT cmp v x) d✝
cy : All (fun x => cmpLT cmp x y✝) c✝
yd : All (fun x => cmpLT cmp y✝ x) d✝
hc : Ordered cmp c✝
hd : Ordered cmp d✝
this :
  Ordered cmp (append b✝ c✝) ∧
    All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝) ∧ All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
l✝ : RBNode α
x✝ : ∀ (a : RBNode α) (x : α) (b : RBNode α), append b✝ c✝ = node red a x b → False
hbc : Ordered cmp (append b✝ c✝)
xbc : All (fun x => cmpLT cmp x✝¹ x) (append b✝ c✝)
bcy : All (fun x => cmpLT cmp x y✝) (append b✝ c✝)
xy : cmpLT cmp x✝¹ y✝
⊢ Ordered cmp (balLeft a✝ x✝¹ (node black (append b✝ c✝) y✝ d✝))
exact ha.balLeft ax ⟨xy, xbc, xy.trans_l yd⟩ ⟨bcy, yd, hbc, hd⟩
case h_5
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ l✝ : RBNode α
v✝ : α
r✝ b✝ : RBNode α
x✝ : α
c✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black l✝ v✝ r✝)
hl : Ordered cmp (node black l✝ v✝ r✝)
vr : All (fun x => cmpLT cmp v x) (node red b✝ x✝ c✝)
hr : Ordered cmp (node red b✝ x✝ c✝)
vx : (fun x => cmpLT cmp v x) x✝
vb : All (fun x => cmpLT cmp v x) b✝
right✝ : All (fun x => cmpLT cmp v x) c✝
⊢ Ordered cmp (node red (append (node black l✝ v✝ r✝) b✝) x✝ c✝)
case h_5
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ l✝ : RBNode α
v✝ : α
r✝ b✝ : RBNode α
x✝ : α
c✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black l✝ v✝ r✝)
hl : Ordered cmp (node black l✝ v✝ r✝)
vr : All (fun x => cmpLT cmp v x) (node red b✝ x✝ c✝)
hr : Ordered cmp (node red b✝ x✝ c✝)
⊢ Ordered cmp (node red (append (node black l✝ v✝ r✝) b✝) x✝ c✝)
have ⟨vx, vb, _⟩ := vr
case h_5
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ l✝ : RBNode α
v✝ : α
r✝ b✝ : RBNode α
x✝ : α
c✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black l✝ v✝ r✝)
hl : Ordered cmp (node black l✝ v✝ r✝)
vr : All (fun x => cmpLT cmp v x) (node red b✝ x✝ c✝)
hr : Ordered cmp (node red b✝ x✝ c✝)
vx : (fun x => cmpLT cmp v x) x✝
vb : All (fun x => cmpLT cmp v x) b✝
right✝ : All (fun x => cmpLT cmp v x) c✝
bx : All (fun x => cmpLT cmp x x✝) b✝
yc : All (fun x => cmpLT cmp x✝ x) c✝
hb : Ordered cmp b✝
hc : Ordered cmp c✝
⊢ Ordered cmp (node red (append (node black l✝ v✝ r✝) b✝) x✝ c✝)
case h_5
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ l✝ : RBNode α
v✝ : α
r✝ b✝ : RBNode α
x✝ : α
c✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black l✝ v✝ r✝)
hl : Ordered cmp (node black l✝ v✝ r✝)
vr : All (fun x => cmpLT cmp v x) (node red b✝ x✝ c✝)
hr : Ordered cmp (node red b✝ x✝ c✝)
vx : (fun x => cmpLT cmp v x) x✝
vb : All (fun x => cmpLT cmp v x) b✝
right✝ : All (fun x => cmpLT cmp v x) c✝
⊢ Ordered cmp (node red (append (node black l✝ v✝ r✝) b✝) x✝ c✝)
have ⟨bx, yc, hb, hc⟩ := hr
no goals
case h_5
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ l✝ : RBNode α
v✝ : α
r✝ b✝ : RBNode α
x✝ : α
c✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node black l✝ v✝ r✝)
hl : Ordered cmp (node black l✝ v✝ r✝)
vr : All (fun x => cmpLT cmp v x) (node red b✝ x✝ c✝)
hr : Ordered cmp (node red b✝ x✝ c✝)
vx : (fun x => cmpLT cmp v x) x✝
vb : All (fun x => cmpLT cmp v x) b✝
right✝ : All (fun x => cmpLT cmp v x) c✝
bx : All (fun x => cmpLT cmp x x✝) b✝
yc : All (fun x => cmpLT cmp x✝ x) c✝
hb : Ordered cmp b✝
hc : Ordered cmp c✝
⊢ Ordered cmp (node red (append (node black l✝ v✝ r✝) b✝) x✝ c✝)
exact ⟨(vx.trans_r lv).append bx, yc, hl.append lv vb hb, hc⟩
case h_6
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ l✝ : RBNode α
v✝ : α
r✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black l✝ v✝ r✝)
hr : Ordered cmp (node black l✝ v✝ r✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
⊢ Ordered cmp (node red a✝ x✝ (append b✝ (node black l✝ v✝ r✝)))
case h_6
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ l✝ : RBNode α
v✝ : α
r✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black l✝ v✝ r✝)
hr : Ordered cmp (node black l✝ v✝ r✝)
⊢ Ordered cmp (node red a✝ x✝ (append b✝ (node black l✝ v✝ r✝)))
have ⟨xv, _, bv⟩ := lv
case h_6
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ l✝ : RBNode α
v✝ : α
r✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black l✝ v✝ r✝)
hr : Ordered cmp (node black l✝ v✝ r✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
⊢ Ordered cmp (node red a✝ x✝ (append b✝ (node black l✝ v✝ r✝)))
case h_6
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ l✝ : RBNode α
v✝ : α
r✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black l✝ v✝ r✝)
hr : Ordered cmp (node black l✝ v✝ r✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
⊢ Ordered cmp (node red a✝ x✝ (append b✝ (node black l✝ v✝ r✝)))
have ⟨ax, xb, ha, hb⟩ := hl
no goals
case h_6
α : Type u_1
cmp : α → α → Ordering
v : α
x✝² x✝¹ a✝ : RBNode α
x✝ : α
b✝ l✝ : RBNode α
v✝ : α
r✝ : RBNode α
lv : All (fun x => cmpLT cmp x v) (node red a✝ x✝ b✝)
hl : Ordered cmp (node red a✝ x✝ b✝)
vr : All (fun x => cmpLT cmp v x) (node black l✝ v✝ r✝)
hr : Ordered cmp (node black l✝ v✝ r✝)
xv : (fun x => cmpLT cmp x v) x✝
left✝ : All (fun x => cmpLT cmp x v) a✝
bv : All (fun x => cmpLT cmp x v) b✝
ax : All (fun x => cmpLT cmp x x✝) a✝
xb : All (fun x => cmpLT cmp x✝ x) b✝
ha : Ordered cmp a✝
hb : Ordered cmp b✝
⊢ Ordered cmp (node red a✝ x✝ (append b✝ (node black l✝ v✝ r✝)))
exact ⟨ax, xb.append (xv.trans_l vr), ha, hb.append bv vr hr⟩