internlm/Lean-Github huggingface dataset:
Theorem: KVChain.rklex_mergeWith_right
Proof state before:
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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
a : α
b₁ b₂ : β a
xs ys : KVChain r fun a => β a
haxs : boundLeft a xs
hays : boundLeft a ys
hb₁b₂ : s a b₁ b₂
haz₁ : ¬r a z₁
hz₁a : ¬r z₁ a
⊢ KVChain.rklex s (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons a b₁ xs haxs) (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:
have : a = z₁ := Trichotomous.eq_of_incomp ⟨haz₁, hz₁a⟩
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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
a : α
b₁ b₂ : β a
xs ys : KVChain r fun a => β a
haxs : boundLeft a xs
hays : boundLeft a ys
hb₁b₂ : s a b₁ b₂
haz₁ : ¬r a z₁
hz₁a : ¬r z₁ a
this : a = z₁
⊢ KVChain.rklex s (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons a b₁ xs haxs) (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))
Theorem: KVChain.rklex_mergeWith_right
Proof state before:
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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
a : α
b₁ b₂ : β a
xs ys : KVChain r fun a => β a
haxs : boundLeft a xs
hays : boundLeft a ys
hb₁b₂ : s a b₁ b₂
haz₁ : ¬r a z₁
hz₁a : ¬r z₁ a
this : a = z₁
⊢ KVChain.rklex s (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons a b₁ xs haxs) (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:
cases this
Proof state after:
case e.e.refl
α : 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
xs ys : KVChain r fun a => β a
b₁ b₂ : β z₁
haxs : boundLeft z₁ xs
hays : boundLeft z₁ ys
hb₁b₂ : s z₁ b₁ b₂
haz₁ hz₁a : ¬r z₁ z₁
⊢ KVChain.rklex s (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons z₁ b₁ xs haxs) (KVChain.cons z₁ z₂ zs hzs))
    (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons z₁ b₂ ys hays) (KVChain.cons z₁ z₂ zs hzs))
Theorem: KVChain.rklex_mergeWith_right
Proof state before:
case e.e.refl
α : 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
xs ys : KVChain r fun a => β a
b₁ b₂ : β z₁
haxs : boundLeft z₁ xs
hays : boundLeft z₁ ys
hb₁b₂ : s z₁ b₁ b₂
haz₁ hz₁a : ¬r z₁ z₁
⊢ KVChain.rklex s (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons z₁ b₁ xs haxs) (KVChain.cons z₁ z₂ zs hzs))
    (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons z₁ b₂ ys hays) (KVChain.cons z₁ z₂ zs hzs))
Tactic:
rw [cons_mergeWith_cons_rfl]
Proof state after:
case e.e.refl
α : 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
xs ys : KVChain r fun a => β a
b₁ b₂ : β z₁
haxs : boundLeft z₁ xs
hays : boundLeft z₁ ys
hb₁b₂ : s z₁ b₁ b₂
haz₁ hz₁a : ¬r z₁ z₁
⊢ KVChain.rklex s
    (Option.casesOn (some (f z₁ b₁ z₂)) (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs) fun bf =>
      KVChain.cons z₁ bf (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)
        (_ : boundLeft z₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)))
    (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons z₁ b₂ ys hays) (KVChain.cons z₁ z₂ zs hzs))
Theorem: KVChain.rklex_mergeWith_right
Proof state before:
case e.e.refl
α : 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
xs ys : KVChain r fun a => β a
b₁ b₂ : β z₁
haxs : boundLeft z₁ xs
hays : boundLeft z₁ ys
hb₁b₂ : s z₁ b₁ b₂
haz₁ hz₁a : ¬r z₁ z₁
⊢ KVChain.rklex s
    (Option.casesOn (some (f z₁ b₁ z₂)) (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs) fun bf =>
      KVChain.cons z₁ bf (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)
        (_ : boundLeft z₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)))
    (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons z₁ b₂ ys hays) (KVChain.cons z₁ z₂ zs hzs))
Tactic:
rw [cons_mergeWith_cons_rfl]
Proof state after:
case e.e.refl
α : 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
xs ys : KVChain r fun a => β a
b₁ b₂ : β z₁
haxs : boundLeft z₁ xs
hays : boundLeft z₁ ys
hb₁b₂ : s z₁ b₁ b₂
haz₁ hz₁a : ¬r z₁ z₁
⊢ KVChain.rklex s
    (Option.casesOn (some (f z₁ b₁ z₂)) (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs) fun bf =>
      KVChain.cons z₁ bf (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)
        (_ : boundLeft z₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)))
    (Option.casesOn (some (f z₁ b₂ z₂)) (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs) fun bf =>
      KVChain.cons z₁ bf (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)
        (_ : boundLeft z₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)))
Theorem: KVChain.rklex_mergeWith_right
Proof state before:
case e.e.refl
α : 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
xs ys : KVChain r fun a => β a
b₁ b₂ : β z₁
haxs : boundLeft z₁ xs
hays : boundLeft z₁ ys
hb₁b₂ : s z₁ b₁ b₂
haz₁ hz₁a : ¬r z₁ z₁
⊢ KVChain.rklex s
    (Option.casesOn (some (f z₁ b₁ z₂)) (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs) fun bf =>
      KVChain.cons z₁ bf (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)
        (_ : boundLeft z₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)))
    (Option.casesOn (some (f z₁ b₂ z₂)) (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs) fun bf =>
      KVChain.cons z₁ bf (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)
        (_ : boundLeft z₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)))
Tactic:
dsimp
Proof state after:
case e.e.refl
α : 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
xs ys : KVChain r fun a => β a
b₁ b₂ : β z₁
haxs : boundLeft z₁ xs
hays : boundLeft z₁ ys
hb₁b₂ : s z₁ b₁ b₂
haz₁ hz₁a : ¬r z₁ z₁
⊢ KVChain.rklex s
    (KVChain.cons z₁ (f z₁ b₁ z₂) (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)
      (_ : boundLeft z₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)))
    (KVChain.cons z₁ (f z₁ b₂ z₂) (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)
      (_ : boundLeft z₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)))
Theorem: KVChain.rklex_mergeWith_right
Proof state before:
case e.e.refl
α : 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
xs ys : KVChain r fun a => β a
b₁ b₂ : β z₁
haxs : boundLeft z₁ xs
hays : boundLeft z₁ ys
hb₁b₂ : s z₁ b₁ b₂
haz₁ hz₁a : ¬r z₁ z₁
⊢ KVChain.rklex s
    (KVChain.cons z₁ (f z₁ b₁ z₂) (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)
      (_ : boundLeft z₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs zs)))
    (KVChain.cons z₁ (f z₁ b₂ z₂) (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)
      (_ : boundLeft z₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys zs)))
Tactic:
exact KVChain.rklex.headSnd $ hsf_stab _ _ _ _ hb₁b₂
Proof state after:
no goals
Theorem: KVChain.rklex_mergeWith_right
Proof state before:
case 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
a : α
b₁ b₂ : β a
xs ys : KVChain r fun a => β a
haxs : boundLeft a xs
hays : boundLeft a ys
hb₁b₂ : s a b₁ b₂
haz₁ : r a z₁
⊢ KVChain.rklex s (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons a b₁ xs haxs) (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_rel haz₁]
Proof state after:
case 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
a : α
b₁ b₂ : β a
xs ys : KVChain r fun a => β a
haxs : boundLeft a xs
hays : boundLeft a ys
hb₁b₂ : s a b₁ b₂
haz₁ : r a z₁
⊢ KVChain.rklex s
    (KVChain.cons a b₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs (KVChain.cons z₁ z₂ zs hzs))
      (_ : boundLeft a (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs (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))
Theorem: KVChain.rklex_mergeWith_right
Proof state before:
case 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
a : α
b₁ b₂ : β a
xs ys : KVChain r fun a => β a
haxs : boundLeft a xs
hays : boundLeft a ys
hb₁b₂ : s a b₁ b₂
haz₁ : r a z₁
⊢ KVChain.rklex s
    (KVChain.cons a b₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs (KVChain.cons z₁ z₂ zs hzs))
      (_ : boundLeft a (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs (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_rel haz₁]
Proof state after:
case 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
a : α
b₁ b₂ : β a
xs ys : KVChain r fun a => β a
haxs : boundLeft a xs
hays : boundLeft a ys
hb₁b₂ : s a b₁ b₂
haz₁ : r a z₁
⊢ KVChain.rklex s
    (KVChain.cons a b₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs (KVChain.cons z₁ z₂ zs hzs))
      (_ : boundLeft a (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs (KVChain.cons z₁ z₂ zs hzs))))
    (KVChain.cons a b₂ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys (KVChain.cons z₁ z₂ zs hzs))
      (_ : boundLeft a (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys (KVChain.cons z₁ z₂ zs hzs))))
Theorem: KVChain.rklex_mergeWith_right
Proof state before:
case 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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
a : α
b₁ b₂ : β a
xs ys : KVChain r fun a => β a
haxs : boundLeft a xs
hays : boundLeft a ys
hb₁b₂ : s a b₁ b₂
haz₁ : r a z₁
⊢ KVChain.rklex s
    (KVChain.cons a b₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs (KVChain.cons z₁ z₂ zs hzs))
      (_ : boundLeft a (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) xs (KVChain.cons z₁ z₂ zs hzs))))
    (KVChain.cons a b₂ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys (KVChain.cons z₁ z₂ zs hzs))
      (_ : boundLeft a (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) ys (KVChain.cons z₁ z₂ zs hzs))))
Tactic:
exact KVChain.rklex.headSnd hb₁b₂
Proof state after:
no goals
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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
a : α
b₁ b₂ : β a
xs ys : KVChain r fun a => β a
haxs : boundLeft a xs
hays : boundLeft a ys
hb₁b₂ : s a b₁ b₂
haz₁ : ¬r a z₁
hz₁a : r z₁ a
⊢ KVChain.rklex s (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons a b₁ xs haxs) (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]
Proof state after:
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 :
  (fun 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))
    zs
xs✝ ys✝ : KVChain r fun a => β a
h : KVChain.rklex s xs✝ ys✝
a : α
b₁ b₂ : β a
xs ys : KVChain r fun a => β a
haxs : boundLeft a xs
hays : boundLeft a ys
hb₁b₂ : s a b₁ b₂
haz₁ : ¬r a z₁
hz₁a : r z₁ a
⊢ KVChain.rklex s
    (KVChain.cons z₁ z₂ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons a b₁ xs haxs) zs)
      (_ : boundLeft z₁ (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons a b₁ xs haxs) zs)))
    (mergeWith (fun a b₁ b₂ => some (f a b₁ b₂)) (KVChain.cons a b₂ ys hays) (KVChain.cons z₁ z₂ zs hzs))