Theorem: LRAT.DefaultFormula.clear_insertRat
Proof state before:
case assignments.intro.h₂.inl
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRatUnits units).fst.ratUnits
h_base : motive 0 (f.insertRatUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRatUnits units).fst.ratUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRatUnits units).fst.ratUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h :
  (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
          0)[↑⟨i, i_lt_n⟩] =
      f.assignments[↑⟨i, i_lt_n⟩] ∧
    ∀ (j : Fin (f.insertRatUnits units).fst.ratUnits.size),
      ↑j ≥ (f.insertRatUnits units).fst.ratUnits.size → (f.insertRatUnits units).fst.ratUnits[j].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0)[i] =
    f.assignments[i]

case assignments.intro.h₂.inr.inl
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRatUnits units).fst.ratUnits
h_base : motive 0 (f.insertRatUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRatUnits units).fst.ratUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRatUnits units).fst.ratUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h :
  ∃ j b i_gt_zero,
    ↑j ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
      (f.insertRatUnits units).fst.ratUnits[j] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, b) ∧
        (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments
                (f.insertRatUnits units).fst.ratUnits 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.insertRatUnits units).fst.ratUnits.size),
              ↑k ≥ (f.insertRatUnits units).fst.ratUnits.size →
                k ≠ j → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0)[i] =
    f.assignments[i]

case assignments.intro.h₂.inr.inr
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRatUnits units).fst.ratUnits
h_base : motive 0 (f.insertRatUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRatUnits units).fst.ratUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRatUnits units).fst.ratUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h :
  ∃ j1 j2 i_gt_zero,
    ↑j1 ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
      ↑j2 ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
        (f.insertRatUnits units).fst.ratUnits[j1] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, true) ∧
          (f.insertRatUnits units).fst.ratUnits[j2] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, false) ∧
            (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments
                    (f.insertRatUnits units).fst.ratUnits 0)[↑⟨i, i_lt_n⟩] =
                both ∧
              f.assignments[↑⟨i, i_lt_n⟩] = unassigned ∧
                ∀ (k : Fin (f.insertRatUnits units).fst.ratUnits.size),
                  ↑k ≥ (f.insertRatUnits units).fst.ratUnits.size →
                    k ≠ j1 → k ≠ j2 → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0)[i] =
    f.assignments[i]
Tactic:
. exact h.1
Proof state after:
case assignments.intro.h₂.inr.inl
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRatUnits units).fst.ratUnits
h_base : motive 0 (f.insertRatUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRatUnits units).fst.ratUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRatUnits units).fst.ratUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h :
  ∃ j b i_gt_zero,
    ↑j ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
      (f.insertRatUnits units).fst.ratUnits[j] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, b) ∧
        (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments
                (f.insertRatUnits units).fst.ratUnits 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.insertRatUnits units).fst.ratUnits.size),
              ↑k ≥ (f.insertRatUnits units).fst.ratUnits.size →
                k ≠ j → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0)[i] =
    f.assignments[i]

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