-- Mathlib/.lake/packages/lean4/src/lean/Std/Tactic/BVDecide/LRAT/Internal/Formula/RupAddResult.lean
theorem clear_insertRup_base_case {n : Nat} (f : DefaultFormula n) (f_readyForRupAdd : ReadyForRupAdd f)
  (units : CNF.Clause (PosFin n)) :
  ClearInsertInductionMotive f f_readyForRupAdd.2.1 (insertRupUnits f units).1.rupUnits 0 (insertRupUnits f units).1.assignments

Proof state:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.ReadyForRupAdd
units : CNF.Clause (PosFin n)
insertRupUnits_assignments_size : (f.insertRupUnits units).fst.assignments.size = n
i : Fin n
⊢ ((f.insertRupUnits units).fst.assignments[↑i] = f.assignments[↑i] ∧
      ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size), ¬(f.insertRupUnits units).fst.rupUnits[↑j].fst.val = ↑i) ∨
    (∃ j b h,
        (f.insertRupUnits units).fst.rupUnits[↑j] = (⟨↑i, ⋯⟩, b) ∧
          (f.insertRupUnits units).fst.assignments[↑i] = addAssignment b f.assignments[↑i] ∧
            ¬hasAssignment b f.assignments[↑i] = true ∧
              ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                ¬k = j → ¬(f.insertRupUnits units).fst.rupUnits[↑k].fst.val = ↑i) ∨
      ∃ j1 j2 h,
        (f.insertRupUnits units).fst.rupUnits[↑j1] = (⟨↑i, ⋯⟩, true) ∧
          (f.insertRupUnits units).fst.rupUnits[↑j2] = (⟨↑i, ⋯⟩, false) ∧
            (f.insertRupUnits units).fst.assignments[↑i] = both ∧
              f.assignments[↑i] = unassigned ∧
                ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                  ¬k = j1 → ¬k = j2 → ¬(f.insertRupUnits units).fst.rupUnits[↑k].fst.val = ↑i

Tactic:
exact insertUnitInvariant_insertRupUnits f f_readyForRupAdd units i

Result:
no goals

Proof state:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.ReadyForRupAdd
units : CNF.Clause (PosFin n)
insertRupUnits_assignments_size : (f.insertRupUnits units).fst.assignments.size = n
⊢ f.ClearInsertInductionMotive ⋯ (f.insertRupUnits units).fst.rupUnits 0 (f.insertRupUnits units).fst.assignments

Tactic:
apply Exists.intro insertRupUnits_assignments_size

Result:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.ReadyForRupAdd
units : CNF.Clause (PosFin n)
insertRupUnits_assignments_size : (f.insertRupUnits units).fst.assignments.size = n
⊢ ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (f.insertRupUnits units).fst.assignments[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ 0 → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ 0 ∧
            (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 ≥ 0 → k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ 0 ∧
            ↑j2 ≥ 0 ∧
              (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 ≥ 0 → k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i