Theorem: Batteries.RBNode.Ordered.ins
File: .lake/packages/batteries/Batteries/Data/RBMap/WF.lean

tactic: unfold ins
state_before: α : Type u_1
cmp : α → α → Ordering
x : α
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 (ins cmp x (node red a y b))
state_after: α : Type u_1
cmp : α → α → Ordering
x : α
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 cmp x y with
    | Ordering.lt => node red (ins cmp x a) y b
    | Ordering.gt => node red a y (ins cmp x b)
    | Ordering.eq => node red a x b)

tactic: split
state_before: α : Type u_1
cmp : α → α → Ordering
x : α
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 cmp x y with
    | Ordering.lt => node red (ins cmp x a) y b
    | Ordering.gt => node red a y (ins cmp x b)
    | Ordering.eq => node red a x b)
state_after: case h_1
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.lt
⊢ Ordered cmp (node red (ins cmp x a) y b)

case h_2
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.gt
⊢ Ordered cmp (node red a y (ins cmp x b))

case h_3
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.eq
⊢ Ordered cmp (node red a x b)

tactic: next h => exact ⟨ay.ins ⟨h⟩, yb, ha.ins, hb⟩
state_before: case h_1
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.lt
⊢ Ordered cmp (node red (ins cmp x a) y b)
state_after: no goals

tactic: exact ⟨ay.ins ⟨h⟩, yb, ha.ins, hb⟩
state_before: α : Type u_1
cmp : α → α → Ordering
x : α
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
h : cmp x y = Ordering.lt
⊢ Ordered cmp (node red (ins cmp x a) y b)
state_after: no goals

tactic: next h => exact ⟨ay, yb.ins ⟨OrientedCmp.cmp_eq_gt.1 h⟩, ha, hb.ins⟩
state_before: case h_2
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.gt
⊢ Ordered cmp (node red a y (ins cmp x b))
state_after: no goals

tactic: exact ⟨ay, yb.ins ⟨OrientedCmp.cmp_eq_gt.1 h⟩, ha, hb.ins⟩
state_before: α : Type u_1
cmp : α → α → Ordering
x : α
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
h : cmp x y = Ordering.gt
⊢ Ordered cmp (node red a y (ins cmp x b))
state_after: no goals

tactic: next h => exact (⟨
  ay.imp fun ⟨h'⟩ => ⟨(TransCmp.cmp_congr_right h).trans h'⟩,
  yb.imp fun ⟨h'⟩ => ⟨(TransCmp.cmp_congr_left h).trans h'⟩, ha, hb⟩)
state_before: case h_3
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.eq
⊢ Ordered cmp (node red a x b)
state_after: no goals

tactic: exact (⟨
ay.imp fun ⟨h'⟩ => ⟨(TransCmp.cmp_congr_right h).trans h'⟩,
yb.imp fun ⟨h'⟩ => ⟨(TransCmp.cmp_congr_left h).trans h'⟩, ha, hb⟩)
state_before: α : Type u_1
cmp : α → α → Ordering
x : α
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
h : cmp x y = Ordering.eq
⊢ Ordered cmp (node red a x b)
state_after: no goals

tactic: unfold ins
state_before: α : Type u_1
cmp : α → α → Ordering
x : α
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 (ins cmp x (node black a y b))
state_after: α : Type u_1
cmp : α → α → Ordering
x : α
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 cmp x y with
    | Ordering.lt => (ins cmp x a).balance1 y b
    | Ordering.gt => a.balance2 y (ins cmp x b)
    | Ordering.eq => node black a x b)

tactic: split
state_before: α : Type u_1
cmp : α → α → Ordering
x : α
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 cmp x y with
    | Ordering.lt => (ins cmp x a).balance1 y b
    | Ordering.gt => a.balance2 y (ins cmp x b)
    | Ordering.eq => node black a x b)
state_after: case h_1
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.lt
⊢ Ordered cmp ((ins cmp x a).balance1 y b)

case h_2
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.gt
⊢ Ordered cmp (a.balance2 y (ins cmp x b))

case h_3
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.eq
⊢ Ordered cmp (node black a x b)

tactic: next h => exact ha.ins.balance1 (ay.ins ⟨h⟩) yb hb
state_before: case h_1
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.lt
⊢ Ordered cmp ((ins cmp x a).balance1 y b)
state_after: no goals

tactic: exact ha.ins.balance1 (ay.ins ⟨h⟩) yb hb
state_before: α : Type u_1
cmp : α → α → Ordering
x : α
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
h : cmp x y = Ordering.lt
⊢ Ordered cmp ((ins cmp x a).balance1 y b)
state_after: no goals

tactic: next h => exact ha.balance2 ay (yb.ins ⟨OrientedCmp.cmp_eq_gt.1 h⟩) hb.ins
state_before: case h_2
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.gt
⊢ Ordered cmp (a.balance2 y (ins cmp x b))
state_after: no goals

tactic: exact ha.balance2 ay (yb.ins ⟨OrientedCmp.cmp_eq_gt.1 h⟩) hb.ins
state_before: α : Type u_1
cmp : α → α → Ordering
x : α
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
h : cmp x y = Ordering.gt
⊢ Ordered cmp (a.balance2 y (ins cmp x b))
state_after: no goals

tactic: next h => exact (⟨
  ay.imp fun ⟨h'⟩ => ⟨(TransCmp.cmp_congr_right h).trans h'⟩,
  yb.imp fun ⟨h'⟩ => ⟨(TransCmp.cmp_congr_left h).trans h'⟩, ha, hb⟩)
state_before: case h_3
α : Type u_1
cmp : α → α → Ordering
x : α
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✝ : cmp x y = Ordering.eq
⊢ Ordered cmp (node black a x b)
state_after: no goals

tactic: exact (⟨
ay.imp fun ⟨h'⟩ => ⟨(TransCmp.cmp_congr_right h).trans h'⟩,
yb.imp fun ⟨h'⟩ => ⟨(TransCmp.cmp_congr_left h).trans h'⟩, ha, hb⟩)
state_before: α : Type u_1
cmp : α → α → Ordering
x : α
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
h : cmp x y = Ordering.eq
⊢ Ordered cmp (node black a x b)
state_after: no goals