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

State before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ (f.insertRupUnits units).fst.clearRupUnits = f
Tactic:
simp only [clearRupUnits]
State after:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
      assignments :=
        Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 } =
    f

State before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
      assignments :=
        Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 } =
    f
Tactic:
ext
State after:
case clauses
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 }.clauses =
    f.clauses

case rupUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.rupUnits =
    f.rupUnits

case ratUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.ratUnits =
    f.ratUnits

case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.assignments =
    f.assignments

State before:
case clauses
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 }.clauses =
    f.clauses

case rupUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.rupUnits =
    f.rupUnits

case ratUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.ratUnits =
    f.ratUnits

case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.assignments =
    f.assignments
Tactic:
. simp only [insertRupUnits]
State after:
case rupUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.rupUnits =
    f.rupUnits

case ratUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.ratUnits =
    f.ratUnits

case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.assignments =
    f.assignments

State before:
case rupUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.rupUnits =
    f.rupUnits

case ratUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.ratUnits =
    f.ratUnits

case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.assignments =
    f.assignments
Tactic:
. rw [f_readyForRupAdd.1]
State after:
case ratUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.ratUnits =
    f.ratUnits

case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.assignments =
    f.assignments

State before:
case ratUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.ratUnits =
    f.ratUnits

case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.assignments =
    f.assignments
Tactic:
. simp only [insertRupUnits, Misc.Prod.mk.eta]
State after:
case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.assignments =
    f.assignments

State before:
case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.assignments =
    f.assignments
Tactic:
. simp only
  let motive := clear_insert_induction_motive f f_readyForRupAdd.2.1 (insertRupUnits f units).1.rupUnits
  have h_base : motive 0 (insertRupUnits f units).1.assignments := clear_insertRup_base_case f f_readyForRupAdd units
  have h_inductive (idx : Fin (insertRupUnits f units).1.rupUnits.size) (assignments : Array Assignment)
    (ih : motive idx.val assignments) : motive (idx.val + 1) (clearUnit assignments (insertRupUnits f units).1.rupUnits[idx]) :=
    clear_insert_inductive_case f f_readyForRupAdd.2.1 (insertRupUnits f units).1.rupUnits
      (insertRupUnits_nodup f f_readyForRupAdd units) idx assignments ih
  rcases Array.foldl_induction motive h_base h_inductive with ⟨h_size, h⟩
  apply Array.ext
  . rw [h_size, f_readyForRupAdd.2.1]
  . intro i hi1 hi2
    have i_lt_n : i < n := by rw [← f_readyForRupAdd.2.1]; exact hi2
    specialize h ⟨i, i_lt_n⟩
    rcases h with ⟨h,_⟩
    . exact h
    . omega
State after:
no goals

State before:
case clauses
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 }.clauses =
    f.clauses
Tactic:
simp only [insertRupUnits]
State after:
no goals

State before:
case rupUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.rupUnits =
    f.rupUnits
Tactic:
rw [f_readyForRupAdd.1]
State after:
no goals

State before:
case ratUnits
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.ratUnits =
    f.ratUnits
Tactic:
simp only [insertRupUnits, Misc.Prod.mk.eta]
State after:
no goals

State before:
case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ { clauses := (f.insertRupUnits units).1.clauses, rupUnits := #[], ratUnits := (f.insertRupUnits units).1.ratUnits,
        assignments :=
          Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits
            0 }.assignments =
    f.assignments
Tactic:
simp only
State after:
case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 = f.assignments

State before:
case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 = f.assignments
Tactic:
let motive := clear_insert_induction_motive f f_readyForRupAdd.2.1 (insertRupUnits f units).1.rupUnits
State after:
case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
⊢ Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 = f.assignments

State before:
case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
⊢ Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 = f.assignments
Tactic:
have h_base : motive 0 (insertRupUnits f units).1.assignments := clear_insertRup_base_case f f_readyForRupAdd units
State after:
case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
⊢ Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 = f.assignments

State before:
case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
⊢ Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 = f.assignments
Tactic:
have h_inductive (idx : Fin (insertRupUnits f units).1.rupUnits.size) (assignments : Array Assignment)
  (ih : motive idx.val assignments) : motive (idx.val + 1) (clearUnit assignments (insertRupUnits f units).1.rupUnits[idx]) :=
  clear_insert_inductive_case f f_readyForRupAdd.2.1 (insertRupUnits f units).1.rupUnits
    (insertRupUnits_nodup f f_readyForRupAdd units) idx assignments ih
State after:
case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
⊢ Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 = f.assignments

State before:
case assignments
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
⊢ Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 = f.assignments
Tactic:
rcases Array.foldl_induction motive h_base h_inductive with ⟨h_size, h⟩
State after:
case assignments.intro
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
⊢ Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 = f.assignments

State before:
case assignments.intro
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
⊢ Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0 = f.assignments
Tactic:
apply Array.ext
State after:
case assignments.intro.h₁
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size =
    f.assignments.size

case assignments.intro.h₂
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
⊢ ∀ (i : Nat)
    (hi₁ :
      i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size)
    (hi₂ : i < f.assignments.size),
    (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
      f.assignments[i]

State before:
case assignments.intro.h₁
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size =
    f.assignments.size

case assignments.intro.h₂
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
⊢ ∀ (i : Nat)
    (hi₁ :
      i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size)
    (hi₂ : i < f.assignments.size),
    (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
      f.assignments[i]
Tactic:
. rw [h_size, f_readyForRupAdd.2.1]
State after:
case assignments.intro.h₂
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
⊢ ∀ (i : Nat)
    (hi₁ :
      i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size)
    (hi₂ : i < f.assignments.size),
    (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
      f.assignments[i]

State before:
case assignments.intro.h₂
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
⊢ ∀ (i : Nat)
    (hi₁ :
      i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size)
    (hi₂ : i < f.assignments.size),
    (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
      f.assignments[i]
Tactic:
. intro i hi1 hi2
  have i_lt_n : i < n := by rw [← f_readyForRupAdd.2.1]; exact hi2
  specialize h ⟨i, i_lt_n⟩
  rcases h with ⟨h,_⟩
  . exact h
  . omega
State after:
no goals

State before:
case assignments.intro.h₁
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size =
    f.assignments.size
Tactic:
rw [h_size, f_readyForRupAdd.2.1]
State after:
no goals

State before:
case assignments.intro.h₂
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
⊢ ∀ (i : Nat)
    (hi₁ :
      i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size)
    (hi₂ : i < f.assignments.size),
    (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
      f.assignments[i]
Tactic:
intro i hi1 hi2
State after:
case assignments.intro.h₂
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]

State before:
case assignments.intro.h₂
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]
Tactic:
have i_lt_n : i < n := by rw [← f_readyForRupAdd.2.1]; exact hi2
State after:
case assignments.intro.h₂
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]

State before:
case assignments.intro.h₂
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]
Tactic:
specialize h ⟨i, i_lt_n⟩
State after:
case assignments.intro.h₂
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : 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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0)[↑⟨i, i_lt_n⟩];
  let fassignments_i := f.assignments[↑⟨i, i_lt_n⟩];
  (assignments_i = fassignments_i ∧
      ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
        ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size →
          (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑⟨i, i_lt_n⟩) ∨
    (∃ j b i_gt_zero,
        ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
          (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, b) ∧
            assignments_i = addAssignment b fassignments_i ∧
              ¬hasAssignment b fassignments_i = true ∧
                ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                  ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                    k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩) ∨
      ∃ j1 j2 i_gt_zero,
        ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
          ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, true) ∧
              (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, false) ∧
                assignments_i = both ∧
                  fassignments_i = unassigned ∧
                    ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                      ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                        k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]

State before:
case assignments.intro.h₂
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : 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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0)[↑⟨i, i_lt_n⟩];
  let fassignments_i := f.assignments[↑⟨i, i_lt_n⟩];
  (assignments_i = fassignments_i ∧
      ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
        ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size →
          (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑⟨i, i_lt_n⟩) ∨
    (∃ j b i_gt_zero,
        ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
          (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, b) ∧
            assignments_i = addAssignment b fassignments_i ∧
              ¬hasAssignment b fassignments_i = true ∧
                ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                  ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                    k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩) ∨
      ∃ j1 j2 i_gt_zero,
        ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
          ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, true) ∧
              (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, false) ∧
                assignments_i = both ∧
                  fassignments_i = unassigned ∧
                    ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                      ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                        k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]
Tactic:
rcases h with ⟨h,_⟩
State after:
case assignments.intro.h₂.inl.intro
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0)[↑⟨i, i_lt_n⟩] =
    f.assignments[↑⟨i, i_lt_n⟩]
right✝ :
  ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
    ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]

case assignments.intro.h₂.inr
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h✝ :
  (∃ j b i_gt_zero,
      ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
        (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, b) ∧
          (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments
                  (f.insertRupUnits units).fst.rupUnits 0)[↑⟨i, i_lt_n⟩] =
              addAssignment b f.assignments[↑⟨i, i_lt_n⟩] ∧
            ¬hasAssignment b f.assignments[↑⟨i, i_lt_n⟩] = true ∧
              ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                  k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩) ∨
    ∃ j1 j2 i_gt_zero,
      ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
        ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
          (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, true) ∧
            (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, false) ∧
              (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments
                      (f.insertRupUnits units).fst.rupUnits 0)[↑⟨i, i_lt_n⟩] =
                  both ∧
                f.assignments[↑⟨i, i_lt_n⟩] = unassigned ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]

State before:
case assignments.intro.h₂.inl.intro
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0)[↑⟨i, i_lt_n⟩] =
    f.assignments[↑⟨i, i_lt_n⟩]
right✝ :
  ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
    ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]

case assignments.intro.h₂.inr
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h✝ :
  (∃ j b i_gt_zero,
      ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
        (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, b) ∧
          (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments
                  (f.insertRupUnits units).fst.rupUnits 0)[↑⟨i, i_lt_n⟩] =
              addAssignment b f.assignments[↑⟨i, i_lt_n⟩] ∧
            ¬hasAssignment b f.assignments[↑⟨i, i_lt_n⟩] = true ∧
              ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                  k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩) ∨
    ∃ j1 j2 i_gt_zero,
      ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
        ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
          (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, true) ∧
            (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, false) ∧
              (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments
                      (f.insertRupUnits units).fst.rupUnits 0)[↑⟨i, i_lt_n⟩] =
                  both ∧
                f.assignments[↑⟨i, i_lt_n⟩] = unassigned ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]
Tactic:
. exact h
State after:
case assignments.intro.h₂.inr
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h✝ :
  (∃ j b i_gt_zero,
      ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
        (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, b) ∧
          (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments
                  (f.insertRupUnits units).fst.rupUnits 0)[↑⟨i, i_lt_n⟩] =
              addAssignment b f.assignments[↑⟨i, i_lt_n⟩] ∧
            ¬hasAssignment b f.assignments[↑⟨i, i_lt_n⟩] = true ∧
              ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                  k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩) ∨
    ∃ j1 j2 i_gt_zero,
      ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
        ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
          (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, true) ∧
            (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, false) ∧
              (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments
                      (f.insertRupUnits units).fst.rupUnits 0)[↑⟨i, i_lt_n⟩] =
                  both ∧
                f.assignments[↑⟨i, i_lt_n⟩] = unassigned ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]

State before:
case assignments.intro.h₂.inr
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h✝ :
  (∃ j b i_gt_zero,
      ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
        (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, b) ∧
          (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments
                  (f.insertRupUnits units).fst.rupUnits 0)[↑⟨i, i_lt_n⟩] =
              addAssignment b f.assignments[↑⟨i, i_lt_n⟩] ∧
            ¬hasAssignment b f.assignments[↑⟨i, i_lt_n⟩] = true ∧
              ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                  k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩) ∨
    ∃ j1 j2 i_gt_zero,
      ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
        ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
          (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, true) ∧
            (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, false) ∧
              (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments
                      (f.insertRupUnits units).fst.rupUnits 0)[↑⟨i, i_lt_n⟩] =
                  both ∧
                f.assignments[↑⟨i, i_lt_n⟩] = unassigned ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]
Tactic:
. omega
State after:
no goals

State before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
⊢ i < n
Tactic:
rw [← f_readyForRupAdd.2.1]
State after:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
⊢ i < f.assignments.size

State before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        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.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
            ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
⊢ i < f.assignments.size
Tactic:
exact hi2
State after:
no goals

State before:
case assignments.intro.h₂.inl.intro
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0)[↑⟨i, i_lt_n⟩] =
    f.assignments[↑⟨i, i_lt_n⟩]
right✝ :
  ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
    ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]
Tactic:
exact h
State after:
no goals

State before:
case assignments.intro.h₂.inr
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRupUnits units).fst.rupUnits
h_base : motive 0 (f.insertRupUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRupUnits units).fst.rupUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRupUnits units).fst.rupUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments (f.insertRupUnits units).fst.rupUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h✝ :
  (∃ j b i_gt_zero,
      ↑j ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
        (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, b) ∧
          (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments
                  (f.insertRupUnits units).fst.rupUnits 0)[↑⟨i, i_lt_n⟩] =
              addAssignment b f.assignments[↑⟨i, i_lt_n⟩] ∧
            ¬hasAssignment b f.assignments[↑⟨i, i_lt_n⟩] = true ∧
              ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                  k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩) ∨
    ∃ j1 j2 i_gt_zero,
      ↑j1 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
        ↑j2 ≥ (f.insertRupUnits units).fst.rupUnits.size ∧
          (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, true) ∧
            (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, false) ∧
              (Array.foldl (fun b => clearUnit b) (f.insertRupUnits units).fst.assignments
                      (f.insertRupUnits units).fst.rupUnits 0)[↑⟨i, i_lt_n⟩] =
                  both ∧
                f.assignments[↑⟨i, i_lt_n⟩] = unassigned ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ (f.insertRupUnits units).fst.rupUnits.size →
                      k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRupUnits units).1.assignments (f.insertRupUnits units).1.rupUnits 0)[i] =
    f.assignments[i]
Tactic:
omega
State after:
no goals