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

tactic: refine memP_def.trans ⟨fun ⟨y, hy, ey⟩ => ?_, fun ⟨x, hx, e⟩ => ⟨_, lowerBound?_mem hx, e⟩⟩
state_before: α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
⊢ MemP cut t ↔ ∃ x, lowerBound? cut t = some x ∧ cut x = Ordering.eq
state_after: α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
⊢ ∃ x, lowerBound? cut t = some x ∧ cut x = Ordering.eq

tactic: have ⟨x, hx⟩ := ht.lowerBound?_exists.2 ⟨_, hy, fun h => nomatch ey.symm.trans h⟩
state_before: α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
⊢ ∃ x, lowerBound? cut t = some x ∧ cut x = Ordering.eq
state_after: α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
⊢ ∃ x, lowerBound? cut t = some x ∧ cut x = Ordering.eq

tactic: refine ⟨x, hx, ?_⟩
state_before: α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
⊢ ∃ x, lowerBound? cut t = some x ∧ cut x = Ordering.eq
state_after: α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
⊢ cut x = Ordering.eq

tactic: cases ex : cut x
state_before: α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
⊢ cut x = Ordering.eq
state_after: case lt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.lt
⊢ Ordering.lt = Ordering.eq

case eq
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.eq
⊢ Ordering.eq = Ordering.eq

case gt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.gt
⊢ Ordering.gt = Ordering.eq

tactic: cases lowerBound?_le hx ex
state_before: case lt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.lt
⊢ Ordering.lt = Ordering.eq
state_after: no goals

tactic: rfl
state_before: case eq
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.eq
⊢ Ordering.eq = Ordering.eq
state_after: no goals

tactic: cases e : cmp x y
state_before: case gt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.gt
⊢ Ordering.gt = Ordering.eq
state_after: case gt.lt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.gt
e : cmp x y = Ordering.lt
⊢ Ordering.gt = Ordering.eq

case gt.eq
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.gt
e : cmp x y = Ordering.eq
⊢ Ordering.gt = Ordering.eq

case gt.gt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.gt
e : cmp x y = Ordering.gt
⊢ Ordering.gt = Ordering.eq

tactic: cases ey.symm.trans <| ht.lowerBound?_greatest hx hy e ex
state_before: case gt.lt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.gt
e : cmp x y = Ordering.lt
⊢ Ordering.gt = Ordering.eq
state_after: no goals

tactic: cases ey.symm.trans <| IsCut.congr e |>.symm.trans ex
state_before: case gt.eq
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.gt
e : cmp x y = Ordering.eq
⊢ Ordering.gt = Ordering.eq
state_after: no goals

tactic: cases ey.symm.trans <| IsCut.gt_trans (OrientedCmp.cmp_eq_gt.1 e) ex
state_before: case gt.gt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
inst✝¹ : TransCmp cmp
inst✝ : IsCut cmp cut
ht : Ordered cmp t
x✝ : ∃ x, x ∈ t ∧ cut x = Ordering.eq
y : α
hy : y ∈ t
ey : cut y = Ordering.eq
x : α
hx : lowerBound? cut t = some x
ex : cut x = Ordering.gt
e : cmp x y = Ordering.gt
⊢ Ordering.gt = Ordering.eq
state_after: no goals