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

tactic: simp [upperBound?]
state_before: case node
α : Type u_1
x : α
cut : α → Ordering
c : RBColor
a : RBNode α
y : α
b : RBNode α
iha : ∀ (ub : Option α), find? cut a = some x → upperBound? cut a ub = some x
ihb : ∀ (ub : Option α), find? cut b = some x → upperBound? cut b ub = some x
ub : Option α
H :
  (match cut y with
    | Ordering.lt => find? cut a
    | Ordering.gt => find? cut b
    | Ordering.eq => some y) =
    some x
⊢ upperBound? cut (node c a y b) ub = some x
state_after: case node
α : Type u_1
x : α
cut : α → Ordering
c : RBColor
a : RBNode α
y : α
b : RBNode α
iha : ∀ (ub : Option α), find? cut a = some x → upperBound? cut a ub = some x
ihb : ∀ (ub : Option α), find? cut b = some x → upperBound? cut b ub = some x
ub : Option α
H :
  (match cut y with
    | Ordering.lt => find? cut a
    | Ordering.gt => find? cut b
    | Ordering.eq => some y) =
    some x
⊢ (match cut y with
    | Ordering.lt => upperBound? cut a (some y)
    | Ordering.gt => upperBound? cut b ub
    | Ordering.eq => some y) =
    some x

tactic: split at H
state_before: case node
α : Type u_1
x : α
cut : α → Ordering
c : RBColor
a : RBNode α
y : α
b : RBNode α
iha : ∀ (ub : Option α), find? cut a = some x → upperBound? cut a ub = some x
ihb : ∀ (ub : Option α), find? cut b = some x → upperBound? cut b ub = some x
ub : Option α
H :
  (match cut y with
    | Ordering.lt => find? cut a
    | Ordering.gt => find? cut b
    | Ordering.eq => some y) =
    some x
⊢ (match cut y with
    | Ordering.lt => upperBound? cut a (some y)
    | Ordering.gt => upperBound? cut b ub
    | Ordering.eq => some y) =
    some x
state_after: case node.h_1
α : Type u_1
x : α
cut : α → Ordering
c : RBColor
a : RBNode α
y : α
b : RBNode α
iha : ∀ (ub : Option α), find? cut a = some x → upperBound? cut a ub = some x
ihb : ∀ (ub : Option α), find? cut b = some x → upperBound? cut b ub = some x
ub : Option α
x✝ : Ordering
heq✝ : cut y = Ordering.lt
H : find? cut a = some x
⊢ upperBound? cut a (some y) = some x

case node.h_2
α : Type u_1
x : α
cut : α → Ordering
c : RBColor
a : RBNode α
y : α
b : RBNode α
iha : ∀ (ub : Option α), find? cut a = some x → upperBound? cut a ub = some x
ihb : ∀ (ub : Option α), find? cut b = some x → upperBound? cut b ub = some x
ub : Option α
x✝ : Ordering
heq✝ : cut y = Ordering.gt
H : find? cut b = some x
⊢ upperBound? cut b ub = some x

case node.h_3
α : Type u_1
x : α
cut : α → Ordering
c : RBColor
a : RBNode α
y : α
b : RBNode α
iha : ∀ (ub : Option α), find? cut a = some x → upperBound? cut a ub = some x
ihb : ∀ (ub : Option α), find? cut b = some x → upperBound? cut b ub = some x
ub : Option α
x✝ : Ordering
heq✝ : cut y = Ordering.eq
H : some y = some x
⊢ some y = some x

tactic: apply iha _ H
state_before: case node.h_1
α : Type u_1
x : α
cut : α → Ordering
c : RBColor
a : RBNode α
y : α
b : RBNode α
iha : ∀ (ub : Option α), find? cut a = some x → upperBound? cut a ub = some x
ihb : ∀ (ub : Option α), find? cut b = some x → upperBound? cut b ub = some x
ub : Option α
x✝ : Ordering
heq✝ : cut y = Ordering.lt
H : find? cut a = some x
⊢ upperBound? cut a (some y) = some x
state_after: no goals

tactic: apply ihb _ H
state_before: case node.h_2
α : Type u_1
x : α
cut : α → Ordering
c : RBColor
a : RBNode α
y : α
b : RBNode α
iha : ∀ (ub : Option α), find? cut a = some x → upperBound? cut a ub = some x
ihb : ∀ (ub : Option α), find? cut b = some x → upperBound? cut b ub = some x
ub : Option α
x✝ : Ordering
heq✝ : cut y = Ordering.gt
H : find? cut b = some x
⊢ upperBound? cut b ub = some x
state_after: no goals

tactic: exact H
state_before: case node.h_3
α : Type u_1
x : α
cut : α → Ordering
c : RBColor
a : RBNode α
y : α
b : RBNode α
iha : ∀ (ub : Option α), find? cut a = some x → upperBound? cut a ub = some x
ihb : ∀ (ub : Option α), find? cut b = some x → upperBound? cut b ub = some x
ub : Option α
x✝ : Ordering
heq✝ : cut y = Ordering.eq
H : some y = some x
⊢ some y = some x
state_after: no goals