Theorem: Batteries.RBNode.Ordered.upperBound?_least_ub
File: .lake/packages/batteries/Batteries/Data/RBMap/Lemmas.lean

tactic: nofun
state_before: case nil
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ub : Option α
h : Ordered cmp nil
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) nil
⊢ upperBound? cut nil ub = some x → y ∈ nil → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
state_after: no goals

tactic: simp [upperBound?]
state_before: case node
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
⊢ upperBound? cut (node c✝ l✝ v✝ r✝) ub = some x →
    y ∈ node c✝ l✝ v✝ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
state_after: case node
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
⊢ (match cut v✝ with
      | Ordering.lt => upperBound? cut l✝ (some v✝)
      | Ordering.gt => upperBound? cut r✝ ub
      | Ordering.eq => some v✝) =
      some x →
    y = v✝ ∨ y ∈ l✝ ∨ y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt

tactic: split <;> rename_i hv <;> rintro h₁ (rfl | hy' | hy') hx h₂
state_before: case node
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
⊢ (match cut v✝ with
      | Ordering.lt => upperBound? cut l✝ (some v✝)
      | Ordering.gt => upperBound? cut r✝ ub
      | Ordering.eq => some v✝) =
      some x →
    y = v✝ ∨ y ∈ l✝ ∨ y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
state_after: case node.h_1.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
h : Ordered cmp (node c✝ l✝ y r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ y r✝)
hv : cut y = Ordering.lt
h₁ : upperBound? cut l✝ (some y) = some x
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt

case node.h_1.inr.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ l✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt

case node.h_1.inr.inr
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt

case node.h_2.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
h₁ : upperBound? cut r✝ ub = some x
h : Ordered cmp (node c✝ l✝ y r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ y r✝)
hv : cut y = Ordering.gt
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt

case node.h_2.inr.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.gt
h₁ : upperBound? cut r✝ ub = some x
hy' : y ∈ l✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt

case node.h_2.inr.inr
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.gt
h₁ : upperBound? cut r✝ ub = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt

case node.h_3.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
h : Ordered cmp (node c✝ l✝ y r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ y r✝)
hv : cut y = Ordering.eq
h₁ : some y = some x
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt

case node.h_3.inr.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.eq
h₁ : some v✝ = some x
hy' : y ∈ l✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt

case node.h_3.inr.inr
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.eq
h₁ : some v✝ = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt

tactic: rcases upperBound?_mem_ub h₁ with h₁ | ⟨⟨⟩⟩
state_before: case node.h_1.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
h : Ordered cmp (node c✝ l✝ y r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ y r✝)
hv : cut y = Ordering.lt
h₁ : upperBound? cut l✝ (some y) = some x
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt
state_after: case node.h_1.inl.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
h : Ordered cmp (node c✝ l✝ y r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ y r✝)
hv : cut y = Ordering.lt
h₁✝ : upperBound? cut l✝ (some y) = some x
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
h₁ : x ∈ l✝
⊢ cut y = Ordering.gt

case node.h_1.inl.inr.refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ub : Option α
x✝ : Ordering
hx : cut x = Ordering.lt
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → x ∈ l✝ → cut x = Ordering.lt → cmp x x = Ordering.lt → cut x = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → x ∈ r✝ → cut x = Ordering.lt → cmp x x = Ordering.lt → cut x = Ordering.gt
h : Ordered cmp (node c✝ l✝ x r✝)
hub : ∀ {x_1 : α}, ub = some x_1 → All (fun x => cmpLT cmp x x_1) (node c✝ l✝ x r✝)
hv : cut x = Ordering.lt
h₁ : upperBound? cut l✝ (some x) = some x
h₂ : cmp x x = Ordering.lt
⊢ cut x = Ordering.gt

tactic: cases TransCmp.lt_asymm h₂ (All_def.1 h.1 _ h₁).1
state_before: case node.h_1.inl.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
h : Ordered cmp (node c✝ l✝ y r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ y r✝)
hv : cut y = Ordering.lt
h₁✝ : upperBound? cut l✝ (some y) = some x
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
h₁ : x ∈ l✝
⊢ cut y = Ordering.gt
state_after: no goals

tactic: cases TransCmp.lt_asymm h₂ h₂
state_before: case node.h_1.inl.inr.refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ub : Option α
x✝ : Ordering
hx : cut x = Ordering.lt
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → x ∈ l✝ → cut x = Ordering.lt → cmp x x = Ordering.lt → cut x = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → x ∈ r✝ → cut x = Ordering.lt → cmp x x = Ordering.lt → cut x = Ordering.gt
h : Ordered cmp (node c✝ l✝ x r✝)
hub : ∀ {x_1 : α}, ub = some x_1 → All (fun x => cmpLT cmp x x_1) (node c✝ l✝ x r✝)
hv : cut x = Ordering.lt
h₁ : upperBound? cut l✝ (some x) = some x
h₂ : cmp x x = Ordering.lt
⊢ cut x = Ordering.gt
state_after: no goals

tactic: exact ihl h.2.2.1 (by rintro _ ⟨⟨⟩⟩; exact h.1) h₁ hy' hx h₂
state_before: case node.h_1.inr.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ l✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt
state_after: no goals

tactic: rintro _ ⟨⟨⟩⟩
state_before: α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ l✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ ∀ {x : α}, some v✝ = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝
state_after: case refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ l✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ All (fun x => cmpLT cmp x v✝) l✝

tactic: exact h.1
state_before: case refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ l✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ All (fun x => cmpLT cmp x v✝) l✝
state_after: no goals

tactic: refine (TransCmp.lt_asymm h₂ ?_).elim
state_before: case node.h_1.inr.inr
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt
state_after: case node.h_1.inr.inr
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cmp x y = Ordering.lt

tactic: have := (All_def.1 h.2.1 _ hy').1
state_before: case node.h_1.inr.inr
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cmp x y = Ordering.lt
state_after: case node.h_1.inr.inr
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
this : cmp v✝ y = Ordering.lt
⊢ cmp x y = Ordering.lt

tactic: rcases upperBound?_mem_ub h₁ with h₁ | ⟨⟨⟩⟩
state_before: case node.h_1.inr.inr
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
this : cmp v✝ y = Ordering.lt
⊢ cmp x y = Ordering.lt
state_after: case node.h_1.inr.inr.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁✝ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
this : cmp v✝ y = Ordering.lt
h₁ : x ∈ l✝
⊢ cmp x y = Ordering.lt

case node.h_1.inr.inr.inr.refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
h : Ordered cmp (node c✝ l✝ x r✝)
hub : ∀ {x_1 : α}, ub = some x_1 → All (fun x => cmpLT cmp x x_1) (node c✝ l✝ x r✝)
hv : cut x = Ordering.lt
h₁ : upperBound? cut l✝ (some x) = some x
this : cmp x y = Ordering.lt
⊢ cmp x y = Ordering.lt

tactic: exact TransCmp.lt_trans (All_def.1 h.1 _ h₁).1 this
state_before: case node.h_1.inr.inr.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.lt
h₁✝ : upperBound? cut l✝ (some v✝) = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
this : cmp v✝ y = Ordering.lt
h₁ : x ∈ l✝
⊢ cmp x y = Ordering.lt
state_after: no goals

tactic: exact this
state_before: case node.h_1.inr.inr.inr.refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
h : Ordered cmp (node c✝ l✝ x r✝)
hub : ∀ {x_1 : α}, ub = some x_1 → All (fun x => cmpLT cmp x x_1) (node c✝ l✝ x r✝)
hv : cut x = Ordering.lt
h₁ : upperBound? cut l✝ (some x) = some x
this : cmp x y = Ordering.lt
⊢ cmp x y = Ordering.lt
state_after: no goals

tactic: exact hv
state_before: case node.h_2.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
h₁ : upperBound? cut r✝ ub = some x
h : Ordered cmp (node c✝ l✝ y r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ y r✝)
hv : cut y = Ordering.gt
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt
state_after: no goals

tactic: exact IsCut.gt_trans (cut := cut) (cmp := cmp) (All_def.1 h.1 _ hy').1 hv
state_before: case node.h_2.inr.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.gt
h₁ : upperBound? cut r✝ ub = some x
hy' : y ∈ l✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt
state_after: no goals

tactic: exact ihr h.2.2.2 (fun h => (hub h).2.2) h₁ hy' hx h₂
state_before: case node.h_2.inr.inr
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.gt
h₁ : upperBound? cut r✝ ub = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt
state_after: no goals

tactic: cases h₁
state_before: case node.h_3.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
h : Ordered cmp (node c✝ l✝ y r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ y r✝)
hv : cut y = Ordering.eq
h₁ : some y = some x
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt
state_after: case node.h_3.inl.refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ub : Option α
x✝ : Ordering
hx : cut x = Ordering.lt
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → x ∈ l✝ → cut x = Ordering.lt → cmp x x = Ordering.lt → cut x = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → x ∈ r✝ → cut x = Ordering.lt → cmp x x = Ordering.lt → cut x = Ordering.gt
h : Ordered cmp (node c✝ l✝ x r✝)
hub : ∀ {x_1 : α}, ub = some x_1 → All (fun x => cmpLT cmp x x_1) (node c✝ l✝ x r✝)
hv : cut x = Ordering.eq
h₂ : cmp x x = Ordering.lt
⊢ cut x = Ordering.gt

tactic: cases TransCmp.lt_asymm h₂ h₂
state_before: case node.h_3.inl.refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ub : Option α
x✝ : Ordering
hx : cut x = Ordering.lt
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → x ∈ l✝ → cut x = Ordering.lt → cmp x x = Ordering.lt → cut x = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → x ∈ r✝ → cut x = Ordering.lt → cmp x x = Ordering.lt → cut x = Ordering.gt
h : Ordered cmp (node c✝ l✝ x r✝)
hub : ∀ {x_1 : α}, ub = some x_1 → All (fun x => cmpLT cmp x x_1) (node c✝ l✝ x r✝)
hv : cut x = Ordering.eq
h₂ : cmp x x = Ordering.lt
⊢ cut x = Ordering.gt
state_after: no goals

tactic: cases h₁
state_before: case node.h_3.inr.inl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.eq
h₁ : some v✝ = some x
hy' : y ∈ l✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt
state_after: case node.h_3.inr.inl.refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
hy' : y ∈ l✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
h : Ordered cmp (node c✝ l✝ x r✝)
hub : ∀ {x_1 : α}, ub = some x_1 → All (fun x => cmpLT cmp x x_1) (node c✝ l✝ x r✝)
hv : cut x = Ordering.eq
⊢ cut y = Ordering.gt

tactic: cases hx.symm.trans hv
state_before: case node.h_3.inr.inl.refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
hy' : y ∈ l✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
h : Ordered cmp (node c✝ l✝ x r✝)
hub : ∀ {x_1 : α}, ub = some x_1 → All (fun x => cmpLT cmp x x_1) (node c✝ l✝ x r✝)
hv : cut x = Ordering.eq
⊢ cut y = Ordering.gt
state_after: no goals

tactic: cases h₁
state_before: case node.h_3.inr.inr
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
h : Ordered cmp (node c✝ l✝ v✝ r✝)
hub : ∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) (node c✝ l✝ v✝ r✝)
x✝ : Ordering
hv : cut v✝ = Ordering.eq
h₁ : some v✝ = some x
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
⊢ cut y = Ordering.gt
state_after: case node.h_3.inr.inr.refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
h : Ordered cmp (node c✝ l✝ x r✝)
hub : ∀ {x_1 : α}, ub = some x_1 → All (fun x => cmpLT cmp x x_1) (node c✝ l✝ x r✝)
hv : cut x = Ordering.eq
⊢ cut y = Ordering.gt

tactic: cases hx.symm.trans hv
state_before: case node.h_3.inr.inr.refl
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
c✝ : RBColor
l✝ r✝ : RBNode α
ihl :
  ∀ {ub : Option α},
    Ordered cmp l✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) l✝) →
        upperBound? cut l✝ ub = some x → y ∈ l✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ihr :
  ∀ {ub : Option α},
    Ordered cmp r✝ →
      (∀ {x : α}, ub = some x → All (fun x_1 => cmpLT cmp x_1 x) r✝) →
        upperBound? cut r✝ ub = some x → y ∈ r✝ → cut x = Ordering.lt → cmp y x = Ordering.lt → cut y = Ordering.gt
ub : Option α
x✝ : Ordering
hy' : y ∈ r✝
hx : cut x = Ordering.lt
h₂ : cmp y x = Ordering.lt
h : Ordered cmp (node c✝ l✝ x r✝)
hub : ∀ {x_1 : α}, ub = some x_1 → All (fun x => cmpLT cmp x x_1) (node c✝ l✝ x r✝)
hv : cut x = Ordering.eq
⊢ cut y = Ordering.gt
state_after: no goals