cases hf : f a b₁ b <;> rfl
α : Type u
r : α → α → Prop
inst✝¹ : StrictLinearOrder r
inst✝ : DecidableRel r
β : α → Type v
f : (a : α) → β a → β a → Option (β a)
xs : KVChain (flip r) β
a : α
b₁ : β a
ys : KVChain r β
hays : boundLeft a ys
haxs : hingeable xs (KVChain.cons a b₁ ys hays)
b : β a
haxs' : boundLeft a xs
⊢ (match f a b₁ b with
    | none =>
      { val := (xs, { toList := ys.toList, ascend := (_ : List.Ascending (Sigma.relOnFst r) ys.toList) }),
        property :=
          (_ : hingeable xs { toList := ys.toList, ascend := (_ : List.Ascending (Sigma.relOnFst r) ys.toList) }) }
    | some z =>
      {
        val :=
          (KVChain.cons a z xs
              (_ :
                List.predHead (fun b => List.predHead (flip (fun a b => r a.fst b.fst) b) xs.toList)
                  (KVChain.cons a b₁ ys hays).toList),
            { toList := ys.toList, ascend := (_ : List.Ascending (Sigma.relOnFst r) ys.toList) }),
        property :=
          (_ :
            hingeable
              (KVChain.cons a z xs
                (_ :
                  List.predHead (fun b => List.predHead (flip (fun a b => r a.fst b.fst) b) xs.toList)
                    (KVChain.cons a b₁ ys hays).toList))
              { toList := ys.toList, ascend := (_ : List.Ascending (Sigma.relOnFst r) ys.toList) }) }) =
    Option.rec { val := (xs, ys), property := (_ : hingeable xs ys) }
      (fun val =>
        { val := (KVChain.cons a val xs haxs', ys), property := (_ : hingeable (KVChain.cons a val xs haxs') ys) })
      (f a b₁ b)
no goals