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

tactic: refine ⟨fun h => ?_, fun h => OrientedCmp.cmp_eq_gt.1 ?_⟩
state_before: α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
⊢ cmp x y = Ordering.lt ↔ cut y = Ordering.lt
state_after: case refine_1
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cmp x y = Ordering.lt
⊢ cut y = Ordering.lt

case refine_2
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cut y = Ordering.lt
⊢ cmp y x = Ordering.gt

tactic: cases e : cut x
state_before: case refine_1
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cmp x y = Ordering.lt
⊢ cut y = Ordering.lt
state_after: case refine_1.lt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cmp x y = Ordering.lt
e : cut x = Ordering.lt
⊢ cut y = Ordering.lt

case refine_1.eq
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cmp x y = Ordering.lt
e : cut x = Ordering.eq
⊢ cut y = Ordering.lt

case refine_1.gt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cmp x y = Ordering.lt
e : cut x = Ordering.gt
⊢ cut y = Ordering.lt

tactic: cases lowerBound?_le H e
state_before: case refine_1.lt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cmp x y = Ordering.lt
e : cut x = Ordering.lt
⊢ cut y = Ordering.lt
state_after: no goals

tactic: exact IsStrictCut.exact e |>.symm.trans h
state_before: case refine_1.eq
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cmp x y = Ordering.lt
e : cut x = Ordering.eq
⊢ cut y = Ordering.lt
state_after: no goals

tactic: exact ht.lowerBound?_greatest H hy h e
state_before: case refine_1.gt
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cmp x y = Ordering.lt
e : cut x = Ordering.gt
⊢ cut y = Ordering.lt
state_after: no goals

tactic: by_contra h'
state_before: case refine_2
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cut y = Ordering.lt
⊢ cmp y x = Ordering.gt
state_after: case refine_2
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cut y = Ordering.lt
h' : ¬cmp y x = Ordering.gt
⊢ False

tactic: exact lowerBound?_le H <| IsCut.le_lt_trans (cmp := cmp) (cut := cut) h' h
state_before: case refine_2
α : Type u_1
cmp : α → α → Ordering
cut : α → Ordering
t : RBNode α
x y : α
inst✝¹ : TransCmp cmp
inst✝ : IsStrictCut cmp cut
ht : Ordered cmp t
H : lowerBound? cut t = some x
hy : y ∈ t
h : cut y = Ordering.lt
h' : ¬cmp y x = Ordering.gt
⊢ False
state_after: no goals