case cons =>
  intro a₁ b₁ ys ha₁ys h_ind xs ha₁xs hzxs hpxs hpys hpa
  apply dite (r a₁ a) <;> intro ha₁a
  . rw [insertWithAux_cons_rel ha₁a]
    exact h_ind (xs.cons a₁ b₁ (hingeable_cons ▸ ha₁xs)) (cons_hingeable.symm ▸ ha₁ys) ha₁a ⟨hpys.left, hpxs⟩ hpys.right hpa
  . apply dite (r a a₁) <;> intro haa₁
    . rw [insertWithAux_cons_flip haa₁]
      dsimp
      exact ⟨⟨hpa,hpxs⟩,hpys⟩
    . have : a = a₁ := Trichotomous.eq_of_incomp ⟨haa₁, ha₁a⟩
      cases this
      rw [insertWithAux_cons_rfl]
      cases f a b₁ b
      case none => exact ⟨hpxs, hpys.right⟩
      case some bf => exact ⟨⟨hpys.left, hpxs⟩, hpys.right⟩
α : Type u
r : α → α → Prop
inst✝¹ : StrictLinearOrder r
inst✝ : DecidableRel r
β : α → Type v
f : (a : α) → β a → β a → Option (β a)
ys : KVChain r β
a : α
b : β a
p : α → Prop
⊢ ∀ (a_1 : α) (b_1 : β a_1) (xs : KVChain r fun a => β a) (haxs : boundLeft a_1 xs),
    (fun ys =>
          ∀ (xs : KVChain (flip r) fun a => β a) (hxsys : hingeable xs ys) (haxs : boundLeft a xs),
            List.forAll (p ∘ Sigma.fst) xs.toList →
              List.forAll (p ∘ Sigma.fst) ys.toList →
                p a →
                  List.forAll (p ∘ Sigma.fst) (insertWithAux f xs ys hxsys a b haxs).val.fst.toList ∧
                    List.forAll (p ∘ Sigma.fst) (insertWithAux f xs ys hxsys a b haxs).val.snd.toList)
        xs →
      (fun ys =>
          ∀ (xs : KVChain (flip r) fun a => β a) (hxsys : hingeable xs ys) (haxs : boundLeft a xs),
            List.forAll (p ∘ Sigma.fst) xs.toList →
              List.forAll (p ∘ Sigma.fst) ys.toList →
                p a →
                  List.forAll (p ∘ Sigma.fst) (insertWithAux f xs ys hxsys a b haxs).val.fst.toList ∧
                    List.forAll (p ∘ Sigma.fst) (insertWithAux f xs ys hxsys a b haxs).val.snd.toList)
        (KVChain.cons a_1 b_1 xs haxs)
no goals