-- Mathlib/.lake/packages/lean4/src/lean/Std/Tactic/BVDecide/LRAT/Internal/Formula/RupAddResult.lean
theorem restoreAssignments_performRupCheck_base_case {n : Nat} (f : DefaultFormula n)
    (f_assignments_size : f.assignments.size = n)
    (f' : DefaultFormula n) (_f'_def : f' = (performRupCheck f rupHints).1)
    (f'_assignments_size : f'.assignments.size = n) (derivedLits : CNF.Clause (PosFin n))
    (derivedLits_arr : Array (Literal (PosFin n)))
    (derivedLits_arr_def : derivedLits_arr = {toList := derivedLits})
    (derivedLits_satisfies_invariant :
      DerivedLitsInvariant f f_assignments_size f'.assignments f'_assignments_size derivedLits)
    (_derivedLits_arr_nodup : ∀ (i j : Fin (Array.size derivedLits_arr)), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]) :
    ClearInsertInductionMotive f f_assignments_size derivedLits_arr 0 f'.assignments

Proof state:
rupHints : Array Nat
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
f' : DefaultFormula n
_f'_def : f' = (f.performRupCheck rupHints).fst
f'_assignments_size : f'.assignments.size = n
derivedLits : CNF.Clause (PosFin n)
derivedLits_arr : Array (Literal (PosFin n))
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
_derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
i : Fin n
j : Fin (List.length derivedLits)
j_eq_i : (List.get derivedLits j).fst.val = ↑i
h1 : f'.assignments[↑i] = addAssignment (List.get derivedLits j).snd f.assignments[↑i]
h2 : ¬hasAssignment (List.get derivedLits j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j → (List.get derivedLits k).fst.val ≠ ↑i
j_lt_derivedLits_arr_size : ↑j < derivedLits_arr.size
⊢ ↑i > 0

Tactic:
rw [← j_eq_i]

Result:
rupHints : Array Nat
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
f' : DefaultFormula n
_f'_def : f' = (f.performRupCheck rupHints).fst
f'_assignments_size : f'.assignments.size = n
derivedLits : CNF.Clause (PosFin n)
derivedLits_arr : Array (Literal (PosFin n))
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
_derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
i : Fin n
j : Fin (List.length derivedLits)
j_eq_i : (List.get derivedLits j).fst.val = ↑i
h1 : f'.assignments[↑i] = addAssignment (List.get derivedLits j).snd f.assignments[↑i]
h2 : ¬hasAssignment (List.get derivedLits j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j → (List.get derivedLits k).fst.val ≠ ↑i
j_lt_derivedLits_arr_size : ↑j < derivedLits_arr.size
⊢ (List.get derivedLits j).fst.val > 0

Proof state:
rupHints : Array Nat
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
f' : DefaultFormula n
_f'_def : f' = (f.performRupCheck rupHints).fst
f'_assignments_size : f'.assignments.size = n
derivedLits : CNF.Clause (PosFin n)
derivedLits_arr : Array (Literal (PosFin n))
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
_derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
i : Fin n
j : Fin (List.length derivedLits)
j_eq_i : (List.get derivedLits j).fst.val = ↑i
h1 : f'.assignments[↑i] = addAssignment (List.get derivedLits j).snd f.assignments[↑i]
h2 : ¬hasAssignment (List.get derivedLits j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j → (List.get derivedLits k).fst.val ≠ ↑i
j_lt_derivedLits_arr_size : ↑j < derivedLits_arr.size
⊢ (List.get derivedLits j).fst.val > 0

Tactic:
exact (List.get derivedLits j).1.2.1

Result:
no goals

Proof state:
case inr.inl.intro.intro.intro.intro.right
rupHints : Array Nat
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
f' : DefaultFormula n
_f'_def : f' = (f.performRupCheck rupHints).fst
f'_assignments_size : f'.assignments.size = n
derivedLits : CNF.Clause (PosFin n)
derivedLits_arr : Array (Literal (PosFin n))
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
_derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
i : Fin n
j : Fin (List.length derivedLits)
j_eq_i : (List.get derivedLits j).fst.val = ↑i
h1 : f'.assignments[↑i] = addAssignment (List.get derivedLits j).snd f.assignments[↑i]
h2 : ¬hasAssignment (List.get derivedLits j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j → (List.get derivedLits k).fst.val ≠ ↑i
j_lt_derivedLits_arr_size : ↑j < derivedLits_arr.size
i_gt_zero : ↑i > 0
⊢ derivedLits_arr[⟨↑j, j_lt_derivedLits_arr_size⟩] = (⟨↑i, ⋯⟩, (List.get derivedLits j).snd) ∧
    f'.assignments[↑i] = addAssignment (List.get derivedLits j).snd f.assignments[↑i] ∧
      ¬hasAssignment (List.get derivedLits j).snd f.assignments[↑i] = true ∧
        ∀ (k : Fin derivedLits_arr.size), ↑k ≥ 0 → k ≠ ⟨↑j, j_lt_derivedLits_arr_size⟩ → derivedLits_arr[k].fst.val ≠ ↑i

Tactic:
constructor

Result:
case inr.inl.intro.intro.intro.intro.right.left
rupHints : Array Nat
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
f' : DefaultFormula n
_f'_def : f' = (f.performRupCheck rupHints).fst
f'_assignments_size : f'.assignments.size = n
derivedLits : CNF.Clause (PosFin n)
derivedLits_arr : Array (Literal (PosFin n))
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
_derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
i : Fin n
j : Fin (List.length derivedLits)
j_eq_i : (List.get derivedLits j).fst.val = ↑i
h1 : f'.assignments[↑i] = addAssignment (List.get derivedLits j).snd f.assignments[↑i]
h2 : ¬hasAssignment (List.get derivedLits j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j → (List.get derivedLits k).fst.val ≠ ↑i
j_lt_derivedLits_arr_size : ↑j < derivedLits_arr.size
i_gt_zero : ↑i > 0
⊢ derivedLits_arr[⟨↑j, j_lt_derivedLits_arr_size⟩] = (⟨↑i, ⋯⟩, (List.get derivedLits j).snd)

case inr.inl.intro.intro.intro.intro.right.right
rupHints : Array Nat
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
f' : DefaultFormula n
_f'_def : f' = (f.performRupCheck rupHints).fst
f'_assignments_size : f'.assignments.size = n
derivedLits : CNF.Clause (PosFin n)
derivedLits_arr : Array (Literal (PosFin n))
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
_derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
i : Fin n
j : Fin (List.length derivedLits)
j_eq_i : (List.get derivedLits j).fst.val = ↑i
h1 : f'.assignments[↑i] = addAssignment (List.get derivedLits j).snd f.assignments[↑i]
h2 : ¬hasAssignment (List.get derivedLits j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j → (List.get derivedLits k).fst.val ≠ ↑i
j_lt_derivedLits_arr_size : ↑j < derivedLits_arr.size
i_gt_zero : ↑i > 0
⊢ f'.assignments[↑i] = addAssignment (List.get derivedLits j).snd f.assignments[↑i] ∧
    ¬hasAssignment (List.get derivedLits j).snd f.assignments[↑i] = true ∧
      ∀ (k : Fin derivedLits_arr.size), ↑k ≥ 0 → k ≠ ⟨↑j, j_lt_derivedLits_arr_size⟩ → derivedLits_arr[k].fst.val ≠ ↑i