Theorem: KVChain.rklex_mergeWith_right
Proof state before:
case e.t
α : Type u
r : α → α → Prop
inst✝¹ : StrictLinearOrder r
inst✝ : DecidableRel r
β : α → Type v
f✝ : (a : α) → β a → β a → Option (β a)
s : (a : α) → β a → β a → Prop
f : (a : α) → β a → β a → β a
xs✝ ys✝¹ zs✝ : KVChain r β
hsf_right : ∀ (a : α) (b₁ b : β a), s a b₁ (f a b b₁)
hsf_stab : ∀ (a : α) (b₁ b₂ b : β a), s a b₁ b₂ → s a (f a b₁ b) (f a b₂ b)
z₁ : α
z₂ : β z₁
zs : KVChain r fun a => β a
hzs : boundLeft z₁ zs
h_ind_zs✝ :
  ∀ (xs ys : KVChain r fun a => β a),
    KVChain.rklex s xs ys →
      KVChain.rklex s (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)
        (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)
xs ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs ys✝
a : α
b : β a
ys : KVChain r fun a => β a
hays : boundLeft a ys
h_ind_zs :
  ∀ (ys : KVChain r fun a => β a),
    KVChain.rklex s KVChain.nil ys → KVChain.rklex s zs (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)
haz₁ : ¬r a z₁
hz₁a : r z₁ a
⊢ KVChain.rklex s (KVChain.cons z₁ z₂ zs hzs)
    (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons a b ys hays) (KVChain.cons z₁ z₂ zs hzs))

case e.e
α : Type u
r : α → α → Prop
inst✝¹ : StrictLinearOrder r
inst✝ : DecidableRel r
β : α → Type v
f✝ : (a : α) → β a → β a → Option (β a)
s : (a : α) → β a → β a → Prop
f : (a : α) → β a → β a → β a
xs✝ ys✝¹ zs✝ : KVChain r β
hsf_right : ∀ (a : α) (b₁ b : β a), s a b₁ (f a b b₁)
hsf_stab : ∀ (a : α) (b₁ b₂ b : β a), s a b₁ b₂ → s a (f a b₁ b) (f a b₂ b)
z₁ : α
z₂ : β z₁
zs : KVChain r fun a => β a
hzs : boundLeft z₁ zs
h_ind_zs✝ :
  ∀ (xs ys : KVChain r fun a => β a),
    KVChain.rklex s xs ys →
      KVChain.rklex s (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)
        (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)
xs ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs ys✝
a : α
b : β a
ys : KVChain r fun a => β a
hays : boundLeft a ys
h_ind_zs :
  ∀ (ys : KVChain r fun a => β a),
    KVChain.rklex s KVChain.nil ys → KVChain.rklex s zs (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)
haz₁ : ¬r a z₁
hz₁a : ¬r z₁ a
⊢ KVChain.rklex s (KVChain.cons z₁ z₂ zs hzs)
    (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons a b ys hays) (KVChain.cons z₁ z₂ zs hzs))
Tactic:
. rw [cons_mergeWith_cons_flip hz₁a]
  exact KVChain.rklex.tail (h_ind_zs _ KVChain.rklex.nil)
Proof state after:
case e.e
α : Type u
r : α → α → Prop
inst✝¹ : StrictLinearOrder r
inst✝ : DecidableRel r
β : α → Type v
f✝ : (a : α) → β a → β a → Option (β a)
s : (a : α) → β a → β a → Prop
f : (a : α) → β a → β a → β a
xs✝ ys✝¹ zs✝ : KVChain r β
hsf_right : ∀ (a : α) (b₁ b : β a), s a b₁ (f a b b₁)
hsf_stab : ∀ (a : α) (b₁ b₂ b : β a), s a b₁ b₂ → s a (f a b₁ b) (f a b₂ b)
z₁ : α
z₂ : β z₁
zs : KVChain r fun a => β a
hzs : boundLeft z₁ zs
h_ind_zs✝ :
  ∀ (xs ys : KVChain r fun a => β a),
    KVChain.rklex s xs ys →
      KVChain.rklex s (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)
        (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)
xs ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs ys✝
a : α
b : β a
ys : KVChain r fun a => β a
hays : boundLeft a ys
h_ind_zs :
  ∀ (ys : KVChain r fun a => β a),
    KVChain.rklex s KVChain.nil ys → KVChain.rklex s zs (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)
haz₁ : ¬r a z₁
hz₁a : ¬r z₁ a
⊢ KVChain.rklex s (KVChain.cons z₁ z₂ zs hzs)
    (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons a b ys hays) (KVChain.cons z₁ z₂ zs hzs))