no goals
case nil
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
⊢ x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) [] → x.fst = k ∨ x ∈ []
exact .inr
case cons
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
⊢ (x ∈
      match bif p a then some (k, f a) else none with
      | none => a :: List.replaceF (fun a => bif p a then some (k, f a) else none) l
      | some a => a :: l) →
    x.fst = k ∨ x = a ∨ x ∈ l
case cons
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
⊢ x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) (a :: l) → x.fst = k ∨ x ∈ a :: l
simp
case cons
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
z : Option (α × β)
e : (bif p a then some (k, f a) else none) = z
⊢ (x ∈
      match z with
      | none => a :: List.replaceF (fun a => bif p a then some (k, f a) else none) l
      | some a => a :: l) →
    x.fst = k ∨ x = a ∨ x ∈ l
case cons
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
⊢ (x ∈
      match bif p a then some (k, f a) else none with
      | none => a :: List.replaceF (fun a => bif p a then some (k, f a) else none) l
      | some a => a :: l) →
    x.fst = k ∨ x = a ∨ x ∈ l
generalize e : cond .. = z
case cons
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
z : Option (α × β)
⊢ (bif p a then some (k, f a) else none) = z →
    (x ∈
        match z with
        | none => a :: List.replaceF (fun a => bif p a then some (k, f a) else none) l
        | some a => a :: l) →
      x.fst = k ∨ x = a ∨ x ∈ l
case cons
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
z : Option (α × β)
e : (bif p a then some (k, f a) else none) = z
⊢ (x ∈
      match z with
      | none => a :: List.replaceF (fun a => bif p a then some (k, f a) else none) l
      | some a => a :: l) →
    x.fst = k ∨ x = a ∨ x ∈ l
revert e
case cons
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
z : Option (α × β)
⊢ (match p a with
      | true => some (k, f a)
      | false => none) =
      z →
    (x ∈
        match z with
        | none =>
          a ::
            List.replaceF
              (fun a =>
                match p a with
                | true => some (k, f a)
                | false => none)
              l
        | some a => a :: l) →
      x.fst = k ∨ x = a ∨ x ∈ l
case cons
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
z : Option (α × β)
⊢ (bif p a then some (k, f a) else none) = z →
    (x ∈
        match z with
        | none => a :: List.replaceF (fun a => bif p a then some (k, f a) else none) l
        | some a => a :: l) →
      x.fst = k ∨ x = a ∨ x ∈ l
unfold cond
case cons.h_1
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
c✝ : Bool
heq✝ : p a = true
⊢ x = (k, f a) ∨ x ∈ l → x.fst = k ∨ x = a ∨ x ∈ l

case cons.h_2
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
c✝ : Bool
heq✝ : p a = false
⊢ x = a ∨
      x ∈
        List.replaceF
          (fun a =>
            match p a with
            | true => some (k, f a)
            | false => none)
          l →
    x.fst = k ∨ x = a ∨ x ∈ l
case cons
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
z : Option (α × β)
⊢ (match p a with
      | true => some (k, f a)
      | false => none) =
      z →
    (x ∈
        match z with
        | none =>
          a ::
            List.replaceF
              (fun a =>
                match p a with
                | true => some (k, f a)
                | false => none)
              l
        | some a => a :: l) →
      x.fst = k ∨ x = a ∨ x ∈ l
split <;> (intro h; subst h; simp)
case cons.h_2
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
z : Option (α × β)
c✝ : Bool
heq✝ : p a = false
h : none = z
⊢ (x ∈
      match z with
      | none =>
        a ::
          List.replaceF
            (fun a =>
              match p a with
              | true => some (k, f a)
              | false => none)
            l
      | some a => a :: l) →
    x.fst = k ∨ x = a ∨ x ∈ l
case cons.h_2
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
z : Option (α × β)
c✝ : Bool
heq✝ : p a = false
⊢ none = z →
    (x ∈
        match z with
        | none =>
          a ::
            List.replaceF
              (fun a =>
                match p a with
                | true => some (k, f a)
                | false => none)
              l
        | some a => a :: l) →
      x.fst = k ∨ x = a ∨ x ∈ l
intro h
case cons.h_2
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
c✝ : Bool
heq✝ : p a = false
⊢ (x ∈
      match none with
      | none =>
        a ::
          List.replaceF
            (fun a =>
              match p a with
              | true => some (k, f a)
              | false => none)
            l
      | some a => a :: l) →
    x.fst = k ∨ x = a ∨ x ∈ l
case cons.h_2
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
z : Option (α × β)
c✝ : Bool
heq✝ : p a = false
h : none = z
⊢ (x ∈
      match z with
      | none =>
        a ::
          List.replaceF
            (fun a =>
              match p a with
              | true => some (k, f a)
              | false => none)
            l
      | some a => a :: l) →
    x.fst = k ∨ x = a ∨ x ∈ l
subst h
case cons.h_2
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
c✝ : Bool
heq✝ : p a = false
⊢ x = a ∨
      x ∈
        List.replaceF
          (fun a =>
            match p a with
            | true => some (k, f a)
            | false => none)
          l →
    x.fst = k ∨ x = a ∨ x ∈ l
case cons.h_2
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
c✝ : Bool
heq✝ : p a = false
⊢ (x ∈
      match none with
      | none =>
        a ::
          List.replaceF
            (fun a =>
              match p a with
              | true => some (k, f a)
              | false => none)
            l
      | some a => a :: l) →
    x.fst = k ∨ x = a ∨ x ∈ l
simp
no goals
case cons.h_1
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
c✝ : Bool
heq✝ : p a = true
⊢ x = (k, f a) ∨ x ∈ l → x.fst = k ∨ x = a ∨ x ∈ l
intro
| .inl eq => exact eq ▸ .inl rfl
| .inr h => exact .inr (.inr h)
no goals
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
c✝ : Bool
heq✝ : p a = true
x✝ : x = (k, f a) ∨ x ∈ l
eq : x = (k, f a)
⊢ x.fst = k ∨ x = a ∨ x ∈ l
exact eq ▸ .inl rfl
no goals
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
c✝ : Bool
heq✝ : p a = true
x✝ : x = (k, f a) ∨ x ∈ l
h : x ∈ l
⊢ x.fst = k ∨ x = a ∨ x ∈ l
exact .inr (.inr h)
no goals
case cons.h_2
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
c✝ : Bool
heq✝ : p a = false
⊢ x = a ∨
      x ∈
        List.replaceF
          (fun a =>
            match p a with
            | true => some (k, f a)
            | false => none)
          l →
    x.fst = k ∨ x = a ∨ x ∈ l
intro
| .inl eq => exact .inr (.inl eq)
| .inr h => exact (ih h).imp_right .inr
no goals
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
c✝ : Bool
heq✝ : p a = false
x✝ :
  x = a ∨
    x ∈
      List.replaceF
        (fun a =>
          match p a with
          | true => some (k, f a)
          | false => none)
        l
eq : x = a
⊢ x.fst = k ∨ x = a ∨ x ∈ l
exact .inr (.inl eq)
no goals
α : Type u_1
β : Type u_2
k : α
x : α × β
p : α × β → Bool
f : α × β → β
a : α × β
l : List (α × β)
ih : x ∈ List.replaceF (fun a => bif p a then some (k, f a) else none) l → x.fst = k ∨ x ∈ l
c✝ : Bool
heq✝ : p a = false
x✝ :
  x = a ∨
    x ∈
      List.replaceF
        (fun a =>
          match p a with
          | true => some (k, f a)
          | false => none)
        l
h :
  x ∈
    List.replaceF
      (fun a =>
        match p a with
        | true => some (k, f a)
        | false => none)
      l
⊢ x.fst = k ∨ x = a ∨ x ∈ l
exact (ih h).imp_right .inr