Theorem: LRAT.DefaultFormula.restoreAssignments_performRupCheck (LeanSAT/LRAT/Formula/RupAddResult.lean)

State before:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
⊢ restoreAssignments (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments
Tactic:
rw [restoreAssignments]
State after:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments

State before:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments
Tactic:
let f' := (performRupCheck f rupHints).1
State after:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
f' : DefaultFormula n := (f.performRupCheck rupHints).fst
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments

State before:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
f' : DefaultFormula n := (f.performRupCheck rupHints).fst
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments
Tactic:
have f'_def : f' = (performRupCheck f rupHints).1 := rfl
State after:
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
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments

State before:
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
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments
Tactic:
have f'_assignments_size : f'.assignments.size = n :=
  by rw [performRupCheck_preserves_assignments_size f rupHints, f_assignments_size]
State after:
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
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments

State before:
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
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments
Tactic:
have derivedLits_satisfies_invariant := derivedLits_postcondition f f_assignments_size rupHints f'_assignments_size
State after:
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_satisfies_invariant :
  let rupCheckRes := f.performRupCheck rupHints;
  f.derivedLits_invariant f_assignments_size rupCheckRes.fst.assignments f'_assignments_size rupCheckRes.snd.fst
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments

State before:
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_satisfies_invariant :
  let rupCheckRes := f.performRupCheck rupHints;
  f.derivedLits_invariant f_assignments_size rupCheckRes.fst.assignments f'_assignments_size rupCheckRes.snd.fst
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments
Tactic:
simp only at derivedLits_satisfies_invariant
State after:
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_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    (f.performRupCheck rupHints).snd.fst
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments

State before:
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_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    (f.performRupCheck rupHints).snd.fst
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments (f.performRupCheck rupHints).snd.fst = f.assignments
Tactic:
generalize (performRupCheck f rupHints).2.1 = derivedLits at *
State after:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments derivedLits = f.assignments

State before:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
⊢ List.foldl clearUnit (f.performRupCheck rupHints).fst.assignments derivedLits = f.assignments
Tactic:
rw [← f'_def, ← Array.foldl_eq_foldl_data]
State after:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments

State before:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments
Tactic:
let derivedLits_arr : Array (Literal (PosFin n)) := {data := derivedLits}
State after:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments

State before:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments
Tactic:
have derivedLits_arr_def : derivedLits_arr = {data := derivedLits} := rfl
State after:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments

State before:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments
Tactic:
have derivedLits_arr_nodup := derivedLits_nodup f f_assignments_size rupHints f'_assignments_size derivedLits
  derivedLits_satisfies_invariant derivedLits_arr derivedLits_arr_def
State after:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments

State before:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments
Tactic:
let motive := clear_insert_induction_motive f f_assignments_size derivedLits_arr
State after:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments

State before:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments
Tactic:
have h_base :=
  restoreAssignments_performRupCheck_base_case f f_assignments_size f' f'_def f'_assignments_size derivedLits
    derivedLits_arr derivedLits_arr_def derivedLits_satisfies_invariant derivedLits_arr_nodup
State after:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments

State before:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = 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
State after:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments

State before:
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments
Tactic:
rcases Array.foldl_induction motive h_base h_inductive with ⟨h_size, h⟩
State after:
case intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments

State before:
case intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
⊢ Array.foldl clearUnit f'.assignments { data := derivedLits } 0 = f.assignments
Tactic:
apply Array.ext
State after:
case intro.h₁
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size = f.assignments.size

case intro.h₂
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
⊢ ∀ (i : Nat) (hi₁ : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size)
    (hi₂ : i < f.assignments.size),
    (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

State before:
case intro.h₁
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size = f.assignments.size

case intro.h₂
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
⊢ ∀ (i : Nat) (hi₁ : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size)
    (hi₂ : i < f.assignments.size),
    (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
. rw [Array.foldl_eq_foldl_data, clearUnit_foldl_preserves_size f'.assignments clearUnit clearUnit_preserves_size derivedLits,
    f'_assignments_size, f_assignments_size]
State after:
case intro.h₂
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
⊢ ∀ (i : Nat) (hi₁ : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size)
    (hi₂ : i < f.assignments.size),
    (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

State before:
case intro.h₂
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
⊢ ∀ (i : Nat) (hi₁ : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size)
    (hi₂ : i < f.assignments.size),
    (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
. intro i hi1 hi2
  rw [f_assignments_size] at hi2
  specialize h ⟨i, hi2⟩
  rcases h with ⟨h1, _⟩ | ⟨j, b, i_gt_zero, j_ge_derivedLits_size, _⟩ | ⟨j1, j2, i_gt_zero, j1_ge_derivedLits_size, _⟩
  . simp only [← derivedLits_arr_def]
    exact h1
  . exfalso
    exact (Nat.not_lt_of_le j_ge_derivedLits_size) j.2
  . exfalso
    exact (Nat.not_lt_of_le j1_ge_derivedLits_size) j1.2
State after:
no goals

State before:
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 = n
Tactic:
rw [performRupCheck_preserves_assignments_size f rupHints, f_assignments_size]
State after:
no goals

State before:
case intro.h₁
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size = f.assignments.size
Tactic:
rw [Array.foldl_eq_foldl_data, clearUnit_foldl_preserves_size f'.assignments clearUnit clearUnit_preserves_size derivedLits,
  f'_assignments_size, f_assignments_size]
State after:
no goals

State before:
case intro.h₂
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
⊢ ∀ (i : Nat) (hi₁ : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size)
    (hi₂ : i < f.assignments.size),
    (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
intro i hi1 hi2
State after:
case intro.h₂
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2 : i < f.assignments.size
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

State before:
case intro.h₂
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2 : i < f.assignments.size
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
rw [f_assignments_size] at hi2
State after:
case intro.h₂
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

State before:
case intro.h₂
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ derivedLits_arr.size ∧
            derivedLits_arr[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin derivedLits_arr.size),
                    ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ derivedLits_arr.size ∧
            ↑j2 ≥ derivedLits_arr.size ∧
              derivedLits_arr[j1] = (⟨↑i, ⋯⟩, true) ∧
                derivedLits_arr[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin derivedLits_arr.size),
                        ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
specialize h ⟨i, hi2⟩
State after:
case intro.h₂
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
h :
  let_fun i_lt_assignments_size := ⋯;
  let_fun i_lt_f_assignments_size := ⋯;
  let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩];
  let fassignments_i := f.assignments[↑⟨i, hi2⟩];
  (assignments_i = fassignments_i ∧
      ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑⟨i, hi2⟩) ∨
    (∃ j b i_gt_zero,
        ↑j ≥ derivedLits_arr.size ∧
          derivedLits_arr[j] = (⟨↑⟨i, hi2⟩, ⋯⟩, b) ∧
            assignments_i = addAssignment b fassignments_i ∧
              ¬hasAssignment b fassignments_i = true ∧
                ∀ (k : Fin derivedLits_arr.size),
                  ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩) ∨
      ∃ j1 j2 i_gt_zero,
        ↑j1 ≥ derivedLits_arr.size ∧
          ↑j2 ≥ derivedLits_arr.size ∧
            derivedLits_arr[j1] = (⟨↑⟨i, hi2⟩, ⋯⟩, true) ∧
              derivedLits_arr[j2] = (⟨↑⟨i, hi2⟩, ⋯⟩, false) ∧
                assignments_i = both ∧
                  fassignments_i = unassigned ∧
                    ∀ (k : Fin derivedLits_arr.size),
                      ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

State before:
case intro.h₂
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
h :
  let_fun i_lt_assignments_size := ⋯;
  let_fun i_lt_f_assignments_size := ⋯;
  let assignments_i := (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩];
  let fassignments_i := f.assignments[↑⟨i, hi2⟩];
  (assignments_i = fassignments_i ∧
      ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑⟨i, hi2⟩) ∨
    (∃ j b i_gt_zero,
        ↑j ≥ derivedLits_arr.size ∧
          derivedLits_arr[j] = (⟨↑⟨i, hi2⟩, ⋯⟩, b) ∧
            assignments_i = addAssignment b fassignments_i ∧
              ¬hasAssignment b fassignments_i = true ∧
                ∀ (k : Fin derivedLits_arr.size),
                  ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩) ∨
      ∃ j1 j2 i_gt_zero,
        ↑j1 ≥ derivedLits_arr.size ∧
          ↑j2 ≥ derivedLits_arr.size ∧
            derivedLits_arr[j1] = (⟨↑⟨i, hi2⟩, ⋯⟩, true) ∧
              derivedLits_arr[j2] = (⟨↑⟨i, hi2⟩, ⋯⟩, false) ∧
                assignments_i = both ∧
                  fassignments_i = unassigned ∧
                    ∀ (k : Fin derivedLits_arr.size),
                      ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
rcases h with ⟨h1, _⟩ | ⟨j, b, i_gt_zero, j_ge_derivedLits_size, _⟩ | ⟨j1, j2, i_gt_zero, j1_ge_derivedLits_size, _⟩
State after:
case intro.h₂.inl.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
h1 : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = f.assignments[↑⟨i, hi2⟩]
right✝ : ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

case intro.h₂.inr.inl.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j : Fin derivedLits_arr.size
b : Bool
i_gt_zero : ↑⟨i, hi2⟩ > 0
j_ge_derivedLits_size : ↑j ≥ derivedLits_arr.size
right✝ :
  derivedLits_arr[j] = (⟨↑⟨i, hi2⟩, ⋯⟩, b) ∧
    (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] =
        addAssignment b f.assignments[↑⟨i, hi2⟩] ∧
      ¬hasAssignment b f.assignments[↑⟨i, hi2⟩] = true ∧
        ∀ (k : Fin derivedLits_arr.size), ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

case intro.h₂.inr.inr.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j1 j2 : Fin derivedLits_arr.size
i_gt_zero : ↑⟨i, hi2⟩ > 0
j1_ge_derivedLits_size : ↑j1 ≥ derivedLits_arr.size
right✝ :
  ↑j2 ≥ derivedLits_arr.size ∧
    derivedLits_arr[j1] = (⟨↑⟨i, hi2⟩, ⋯⟩, true) ∧
      derivedLits_arr[j2] = (⟨↑⟨i, hi2⟩, ⋯⟩, false) ∧
        (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = both ∧
          f.assignments[↑⟨i, hi2⟩] = unassigned ∧
            ∀ (k : Fin derivedLits_arr.size),
              ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

State before:
case intro.h₂.inl.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
h1 : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = f.assignments[↑⟨i, hi2⟩]
right✝ : ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

case intro.h₂.inr.inl.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j : Fin derivedLits_arr.size
b : Bool
i_gt_zero : ↑⟨i, hi2⟩ > 0
j_ge_derivedLits_size : ↑j ≥ derivedLits_arr.size
right✝ :
  derivedLits_arr[j] = (⟨↑⟨i, hi2⟩, ⋯⟩, b) ∧
    (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] =
        addAssignment b f.assignments[↑⟨i, hi2⟩] ∧
      ¬hasAssignment b f.assignments[↑⟨i, hi2⟩] = true ∧
        ∀ (k : Fin derivedLits_arr.size), ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

case intro.h₂.inr.inr.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j1 j2 : Fin derivedLits_arr.size
i_gt_zero : ↑⟨i, hi2⟩ > 0
j1_ge_derivedLits_size : ↑j1 ≥ derivedLits_arr.size
right✝ :
  ↑j2 ≥ derivedLits_arr.size ∧
    derivedLits_arr[j1] = (⟨↑⟨i, hi2⟩, ⋯⟩, true) ∧
      derivedLits_arr[j2] = (⟨↑⟨i, hi2⟩, ⋯⟩, false) ∧
        (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = both ∧
          f.assignments[↑⟨i, hi2⟩] = unassigned ∧
            ∀ (k : Fin derivedLits_arr.size),
              ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
. simp only [← derivedLits_arr_def]
  exact h1
State after:
case intro.h₂.inr.inl.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j : Fin derivedLits_arr.size
b : Bool
i_gt_zero : ↑⟨i, hi2⟩ > 0
j_ge_derivedLits_size : ↑j ≥ derivedLits_arr.size
right✝ :
  derivedLits_arr[j] = (⟨↑⟨i, hi2⟩, ⋯⟩, b) ∧
    (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] =
        addAssignment b f.assignments[↑⟨i, hi2⟩] ∧
      ¬hasAssignment b f.assignments[↑⟨i, hi2⟩] = true ∧
        ∀ (k : Fin derivedLits_arr.size), ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

case intro.h₂.inr.inr.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j1 j2 : Fin derivedLits_arr.size
i_gt_zero : ↑⟨i, hi2⟩ > 0
j1_ge_derivedLits_size : ↑j1 ≥ derivedLits_arr.size
right✝ :
  ↑j2 ≥ derivedLits_arr.size ∧
    derivedLits_arr[j1] = (⟨↑⟨i, hi2⟩, ⋯⟩, true) ∧
      derivedLits_arr[j2] = (⟨↑⟨i, hi2⟩, ⋯⟩, false) ∧
        (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = both ∧
          f.assignments[↑⟨i, hi2⟩] = unassigned ∧
            ∀ (k : Fin derivedLits_arr.size),
              ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

State before:
case intro.h₂.inr.inl.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j : Fin derivedLits_arr.size
b : Bool
i_gt_zero : ↑⟨i, hi2⟩ > 0
j_ge_derivedLits_size : ↑j ≥ derivedLits_arr.size
right✝ :
  derivedLits_arr[j] = (⟨↑⟨i, hi2⟩, ⋯⟩, b) ∧
    (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] =
        addAssignment b f.assignments[↑⟨i, hi2⟩] ∧
      ¬hasAssignment b f.assignments[↑⟨i, hi2⟩] = true ∧
        ∀ (k : Fin derivedLits_arr.size), ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

case intro.h₂.inr.inr.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j1 j2 : Fin derivedLits_arr.size
i_gt_zero : ↑⟨i, hi2⟩ > 0
j1_ge_derivedLits_size : ↑j1 ≥ derivedLits_arr.size
right✝ :
  ↑j2 ≥ derivedLits_arr.size ∧
    derivedLits_arr[j1] = (⟨↑⟨i, hi2⟩, ⋯⟩, true) ∧
      derivedLits_arr[j2] = (⟨↑⟨i, hi2⟩, ⋯⟩, false) ∧
        (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = both ∧
          f.assignments[↑⟨i, hi2⟩] = unassigned ∧
            ∀ (k : Fin derivedLits_arr.size),
              ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
. exfalso
  exact (Nat.not_lt_of_le j_ge_derivedLits_size) j.2
State after:
case intro.h₂.inr.inr.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j1 j2 : Fin derivedLits_arr.size
i_gt_zero : ↑⟨i, hi2⟩ > 0
j1_ge_derivedLits_size : ↑j1 ≥ derivedLits_arr.size
right✝ :
  ↑j2 ≥ derivedLits_arr.size ∧
    derivedLits_arr[j1] = (⟨↑⟨i, hi2⟩, ⋯⟩, true) ∧
      derivedLits_arr[j2] = (⟨↑⟨i, hi2⟩, ⋯⟩, false) ∧
        (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = both ∧
          f.assignments[↑⟨i, hi2⟩] = unassigned ∧
            ∀ (k : Fin derivedLits_arr.size),
              ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]

State before:
case intro.h₂.inr.inr.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j1 j2 : Fin derivedLits_arr.size
i_gt_zero : ↑⟨i, hi2⟩ > 0
j1_ge_derivedLits_size : ↑j1 ≥ derivedLits_arr.size
right✝ :
  ↑j2 ≥ derivedLits_arr.size ∧
    derivedLits_arr[j1] = (⟨↑⟨i, hi2⟩, ⋯⟩, true) ∧
      derivedLits_arr[j2] = (⟨↑⟨i, hi2⟩, ⋯⟩, false) ∧
        (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = both ∧
          f.assignments[↑⟨i, hi2⟩] = unassigned ∧
            ∀ (k : Fin derivedLits_arr.size),
              ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
. exfalso
  exact (Nat.not_lt_of_le j1_ge_derivedLits_size) j1.2
State after:
no goals

State before:
case intro.h₂.inl.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
h1 : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = f.assignments[↑⟨i, hi2⟩]
right✝ : ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
simp only [← derivedLits_arr_def]
State after:
case intro.h₂.inl.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
h1 : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = f.assignments[↑⟨i, hi2⟩]
right✝ : ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0 derivedLits_arr.size)[i] = f.assignments[i]

State before:
case intro.h₂.inl.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
h1 : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = f.assignments[↑⟨i, hi2⟩]
right✝ : ∀ (j : Fin derivedLits_arr.size), ↑j ≥ derivedLits_arr.size → derivedLits_arr[j].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0 derivedLits_arr.size)[i] = f.assignments[i]
Tactic:
exact h1
State after:
no goals

State before:
case intro.h₂.inr.inl.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j : Fin derivedLits_arr.size
b : Bool
i_gt_zero : ↑⟨i, hi2⟩ > 0
j_ge_derivedLits_size : ↑j ≥ derivedLits_arr.size
right✝ :
  derivedLits_arr[j] = (⟨↑⟨i, hi2⟩, ⋯⟩, b) ∧
    (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] =
        addAssignment b f.assignments[↑⟨i, hi2⟩] ∧
      ¬hasAssignment b f.assignments[↑⟨i, hi2⟩] = true ∧
        ∀ (k : Fin derivedLits_arr.size), ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
exfalso
State after:
case intro.h₂.inr.inl.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j : Fin derivedLits_arr.size
b : Bool
i_gt_zero : ↑⟨i, hi2⟩ > 0
j_ge_derivedLits_size : ↑j ≥ derivedLits_arr.size
right✝ :
  derivedLits_arr[j] = (⟨↑⟨i, hi2⟩, ⋯⟩, b) ∧
    (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] =
        addAssignment b f.assignments[↑⟨i, hi2⟩] ∧
      ¬hasAssignment b f.assignments[↑⟨i, hi2⟩] = true ∧
        ∀ (k : Fin derivedLits_arr.size), ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ False

State before:
case intro.h₂.inr.inl.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j : Fin derivedLits_arr.size
b : Bool
i_gt_zero : ↑⟨i, hi2⟩ > 0
j_ge_derivedLits_size : ↑j ≥ derivedLits_arr.size
right✝ :
  derivedLits_arr[j] = (⟨↑⟨i, hi2⟩, ⋯⟩, b) ∧
    (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] =
        addAssignment b f.assignments[↑⟨i, hi2⟩] ∧
      ¬hasAssignment b f.assignments[↑⟨i, hi2⟩] = true ∧
        ∀ (k : Fin derivedLits_arr.size), ↑k ≥ derivedLits_arr.size → k ≠ j → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ False
Tactic:
exact (Nat.not_lt_of_le j_ge_derivedLits_size) j.2
State after:
no goals

State before:
case intro.h₂.inr.inr.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j1 j2 : Fin derivedLits_arr.size
i_gt_zero : ↑⟨i, hi2⟩ > 0
j1_ge_derivedLits_size : ↑j1 ≥ derivedLits_arr.size
right✝ :
  ↑j2 ≥ derivedLits_arr.size ∧
    derivedLits_arr[j1] = (⟨↑⟨i, hi2⟩, ⋯⟩, true) ∧
      derivedLits_arr[j2] = (⟨↑⟨i, hi2⟩, ⋯⟩, false) ∧
        (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = both ∧
          f.assignments[↑⟨i, hi2⟩] = unassigned ∧
            ∀ (k : Fin derivedLits_arr.size),
              ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ (Array.foldl clearUnit f'.assignments { data := derivedLits } 0)[i] = f.assignments[i]
Tactic:
exfalso
State after:
case intro.h₂.inr.inr.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j1 j2 : Fin derivedLits_arr.size
i_gt_zero : ↑⟨i, hi2⟩ > 0
j1_ge_derivedLits_size : ↑j1 ≥ derivedLits_arr.size
right✝ :
  ↑j2 ≥ derivedLits_arr.size ∧
    derivedLits_arr[j1] = (⟨↑⟨i, hi2⟩, ⋯⟩, true) ∧
      derivedLits_arr[j2] = (⟨↑⟨i, hi2⟩, ⋯⟩, false) ∧
        (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = both ∧
          f.assignments[↑⟨i, hi2⟩] = unassigned ∧
            ∀ (k : Fin derivedLits_arr.size),
              ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ False

State before:
case intro.h₂.inr.inr.intro.intro.intro.intro
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 : List (Literal (PosFin n))
derivedLits_satisfies_invariant :
  f.derivedLits_invariant f_assignments_size (f.performRupCheck rupHints).fst.assignments f'_assignments_size
    derivedLits
derivedLits_arr : Array (Literal (PosFin n)) := { data := derivedLits }
derivedLits_arr_def : derivedLits_arr = { data := derivedLits }
derivedLits_arr_nodup : ∀ (i j : Fin derivedLits_arr.size), i ≠ j → derivedLits_arr[i] ≠ derivedLits_arr[j]
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive f_assignments_size derivedLits_arr
h_base : f.clear_insert_induction_motive f_assignments_size derivedLits_arr 0 f'.assignments
h_inductive :
  ∀ (idx : Fin derivedLits_arr.size) (assignments : Array Assignment),
    motive (↑idx) assignments →
      f.clear_insert_induction_motive f_assignments_size derivedLits_arr (↑idx + 1)
        (clearUnit assignments derivedLits_arr[idx])
h_size : (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0).size = n
i : Nat
hi1 : i < (Array.foldl clearUnit f'.assignments { data := derivedLits } 0).size
hi2✝ : i < f.assignments.size
hi2 : i < n
j1 j2 : Fin derivedLits_arr.size
i_gt_zero : ↑⟨i, hi2⟩ > 0
j1_ge_derivedLits_size : ↑j1 ≥ derivedLits_arr.size
right✝ :
  ↑j2 ≥ derivedLits_arr.size ∧
    derivedLits_arr[j1] = (⟨↑⟨i, hi2⟩, ⋯⟩, true) ∧
      derivedLits_arr[j2] = (⟨↑⟨i, hi2⟩, ⋯⟩, false) ∧
        (Array.foldl (fun b => clearUnit b) f'.assignments derivedLits_arr 0)[↑⟨i, hi2⟩] = both ∧
          f.assignments[↑⟨i, hi2⟩] = unassigned ∧
            ∀ (k : Fin derivedLits_arr.size),
              ↑k ≥ derivedLits_arr.size → k ≠ j1 → k ≠ j2 → derivedLits_arr[k].fst.val ≠ ↑⟨i, hi2⟩
⊢ False
Tactic:
exact (Nat.not_lt_of_le j1_ge_derivedLits_size) j1.2
State after:
no goals