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

Proof state:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
f'_assignments_size : (f.performRupCheck rupHints).fst.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))
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
i j : Fin derivedLits_arr.size
i_ne_j : i ≠ j
li_eq_lj : derivedLits_arr[i] = derivedLits_arr[j]
li : Literal (PosFin n) := derivedLits_arr[i]
li_in_derivedLits : li ∈ derivedLits
i_in_bounds : ↑i < List.length derivedLits
j_in_bounds : ↑j < List.length derivedLits
k1 k2 : Fin (List.length derivedLits)
left✝³ : (List.get derivedLits k1).fst.val = ↑⟨li.fst.val, ⋯⟩
left✝² : (List.get derivedLits k2).fst.val = ↑⟨li.fst.val, ⋯⟩
k1_eq_true : (List.get derivedLits k1).snd = true
k2_eq_false : (List.get derivedLits k2).snd = false
left✝¹ : (f.performRupCheck rupHints).fst.assignments[↑⟨li.fst.val, ⋯⟩] = both
left✝ : f.assignments[↑⟨li.fst.val, ⋯⟩] = unassigned
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ k1 → k ≠ k2 → (List.get derivedLits k).fst.val ≠ ↑⟨li.fst.val, ⋯⟩
li_eq_false : li.snd = false
i_ne_k1 : ⟨↑i, i_in_bounds⟩ ≠ k1
j_ne_k1 : ⟨↑j, j_in_bounds⟩ ≠ k1
⊢ False

Tactic:
by_cases ⟨i.1, i_in_bounds⟩ = k2

Result:
case pos
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
f'_assignments_size : (f.performRupCheck rupHints).fst.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))
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
i j : Fin derivedLits_arr.size
i_ne_j : i ≠ j
li_eq_lj : derivedLits_arr[i] = derivedLits_arr[j]
li : Literal (PosFin n) := derivedLits_arr[i]
li_in_derivedLits : li ∈ derivedLits
i_in_bounds : ↑i < List.length derivedLits
j_in_bounds : ↑j < List.length derivedLits
k1 k2 : Fin (List.length derivedLits)
left✝³ : (List.get derivedLits k1).fst.val = ↑⟨li.fst.val, ⋯⟩
left✝² : (List.get derivedLits k2).fst.val = ↑⟨li.fst.val, ⋯⟩
k1_eq_true : (List.get derivedLits k1).snd = true
k2_eq_false : (List.get derivedLits k2).snd = false
left✝¹ : (f.performRupCheck rupHints).fst.assignments[↑⟨li.fst.val, ⋯⟩] = both
left✝ : f.assignments[↑⟨li.fst.val, ⋯⟩] = unassigned
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ k1 → k ≠ k2 → (List.get derivedLits k).fst.val ≠ ↑⟨li.fst.val, ⋯⟩
li_eq_false : li.snd = false
i_ne_k1 : ⟨↑i, i_in_bounds⟩ ≠ k1
j_ne_k1 : ⟨↑j, j_in_bounds⟩ ≠ k1
h✝ : ⟨↑i, i_in_bounds⟩ = k2
⊢ False

case neg
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
f'_assignments_size : (f.performRupCheck rupHints).fst.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))
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
i j : Fin derivedLits_arr.size
i_ne_j : i ≠ j
li_eq_lj : derivedLits_arr[i] = derivedLits_arr[j]
li : Literal (PosFin n) := derivedLits_arr[i]
li_in_derivedLits : li ∈ derivedLits
i_in_bounds : ↑i < List.length derivedLits
j_in_bounds : ↑j < List.length derivedLits
k1 k2 : Fin (List.length derivedLits)
left✝³ : (List.get derivedLits k1).fst.val = ↑⟨li.fst.val, ⋯⟩
left✝² : (List.get derivedLits k2).fst.val = ↑⟨li.fst.val, ⋯⟩
k1_eq_true : (List.get derivedLits k1).snd = true
k2_eq_false : (List.get derivedLits k2).snd = false
left✝¹ : (f.performRupCheck rupHints).fst.assignments[↑⟨li.fst.val, ⋯⟩] = both
left✝ : f.assignments[↑⟨li.fst.val, ⋯⟩] = unassigned
h3 : ∀ (k : Fin (List.length derivedLits)), k ≠ k1 → k ≠ k2 → (List.get derivedLits k).fst.val ≠ ↑⟨li.fst.val, ⋯⟩
li_eq_false : li.snd = false
i_ne_k1 : ⟨↑i, i_in_bounds⟩ ≠ k1
j_ne_k1 : ⟨↑j, j_in_bounds⟩ ≠ k1
h✝ : ¬⟨↑i, i_in_bounds⟩ = k2
⊢ False

Proof state:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
f'_assignments_size : (f.performRupCheck rupHints).fst.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))
derivedLits_arr_def : derivedLits_arr = { toList := derivedLits }
i j : Fin derivedLits_arr.size
i_ne_j : i ≠ j
li : Literal (PosFin n) := derivedLits_arr[i]
li_in_derivedLits : li ∈ derivedLits
i_in_bounds : ↑i < List.length derivedLits
j_in_bounds : ↑j < List.length derivedLits
k : Fin (List.length derivedLits)
left✝² : (List.get derivedLits k).fst.val = ↑⟨li.fst.val, ⋯⟩
left✝¹ :
  (f.performRupCheck rupHints).fst.assignments[↑⟨li.fst.val, ⋯⟩] =
    addAssignment (List.get derivedLits k).snd f.assignments[↑⟨li.fst.val, ⋯⟩]
left✝ : ¬hasAssignment (List.get derivedLits k).snd f.assignments[↑⟨li.fst.val, ⋯⟩] = true
k_eq_i : ↑k = ↑i
j_ne_k : ⟨↑j, j_in_bounds⟩ ≠ k
li_eq_lj : { toList := derivedLits }[↑i] = { toList := derivedLits }[↑j]
h3 : ¬(List.get derivedLits ⟨↑j, j_in_bounds⟩).fst.val = { toList := derivedLits }[↑j].fst.val
⊢ False

Tactic:
simp only [List.get_eq_getElem, ← Array.getElem_toList, not_true_eq_false] at h3

Result:
no goals