Theorem: Std.RBNode.Ordered.memP_iff_lowerBound?
File: Std/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, x ∈ lowerBound? cut t none ∧ 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, x ∈ lowerBound? cut t none ∧ 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 : x ∈ lowerBound? cut t none
⊢ ∃ x, x ∈ lowerBound? cut t none ∧ 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 : x ∈ lowerBound? cut t none
⊢ cut x = 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 : x ∈ lowerBound? cut t none
ex : cut x = Ordering.lt
⊢ Ordering.lt = Ordering.eq

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 : x ∈ lowerBound? cut t none
ex : cut x = Ordering.eq
⊢ Ordering.eq = Ordering.eq

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 : x ∈ lowerBound? cut t none
ex : cut x = Ordering.gt
⊢ Ordering.gt = Ordering.eq

tactic: cases ey.symm.trans <| ht.lowerBound?_least 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 : x ∈ lowerBound? cut t none
ex : cut x = Ordering.gt
e : cmp x y = Ordering.lt
⊢ Ordering.gt = Ordering.eq

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 : x ∈ lowerBound? cut t none
ex : cut x = Ordering.gt
e : cmp x y = Ordering.eq
⊢ Ordering.gt = Ordering.eq

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 : x ∈ lowerBound? cut t none
ex : cut x = Ordering.gt
e : cmp x y = Ordering.gt
⊢ Ordering.gt = Ordering.eq