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

tactic: exact H
state_before: case nil
α : Type u_1
p : α → Prop
cut : α → Ordering
x : α
ub : Option α
hp : All p nil
H : ∀ {x : α}, ub = some x → p x
⊢ upperBound? cut nil ub = some x → p x
state_after: no goals

tactic: simp [upperBound?]
state_before: case node
α : Type u_1
p : α → Prop
cut : α → Ordering
x : α
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl : ∀ {ub : Option α}, All p l✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut l✝ ub = some x → p x
ihr : ∀ {ub : Option α}, All p r✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut r✝ ub = some x → p x
ub : Option α
hp : All p (node c✝ l✝ v✝ r✝)
H : ∀ {x : α}, ub = some x → p x
⊢ upperBound? cut (node c✝ l✝ v✝ r✝) ub = some x → p x
state_after: case node
α : Type u_1
p : α → Prop
cut : α → Ordering
x : α
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl : ∀ {ub : Option α}, All p l✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut l✝ ub = some x → p x
ihr : ∀ {ub : Option α}, All p r✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut r✝ ub = some x → p x
ub : Option α
hp : All p (node c✝ l✝ v✝ r✝)
H : ∀ {x : α}, ub = some x → p x
⊢ (match cut v✝ with
      | Ordering.lt => upperBound? cut l✝ (some v✝)
      | Ordering.gt => upperBound? cut r✝ ub
      | Ordering.eq => some v✝) =
      some x →
    p x

tactic: split
state_before: case node
α : Type u_1
p : α → Prop
cut : α → Ordering
x : α
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl : ∀ {ub : Option α}, All p l✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut l✝ ub = some x → p x
ihr : ∀ {ub : Option α}, All p r✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut r✝ ub = some x → p x
ub : Option α
hp : All p (node c✝ l✝ v✝ r✝)
H : ∀ {x : α}, ub = some x → p x
⊢ (match cut v✝ with
      | Ordering.lt => upperBound? cut l✝ (some v✝)
      | Ordering.gt => upperBound? cut r✝ ub
      | Ordering.eq => some v✝) =
      some x →
    p x
state_after: case node.h_1
α : Type u_1
p : α → Prop
cut : α → Ordering
x : α
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl : ∀ {ub : Option α}, All p l✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut l✝ ub = some x → p x
ihr : ∀ {ub : Option α}, All p r✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut r✝ ub = some x → p x
ub : Option α
hp : All p (node c✝ l✝ v✝ r✝)
H : ∀ {x : α}, ub = some x → p x
x✝ : Ordering
heq✝ : cut v✝ = Ordering.lt
⊢ upperBound? cut l✝ (some v✝) = some x → p x

case node.h_2
α : Type u_1
p : α → Prop
cut : α → Ordering
x : α
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl : ∀ {ub : Option α}, All p l✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut l✝ ub = some x → p x
ihr : ∀ {ub : Option α}, All p r✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut r✝ ub = some x → p x
ub : Option α
hp : All p (node c✝ l✝ v✝ r✝)
H : ∀ {x : α}, ub = some x → p x
x✝ : Ordering
heq✝ : cut v✝ = Ordering.gt
⊢ upperBound? cut r✝ ub = some x → p x

case node.h_3
α : Type u_1
p : α → Prop
cut : α → Ordering
x : α
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl : ∀ {ub : Option α}, All p l✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut l✝ ub = some x → p x
ihr : ∀ {ub : Option α}, All p r✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut r✝ ub = some x → p x
ub : Option α
hp : All p (node c✝ l✝ v✝ r✝)
H : ∀ {x : α}, ub = some x → p x
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
⊢ some v✝ = some x → p x

tactic: exact ihl hp.2.1 fun | rfl => hp.1
state_before: case node.h_1
α : Type u_1
p : α → Prop
cut : α → Ordering
x : α
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl : ∀ {ub : Option α}, All p l✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut l✝ ub = some x → p x
ihr : ∀ {ub : Option α}, All p r✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut r✝ ub = some x → p x
ub : Option α
hp : All p (node c✝ l✝ v✝ r✝)
H : ∀ {x : α}, ub = some x → p x
x✝ : Ordering
heq✝ : cut v✝ = Ordering.lt
⊢ upperBound? cut l✝ (some v✝) = some x → p x
state_after: no goals

tactic: exact ihr hp.2.2 H
state_before: case node.h_2
α : Type u_1
p : α → Prop
cut : α → Ordering
x : α
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl : ∀ {ub : Option α}, All p l✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut l✝ ub = some x → p x
ihr : ∀ {ub : Option α}, All p r✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut r✝ ub = some x → p x
ub : Option α
hp : All p (node c✝ l✝ v✝ r✝)
H : ∀ {x : α}, ub = some x → p x
x✝ : Ordering
heq✝ : cut v✝ = Ordering.gt
⊢ upperBound? cut r✝ ub = some x → p x
state_after: no goals

tactic: exact fun | rfl => hp.1
state_before: case node.h_3
α : Type u_1
p : α → Prop
cut : α → Ordering
x : α
c✝ : RBColor
l✝ : RBNode α
v✝ : α
r✝ : RBNode α
ihl : ∀ {ub : Option α}, All p l✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut l✝ ub = some x → p x
ihr : ∀ {ub : Option α}, All p r✝ → (∀ {x : α}, ub = some x → p x) → upperBound? cut r✝ ub = some x → p x
ub : Option α
hp : All p (node c✝ l✝ v✝ r✝)
H : ∀ {x : α}, ub = some x → p x
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
⊢ some v✝ = some x → p x
state_after: no goals