-- Mathlib/.lake/packages/lean4/src/lean/Std/Tactic/BVDecide/LRAT/Internal/Formula/RupAddResult.lean
theorem restoreAssignments_performRupCheck {n : Nat} (f : DefaultFormula n) (f_assignments_size : f.assignments.size = n)
    (rupHints : Array Nat) :
    restoreAssignments (performRupCheck f rupHints).1.assignments (performRupCheck f rupHints).2.1
      =
    f.assignments

Proof state:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
f' : DefaultFormula n := (f.performRupCheck rupHints).fst
f'_def : f' = (f.performRupCheck rupHints).fst
f'_assignments_size : f'.assignments.size = n
derivedLits : CNF.Clause (PosFin n)
derivedLits_satisfies_invariant :
  f.DerivedLitsInvariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { toList := derivedLits }
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.ClearInsertInductionMotive f_assignments_size derivedLits_arr
h_base : f.ClearInsertInductionMotive f_assignments_size derivedLits_arr 0 f'.assignments
⊢ Array.foldl clearUnit f'.assignments { toList := derivedLits } = f.assignments

Tactic:
have h_inductive (idx : Fin derivedLits_arr.size) (assignments : Array Assignment) (ih : motive idx.val assignments) :=
  clear_insert_inductive_case f f_assignments_size derivedLits_arr derivedLits_arr_nodup idx assignments ih

Result:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
f' : DefaultFormula n := (f.performRupCheck rupHints).fst
f'_def : f' = (f.performRupCheck rupHints).fst
f'_assignments_size : f'.assignments.size = n
derivedLits : CNF.Clause (PosFin n)
derivedLits_satisfies_invariant :
  f.DerivedLitsInvariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { toList := derivedLits }
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.ClearInsertInductionMotive f_assignments_size derivedLits_arr
h_base : f.ClearInsertInductionMotive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.ClearInsertInductionMotive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
⊢ Array.foldl clearUnit f'.assignments { toList := derivedLits } = f.assignments

Proof state:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
f' : DefaultFormula n := (f.performRupCheck rupHints).fst
f'_def : f' = (f.performRupCheck rupHints).fst
f'_assignments_size : f'.assignments.size = n
derivedLits : CNF.Clause (PosFin n)
derivedLits_satisfies_invariant :
  f.DerivedLitsInvariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { toList := derivedLits }
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
⊢ Array.foldl clearUnit f'.assignments { toList := derivedLits } = f.assignments

Tactic:
have derivedLits_arr_nodup := nodup_derivedLits f f_assignments_size rupHints f'_assignments_size derivedLits
  derivedLits_satisfies_invariant derivedLits_arr derivedLits_arr_def

Result:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
f' : DefaultFormula n := (f.performRupCheck rupHints).fst
f'_def : f' = (f.performRupCheck rupHints).fst
f'_assignments_size : f'.assignments.size = n
derivedLits : CNF.Clause (PosFin n)
derivedLits_satisfies_invariant :
  f.DerivedLitsInvariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { toList := derivedLits }
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
⊢ Array.foldl clearUnit f'.assignments { toList := derivedLits } = f.assignments