-- 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
j1 j2 : Fin (List.length derivedLits)
j1_eq_i : (List.get derivedLits j1).fst.val = ↑i
j2_eq_i : (List.get derivedLits j2).fst.val = ↑i
j1_eq_true : (List.get derivedLits j1).snd = true
j2_eq_false : (List.get derivedLits j2).snd = false
h1 : f'.assignments[↑i] = both
h2 : f.assignments[↑i] = unassigned
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j1 → k ≠ j2 → (List.get derivedLits k).fst.val ≠ ↑i
j1_lt_derivedLits_arr_size : ↑j1 < derivedLits_arr.size
j2_lt_derivedLits_arr_size : ↑j2 < derivedLits_arr.size
i_gt_zero : ↑i > 0
k : Fin derivedLits_arr.size
a✝ : ↑k ≥ 0
k_ne_j1 : k ≠ ⟨↑j1, j1_lt_derivedLits_arr_size⟩
k_ne_j2 : k ≠ ⟨↑j2, j2_lt_derivedLits_arr_size⟩
k_in_bounds : ↑k < List.length derivedLits
⊢ ⟨↑k, k_in_bounds⟩ ≠ j1

Tactic:
apply Fin.ne_of_val_ne

Result:
case h
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
j1 j2 : Fin (List.length derivedLits)
j1_eq_i : (List.get derivedLits j1).fst.val = ↑i
j2_eq_i : (List.get derivedLits j2).fst.val = ↑i
j1_eq_true : (List.get derivedLits j1).snd = true
j2_eq_false : (List.get derivedLits j2).snd = false
h1 : f'.assignments[↑i] = both
h2 : f.assignments[↑i] = unassigned
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j1 → k ≠ j2 → (List.get derivedLits k).fst.val ≠ ↑i
j1_lt_derivedLits_arr_size : ↑j1 < derivedLits_arr.size
j2_lt_derivedLits_arr_size : ↑j2 < derivedLits_arr.size
i_gt_zero : ↑i > 0
k : Fin derivedLits_arr.size
a✝ : ↑k ≥ 0
k_ne_j1 : k ≠ ⟨↑j1, j1_lt_derivedLits_arr_size⟩
k_ne_j2 : k ≠ ⟨↑j2, j2_lt_derivedLits_arr_size⟩
k_in_bounds : ↑k < List.length derivedLits
⊢ ↑⟨↑k, k_in_bounds⟩ ≠ ↑j1

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
j1 j2 : Fin (List.length derivedLits)
j1_eq_i : (List.get derivedLits j1).fst.val = ↑i
j2_eq_i : (List.get derivedLits j2).fst.val = ↑i
j1_eq_true : (List.get derivedLits j1).snd = true
j2_eq_false : (List.get derivedLits j2).snd = false
h1 : f'.assignments[↑i] = both
h2 : f.assignments[↑i] = unassigned
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j1 → k ≠ j2 → (List.get derivedLits k).fst.val ≠ ↑i
j1_lt_derivedLits_arr_size : ↑j1 < derivedLits_arr.size
⊢ ↑j2 < derivedLits_arr.size

Tactic:
simp only [derivedLits_arr_def, Array.size_toArray]

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
j1 j2 : Fin (List.length derivedLits)
j1_eq_i : (List.get derivedLits j1).fst.val = ↑i
j2_eq_i : (List.get derivedLits j2).fst.val = ↑i
j1_eq_true : (List.get derivedLits j1).snd = true
j2_eq_false : (List.get derivedLits j2).snd = false
h1 : f'.assignments[↑i] = both
h2 : f.assignments[↑i] = unassigned
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j1 → k ≠ j2 → (List.get derivedLits k).fst.val ≠ ↑i
j1_lt_derivedLits_arr_size : ↑j1 < derivedLits_arr.size
⊢ ↑j2 < List.length derivedLits

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
j1 j2 : Fin (List.length derivedLits)
j1_eq_i : (List.get derivedLits j1).fst.val = ↑i
j2_eq_i : (List.get derivedLits j2).fst.val = ↑i
j1_eq_true : (List.get derivedLits j1).snd = true
j2_eq_false : (List.get derivedLits j2).snd = false
h1 : f'.assignments[↑i] = both
h2 : f.assignments[↑i] = unassigned
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j1 → k ≠ j2 → (List.get derivedLits k).fst.val ≠ ↑i
j1_lt_derivedLits_arr_size : ↑j1 < derivedLits_arr.size
j2_lt_derivedLits_arr_size : ↑j2 < derivedLits_arr.size
i_gt_zero : ↑i > 0
k : Fin derivedLits_arr.size
a✝ : ↑k ≥ 0
k_ne_j1 : k ≠ ⟨↑j1, j1_lt_derivedLits_arr_size⟩
k_ne_j2 : k ≠ ⟨↑j2, j2_lt_derivedLits_arr_size⟩
⊢ ↑k < List.length derivedLits

Tactic:
have k_property := k.2

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
j1 j2 : Fin (List.length derivedLits)
j1_eq_i : (List.get derivedLits j1).fst.val = ↑i
j2_eq_i : (List.get derivedLits j2).fst.val = ↑i
j1_eq_true : (List.get derivedLits j1).snd = true
j2_eq_false : (List.get derivedLits j2).snd = false
h1 : f'.assignments[↑i] = both
h2 : f.assignments[↑i] = unassigned
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ j1 → k ≠ j2 → (List.get derivedLits k).fst.val ≠ ↑i
j1_lt_derivedLits_arr_size : ↑j1 < derivedLits_arr.size
j2_lt_derivedLits_arr_size : ↑j2 < derivedLits_arr.size
i_gt_zero : ↑i > 0
k : Fin derivedLits_arr.size
a✝ : ↑k ≥ 0
k_ne_j1 : k ≠ ⟨↑j1, j1_lt_derivedLits_arr_size⟩
k_ne_j2 : k ≠ ⟨↑j2, j2_lt_derivedLits_arr_size⟩
k_property : ↑k < derivedLits_arr.size
⊢ ↑k < List.length derivedLits