-- Mathlib/.lake/packages/lean4/src/lean/Std/Tactic/BVDecide/LRAT/Internal/Formula/RupAddSound.lean
theorem confirmRupHint_preserves_motive {n : Nat} (f : DefaultFormula n) (rupHints : Array Nat)
    (idx : Fin rupHints.size) (acc : Array Assignment × CNF.Clause (PosFin n) × Bool × Bool)
    (ih : ConfirmRupHintFoldEntailsMotive f idx.1 acc) :
    ConfirmRupHintFoldEntailsMotive f (idx.1 + 1) ((confirmRupHint f.clauses) acc rupHints[idx])

Proof state:
case inl.h
n : Nat
f : DefaultFormula n
rupHints : Array Nat
idx : Fin rupHints.size
acc : Array Assignment × CNF.Clause (PosFin n) × Bool × Bool
hsize : acc.fst.size = n
h1 : Limplies (PosFin n) f acc.fst
h2 : acc.snd.snd.fst = true → Incompatible (PosFin n) acc.fst f
acc2_eq_false : acc.2.2.snd = false ∧ acc.2.2.fst = false
x✝¹ : Option (Option (DefaultClause n))
c : DefaultClause n
hc : f.clauses[rupHints[↑idx]]? = some (some c)
c_in_f : c ∈ f.toList
x✝ : ReduceResult (PosFin n)
heq : c.reduce acc.fst = reducedToEmpty
p : PosFin n → Bool
pc : ¬(p ⊨ c)
⊢ ¬(p ⊨ f)

Tactic:
intro pf

Result:
case inl.h
n : Nat
f : DefaultFormula n
rupHints : Array Nat
idx : Fin rupHints.size
acc : Array Assignment × CNF.Clause (PosFin n) × Bool × Bool
hsize : acc.fst.size = n
h1 : Limplies (PosFin n) f acc.fst
h2 : acc.snd.snd.fst = true → Incompatible (PosFin n) acc.fst f
acc2_eq_false : acc.2.2.snd = false ∧ acc.2.2.fst = false
x✝¹ : Option (Option (DefaultClause n))
c : DefaultClause n
hc : f.clauses[rupHints[↑idx]]? = some (some c)
c_in_f : c ∈ f.toList
x✝ : ReduceResult (PosFin n)
heq : c.reduce acc.fst = reducedToEmpty
p : PosFin n → Bool
pc : ¬(p ⊨ c)
pf : p ⊨ f
⊢ False

Proof state:
n : Nat
f : DefaultFormula n
rupHints : Array Nat
idx : Fin rupHints.size
acc : Array Assignment × CNF.Clause (PosFin n) × Bool × Bool
hsize : acc.fst.size = n
h1 : Limplies (PosFin n) f acc.fst
h2 : acc.snd.snd.fst = true → Incompatible (PosFin n) acc.fst f
acc2_eq_false : acc.2.2.snd = false ∧ acc.2.2.fst = false
⊢ f.ConfirmRupHintFoldEntailsMotive (↑idx + 1)
    (match f.clauses[rupHints[↑idx]]? with
    | some (some c) =>
      match c.reduce acc.fst with
      | encounteredBoth => (acc.fst, acc.2.fst, true, false)
      | reducedToEmpty => (acc.fst, acc.2.fst, true, false)
      | reducedToUnit (l, b) =>
        if hasAssignment b acc.fst[l.val]! = true then (acc.fst, acc.2.fst, false, false)
        else (acc.fst.modify l.val (addAssignment b), (l, b) :: acc.2.fst, false, false)
      | reducedToNonunit => (acc.fst, acc.2.fst, false, true)
    | some none => (acc.fst, acc.2.fst, false, true)
    | none => (acc.fst, acc.2.fst, false, true))

Tactic:
split

Result:
case h_1
n : Nat
f : DefaultFormula n
rupHints : Array Nat
idx : Fin rupHints.size
acc : Array Assignment × CNF.Clause (PosFin n) × Bool × Bool
hsize : acc.fst.size = n
h1 : Limplies (PosFin n) f acc.fst
h2 : acc.snd.snd.fst = true → Incompatible (PosFin n) acc.fst f
acc2_eq_false : acc.2.2.snd = false ∧ acc.2.2.fst = false
x✝ : Option (Option (DefaultClause n))
c✝ : DefaultClause n
heq✝ : f.clauses[rupHints[↑idx]]? = some (some c✝)
⊢ f.ConfirmRupHintFoldEntailsMotive (↑idx + 1)
    (match c✝.reduce acc.fst with
    | encounteredBoth => (acc.fst, acc.2.fst, true, false)
    | reducedToEmpty => (acc.fst, acc.2.fst, true, false)
    | reducedToUnit (l, b) =>
      if hasAssignment b acc.fst[l.val]! = true then (acc.fst, acc.2.fst, false, false)
      else (acc.fst.modify l.val (addAssignment b), (l, b) :: acc.2.fst, false, false)
    | reducedToNonunit => (acc.fst, acc.2.fst, false, true))

case h_2
n : Nat
f : DefaultFormula n
rupHints : Array Nat
idx : Fin rupHints.size
acc : Array Assignment × CNF.Clause (PosFin n) × Bool × Bool
hsize : acc.fst.size = n
h1 : Limplies (PosFin n) f acc.fst
h2 : acc.snd.snd.fst = true → Incompatible (PosFin n) acc.fst f
acc2_eq_false : acc.2.2.snd = false ∧ acc.2.2.fst = false
x✝ : Option (Option (DefaultClause n))
heq✝ : f.clauses[rupHints[↑idx]]? = some none
⊢ f.ConfirmRupHintFoldEntailsMotive (↑idx + 1) (acc.fst, acc.2.fst, false, true)

case h_3
n : Nat
f : DefaultFormula n
rupHints : Array Nat
idx : Fin rupHints.size
acc : Array Assignment × CNF.Clause (PosFin n) × Bool × Bool
hsize : acc.fst.size = n
h1 : Limplies (PosFin n) f acc.fst
h2 : acc.snd.snd.fst = true → Incompatible (PosFin n) acc.fst f
acc2_eq_false : acc.2.2.snd = false ∧ acc.2.2.fst = false
x✝ : Option (Option (DefaultClause n))
heq✝ : f.clauses[rupHints[↑idx]]? = none
⊢ f.ConfirmRupHintFoldEntailsMotive (↑idx + 1) (acc.fst, acc.2.fst, false, true)

Proof state:
case h
n : Nat
f : DefaultFormula n
rupHints : Array Nat
idx : Fin rupHints.size
acc : Array Assignment × CNF.Clause (PosFin n) × Bool × Bool
hsize : acc.fst.size = n
h1 : Limplies (PosFin n) f acc.fst
h2 : acc.snd.snd.fst = true → Incompatible (PosFin n) acc.fst f
acc2_eq_false : acc.2.2.snd = false ∧ acc.2.2.fst = false
x✝ : Option (Option (DefaultClause n))
c : DefaultClause n
hc : (if h : rupHints[↑idx] < f.clauses.size then some f.clauses[rupHints[↑idx]] else none) = some (some c)
⊢ some c ∈ f.clauses.toList

Tactic:
split at hc

Result:
case h.isTrue
n : Nat
f : DefaultFormula n
rupHints : Array Nat
idx : Fin rupHints.size
acc : Array Assignment × CNF.Clause (PosFin n) × Bool × Bool
hsize : acc.fst.size = n
h1 : Limplies (PosFin n) f acc.fst
h2 : acc.snd.snd.fst = true → Incompatible (PosFin n) acc.fst f
acc2_eq_false : acc.2.2.snd = false ∧ acc.2.2.fst = false
x✝ : Option (Option (DefaultClause n))
c : DefaultClause n
h✝ : rupHints[↑idx] < f.clauses.size
hc : some f.clauses[rupHints[↑idx]] = some (some c)
⊢ some c ∈ f.clauses.toList

case h.isFalse
n : Nat
f : DefaultFormula n
rupHints : Array Nat
idx : Fin rupHints.size
acc : Array Assignment × CNF.Clause (PosFin n) × Bool × Bool
hsize : acc.fst.size = n
h1 : Limplies (PosFin n) f acc.fst
h2 : acc.snd.snd.fst = true → Incompatible (PosFin n) acc.fst f
acc2_eq_false : acc.2.2.snd = false ∧ acc.2.2.fst = false
x✝ : Option (Option (DefaultClause n))
c : DefaultClause n
h✝ : ¬rupHints[↑idx] < f.clauses.size
hc : none = some (some c)
⊢ some c ∈ f.clauses.toList