-- 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:
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

Tactic:
next i_ne_k2 =>
specialize h3 ⟨i.1, i_in_bounds⟩ i_ne_k1 i_ne_k2
simp +decide [derivedLits_arr_def, li] at h3

Result:
no goals

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
h3 : (List.get derivedLits ⟨↑j, j_in_bounds⟩).fst.val ≠ ↑⟨li.fst.val, ⋯⟩
li_eq_lj : { toList := derivedLits }[↑i] = { toList := derivedLits }[↑j]
⊢ False

Tactic:
simp only [Fin.getElem_fin, derivedLits_arr_def, ne_eq, li, li_eq_lj] at h3

Result:
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

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
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 : derivedLits[↑j].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_true : li.snd = true
i_ne_k2 : ⟨↑i, i_in_bounds⟩ ≠ k2
j_eq_k2 : ⟨↑j, j_in_bounds⟩ = k2
li_eq_lj : { toList := derivedLits }[↑i] = { toList := derivedLits }[↑j]
⊢ False

Tactic:
simp [derivedLits_arr_def, k2_eq_false, li_eq_lj, li] at li_eq_true

Result:
no goals