Theorem: Batteries.RBNode.All.del
File: .lake/packages/batteries/Batteries/Data/RBMap/WF.lean

tactic: unfold del
state_before: α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
⊢ All p (del cut (node c✝ a✝² a✝¹ a✝))
state_after: α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
⊢ All p
    (match cut a✝¹ with
    | Ordering.lt =>
      match a✝².isBlack with
      | black => (del cut a✝²).balLeft a✝¹ a✝
      | red => node red (del cut a✝²) a✝¹ a✝
    | Ordering.gt =>
      match a✝.isBlack with
      | black => a✝².balRight a✝¹ (del cut a✝)
      | red => node red a✝² a✝¹ (del cut a✝)
    | Ordering.eq => a✝².append a✝)

tactic: split
state_before: α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
⊢ All p
    (match cut a✝¹ with
    | Ordering.lt =>
      match a✝².isBlack with
      | black => (del cut a✝²).balLeft a✝¹ a✝
      | red => node red (del cut a✝²) a✝¹ a✝
    | Ordering.gt =>
      match a✝.isBlack with
      | black => a✝².balRight a✝¹ (del cut a✝)
      | red => node red a✝² a✝¹ (del cut a✝)
    | Ordering.eq => a✝².append a✝)
state_after: case h_1
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝ : Ordering
heq✝ : cut a✝¹ = Ordering.lt
⊢ All p
    (match a✝².isBlack with
    | black => (del cut a✝²).balLeft a✝¹ a✝
    | red => node red (del cut a✝²) a✝¹ a✝)

case h_2
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝ : Ordering
heq✝ : cut a✝¹ = Ordering.gt
⊢ All p
    (match a✝.isBlack with
    | black => a✝².balRight a✝¹ (del cut a✝)
    | red => node red a✝² a✝¹ (del cut a✝))

case h_3
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝ : Ordering
heq✝ : cut a✝¹ = Ordering.eq
⊢ All p (a✝².append a✝)

tactic: split
state_before: case h_1
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝ : Ordering
heq✝ : cut a✝¹ = Ordering.lt
⊢ All p
    (match a✝².isBlack with
    | black => (del cut a✝²).balLeft a✝¹ a✝
    | red => node red (del cut a✝²) a✝¹ a✝)
state_after: case h_1.h_1
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝¹ : Ordering
heq✝¹ : cut a✝¹ = Ordering.lt
x✝ : RBColor
heq✝ : a✝².isBlack = black
⊢ All p ((del cut a✝²).balLeft a✝¹ a✝)

case h_1.h_2
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝¹ : Ordering
heq✝¹ : cut a✝¹ = Ordering.lt
x✝ : RBColor
heq✝ : a✝².isBlack = red
⊢ All p (node red (del cut a✝²) a✝¹ a✝)

tactic: exact ha.del.balLeft hy hb
state_before: case h_1.h_1
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝¹ : Ordering
heq✝¹ : cut a✝¹ = Ordering.lt
x✝ : RBColor
heq✝ : a✝².isBlack = black
⊢ All p ((del cut a✝²).balLeft a✝¹ a✝)
state_after: no goals

tactic: exact ⟨hy, ha.del, hb⟩
state_before: case h_1.h_2
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝¹ : Ordering
heq✝¹ : cut a✝¹ = Ordering.lt
x✝ : RBColor
heq✝ : a✝².isBlack = red
⊢ All p (node red (del cut a✝²) a✝¹ a✝)
state_after: no goals

tactic: split
state_before: case h_2
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝ : Ordering
heq✝ : cut a✝¹ = Ordering.gt
⊢ All p
    (match a✝.isBlack with
    | black => a✝².balRight a✝¹ (del cut a✝)
    | red => node red a✝² a✝¹ (del cut a✝))
state_after: case h_2.h_1
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝¹ : Ordering
heq✝¹ : cut a✝¹ = Ordering.gt
x✝ : RBColor
heq✝ : a✝.isBlack = black
⊢ All p (a✝².balRight a✝¹ (del cut a✝))

case h_2.h_2
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝¹ : Ordering
heq✝¹ : cut a✝¹ = Ordering.gt
x✝ : RBColor
heq✝ : a✝.isBlack = red
⊢ All p (node red a✝² a✝¹ (del cut a✝))

tactic: exact ha.balRight hy hb.del
state_before: case h_2.h_1
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝¹ : Ordering
heq✝¹ : cut a✝¹ = Ordering.gt
x✝ : RBColor
heq✝ : a✝.isBlack = black
⊢ All p (a✝².balRight a✝¹ (del cut a✝))
state_after: no goals

tactic: exact ⟨hy, ha, hb.del⟩
state_before: case h_2.h_2
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝¹ : Ordering
heq✝¹ : cut a✝¹ = Ordering.gt
x✝ : RBColor
heq✝ : a✝.isBlack = red
⊢ All p (node red a✝² a✝¹ (del cut a✝))
state_after: no goals

tactic: exact ha.append hb
state_before: case h_3
α : Type u_1
p : α → Prop
cut : α → Ordering
c✝ : RBColor
a✝² : RBNode α
a✝¹ : α
a✝ : RBNode α
hy : p a✝¹
ha : All p a✝²
hb : All p a✝
x✝ : Ordering
heq✝ : cut a✝¹ = Ordering.eq
⊢ All p (a✝².append a✝)
state_after: no goals