-- Mathlib/.lake/packages/lean4/src/lean/Std/Tactic/BVDecide/LRAT/Internal/Convert.lean
theorem CNF.Clause.mem_lrat_of_mem (clause : CNF.Clause (PosFin n)) (h1 : l ∈ clause)
    (h2 : DefaultClause.ofArray clause.toArray = some lratClause) : l ∈ lratClause.clause

Proof state:
case cons.h_2.isFalse.isFalse.tail.a.h1
n : Nat
l hd : Literal (PosFin n)
tl : List (Literal (PosFin n))
ih :
  ∀ {lratClause : DefaultClause n}, l ∈ tl → DefaultClause.ofArray tl.toArray = some lratClause → l ∈ lratClause.clause
lratClause : DefaultClause n
acc✝¹ : Option (DefaultClause n)
acc✝ : DefaultClause n
heq :
  List.foldr
      (fun l acc =>
        match acc with
        | none => none
        | some acc => acc.insert l)
      (some DefaultClause.empty) tl =
    some acc✝
h✝¹ : ¬List.contains acc✝.clause (hd.fst, !hd.snd) = true
h✝ : ¬List.contains acc✝.clause hd = true
h2 : some { clause := hd :: acc✝.clause, nodupkey := ⋯, nodup := ⋯ } = some lratClause
a✝ : List.Mem l tl
⊢ l ∈ tl

case cons.h_2.isFalse.isFalse.tail.a.h2
n : Nat
l hd : Literal (PosFin n)
tl : List (Literal (PosFin n))
ih :
  ∀ {lratClause : DefaultClause n}, l ∈ tl → DefaultClause.ofArray tl.toArray = some lratClause → l ∈ lratClause.clause
lratClause : DefaultClause n
acc✝¹ : Option (DefaultClause n)
acc✝ : DefaultClause n
heq :
  List.foldr
      (fun l acc =>
        match acc with
        | none => none
        | some acc => acc.insert l)
      (some DefaultClause.empty) tl =
    some acc✝
h✝¹ : ¬List.contains acc✝.clause (hd.fst, !hd.snd) = true
h✝ : ¬List.contains acc✝.clause hd = true
h2 : some { clause := hd :: acc✝.clause, nodupkey := ⋯, nodup := ⋯ } = some lratClause
a✝ : List.Mem l tl
⊢ DefaultClause.ofArray tl.toArray = some acc✝

Tactic:
assumption

Result:
case cons.h_2.isFalse.isFalse.tail.a.h2
n : Nat
l hd : Literal (PosFin n)
tl : List (Literal (PosFin n))
ih :
  ∀ {lratClause : DefaultClause n}, l ∈ tl → DefaultClause.ofArray tl.toArray = some lratClause → l ∈ lratClause.clause
lratClause : DefaultClause n
acc✝¹ : Option (DefaultClause n)
acc✝ : DefaultClause n
heq :
  List.foldr
      (fun l acc =>
        match acc with
        | none => none
        | some acc => acc.insert l)
      (some DefaultClause.empty) tl =
    some acc✝
h✝¹ : ¬List.contains acc✝.clause (hd.fst, !hd.snd) = true
h✝ : ¬List.contains acc✝.clause hd = true
h2 : some { clause := hd :: acc✝.clause, nodupkey := ⋯, nodup := ⋯ } = some lratClause
a✝ : List.Mem l tl
⊢ DefaultClause.ofArray tl.toArray = some acc✝

Proof state:
case cons.h_2.isTrue
n : Nat
l hd : Literal (PosFin n)
tl : List (Literal (PosFin n))
ih :
  ∀ {lratClause : DefaultClause n}, l ∈ tl → DefaultClause.ofArray tl.toArray = some lratClause → l ∈ lratClause.clause
lratClause : DefaultClause n
h1 : l ∈ hd :: tl
acc✝¹ : Option (DefaultClause n)
acc✝ : DefaultClause n
heq✝ :
  List.foldr
      (fun l acc =>
        match acc with
        | none => none
        | some acc => acc.insert l)
      (some DefaultClause.empty) tl =
    some acc✝
h✝ : List.contains acc✝.clause (hd.fst, !hd.snd) = true
h2 : none = some lratClause
⊢ l ∈ lratClause.clause

Tactic:
cases h2

Result:
no goals

Proof state:
case cons.h_2.isFalse.isTrue
n : Nat
l hd : Literal (PosFin n)
tl : List (Literal (PosFin n))
ih :
  ∀ {lratClause : DefaultClause n}, l ∈ tl → DefaultClause.ofArray tl.toArray = some lratClause → l ∈ lratClause.clause
lratClause : DefaultClause n
h1 : l ∈ hd :: tl
acc✝¹ : Option (DefaultClause n)
acc✝ : DefaultClause n
heq✝ :
  List.foldr
      (fun l acc =>
        match acc with
        | none => none
        | some acc => acc.insert l)
      (some DefaultClause.empty) tl =
    some acc✝
h✝ : ¬List.contains acc✝.clause (hd.fst, !hd.snd) = true
h : List.contains acc✝.clause hd = true
h2 : some acc✝ = some lratClause
⊢ l ∈ lratClause.clause

Tactic:
rw [← Option.some.inj h2] at *

Result:
case cons.h_2.isFalse.isTrue
n : Nat
l hd : Literal (PosFin n)
tl : List (Literal (PosFin n))
ih :
  ∀ {lratClause : DefaultClause n}, l ∈ tl → DefaultClause.ofArray tl.toArray = some lratClause → l ∈ lratClause.clause
lratClause : DefaultClause n
h1 : l ∈ hd :: tl
acc✝¹ : Option (DefaultClause n)
acc✝ : DefaultClause n
heq✝ :
  List.foldr
      (fun l acc =>
        match acc with
        | none => none
        | some acc => acc.insert l)
      (some DefaultClause.empty) tl =
    some acc✝
h✝ : ¬List.contains acc✝.clause (hd.fst, !hd.snd) = true
h : List.contains acc✝.clause hd = true
h2 : some acc✝ = some acc✝
⊢ l ∈ acc✝.clause